Skip to content

Pass correct target amount filter for Dawnhand Dissident - #16089

Open
matoro wants to merge 2 commits into
magefree:masterfrom
matoro:dawnhand
Open

Pass correct target amount filter for Dawnhand Dissident#16089
matoro wants to merge 2 commits into
magefree:masterfrom
matoro:dawnhand

Conversation

@matoro

@matoro matoro commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #16020

@JayDi85

JayDi85 commented Sep 3, 2026

Copy link
Copy Markdown
Member

1 - [[Tayam, Luminous Enigma]] looks like has a same bug due same RemoveCounterCost usage - can you confirm and fix same way here?

2 - [[Tekuthal, Inquiry Dominus]] and [[The Filigree Sylex]] same code but with Integer.MAX instead 3 -- need same code style with 3, not max

3 - [[Ooze Flux]] and same cards -- need research of RemoveVariableCountersTargetCost usage -- it's has getFixedCostsFromAnnouncedValue and potentially buggy use case with x = 0 -- it's uses Integer.max instead x in the target. So need manual test: x = 0, with old code (is it allow to create 0/0 token) and with new code.

If 3 use cases pass manual test then whole fix:

  • pr's card and fix + 2 fix + 3 fix + verify check (see below)

verify check allow to catch all bad cards on verify tests (on card's constructor) -- so add code like

    public RemoveCounterCost(Target target, CounterType counterTypeToRemove, int countersToRemove) {
        this.target = target.withNotTarget(true); // cost is never targeted
        this.counterTypeToRemove = counterTypeToRemove;
        this.countersToRemove = countersToRemove;

        this.text = setText();

        // verify check
        if (countersToRemove != this.target.getMaxNumberOfTargets()) {
            throw new IllegalArgumentException("Wrong code usage: RemoveCounterCost must use same targets count as counters to remove. Counter: " + countersToRemove + ", targets: " + this.target.getMaxNumberOfTargets());
        }
    }

if 3 use cases fail manual test then must use same fixes and verify check by with countersToRemove > this.target.getMaxNumberOfTargets()

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Tayam, Luminous Enigma - (Gatherer) (Scryfall) (EDHREC)

{1}{W}{B}{G}
Legendary Creature — Nightmare Beast
3/3
Each other creature you control enters with an additional vigilance counter on it.
{3}, Remove three counters from among creatures you control: Mill three cards, then return a permanent card with mana value 3 or less from your graveyard to the battlefield.

Tekuthal, Inquiry Dominus - (Gatherer) (Scryfall) (EDHREC)

{2}{U}{U}
Legendary Creature — Phyrexian Horror
3/5
Flying
If you would proliferate, proliferate twice instead.
{1}{U/P}{U/P}, Remove three counters from among other artifacts, creatures, and planeswalkers you control: Put an indestructible counter on Tekuthal. ({U/P} can be paid with either {U} or 2 life.)

The Filigree Sylex - (Gatherer) (Scryfall) (EDHREC)

{2}
Legendary Artifact
{T}: Put an oil counter on The Filigree Sylex.
{T}, Sacrifice The Filigree Sylex: Destroy each nonland permanent with mana value equal to the number of oil counters on The Filigree Sylex.
{T}, Remove ten oil counters from among permanents you control and sacrifice The Filigree Sylex: It deals 10 damage to any target.

Ooze Flux - (Gatherer) (Scryfall) (EDHREC)

{3}{G}
Enchantment
{1}{G}, Remove one or more +1/+1 counters from among creatures you control: Create an X/X green Ooze creature token, where X is the number of +1/+1 counters removed this way.

@matoro

matoro commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

I'm not quite sure I like the runtime throw which will crash games, I'll try to add something to Mage.Verify instead and address everything else as well

@JayDi85

JayDi85 commented Sep 3, 2026

Copy link
Copy Markdown
Member

Yeah, it's a runtime check, sorry (so it's can't find all buggy cards on verify) -- but it require anyway to catch wrong code usage -- game error is better way to report about bugs.

@matoro

matoro commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Extended this a little bit as requested.

1 - Tayam was not bugged because it was using multiple separate choice prompts in an individual loop, so it still worked as intended. But after looking at the code as far as I could tell there was no functional difference with RemoveCounterCost, so I just merged it.

2 - These two were bugged. I added a verify check rather than a runtime check. For the Sylex, I had to remove the CompositeCost and just call addCost twice. As far as I can tell, CompositeCost is not useful and we could do this everywhere.

3 - Ooze Flux and anything using RemoveVariableCountersTargetCost does not let you declare X=0 in the first place when passing in a minValue, which the card implementation does. Nothing to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dawnhand Dissident should allow me to cast creature spells from among cards it exiled by removing three counters from among creatures I control

2 participants