Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ranged combat #167

Merged
merged 86 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
5d9529a
Add ranged combat following
GregHib Jun 8, 2021
40565c8
Clean up duplicate movement setting
GregHib Jun 9, 2021
0a2113a
Load nearby regions on login
GregHib Jun 9, 2021
adfbe56
WIP
GregHib Jun 9, 2021
0e5e44b
Clear offset if no change
GregHib Jun 10, 2021
b9ff936
Bind life points to constitution level
GregHib Jun 10, 2021
c79e584
Add Levels to npcs
GregHib Jun 10, 2021
9d07e0c
Add combat demo
GregHib Jun 10, 2021
f39c238
Add bows & arrows, crossbows & bolts
GregHib Jun 10, 2021
b6c9c11
Rename Arrows slot to Ammo
GregHib Jun 10, 2021
30b0ec6
Add unarmed melee attacks
GregHib Jun 10, 2021
40a847f
Add special attack bar toggling
GregHib Jun 11, 2021
89986ee
Ranged hit calculations start
GregHib Jun 11, 2021
9cc7798
Load attack type & style from cache cs2
GregHib Jun 11, 2021
f532d65
And void knight set effect
GregHib Jun 11, 2021
40bb963
Fix waiting actions stacking up
GregHib Jun 11, 2021
a421ada
Fix npc death updating
GregHib Jun 11, 2021
bdd1623
Fix inventory item switching
GregHib Jun 11, 2021
9fe69ec
Combine bresenhams lines
GregHib Jun 11, 2021
46d067d
Replace prayer activate/deactivate with effects
GregHib Jun 12, 2021
8a983dd
Add priority to Events
GregHib Jun 12, 2021
443d5c8
Fix some unit tests
GregHib Jun 12, 2021
f626e0b
Fix god arrows bow ammo support
GregHib Jun 13, 2021
4b10271
Fix equipment bonus formatting
GregHib Jun 13, 2021
1eb5db1
WIP
GregHib Jun 13, 2021
4d17aee
Split out and move modifiers into events, add static modifiers into i…
GregHib Jun 13, 2021
c1602b2
Fix world startup
GregHib Jun 14, 2021
75d4fde
Add combat style saving
GregHib Jun 14, 2021
315cc4a
Add defensive casting toggle
GregHib Jun 14, 2021
e0c7bd3
Pass weapon as hit parameter
GregHib Jun 14, 2021
85c5f49
WIP turmoil, soul split, sap & leeches
GregHib Jun 15, 2021
ae5a251
Add energy and special attack sap & leech
GregHib Jun 16, 2021
e057b65
Fix un-equip ammo
GregHib Jun 16, 2021
c5a1ba2
Fix interface unlocking after screen mode change
GregHib Jun 16, 2021
b310a75
Add divine and ely passive effects
GregHib Jun 16, 2021
d1eba64
Convert combat Skill to type
GregHib Jun 16, 2021
73b1793
Add dragonfire, veracs & chaos gauntlet passive effects
GregHib Jun 16, 2021
8a744ed
Add equipment requirements
GregHib Jun 16, 2021
d6e85ec
Improved combat swing & debugging
GregHib Jun 17, 2021
585164e
Add magic short bow spec
GregHib Jun 17, 2021
09e4aea
Add supertype support to event handler
GregHib Jun 18, 2021
c3fa9cd
Add dark bow special attack
GregHib Jun 18, 2021
cf8bd54
Fix item definition duplicates
GregHib Jun 18, 2021
cf4ac1a
Add Dorgeshuun and Zaniks crossbow special attacks
GregHib Jun 18, 2021
76fec0b
Add fire arrows
GregHib Jun 18, 2021
2dd4460
Add seercull special
GregHib Jun 18, 2021
f7c7f92
Add god bow specials
GregHib Jun 18, 2021
af00926
Add darts
GregHib Jun 19, 2021
3fe74fa
Add special attack sound effects
GregHib Jun 19, 2021
9d66520
Add javelins
GregHib Jun 19, 2021
466bbbb
Start to morrigans throwing axe
GregHib Jun 20, 2021
d0ac863
Add morrigan's throwing axe special effect
GregHib Jun 20, 2021
f425cec
Add special energy restoration & ring of vigour effect
GregHib Jun 20, 2021
7a061d6
Rename combat bonus to rating
GregHib Jun 20, 2021
3fc88a8
Replace vls and statius warhammer with spec dmg multipliers
GregHib Jun 20, 2021
a830754
Remove throw javelin gfx
GregHib Jun 20, 2021
4aa2448
Fix dart, javelin & throwing axes attack speeds
GregHib Jun 20, 2021
5999c7a
Add throwing knives
GregHib Jun 20, 2021
8fec9fc
Add hand cannon regular fire
GregHib Jun 20, 2021
77a0c7f
Hand cannon
GregHib Jun 21, 2021
e8180aa
Add ammo dropping & avas
GregHib Jun 23, 2021
9b55da3
Add weapon hit poisoning
GregHib Jun 23, 2021
b35e367
Fix collision flags
GregHib Jun 24, 2021
7d54d0f
Add enchanted bolt effects
GregHib Jun 24, 2021
8f97f38
Add training bow
GregHib Jun 24, 2021
2082e8c
Add poison bolts to crossbow ammo
GregHib Jun 24, 2021
7b86134
Add ava's devices junk collection
GregHib Jun 24, 2021
1a75cc5
Add zaryte and crystal bow attacks
GregHib Jun 24, 2021
81d43c1
Add karil's crossbow attack animation
GregHib Jun 24, 2021
b0e437b
Remove metal material from granite armour
GregHib Jun 24, 2021
39de62d
Add sling combat
GregHib Jun 24, 2021
e4aad61
Fix hand cannon special & karils bow ammo depletion
GregHib Jun 24, 2021
22a2e9c
Add toktz-xil-ul obsidian throwing rings
GregHib Jun 24, 2021
995a06c
Use weapon range strength for thrown or ammo-less weapons
GregHib Jun 24, 2021
1c36778
Add chinchompas
GregHib Jun 24, 2021
fdd7295
Add damage soaking & critical hits
GregHib Jun 24, 2021
d2c312f
Add player search by name
GregHib Jun 24, 2021
c179d40
Track attacker damage
GregHib Jun 24, 2021
0f2728d
Add source and persistence to poison
GregHib Jun 24, 2021
b4dcb69
Add rune throwing axe special
GregHib Jun 25, 2021
17c867a
Organisation
GregHib Jun 26, 2021
fc050bf
Organisation
GregHib Jun 26, 2021
d1fb8c0
Add composite & sighted bows
GregHib Jun 26, 2021
5437cc5
Fix damage life points cap
GregHib Jun 26, 2021
8872b9c
Combat following path improvements
GregHib Jun 26, 2021
15f9e78
Tweak game loop tick context
GregHib Jun 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data class ClientScriptDefinition(
var intVariableCount: Int = 0,
var stringArgumentCount: Int = 0,
var longArgumentCount: Int = 0,
var aHashTableArray9503: Array<List<Pair<Int, Int>>>? = null,
var switchStatementIndices: Array<List<Pair<Int, Int>>>? = null,
var name: String? = null,
var instructions: IntArray = intArrayOf(),
var stringOperands: Array<String?>? = null,
Expand All @@ -30,10 +30,10 @@ data class ClientScriptDefinition(
if (intVariableCount != other.intVariableCount) return false
if (stringArgumentCount != other.stringArgumentCount) return false
if (longArgumentCount != other.longArgumentCount) return false
if (aHashTableArray9503 != null) {
if (other.aHashTableArray9503 == null) return false
if (!aHashTableArray9503!!.contentEquals(other.aHashTableArray9503!!)) return false
} else if (other.aHashTableArray9503 != null) return false
if (switchStatementIndices != null) {
if (other.switchStatementIndices == null) return false
if (!switchStatementIndices!!.contentEquals(other.switchStatementIndices!!)) return false
} else if (other.switchStatementIndices != null) return false
if (name != other.name) return false
if (!instructions.contentEquals(other.instructions)) return false
if (stringOperands != null) {
Expand All @@ -60,7 +60,7 @@ data class ClientScriptDefinition(
result = 31 * result + intVariableCount
result = 31 * result + stringArgumentCount
result = 31 * result + longArgumentCount
result = 31 * result + (aHashTableArray9503?.contentHashCode() ?: 0)
result = 31 * result + (switchStatementIndices?.contentHashCode() ?: 0)
result = 31 * result + (name?.hashCode() ?: 0)
result = 31 * result + instructions.contentHashCode()
result = 31 * result + (stringOperands?.contentHashCode() ?: 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package world.gregs.voidps.cache.definition.data

object Instructions {
const val PUSH_INT = 0
const val PUSH_STRING = 3
const val MERGE_STRINGS = 37
const val CALL_CS2 = 40
const val SWITCH = 51
const val GOTO = 6
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ClientScriptDecoder(cache: world.gregs.voidps.cache.Cache, private val rev
hashtable.add(buffer.readInt() to buffer.readInt())
}
}
aHashTableArray9503 = list.toTypedArray()
switchStatementIndices = list.toTypedArray()
}
buffer.position(0)
name = buffer.readString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ClientScriptEncoder(private val revision634: Boolean = false) : Definition
writeShort(definition.longArgumentCount)
}
val position = position()
val table = definition.aHashTableArray9503
val table = definition.switchStatementIndices
if (table.isNullOrEmpty()) {
writeByte(0)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class ClientScriptEncoderTest {
intVariableCount = 2,
stringArgumentCount = 1,
longArgumentCount = 3,
aHashTableArray9503 = arrayOf(listOf(1 to 2), listOf(2 to 3, 3 to 4)),
switchStatementIndices = arrayOf(listOf(1 to 2), listOf(2 to 3, 3 to 4)),
name = "client-script",
instructions = intArrayOf(3, 54, 54, 54, 0, 21),
stringOperands = arrayOf("one", null, null, null, null, null),
Expand Down Expand Up @@ -54,7 +54,7 @@ internal class ClientScriptEncoderTest {
stringVariableCount = 1,
intVariableCount = 2,
stringArgumentCount = 1,
aHashTableArray9503 = arrayOf(listOf(1 to 2), listOf(2 to 3, 3 to 4)),
switchStatementIndices = arrayOf(listOf(1 to 2), listOf(2 to 3, 3 to 4)),
name = "client-script",
instructions = intArrayOf(3, 0, 21),
stringOperands = arrayOf("one", null, null),
Expand Down
82 changes: 81 additions & 1 deletion data/definitions/animation-definition-extras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1016,4 +1016,84 @@ teleport_land_lunar:
teleport_tablet:
id: 9597
teleport_land_tablet:
id: 9598
id: 9598
bow_shoot:
id: 426
crossbow_shoot:
id: 4230
cow_hit:
id: 150
cow_death:
id: 244
cow_attack:
id: 245
calf_hit:
id: 150
calf_death:
id: 244
calf_attack:
id: 245
chicken_attack:
id: 5387
chicken_hit:
id: 5388
chicken_death:
id: 5389
goblin_attack:
id: 6184
goblin_hit:
id: 6183
goblin_death:
id: 6182
big_spider_attack:
id: 5327
big_spider_hit:
id: 5328
big_spider_death:
id: 5329
rat_attack:
id: 2705
rat_hit:
id: 2706
player_punch:
id: 422
player_kick:
id: 423
player_death:
id: 9055
sap:
id: 12569
leech:
id: 12575
deflect:
id: 12573
magic_shortbow_special:
id: 1074
zaniks_crossbow_special:
id: 11359
throw_dart:
id: 582
throw_javelin:
id: 10501
throw_morrigans_throwing_axe:
id: 10501
throw_morrigans_throwing_axe_special:
id: 10504
throw_projectile:
id: 929
hand_cannon_shoot:
id: 12152
hand_cannon_special:
id: 12174
hand_cannon_explode:
id: 12175
karils_crossbow_shoot:
id: 2075
sling_rock:
id: 14867
toktz-xil-ul:
id: 3353
throw_chinchompa:
id: 2779
rune_throwing_axe_special:
id: 1068