M3: Utility card closure (energy, draw) #7

Closed
opened 2026-04-19 17:00:01 -07:00 by nelsong6 · 1 comment
nelsong6 commented 2026-04-19 17:00:01 -07:00 (Migrated from github.com)

Goal

For cards that don't deal damage or generate block directly, measure their downstream value — energy generated and used, cards drawn and played.

Scope

Energy generating cards:

  • On card played: snapshot the generated amount
  • On turn end: was it spent (energy_used) or not (energy_wasted)?

Draw cards:

  • On card played: tag card instances as "drawn by X"
  • On subsequent card plays this turn or turn end: record whether each tagged card was played (closure_played) or remained unplayed (closure_dropped)

Hooks

  • CardPlayFinishedEntry (already tracked)
  • CardDrawnEntry (already flowing through CombatHistory.Add)
  • EnergySpentEntry (already flowing)
  • CombatManager.TurnEnded event for turn boundaries

Schema additions

  • TotalEnergyGenerated
  • TotalEnergyUsed — consumed before turn end
  • TotalCardsDrawn — caused by this card
  • TotalDrawnCardsPlayed — closure: drawn cards that got played

Schema bump coordinated with M2 or bumps again.

## Goal For cards that don't deal damage or generate block directly, measure their downstream value — energy generated and used, cards drawn and played. ## Scope **Energy generating cards:** - On card played: snapshot the generated amount - On turn end: was it spent (energy_used) or not (energy_wasted)? **Draw cards:** - On card played: tag card instances as "drawn by X" - On subsequent card plays this turn or turn end: record whether each tagged card was played (closure_played) or remained unplayed (closure_dropped) ## Hooks - `CardPlayFinishedEntry` (already tracked) - `CardDrawnEntry` (already flowing through CombatHistory.Add) - `EnergySpentEntry` (already flowing) - `CombatManager.TurnEnded` event for turn boundaries ## Schema additions - `TotalEnergyGenerated` - `TotalEnergyUsed` — consumed before turn end - `TotalCardsDrawn` — caused by this card - `TotalDrawnCardsPlayed` — closure: drawn cards that got played Schema bump coordinated with M2 or bumps again.
nelsong6 commented 2026-04-20 18:38:38 -07:00 (Migrated from github.com)

Closing this as resolved.

The remaining gap here turned out to be narrower than the original issue text: energy spend tracking and the other utility asks were already handled, and the missing piece was attribution for cards that directly grant energy while they resolve.

That is now implemented in commit 282e2d30af8df3e3ab25fc1b9e3c6e62f869113e (Track energy gained from card effects).

Shipped pieces:

  • PlayerGainEnergyPatch now observes real post-clamp energy gain while a card is resolving.
  • RunTracker records that gain onto the active card instance and rolls it into aggregates as TotalEnergyGenerated.
  • RunData persists the per-event and aggregate energy-gained fields.
  • The hover UI now shows Energy gained in both the full tooltip and the compact in-hand view.

Deliberate non-changes:

  • This does not broaden the issue into status/power-effect tracking or other future utility categories.
  • This does not reopen the already-completed draw/energy-spend portions of the original milestone.

With direct energy-generation attribution now working in game, this issue is resolved.

Closing this as resolved. The remaining gap here turned out to be narrower than the original issue text: energy spend tracking and the other utility asks were already handled, and the missing piece was attribution for cards that directly grant energy while they resolve. That is now implemented in commit `282e2d30af8df3e3ab25fc1b9e3c6e62f869113e` (`Track energy gained from card effects`). Shipped pieces: - `PlayerGainEnergyPatch` now observes real post-clamp energy gain while a card is resolving. - `RunTracker` records that gain onto the active card instance and rolls it into aggregates as `TotalEnergyGenerated`. - `RunData` persists the per-event and aggregate energy-gained fields. - The hover UI now shows `Energy gained` in both the full tooltip and the compact in-hand view. Deliberate non-changes: - This does not broaden the issue into status/power-effect tracking or other future utility categories. - This does not reopen the already-completed draw/energy-spend portions of the original milestone. With direct energy-generation attribution now working in game, this issue is resolved.
Sign in to join this conversation.
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#7
No description provided.