Skill casting leftovers: handler tables, formulas, erase and special sets

Our reading of the executable’s skill-object code, with the skill table tallied for every value (counts only). Units as in “Skill kinds”: tick = 1/30 s, u = 0.1 m, record fields s16. Confidence per item: H read in the code and checked against the data, M read in the code only, L a lead.

Handler tables

The two pointer runs named as leads in SYSTEMS §5 are five tables that happen to sit next to each other. Only two of them are skill dispatch.

.data 0x1403fafc8 (143 slots):

slots address indexed by entries conf.
0..2 (with the u32 before each) 0x1403fafb0 a name hash: three {u32 hash, handler} records of 16 bytes, searched by the character model set-up 0x14025d380 for each model node (no match → kind 3); the kind then selects the handler at 0x14025dc20 per-node handlers of the character model (0x14025dc40, 0x14025dde0, 0x14025df50). Not skill data M
3..56 0x1403fafe0 a command number 0..53; the table’s address sits in a list of such tables at .rdata 0x1402ddd08 (siblings for the stage-object and battle-object modules have the same shape) script commands of the character module: 16..53 are filled (handlers 0x140260ee0..0x140261810: sound cues, music, fades and the like; each takes a pointer to its int arguments), 0..15 empty. Not indexed by anything in a skill record M (what it is), L (per command)
57..77 0x1403fb190 skill set 0x52 × 24 bytes: {init, update, third} set 0 empty (it uses the next table), 1 erase 0x140263fc0, 2 defense 0x140264020 / 0x140264340, 3 special 0x1402642a0, 4 status 0x1402642d0, 5 environment 0x1402642f0; sets 1, 3, 4, 5 have the empty routine as update; set 6 is all zero H
79..141 0x1403fb240 behavior 0x7A × 24 bytes: {init, update, third} see below H

The skill-object spawn (0x140263a00, at 0x140263b76) stores the entry’s address in the object (+0x1E0) and calls its init at once; object +0x10 is 1 for a set-0 object and 2 for the others. A set-6 record has no init routine: no set-6 object is ever spawned, the button press casts a remembered attack instead (2 usable records; corrected step3 11-13, see “Set 6: cast the remembered attack”).

0x7A init update 0x7A init update
0 straight 0x140264570 0x140264710 10 moving 0x140268590 0x140268940
1 parabola 0x140264b00 0x140265080 11 kinesis 0x140268ee0 0x1402694e0, third 0x140269a50
2 fall 0x140265470 0x1402657f0 12 blade 0x140269c60 0x140269db0
3 pursuit 0x140265d60 0x140265e00 13 melee 0x14026a020 0x14026a0d0
4 auto 0x140265ea0 0x140265f50 14 pursuit as 3 as 3
5 crawl 0x140266060 0x140266290 15, 16 hole 0x14026a510 0x14026a7f0
6 multishot 0x1402666b0 0x140266bf0 17 ricochet 0x14026af40 0x14026b240
7 fast_rain 0x140266fb0 0x140267410 18, 19 empty empty
8 mine 0x140267b90 0x140267e90 20 rain 0x14026b480 0x14026bbd0
9 burst 0x140268050 0x140268320

Only kinesis has a third handler: it is the object’s draw (it draws the carried stage object, below).

.rdata 0x1402dd078 (43 slots):

slots address indexed by entries conf.
0..4 0x1402dd078 the step type (0..4) of a 32-byte step record list at 0x1405347a8, run by 0x14027547f for the first character five small routines that set two position vectors (0x14059e130 / 0x14059e150): a scripted camera of a demo or preview. Not skill data L
5..37 0x1402dd0a0 damage formula 0x56 (0..32) the formula routines, next section H
38..42 0x1402dd1a8 not followed five routines at 0x140275030..0x140275650 next to the step runner L

Card power and the damage formulas

The card power routine 0x140272400(slot object, skill id) runs once per cast:

