Track card draws blocked by Battle Trance #32

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

When a card attempts to draw cards after Battle Trance has been played, the attempted draw is blocked by the Battle Trance restriction.

We should track those blocked draws in card stats instead of silently treating them as ordinary zero-draw outcomes.

Suggested behavior:

  • Attribute the blocked draw count to the card that attempted to draw.
  • Show it distinctly from successful draws so the stat stays honest.
  • Cover both single-card and multi-card draw effects.

Examples:

  • Battle Trance into Pommel Strike
  • Battle Trance into Shrug It Off
  • Any other post-Battle Trance draw effect that gets prevented
When a card attempts to draw cards after Battle Trance has been played, the attempted draw is blocked by the Battle Trance restriction. We should track those blocked draws in card stats instead of silently treating them as ordinary zero-draw outcomes. Suggested behavior: - Attribute the blocked draw count to the card that attempted to draw. - Show it distinctly from successful draws so the stat stays honest. - Cover both single-card and multi-card draw effects. Examples: - Battle Trance into Pommel Strike - Battle Trance into Shrug It Off - Any other post-Battle Trance draw effect that gets prevented
nelsong6 commented 2026-04-21 19:23:13 -07:00 (Migrated from github.com)

Follow-up after merging #33: there is still a missing hand-full / partial-draw case in live testing, so I want to document the current state before moving on.

What we tried

  • Added card-side draw attempt tracking so draw cards can show drawn / tried instead of only successful draws.
  • Added categorized blocked-draw reasons (No Draw, hand full, other).
  • Added effect-side downstream blocked-draw tracking so blocker cards/powers can show how many cards they actually prevented.
  • Added a fallback hook on Hook.AfterCardChangedPiles intended to catch full-hand redirects that do not come through the usual Hook.ShouldDraw=false path.
  • Kept forge / Sovereign Blade changes merged alongside this work and rebuilt the mod.

Current live repro that still fails

  • Have ample cards in the draw pile.
  • Have room for exactly 1 card in hand.
  • Play Battle Trance.
  • Observed live result: Battle Trance draws 1 card and fills the hand, but its tooltip does not report that the other 2 draw attempts were blocked.

Confirmed test coverage we added

  • BlockTooltipTests.AppendCardDrawStats_ShowsActualVersusAttemptedWhenGapExists
  • BlockTooltipTests.AppendCardDrawStats_FallsBackToLegacyBlockedGapWhenAttemptedIsMissing
  • BlockTooltipTests.AppendCardDrawStats_ShowsHandFullReasonWhenCategorized
  • PoisonTooltipTests.AppendAppliedEffects_ShowsDownstreamBlockedDrawsForNoDraw
  • Schema fixtures/tests for additive shapes through the newer blocked-draw fields
  • Current local result on the clean branch: dotnet test Tests/CardUtilityStats.Core.Tests/CardUtilityStats.Core.Tests.csproj -c Debug -p:SkipModsDeploy=true passed (62/62)

Why this is tricky

  • No Draw and hand full appear to travel through different runtime paths.
  • The current fallback assumes the hand-full case will surface as a draw-pile exit that never lands in Hand, but the live Battle Trance sequence suggests that assumption is incomplete or the hook ordering is different than expected.
  • Multi-draw cards are especially sensitive because we need source-card attribution to stay aligned across a sequence of successful and blocked draws.
  • We also want the blocker side and the drawer side to stay consistent without overfitting to one card.

Likely next approaches

  • Instrument the exact hook/order-of-events around Battle Trance with a nearly-full hand to see where the two missing attempts disappear.
  • Patch a lower-level draw-resolution surface so the source card records requested draws vs actual completed draws directly, instead of inferring the gap from pile movement.
  • Continue treating blockers as abstract tracked effects/powers, but separate the hand-full path from the power-block path more explicitly.
  • Add an integration-style regression test that models the "Battle Trance with 9 cards in hand, 1 draw succeeds, 2 blocked by full hand" scenario once the correct runtime seam is identified.

Documenting this here so the remaining gap is visible while other issues/PRs move forward.

Follow-up after merging #33: there is still a missing hand-full / partial-draw case in live testing, so I want to document the current state before moving on. What we tried - Added card-side draw attempt tracking so draw cards can show `drawn / tried` instead of only successful draws. - Added categorized blocked-draw reasons (`No Draw`, `hand full`, `other`). - Added effect-side downstream blocked-draw tracking so blocker cards/powers can show how many cards they actually prevented. - Added a fallback hook on `Hook.AfterCardChangedPiles` intended to catch full-hand redirects that do not come through the usual `Hook.ShouldDraw=false` path. - Kept forge / Sovereign Blade changes merged alongside this work and rebuilt the mod. Current live repro that still fails - Have ample cards in the draw pile. - Have room for exactly 1 card in hand. - Play Battle Trance. - Observed live result: Battle Trance draws 1 card and fills the hand, but its tooltip does not report that the other 2 draw attempts were blocked. Confirmed test coverage we added - `BlockTooltipTests.AppendCardDrawStats_ShowsActualVersusAttemptedWhenGapExists` - `BlockTooltipTests.AppendCardDrawStats_FallsBackToLegacyBlockedGapWhenAttemptedIsMissing` - `BlockTooltipTests.AppendCardDrawStats_ShowsHandFullReasonWhenCategorized` - `PoisonTooltipTests.AppendAppliedEffects_ShowsDownstreamBlockedDrawsForNoDraw` - Schema fixtures/tests for additive shapes through the newer blocked-draw fields - Current local result on the clean branch: `dotnet test Tests/CardUtilityStats.Core.Tests/CardUtilityStats.Core.Tests.csproj -c Debug -p:SkipModsDeploy=true` passed (`62/62`) Why this is tricky - `No Draw` and `hand full` appear to travel through different runtime paths. - The current fallback assumes the hand-full case will surface as a draw-pile exit that never lands in Hand, but the live Battle Trance sequence suggests that assumption is incomplete or the hook ordering is different than expected. - Multi-draw cards are especially sensitive because we need source-card attribution to stay aligned across a sequence of successful and blocked draws. - We also want the blocker side and the drawer side to stay consistent without overfitting to one card. Likely next approaches - Instrument the exact hook/order-of-events around Battle Trance with a nearly-full hand to see where the two missing attempts disappear. - Patch a lower-level draw-resolution surface so the source card records requested draws vs actual completed draws directly, instead of inferring the gap from pile movement. - Continue treating blockers as abstract tracked effects/powers, but separate the hand-full path from the power-block path more explicitly. - Add an integration-style regression test that models the "Battle Trance with 9 cards in hand, 1 draw succeeds, 2 blocked by full hand" scenario once the correct runtime seam is identified. Documenting this here so the remaining gap is visible while other issues/PRs move forward.
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#32
No description provided.