aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


docs/research-notes/critical-hit-research/result-contract.md (3544B)


Original critical-result routing contract

client/tests/critical_result.c executes these unchanged lifted original 14.9.1 kkr.dll functions:

Original address Function covered
100aecb0 AttackInfo activation
1007a660 / 1007a320 Weapon-holder delivery and slot lookup
100ab4c0 Insert damage/result in 50-entry ring
100ab580 / 100ab560 / 100ab500 Nonempty check, result peek, damage pop
100ab5a0 Consume queued damage/result at impact
10075db0 Assign actor raw stat with IP editing inactive
1007be50 Immediate generic damage when attacker is absent

Generated addresses are rebased from 10000000 to 36000000. The fixture links lifted-0034.c, lifted-0035.c, lifted-0050.c and lifted-0051.c directly.

The four known-attacker scenarios cover normal 4 and critical 5, death 0/7, ammo 3/0/-1, local defender/uninvolved observer, and ring index 49 wrapping to 0. The packet deliberately names another target identity, different from the current opponent used for impact; the packet target remains undamaged.

For each valid known-attacker result:

Five missing-attacker scenarios cover result 4/5, death 0/7, local/nonlocal target and missing target. A local known payload target receives one immediate 100 to 87 subtraction and generic damage text for both 4 and 5; no critical result reaches the generic formatter. Nonlocal or absent payload targets are ignored. This path does not queue or assign ammunition.

Identity lookup/casts, locality, target-state test, weapon damage type 90, actor/item stat storage, feedback formatting and death are external fixture boundaries. The actual critical suffix text formatter 1001d0b0 is NOT executed here. Its result 5 branch is retained static evidence: ev_16fbb07444de249fd19ed14114c99abb43239d8f64214cc0e4494b36dc8a7c77. Other source evidence already retained in local/reports/combat-outcomes-1491-evidence.json:

This contract does not exercise the network reader, actual animation scheduling, renderer, death implementation, sound, chat text or server critical probability/damage calculations. It tests the exact original activation and queue algorithms with supplied outcomes. Browser testing must still verify critical text, animation timing and complete packet flow.

Build/run logs are native-contract-build.log, native-contract.log, wasm-contract-build.log and wasm-contract.log in this directory.