The result is the object’s carried value (+0x60): the damage of an attack, the durability of a defense. Every damaging record uses formula 0 and every formula-31 record has 0x58 = 0 (tally: formula 0 = 148 records, 144 of them attacks with 0x58 > 0; formula 31 = 79 records of type erase / status / special, none with a damage), so “31” is “no damage”, not “plain”.

Inputs: d = the record’s 0x58. Caster and target are status records (target = the locked character; no target → the formula gives 0). Status record fields used here: +0x04 player number, +0x0C health, +0x18 aura level, +0x1C aura (float). The caster’s four slots are 0x50-byte slot objects at status + 0x348 (fields below). The used list is the second 100-int array of the deck block (0x140584f80 + (4 + p) × 0x190, count at +0xC90 + 4p).

0x56 routine value records
0 0x140273f50 d 148
1 0x140273f80 d × (target health − caster health) 1
2 0x140273fe0 d × (caster health − target health) 1
3 0x140274040 d × the number of attack cards (type 1) in the caster’s used list 2
4 0x1402740d0 as 3, defense cards (type 2) 1
5, 6, 7, 8 0x140274160… as 3, cards of type 3 (erase), 4 (status), 5 (special), 0 0
9 0x1402743a0 (attack cards in the used list) / d, integer division 0
10..14 0x140274440 d × the number of the caster’s slots holding an attack card 0
15 0x140274510 d × the caster’s slots that are filled with skill id 0 0
16 0x1402745a0 d × the caster’s filled slots whose card is neither attack nor defense 0
17 0x140274620 d × the target’s aura level 2
18 0x140274680 d × the target’s aura (truncated) 1
19 0x1402746d0 (target’s aura level) / d 0
20 0x140274730 (target’s aura, truncated) / d 1
21 0x140274790 d × the aura paid for this cast (slot object +0x1C; the “all aura” cost of “Combat rules” stores what it spent there) 7
22 0x1402747d0 (aura paid) / d 0
23 0x140274810 d × the number of the target’s empty slots (0..4) 3
24 0x140274890 d × the number of the caster’s empty slots 1
25 0x140274900 sum of the 0x58 of the caster’s slot cards whose skill id equals entry d of a table at 0x1404bdc60 0
26 0x140274990 sum of the 0x58 of the caster’s slot cards whose record field 0x10 equals d (0x10 is a group tag 1..4 carried by 36 records; this card’s own slot counts when it matches) 4
27, 28, 29 0x140274a10 d × r, r random in 0..(0x56 − 25) − 1: ((rand() & 0x7FFF) × (0x56 − 25)) >> 15, one draw of the shared generator (“Capsules”: rand) per cast. 28 → 0, d or 2d 3 (all 28)
30 0x140274a90 d × the number of aura capsules that are up (slot state 2, skill id 0) over all four players that are in the match 1
31 — 0 79
32 empty routine not a value (never in the data) 0

A negative total becomes 0 (after the strength status and the per-use change are added).

Aura paid (slot +0x1C, formulas 21 / 22; shotvar 11-11, M). The slot’s cost routine 0x1402623b0 (run while the card sits in the slot) writes the current cost into both +0x18 and +0x1C: 0x28 + 0x2C × uses, halved / doubled by status 30, at most 99. A card with 0x2A < 0 (it spends every level) instead has cost 0 and +0x1C = its owner’s aura level (at least 0). The release 0x1402626d0 then, when the cast’s hold count (cast state +0x80) is non-zero, sets +0x1C = cost + count / 10 and adds count / 10 (status-30 scaled) to the cost; computes the card power (0x140272400); and only then pays (0x1402621f0), so formula 21 reads the value above. The pay routine: 0x28 < 0 → needs aura ≥ 1, +0x1C = the aura truncated, aura = 0 (after the power: such a card’s power reads the cost routine’s value); 0x2A < 0 → +0x1C = the level, the level set to 0 (clamped to the mode’s lowest, 0x14024d8b0); else aura − cost, the health cost 0x2E, level − 0x2A. In game mode 0 nothing is paid. At the end of the release +0x1C is cleared. Refused release (bof4 r2): the pay routine returns 0 when the cost (with the hold extra) is above the aura or the level is below 0x2A, which can happen when the aura dropped during the windup (the press only checked). The release then sets +0x1C to 0 and returns before the power is thrown, the use counter, the used-pile step and the slot routine: nothing is paid and nothing comes out. This branch is skipped when the global at 0x1404c01d8 equals 0x7777 or the player index is above the count at 0x1404bdc40 + 0x10 (neither traced). M (code). The hold count +0x80 rises by 1 per tick while the card’s button stays held in the hold state (0x14025c801, records with 0x46 = 2) as long as 0x1402620e0 allows the next count (not followed). The five formula-21 records: one spends every level (0x2A = −1), four are hold cards with cost 0 (their power is d × (hold ticks / 10)).

