Track the Energy Ice Cream actually conserved #337

Merged
nelsong6 merged 1 commit from claude/ice-cream-missing-stats-12efbd into main 2026-10-10 19:21:42 -07:00
nelsong6 commented 2026-10-10 19:21:25 -07:00 (Migrated from github.com)

Ice Cream had no stats at all. It has no activation callback — it only overrides
ShouldPlayerResetEnergy, returning false for its own owner from turn 2 on. So
the observed unit is the game's own reset-or-carry decision, not a trigger.

Where the number comes from

CombatManager.SetupPlayerTurn asks Hook.ShouldPlayerResetEnergy once per
player turn setup and then branches: true assigns Energy = MaxEnergy and
throws the old pool away, false adds MaxEnergy to whatever is already there.
The pool readable on the player while that hook is answering is therefore
exactly what the reset would have discarded, which makes the postfix read
marginal without a counterfactual. Reading after either branch would measure the
refilled total instead.

Credit is gated on the relic instance's own answer rather than the aggregate
result: Hook.ShouldPlayerResetEnergy short-circuits on the first listener
returning false and never reports which one, and it runs for non-owning players
in multiplayer.

Rows

Row Denominator
Total energy conserved —
Avg energy conserved per turn every player turn held, including turn 1
Avg energy conserved per combat every combat held

Both averages divide by zero-inclusive held-period denominators counted at the
same decision point, so turns and combats that carried nothing stay in. Turn 1
counts too — it always resets, and the row descriptions say so rather than
quietly excluding it.

Game-shape assumptions

IceCreamStatsTests pins the one-suppressor assumption so a second suppressor
added by a game update surfaces as a test failure rather than as a silently
shared stat. Re-verified against the live sts2.dll on rebase: IceCream is
still the only type overriding ShouldPlayerResetEnergy, and the
ResetEnergy/AddMaxEnergyToCurrent branch is unchanged.

Notes

  • Persisted fields are additive, with ice-cream-relic-run.json and
    SchemaLoadingTests assertions.
  • Deployed and hot-reloaded: patch install went 437 -> 438 classes, 0
    failed/skipped, Hook.ShouldPlayerResetEnergy listed as a patched target.
  • This is a newly introduced Harmony target, and the running process had already
    played combat before the patch was installed, so per
    docs/sts2-runtime-primer.md it will not record in that process until a full
    game restart. Not a precaution — the patched-method listing proves
    installation, not reach.
Ice Cream had no stats at all. It has no activation callback — it only overrides `ShouldPlayerResetEnergy`, returning false for its own owner from turn 2 on. So the observed unit is the game's own reset-or-carry decision, not a trigger. ## Where the number comes from `CombatManager.SetupPlayerTurn` asks `Hook.ShouldPlayerResetEnergy` once per player turn setup and then branches: true assigns `Energy = MaxEnergy` and throws the old pool away, false adds `MaxEnergy` to whatever is already there. The pool readable on the player while that hook is answering is therefore exactly what the reset would have discarded, which makes the postfix read marginal without a counterfactual. Reading after either branch would measure the refilled total instead. Credit is gated on the relic instance's own answer rather than the aggregate result: `Hook.ShouldPlayerResetEnergy` short-circuits on the first listener returning false and never reports which one, and it runs for non-owning players in multiplayer. ## Rows | Row | Denominator | | --- | --- | | Total energy conserved | — | | Avg energy conserved per turn | every player turn held, including turn 1 | | Avg energy conserved per combat | every combat held | Both averages divide by zero-inclusive held-period denominators counted at the same decision point, so turns and combats that carried nothing stay in. Turn 1 counts too — it always resets, and the row descriptions say so rather than quietly excluding it. ## Game-shape assumptions `IceCreamStatsTests` pins the one-suppressor assumption so a second suppressor added by a game update surfaces as a test failure rather than as a silently shared stat. Re-verified against the live `sts2.dll` on rebase: `IceCream` is still the only type overriding `ShouldPlayerResetEnergy`, and the `ResetEnergy`/`AddMaxEnergyToCurrent` branch is unchanged. ## Notes - Persisted fields are additive, with `ice-cream-relic-run.json` and `SchemaLoadingTests` assertions. - Deployed and hot-reloaded: patch install went 437 -> 438 classes, 0 failed/skipped, `Hook.ShouldPlayerResetEnergy` listed as a patched target. - This is a newly introduced Harmony target, and the running process had already played combat before the patch was installed, so per `docs/sts2-runtime-primer.md` it will not record in that process until a full game restart. Not a precaution — the patched-method listing proves installation, not reach.
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!337
No description provided.