fix(parser): controller-scoped "you lost life this turn" intervening-if condition#4643
Conversation
…if condition
The gained/lost x you/opponent/player condition matrix was missing exactly
one subject: the controller-scoped "you lost [N or more] life this turn".
Opponent and any-player "lost life" parsed, and controller "gained life"
parsed, but "you lost ..." silently dropped its condition (left None), so
phase-trigger intervening-ifs such as The Book of Vile Darkness ("if you lost
2 or more life this turn, create a 2/2 black Zombie") lost both the gate and
their effect.
Add parse_you_lost_life_this_turn as the mirror of
parse_you_gained_life_this_turn, wired into parse_life_history_condition.
Resolves via the existing QuantityRef::LifeLostThisTurn { Controller } — no
new variants.
CR 119.3 + CR 603.4.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request adds the parse_you_lost_life_this_turn parser to crates/engine/src/parser/oracle_nom/condition.rs to handle conditions like 'you lost N or more life this turn' and 'you've lost life this turn'. This completes the controller-scoped mirror of the life-gained conditions, mapping to the existing LifeLostThisTurn quantity reference with PlayerScope::Controller. No review comments were provided, and the implementation conforms to the repository's architectural rules, so there is no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
matthewevans
left a comment
There was a problem hiding this comment.
Reviewed the updated head after the base-branch merge. The change is parser-only, at the existing life-history condition seam, reuses LifeLostThisTurn { Controller }, and covers both threshold and non-threshold intervening-if trigger forms. CI is pending; auto-merge will wait for required checks.
Parse changes introduced by this PR · 1 card(s), 1 signature(s) (baseline: main
|
Problem
The gained/lost-life intervening-if condition matrix was missing exactly one subject: the controller-scoped "you lost [N or more] life this turn". Opponent (
parse_opponent_lost_life_this_turn) and any-player (parse_player_lost_life_this_turn) "lost life" parsed, and the controller gained sibling parsed too — but"you lost ..."silently dropped its condition (leftNone).As a result, phase-trigger intervening-ifs such as The Book of Vile Darkness lost both the gate and their effect:
Fix
Add
parse_you_lost_life_this_turnas the exact mirror ofparse_you_gained_life_this_turn, wired intoparse_life_history_condition. It resolves via the existingQuantityRef::LifeLostThisTurn { player: Controller }— no new variants. Handles both"you lost N or more life this turn"(≥ N) and the bare"you lost life this turn"(≥ 1) forms, plus the"you've lost ..."contraction.CR 119.3 (life-total changes) + CR 603.4 (intervening-if).
Tests
Two inline parser regressions in
oracle_trigger.rs:trigger_if_you_lost_2_or_more_life— The Book of Vile Darkness; asserts conditionLifeLostThisTurn{Controller} ≥ 2andexecute.is_some()(the dropped effect).trigger_if_you_lost_life_this_turn_no_minimum— bare form →≥ 1.Both pass; engine compiles clean.
🤖 Generated with Claude Code