Objects per release (0x1402626d0, M). The release spawns one skill object per numbered fire node of the cast’s effect instance (cast state +0xc20, the effect spawned at the cast; 0x14018a310 walks its model’s nodes whose name hash has the prefix 0xb3d8c5 and two decimal digits, and returns the highest number), or one object when there is no effect instance. Each object gets the character’s shot counter (status record +0x08) as its index (object +0x04), the counter rises by one per object and is stored back after the loop, so the index runs on across casts; the fire node used is index mod count. The divisions do not test for d = 0. M for the table (code only: the public list gives no numbers for these skills), H for formulas 0 and 31.

Slot object (status + 0x348 + 0x50 × slot; the argument of the power and cost routines): +0x08 state (0 = empty; the HUD and formulas 23/24 test it), +0x0C times used, +0x10 / +0x14 “has a placed object” flag and that object’s index (remote mine, below), +0x1C aura paid, +0x24 flags (bit 0x10 = use condition not met), +0x28 the status record, +0x30 skill id, +0x38 “counts for the used list”, +0x44 the kinesis object index.

Used list. A card is appended (when slot +0x38 is set and the list has < 100 entries) by the routine that empties a slot (0x140263570, also inline at 0x1402634de and 0x140261cb0) and by the slot-fill routine 0x140261a00 for records with 0x4E = 2. Status-set effects pop cards from it again (0x14027115a, 0x1402712b6; topic status). So it is “the cards that have left this player’s slots”. M: the append sites were read, not every caller.

Use condition (0x48 / 0x4A), now read in the executable (0x140262470, called from the cost check at 0x140262087): a 9-way switch on 0x48. 1 / 2 health ≤ / ≥ value; 3 / 4 aura ≤ / ≥ value; 5 / 6 cards left ≤ / ≥ value, where cards left = 30 − draw pointer + the int at deck block +0xCA0 + 4p (for a remote player: a count the character object keeps at +0x17158); 7 aura (truncated) = aura level; 8 / 9 aura level ≤ / ≥ value. While the condition fails the slot’s flag bit 0x10 is set and the card cannot be cast. This confirms the shared notes’ table (5 / 6 are “cards left”, not capsules). H (code; modes 1, 2, 5, 7, 8, 9 occur in 20 records).

Erase set (set 1): capsule erasers

Set 1 does not touch slot cards (the card erasers are set-0 attacks with 0x5C..0x60). It acts on the capsules on the field (“Capsules”: three per player, state 2 = up). Init 0x140263fc0 → erase routine 0x14026fcb0 → per capsule 0x14026ff20; the object then ends.

The capsule target (0x14014f700, run every tick by the character’s targeting at 0x140251672, result in character object +0x17170): the first capsule, in player then slot order, that belongs to another living, locally simulated player, is up, and lies within 15 u of the caster’s position (the capsule point lowered by 9 u, as in the own-capsule take test). −1 when there is none. The cast copies it into the skill object (+0x60) through the card power.

0x54: which capsules (filter 0x140270150; an “aura capsule” is one whose skill id is 0):

