Skip to content

Dark Confidant: anaphoric "its mana value" after reveal resolves to 0 life loss #511

Description

@matthewevans

Summary

Dark Confidant's triggered ability — "At the beginning of your upkeep, reveal the top card of your library and put that card into your hand. You lose life equal to its mana value." — loses 0 life regardless of the revealed card's mana value.

Root cause

The anaphoric pronoun "its" refers to the revealed card. At runtime the revealed card is tracked only in state.last_revealed_ids, which no ObjectScope variant reads.

The ability is a 3-deep chain: RevealTopChangeZone { target: ParentTarget }LoseLife { amount: ObjectManaValue { scope: <anaphoric> } }. RevealTop injects the revealed card as a target into its immediate sub-ability (ChangeZone) only; apply_parent_chain_context does not propagate it (nor populate effect_context_object) into the nested LoseLife. At LoseLife resolution the referent chain (cost_paid_object → trigger-event source → effect_context_object) is entirely empty — the trigger is a phase event with no source object, and the revealed card moved to Hand (not a public zone, so moved_object_context_from_events captures nothing). Resolution falls through to unwrap_or(0).

This is pre-existing breakage, surfaced during the issue #495 (Rite of Consumption) review — the committed dark_confidant_ir.snap shows the pre-fix amount scope was already CostPaidObject, which hits the same dead chain.

Building-block fix (the general pattern)

This is not Dark-Confidant-specific. It is the general "anaphoric reference to an object introduced by an earlier instruction in the same resolving triggered ability" case. The fix needs the revealed-card referent (from RevealTop) to reach nested sub-abilities — either by capturing it into effect_context_object via the chain-context propagation, or by threading the referent through the chained-target inheritance into deeper sub-abilities. Covers every "reveal … you do X equal to its …" card, not just Dark Confidant.

Repro

Cast/resolve Dark Confidant's upkeep trigger with a non-zero-CMC card on top of the library; observe life total unchanged.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions