fix(engine): wire "as ~ becomes attached, choose" replacement for Psychic Paper#5854
Conversation
…chic Paper
Psychic Paper's continuous grant (ward, can't-be-blocked, name/type set
from the last chosen name/type) was already implemented and tested, but
the leading "As this Equipment becomes attached to a creature, choose a
creature card name and a creature type" clause parsed to Unimplemented —
nothing ever actually prompted the choice, so the grant read empty.
Reuses the existing ReplacementEvent::Attached matcher/applier (declared
but never produced by any parser) and routes Effect::Attach's single
resolver through the replacement pipeline, so any "as it becomes
attached, choose ..." definition fires regardless of which ability moves
the attachment. The two-part choice ("a creature card name and a
creature type") is parsed via a small conjunction combinator that
re-dispatches each conjunct through the existing named-choice phrase
table, extended generically rather than special-cased to this card.
Closes phase-rs#5821
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Parse changes introduced by this PRBaseline pending for |
deliver_attach's apply_pending_post_replacement_effect call (Psychic Paper's attach-time choice) is a reviewed new consumer site; freeze the ratchet baseline to match.
matthewevans
left a comment
There was a problem hiding this comment.
Request changes — only actual attachment events may trigger Attached.
🔴 Blocker
[HIGH] The replacement matches every attachment ZoneChange to battlefield, including an unattached Psychic Paper ETB. Evidence: crates/engine/src/game/replacement.rs:3409-3435. Why it matters: Attached triggers when no attachment occurred. Suggested fix: require an actual attach operation/event and add the unattached-ETB regression.
Recommendation: request-changes.
…vents attached_matcher's ZoneChange branch matched any Aura/Equipment entering the battlefield, including a plain unattached Equipment ETB (CR 301.5b: Equipment enters like other artifacts, not attached). That false match let Psychic Paper's "as it becomes attached, choose ..." replacement fire on cast, before it was ever equipped. Gate the branch on the zone change's attach_to slot actually being populated, and add a regression test that casting bare Psychic Paper settles at Priority instead of stalling on the name/type prompt. Addresses review feedback on phase-rs#5854.
matthewevans
left a comment
There was a problem hiding this comment.
Approved — the attach-time matcher now requires an actual attachment target, and the current runtime regression proves a bare Equipment ETB does not prompt.
Psychic Paper's continuous grant (ward, can't-be-blocked, name/type set
from the last chosen name/type) was already implemented and tested, but
the leading "As this Equipment becomes attached to a creature, choose a
creature card name and a creature type" clause parsed to Unimplemented —
nothing ever actually prompted the choice, so the grant read empty.
Reuses the existing ReplacementEvent::Attached matcher/applier (declared
but never produced by any parser) and routes Effect::Attach's single
resolver through the replacement pipeline, so any "as it becomes
attached, choose ..." definition fires regardless of which ability moves
the attachment. The two-part choice ("a creature card name and a
creature type") is parsed via a small conjunction combinator that
re-dispatches each conjunct through the existing named-choice phrase
table, extended generically rather than special-cased to this card.
Closes #5821