0x54 capsules records
0 the target capsule, any kind 3
1 the target capsule, only if it is an aura capsule 1
3 the target capsule, only if it is a skill capsule 1
2 every aura capsule that is up, of every player (the caster’s too) 1
4 every capsule that is up of every player on another team (team id at the player object +0x1C) 0
5 every capsule that is up, of every player 3

Modes 0, 1, 3 with no target (−1) do nothing. Modes 2, 4, 5 ignore the target.

0x56: what happens to each capsule (only capsules in state 2, and only on the machine that simulates the capsule’s owner):

0x56 effect records
0 the capsule is taken away: the take routine 0x14014fd10 in its “move effect” mode, i.e. the owner’s next card is drawn into the slot and the refill timer (420 ticks + status) starts; the card is lost 6
1 steal: the capsule’s card is put into the caster’s slot that this erase card was cast from (slot-fill 0x140261a00; in the network modes a message instead), then the capsule is taken (take effect) 1
2 reshuffle: the capsule’s card is swapped with a random undrawn card of its owner’s deck (0x14014fa20 with card −1) 1
3 the capsule becomes an aura capsule (skill id 0, stays up), with the capsule network message 1

After each capsule the object’s position is set to that capsule’s point and the object ends with reason 11 (so the effect file’s end slot plays at the capsule). 0x58..0x6C are 0 in all nine records. M (code; the nine records’ 0x54 / 0x56 combinations all land on cases that exist).

Special set (set 3)

Init 0x1402642a0 → 0x140270200(character, object): nothing happens for a character that is not locally simulated, or in one game state (0x1404c01d8 = 0x7777). Then a 10-way switch on 0x54 (jump table 0x140270868); the object ends at once.

0x54 what it does values records
0 high jump: the jump routine (0x140257b90) with height 0x56 m (the raw value, not × 0.1), gravity 0.12 × (100 + 0x5A) / 100 u/tick², jump kind = the slot number the card was cast from 0x56, 0x5A 1 (10 m)
1, 3 nothing 0
2 teleport to an own capsule: a random one of the caster’s capsules that is up (0x14014f9a0; none up → a random slot 0..2), then the teleport routine 0x140257e90 to the capsule’s point; a floor probe from 10 u above to 20 u below the point snaps the height when it hits 1
4 bring a capsule here: one of the caster’s capsule slots (number = object field +0x04 mod 3; what +0x04 counts was not followed) gets the caster’s position raised by 10 u as its point; network message in the network modes 1
5 levitate: sets the character’s float flag (+0x6240 = 1 with a tick count +0x6244 = 0x58 when 0x58 ≠ 0, else the untimed flag +0x623C), the status routine 0x14024d6d0 with slot 11, then the jump of subtype 0 (height 0x56 m, gravity from 0x5A) 0x56 height, 0x58 ticks, 0x5A 2 (5 m for 450 ticks; 10 m for 90)
6 return to the own start position (start record of the character’s start index +0x18, via 0x14012a5e0), with the floor probe, then the teleport routine 1
7 go to another player’s start position: the locked target’s when it has one and it is locally simulated, else a random other living player’s (one rand draw: skip 0..2 candidates, walking the player numbers upward from 0); in game mode 0 it teleports in place 2
8 dash (the evade’s roll; “The evade”) 0x56 1
9 jump (the evade’s jump: height 0x56 × 0.1 m, jump kind 5; “The evade”) 0x56, 0x5A 0 among the first-per-id records; two more usable records repeat a shown id (one subtype 9, one subtype 8: the evades)

The game mode at 0x1404bc9d4 is 4 or 5 for the network modes (every “network message instead” above tests that). M (code; each used subtype’s values are of the size its case expects). The levitate’s hold (what +0x6240 / +0x623C do while set) belongs to movement and was not followed.

Followed further (skills3b 11-13):

Ricochet (17)

Kinesis (11), cast side

Mine mode 2: the remote mine

