Update Healer Man server

This commit is contained in:
phenom committed 2026-10-04 13:13:35 -04:00
1 parent 39458d5de6
commit 6cc1b9217f
203 files changed
+133929 -31271

No files matched your search

@@ -0,0 +1,40 @@
# Native RoM recovery source audit
## Implemented scope
Native RoM recovery now uses RuneWaker's ReHP/ReMP values and actor-specific pulse cadence for exact RoM-mode player builds and owned party NPCs. Player and companion stats remain actor-local: a companion uses its own class, secondary class, level, race, gear, and `statRuleset`. The native path only activates for a RoM class whose actor ruleset is `rom`; saved WoW-mode RoM characters and ordinary WoW actors keep the existing shared resource behavior.
The source-derived stat snapshot is already generated by `scripts/runewaker-pipeline/export-rom-native-stat-rules.mjs` into `src/game/generated/romNativeStatRules.generated.json`. `src/game/romNativeStats.ts` computes ReHP from its source base, stamina coefficient, and mapped gear/aura channel; ReMP uses its source base, wisdom coefficient, and mapped gear/aura channel. The five active build stat profiles use BaseReHP 2, ReHpArg 0.15, BaseReMP 0, and ReMpArg 0.3. The character's supported Mana eligibility is preserved, including a Mana secondary pool when the selected primary resource is not Mana.
## Source behavior
`F:/Projects/Runewaker/SourceCodeVS2019/Server/NetGameServer/MainProc/Global.cpp` contains the source player update at lines 1956–1984 and owned-NPC update at lines 2335–2363. Player recovery checks every `ClockMod(20)` and owned NPC recovery every `ClockMod(60)`, corresponding to 2-second and 6-second pulses in the source server clock. Dead actors and actors with `StopOntimeCure` set are skipped. Recovery only runs when integer current HP or MP differs from its maximum.
For players, `IsAttackMode()` restores no HP and restores `ReMP / 24` Mana per pulse. Out of attack mode, standing recovery restores `ReHP / 3` and `ReMP / 3`; sitting uses `0.66 * ReHP` and `0.66 * ReMP`. For owned NPCs, attack mode likewise restores only `ReMP / 24`; idle recovery restores `0.66 * ReHP` and `0.66 * ReMP`. The separate unowned-NPC branch uses max-resource fractions and is not the source behavior for party companions.
`F:/Projects/Runewaker/SourceCodeVS2019/Libraries/Union/RoleData/RoleAttr.cpp` lines 525–531 defines:
```text
ReHP = max(0, BaseReHP + Fin.STA * ReHpArg + Mid.Body[ReHP])
ReMP = max(0, BaseReMP + Fin.MND * ReMpArg + Mid.Body[ReMP])
```
The resulting values are copied to `Fin.ReHP` and `Fin.ReMP` in the same file at lines 279–280. `RD_ValueCal.cxx` lines 1512–1552 (`AddHP`) and 1584 onward (`AddMP`) apply float amounts to the stored resources and clamp to their maxima, so simulator pulse values remain fractional instead of being rounded to whole points.
RoM Aura components mapped to source ReHP/ReMP channels are included in the per-pulse source stat snapshot. Other generic or unmarked regeneration modifiers do not enter the native recovery calculation. Explicit `rom-resource-over-time-*` Mana effects remain a separate simulator flow and are integrated over the effect's actual active interval; they are not added to ReMP. WoW's five-second mana spending rule and out-of-combat minimum do not apply to the native ReMP path.
## Runtime ownership and validation
`src/game/romNativeRecovery.ts` owns the 2-second player and 6-second owned-NPC pulse clocks, fractional source formulas, sitting coefficient, and separate explicit periodic-Mana interval integration. The clocks preserve fractional elapsed time across update partitioning and clear when actor kind/ruleset changes. `src/game/combatStore.ts` owns the player pulse consumer; `src/game/partyRuntime.ts` owns the companion consumer; `src/game/partyStore.ts` clears companion recovery timing on lethal damage, revive, and combat reset. Aura records are sampled at each pulse timestamp, so an aura expiring after a pulse still contributes to that pulse.
On the player path, source attack mode is approximated by the existing engaged-combat signal. For owned party NPCs, the source gate includes an active party target or a live engaged/threatened enemy, so the party's Stop command alone does not switch a companion to idle recovery. Native HP/Mana bypass shared HP5/Spirit, passive generic Mana, and the shared out-of-combat Mana floor. Other resource types continue through their existing resource model.
Focused validation is `npx vitest run src/game/romNativeRecovery.test.ts src/game/romNativeRecovery.integration.test.ts`; the parent task adds active-five NPC, secondary-Mana, and WoW-mode compatibility integration cases. Source and simulator limits remain: there is no sitting UI/state, no simulator equivalent for source `StopOntimeCure`, and player/party combat-mode detection is an approximation of source `IsAttackMode`. Native rates are source-derived; this audit does not certify sustained encounter pressure or change encounter budgets/readiness.
## Early level-one sustain diagnostic
The first native Knight level-one pull against Anglo ended after 141 seconds with the player and Rogue companion dead: Anglo's 2,772-HP pool was depleted, but incoming damage was 391.2, healing was 56, player damage was 118 across 6 casts, and 44 rotation decisions were resource-blocked. The pre-recovery/equipment baseline cleared the same pull in 54 seconds with 157.6 player HP remaining, 375 player damage across 19 casts, 262 healing, and 276 incoming damage. These two observations identified an additional attack-start and resource-rotation gap; they do not justify changing the source ReHP/ReMP formulas, and are not a full-cohort result.
Source Holy Strike `490148` is documented as a main-hand attack with Physical Light Damage. The imported direct hit was already level-one 16 holy damage, but its nonphysical damage school caused the generic attack-kind classifier to treat it as a spell; a cast therefore did not start the player's auto-attack. A separate `sourceAttackKind: "melee"` annotation now represents source delivery without changing effect school or amount. The focused regression confirms the cast remains 16 holy damage and is followed by a positive 22 physical auto-attack.
The level-one Priest observation showed max Mana 123 and ReMP 4.8, which gives an owned-NPC combat recovery pulse of 0.2 Mana every six seconds. At full party health its chooser selected 12-Mana Rising Tide despite having the 25-Mana Urgent Heal, confirming a finite-Mana rotation concern independent of recovery-rate math. A separate clean-room pre-level-10 healer policy reserves one learned direct heal before hostile Mana spending; it keeps source recovery unchanged. That reserve alone did not resolve the failed early encounter, so the native level-one boss training budget was separately reduced from 0.30 to 0.20. The unchanged final 80-pull cohort passes with zero player/NPC deaths and invalid casts. See [the aggregate verification and limits](ROM_NATIVE_RECOVERY_EQUIPMENT_PACING_PASS_2026-10-03.md).