Track the average turn Pendulum activated on #303

Merged
nelsong6 merged 1 commit from claude/pendulum-relic-avg-turn-e24aec into main 2026-08-08 12:36:57 -07:00
nelsong6 commented 2026-08-08 12:36:50 -07:00 (Migrated from github.com)

Pendulum already recorded activations, marginal draw attribution, and combat-end
charge buckets. This adds the turn each activation landed on, so the tooltip can
answer how deep into a combat the relic actually pays out rather than only how
often. New Avg activation turn row, reusing the label Centennial Puzzle and
Pael's Eye already use.

Turn number settled against the assembly, not assumed

Reading a turn number during a hand draw is ambiguous on its face -- the counter
could increment after the draw. Checked in sts2.dll rather than guessed:
CombatManager.SwitchSides increments PlayerCombatState.TurnNumber before the
upcoming player side, and SetupPlayerTurn itself branches on TurnNumber == 1
for first-turn Innate handling immediately after Hook.ModifyHandDraw. The value
is already the turn being drawn for. Hook.ModifyHandDraw has exactly one call
site, so one turn cannot yield two samples. Recorded in the runtime primer.

Denominator choice

Samples count activations rather than combats, matching the Pael's Eye precedent.
A long combat contributes each of its turn-3/6/9 activations; a combat too short
to activate contributes nothing instead of a zero that would drag the average
down. This deliberately differs from the adjacent zero-inclusive per-combat draw
row.

Schema

The two fields are additive, so historic run files still load via missing-field
defaults -- asserted on the existing pendulum fixture, which pre-dates them. New
pendulum-activation-turn-run.json fixture plus schema-loading assertions. They
are observation-era: an upgraded run cannot reconstruct activation turns for
combats already fought, so the row reads 0.0 until Pendulum next activates.

No mod version bump.

Validation

Unit tests were not run, per the repo's user-owned verification rule. Deployed
and hot-reloaded (reload 8, Core.Initialize complete, 425 classes patched,
0 failed/skipped); the user confirmed the new tooltip row live. No restart was
needed -- Pendulum.ModifyHandDraw was already a patched target, so no new
Harmony target was introduced.

Pendulum already recorded activations, marginal draw attribution, and combat-end charge buckets. This adds the turn each activation landed on, so the tooltip can answer how deep into a combat the relic actually pays out rather than only how often. New `Avg activation turn` row, reusing the label Centennial Puzzle and Pael's Eye already use. ## Turn number settled against the assembly, not assumed Reading a turn number during a hand draw is ambiguous on its face -- the counter could increment after the draw. Checked in `sts2.dll` rather than guessed: `CombatManager.SwitchSides` increments `PlayerCombatState.TurnNumber` before the upcoming player side, and `SetupPlayerTurn` itself branches on `TurnNumber == 1` for first-turn Innate handling immediately after `Hook.ModifyHandDraw`. The value is already the turn being drawn for. `Hook.ModifyHandDraw` has exactly one call site, so one turn cannot yield two samples. Recorded in the runtime primer. ## Denominator choice Samples count activations rather than combats, matching the Pael's Eye precedent. A long combat contributes each of its turn-3/6/9 activations; a combat too short to activate contributes nothing instead of a zero that would drag the average down. This deliberately differs from the adjacent zero-inclusive per-combat draw row. ## Schema The two fields are additive, so historic run files still load via missing-field defaults -- asserted on the existing pendulum fixture, which pre-dates them. New `pendulum-activation-turn-run.json` fixture plus schema-loading assertions. They are observation-era: an upgraded run cannot reconstruct activation turns for combats already fought, so the row reads 0.0 until Pendulum next activates. No mod version bump. ## Validation Unit tests were not run, per the repo's user-owned verification rule. Deployed and hot-reloaded (reload 8, `Core.Initialize complete`, 425 classes patched, 0 failed/skipped); the user confirmed the new tooltip row live. No restart was needed -- `Pendulum.ModifyHandDraw` was already a patched target, so no new Harmony target was introduced.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/spirelens!303
No description provided.