0x7C = 2 (one record: counter 0, explosion radius 0x82 × 0.1 = 30 u) has no branch in the mine’s update (0x140267e90): it never arms and never times out. It is set off by pressing its button again: the slot keeps “has a placed object” (+0x10) and the object’s index (+0x14); the button handler (0x1402519ec → 0x140263100) then ends the live mode-2 mine cast from that slot (0x14026efa0 walks the caster’s 48 objects for kind 8, mode 2, the same slot, not already ending) with end reason 8 — the mine’s explosion — and only then counts the use (and empties the slot under the single-use status, slot 32). Replacing the slot’s card removes the placed mine without an explosion (0x14026ef10 from the slot-fill routine). The auto kind’s update and the guard test skip a check for “kind 4 with 0x7C = 2” in the same way (0x140265f8d, 0x14026f709; no such record exists). M.

Fast rain (7), partly

Still only partly followed (3 records). Read: lifetime 0x7C + 0x7E ticks; two offsets 0x80 × 10 u and 0x82 × 10 u build its start relative to the target (the second is negated); hit radius 0x84 × 0.1 u; it passes through (flag 0x20). In the network modes the machine of the target’s player computes the placement and sends it (0x14026d7d0, a distance and an angle), and the other machines hold the object for up to 60 ticks waiting for it. Not followed: how the body moves between the two points over the 0x7C and 0x7E phases, and its hit shape per tick. L.

Type-7 defense (auto-shelter)

Nothing new beyond “Defense”: the pass list of the object it casts was not separated in this run either. It stays the one open item of set 2 (5 records).

Coverage: what can be implemented 1:1 from the docs today

Usable records, first per shown id (387). “Decoded” = the kind’s behaviour, its formula, its hit effect and its other non-zero fields are all written up in this file; the right column says what blocks the rest. Counts only.

group records decoded open, by blocker
set 0, straight (0) 94 60 card fields 0x5C..0x60 ×11; hit effect not decoded ×10; hit effect partly ×6; use condition (now decoded) ×7
set 0, parabola (1) 13 11 hit effect partly ×1; use condition ×1
set 0, fall (2) 6 5 use condition ×1
set 0, auto (4) 20 5 hit effect not decoded ×9; partly ×4; card fields ×2
set 0, crawl (5) 10 10
set 0, multishot (6) 11 9 card fields ×1; use condition ×1
set 0, fast_rain (7) 3 0 kind partly followed ×3 (2 also card fields)
set 0, mine (8) 13 9 card fields ×1; hit effect not decoded ×1; partly ×2
set 0, burst (9) 6 6
set 0, moving (10) 3 3
set 0, kinesis (11) 2 0 needs the stage-object side ×2
set 0, blade (12) 19 12 card fields ×2; hit effect not decoded ×2; partly ×1; use condition ×2
set 0, melee (13) 29 13 hit effect not decoded ×7; card fields ×4; partly ×2; use condition ×3
set 0, pursuit (14) 2 1 hit effect not decoded ×1
set 0, hole (15) / hole_all (16) 3 / 7 3 / 5 card fields ×1; hit effect partly ×1
set 0, ricochet (17) 5 5
set 0, rain (20) 9 7 use condition ×2
set 1, erase 9 9
set 2, defense types 0..6 43 43
set 2, defense type 7 5 0 auto-shelter pass list ×5
set 3, special 9 9 (subtypes 0, 2, 4, 5 ×2, 6, 7 ×2, 8)
set 4, status 34 26 status effects 11 ×2, 15, 19, 20, 21 ×2, 22
set 5, environment 30 30 (the slot is known for all 30; slots without a decoded meaning are topic status)
set 6 2 0 cast a remembered attack (step3: decoded later)
total 387 281

“Hit effect partly” = 0x62 in {1, 2, 4, 11, 44, 47} (health change / set, cases not separated); “not decoded” = the other values outside “Hit effects”. The use condition rows count as open here because the rebuild does not read 0x48 yet; with this section’s decode they move to “decoded” (18 records have no other blocker). All 15 formula ids in the data are decoded, so no record is blocked by its formula. Kinds 3, 18 and 19 have no usable record.

Implementation notes for the rebuild