feat(engine): support "damage isn't removed during cleanup" statics#3645
feat(engine): support "damage isn't removed during cleanup" statics#3645philluiz2323 wants to merge 1 commit into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
VERDICT: request-changes [MED] Parser arm is ad hoc and can over-accept instead of requiring the cleanup sentence grammar. Evidence: [MED] Cleanup protection matching drops phased-out affected permanents even though this code is implementing CR 514.2's cleanup population. Evidence: [LOW] |
524f495 to
ded7c3c
Compare
|
VERDICT: request-changes [MED] The parser still uses the same over-accepting scan/split shape instead of an all-consuming cleanup sentence grammar. Evidence: [MED] The cleanup hook still evaluates protected objects with the normal phased-out-excluding matcher. Evidence: |
matthewevans
left a comment
There was a problem hiding this comment.
Formalizing my blocking review comment: this still needs the cleanup parser grammar and cleanup-time phased-out matcher issue addressed before merge.
CR 514.2: removing all marked damage is a turn-based action during the cleanup
step. "Damage isn't removed from [subject] during cleanup steps" statics
(Ancient Adamantoise, Patient Zero, Uthgardt Fury, Case of the Market Melee)
suppress that removal for the permanents they match, so marked damage persists
across turns. The engine had no mechanism — execute_cleanup cleared every
permanent's damage_marked unconditionally — so these cards were unsupported.
- Add StaticMode::DamageNotRemovedDuringCleanup, a nullary marker whose subject
rides the definition's affected filter ("this creature" -> SelfRef;
"creatures your opponents control" -> a typed filter). Classified
data-carrying in coverage (enforced by a bespoke turn-based hook, not the
layer registry).
- Parser parse_damage_not_removed_during_cleanup composes the sanctioned
scan_contains / split_once_on_lower / parse_type_phrase building blocks.
- execute_cleanup gathers permanents matched by an active such static (via
battlefield_active_statics + matches_target_filter) and skips clearing their
damage.
Tests: parser (self + filtered subject) and a runtime cleanup scenario asserting
a protected permanent keeps its marked damage while a normal creature's is
removed. Full engine lib suite green (12413 passed); local regen: 4 cards flip
to supported, 0 regressions.
Closes phase-rs#3644
ded7c3c to
8412bb0
Compare
|
Thanks — all three addressed:
Full engine lib suite green (12439 passed), clippy |
matthewevans
left a comment
There was a problem hiding this comment.
VERDICT: request-changes
Prior findings status: the parser is now anchored to the Damage isn't removed from <subject> during cleanup steps. sentence shape, and the direct execute_cleanup path now uses the phased-out-aware matcher with a regression test. Those two blockers are addressed.
[HIGH] The deferred cleanup-discard path still ignores DamageNotRemovedDuringCleanup. Evidence: crates/engine/src/game/turns.rs:1350 returns WaitingFor::DiscardToHandSize before the new protected-set logic runs, and crates/engine/src/game/turns.rs:1524 then clears every damaged battlefield permanent in finish_cleanup_discard without consulting StaticMode::DamageNotRemovedDuringCleanup. Why it matters: in any cleanup where the active player has to discard, Patient Zero / Ancient Adamantoise / Uthgardt Fury-style statics stop working and protected damage is removed anyway. Suggested fix: share the cleanup damage-clearing helper between execute_cleanup and finish_cleanup_discard so both paths compute the same protected set, and add a regression where cleanup first prompts for discard and then preserves protected marked damage after finish_cleanup_discard.
|
Both [MED] items are already resolved in the current HEAD (
Could you re-run the review against |
|
Thanks for the follow-up. I did review the current
The remaining blocker is a different path on the same head: So the ask is not to revisit the parser/phased-out fixes; those are fine. Please share the cleanup damage-clearing helper between |
Problem
Cards with a "Damage isn't removed from [subject] during cleanup steps" static were unsupported — the clause wasn't modeled, so the static fell to
Unrecognized: Ancient Adamantoise, Patient Zero, Uthgardt Fury, Case of the Market Melee.CR 514.2: removing all marked damage is a turn-based action during the cleanup step. These statics suppress that removal for the permanents they match, so marked damage persists across turns. The engine had no mechanism —
execute_cleanupcleared every permanent'sdamage_markedunconditionally.Fix
StaticMode::DamageNotRemovedDuringCleanup— a nullary marker whose subject rides the definition'saffectedfilter (this creature→SelfRef;creatures your opponents control→ a typed filter). Classified data-carrying in coverage (enforced by a bespoke turn-based hook, not the layer registry).parse_damage_not_removed_during_cleanupcomposes the sanctionedscan_contains/split_once_on_lower/parse_type_phrasebuilding blocks (parser gate clean).execute_cleanupgathers the permanents matched by an active such static (battlefield_active_statics+matches_target_filter) and skips clearing their marked damage.Verification
SelfRef; typed subject → opponent-creatures filter (not collapsed toSelfRef).execute_cleanup_preserves_damage_under_damage_not_removed_static: a protected permanent keeps its marked damage through cleanup while a normal creature's is removed.-D warningsclean.Closes #3644