aorecomp

Anarchy Online classic in the browser

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


docs/trader-health-payment.md (5288B)


Trader starter team healing

The issued Weak Delayed Health Payment crystal 43378 now uploads program 43374. Its team heal and caster debt execute together. This resolves the A5 starter crystal rejection; it does not add the broader Trader team-heal catalog or prove ordinary-play affordability.

Original records and alpha policy

The complete records are in server/gamedata/items/items_002.yaml (crystal) and items_167.yaml (parent and both children):

Record Contract
43378 QL1 crystal, uploads 43374; Biological Metamorphosis >9 and Time & Space >8, Trader
43374 Caster-scoped functions 53066 -> 43373 and 53051 -> 43372; 15m range, 1.5s base cast, 1s recharge, base nano cost 10
43373 Team effect: one HP hit of +11 to +15
43372 Caster effect: five energy HP hits of -10 at two-second intervals; 15s lifetime, strain 258, rank 999

The existing cost conversion debits 9 nano without cost modifiers. The debt's hostile flag excludes its rank from used NCU and prevents manual removal. Its rank blocks another rank-1 parent cast until the full 15-second effect expires, including the five seconds after its last damage tick. The parent, heal child and debt child must all match their supported effect contracts for upload and casting to be admitted. The instant heal and hostile debt need no free NCU.

Team recipient scope and raw self-damage are provisional server policy. The caster is always healed, including when solo. Other recipients must be living, online, ready members of the same team, in the same playfield, within the parent's modified range and line of sight. Team membership permits mixed-faction healing; selected nonmembers cannot redirect the formula. Each recipient gets an independent 11-15 roll, capped at maximum health. The debt deals the recorded 10 HP directly without armor or a PvP reduction. Original server code for the team recipient selection and self-damage mitigation has not been recovered. These rules provide a complete bounded implementation, not a claim of exact historical server behavior. No additional historical search was needed here.

Persistence and lifecycle

All healed HP, the debt, the reserved nano settlement and recharge commit in one transaction before any success is published. A failed write heals nobody and refunds the reservation. Debt ticks save HP and tick progress together; rejected writes retry without skipping or doubling damage. Lethal debt uses the existing player death/reclaim transaction and grants no combat rewards.

The player periodic-nano path orders debt and healing ticks by deadline. Debt pauses with other player nanos on logout, resumes on login, and restores its remaining duration and tick delay after cold startup. Reconnection cannot remove the debt or turn the team heal into a free repeatable heal.

Verification

TestHealthPaymentStarterCrystalHealsAndSchedulesDebt first reproduced the issued crystal's rejection. The focused checks cover upload, solo healing, eligible/ineligible teammates and bystanders, mixed factions, exact tick timing, removal/recast refusal, expiry, lethal debt, cold state, and rejected/ignored cast and tick writes with retry. Altering any linked effect rejects the formula. The full-NCU case also passes without charging NCU for the instant heal.

TestBrowserHealthPayment uses a controlled two-player team and real native crystal upload and program clicks. It compares both clients' healed HP with the server, checks self-damage across reconnect, waits for expiry, casts again and checks cold recovery with another debt still pending. This uses seeded health, skills and nano; it is not earned progression or an affordability sample.

The final focused batch passes 22 roots and 132 results, including existing healing-over-time and player-death regressions. The broader batch passes 143 roots and 2,677 results, with one unrelated failing root: TestNanoReservationItemEditCommitsRefundWithActorReload. Its two failures also reproduce in the retained pre-change binary. That test expects item edits to reload the actor, while the current live inventory-edit path preserves the pending cast; the separate P1 TODO records the required regression update. That follow-up is now complete: carried edits verify preserved reservations and settlement, while equipped edits verify atomic refund/reload. Both pass, with rejected-write/retry and cold recovery coverage (local/alpha-admin-cast/regressions.log). Logs are local/alpha-health-payment/final-focused.log, regressions.log and baseline-admin-reservation.log. go vet ./server/..., JavaScript syntax and diff checks pass.

The final native run passes in 36.50 seconds, with captures and authoritative snapshots under local/health-payment/20261105-161622/ and the log at local/alpha-health-payment/browser-final.log. From 100 HP each, the first cast healed the caster to 112 and teammate to 113; the caster then paid exactly 50 HP. After expiry, the second cast healed them to 73/127. Its first tick left the caster at 63 HP with four ticks pending and 82 nano. Cold startup retained those values and the paused interval. Native heal/damage feedback and both recipient views were inspected. Test servers and Chromium processes were closed.