aorecomp

Anarchy Online classic in the browser

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


docs/briefcase-weapon.md (7555B)


Briefcase weapon support

Briefcase of Holding 205736 can be equipped in the right hand, removed and used through an equipped page101 reference to open the bank. Its normal attacks use the shared weapon clock, range, damage and persistence paths. This does not complete its Brawl, Dimach, critical or hit-effect behavior.

Authored rules and shared calculations

The original fixed-QL100 item has a 0.1-second equip delay. Wield action8 requires Bureaucrat, Psychology >299 and title level >3, joined by AND. Unlike bank Use3, the authored equip expression has no combat predicate. The existing server combat-swap gate still applies to equipment changes.

Field Original value
Attack weight Psychology162, 100%
Defense weight Duck Explosives153, 100%
Minimum / maximum / critical bonus 50 / 125 / 91
Base attack / recharge 125 / 125 centiseconds
Initiative440 Melee Initiative118
Range287 2 metres, before actor extents
OnWear Sensory Improvement122 +5, Sneak Attack146 +10, XP modifier319 +1

The server reads each admitted weapon's action8 predicates for equipping and overequipping, and its section12 weights for attack rating. This replaces the assumption that every melee weapon uses 1-Hand Edged and every ranged weapon uses Pistol. Each weighted skill term is divided by 100 separately; stat276 is added only when their sum is positive. Fists retain their native MA-plus-276 fallback. Initiative is selected by authored stat440.

The Briefcase omits DamageType436. Native WeaponItem constructors seed that field with Melee91; an explicitly invalid value instead falls back to Projectile90. A getter returning zero for both cases would lose this distinction. NoAmmo and clip size -1 mean attacks and bank use consume no ammunition.

Overequipping scans every strict-bound predicate in action8, including title. The stored denominators are Psychology299 and title3; they are distinct from the strict admission thresholds300 and4. Profession equality is not an OE criterion. Each criterion contributes min(4,(required-actual)*5/required) below its denominator, and the worst tier wins. The recovered endpoint penalty and the existing provisional AR/armor ordering are described in overequipping.

Effective Psychology, title4 OE tier Adjusted min / max / critical bonus
>=240 0 50 / 125 / 91
180..239 1 38 / 94 / 69
120..179 2 25 / 63 / 46
60..119 3 13 / 32 / 23
<=59 4 0 / 0 / 0

At Psychology300, title3 retains full effectiveness, title2 gives tier1 and title1 gives tier3. Dropping below an equip requirement does not remove the owned item. Ordinary moves still commit before equipment publication. Invalid source pages, stale sequences and failed persistence cannot open a bank or publish a new weapon or modifiers.

Original evidence and remaining work

The item resource identity and exact payload hash are retained in remote bank evidence. The additional research is under local/briefcase-weapon-research/: content/ preserves all four raw item/nano records, offsets and hashes; native/ preserves the original KKR snapshot, 44 validated citations and complete records.

Original KKR 1008f1f0 supplies the separate signed multiply/divide operations for attack weights; 10090f10 supplies the action8 OE scan. Live constructor 100abb20 establishes defaults420=-1,436=91,440=119. Briefcase overrides440 with118. Native initialization 100b2830 runs OnActivate53076, whose tuple is consumed by 100ac610 to configure the hit visual effect, not a damage or proc roll. Full weapon attachment applies the item's OnWear modifiers; runtime owner/observer checks are needed to detect missing or duplicate application.

OnHit53089 authors three CastChance entries: target14/program207287/20%, target2/program207284/3%, target2/program207288/3%. Their programs contain single Modify effects: Psychic -17 for300 seconds, Psychology +52 and +22 for 2500 seconds each. There are no recursive child programs. The client-local effect gate excludes53089, so enabling it needs authoritative server outcomes. Static client target14 routing follows the fight target, with selected-target fallback; it does not settle original-server proc victim or probability rules.

Those procs remain disabled until their admission, resistance/NCU, replacement and persistence rules are established. Existing friendly-buff machinery needs extension for NPC effects and skill modifiers. Native effective-stat getters preserve signed values without a zero floor; a hostile Psychic debuff must not wrap through unsigned arithmetic or invent a clamp. Brawl/Dimach need their general special-action implementation. Global miss/critical resolution and kill-XP awards, including modifier319, remain separate TODOs.

Verification

Go tests cover strict profession/skill/title admission, the exact equip timer, every Psychology OE boundary and title penalties, restored effectiveness, equipped-use source pages, replay, combat rejection and failed persistence. The shared calculations have checks for separate weight truncation, AllOff's positive-sum gate, authored initiative/default selection and omitted damage type against armor. Existing axe, pistol and armor regressions remain in place.

The full Go suite passed (go test ./server/..., 388.597 seconds for the server). Affected equipment, weapon, bank, backpack and ammunition paths passed twice under the race detector (184.173 seconds). Process-crash recovery is run separately because repeated instrumented child initialization exceeded the initial combined run's default timeout; the timeout log is retained rather than counted as a passing run. The isolated crash-recovery race run passed all four cases (474.436 seconds, -count=1 -timeout=15m). go vet -stdversion=false ./server/... passed; the existing declared-toolchain/WaitGroup.Go mismatch remains tracked in TODO.

Two Chromium WASM clients used GPU OpenGL4.5 through the normal LAN preview. Native pickup/place equipped the same Briefcase, and both clients applied exactly +5/+10/+1 to the corresponding modifier maps. The equipped shortcut produced page101/slot6 Use, opened the bank repeatedly and worked after browser reload. A real combat request produced matching owner/observer melee-hit and death packets. A server-rejected bank Use occurred between the attack request and the hit; bank use succeeded again after combat ended.

The native owner's attack rating and damage fields matched Psychology299 retention and Psychology239 tier1. That equipped identity and tier survived a real server restart. Remote weapon fields are not used to infer the owner's OE calculation; the server's hit packet supplies the observer's damage. Removal cleared the three modifiers for both clients. At239, native re-equipping displayed the Psychology300 requirement and sent no move. Restoring300 allowed the same item to equip again with one contribution, and a second removal returned both clients to baseline. SQLite snapshots preserve all three fixture instances, quantities and unrelated placements, with no allocation or consumption.

The retained local/briefcase-weapon-smoke/verification.json checks snapshots, native object/modifier reads, wire packets and rejection feedback. Browser and adapter errors were empty. Both test clients and their owned fixtures were cleaned up; all other database rows were unchanged by cleanup, and the single LAN preview was restored.