Read docs/work-queue.md and do the next unchecked batch. For each batch:
mtg-engine/src/abilities.rs, mtg-engine/src/game.rs) to understand current Effect/StaticEffect variantsgame.rs mod tests)cargo check -p mtg-cards && cargo test --libdocs/{fdn,tla,tdm,ecl}-remediation.md, update ROADMAP.mddocs/work-queue.md with today's dateIf a batch turns out to be wrong or more complex than described, update the queue with what you learned and move on to the next one.
I'll start by reading the work queue to understand what's next.
Batch 2 is next - "Easy swaps — existing typed effects" with sub-batches 2a through 2f. Let me read the engine files and investigate the cards.
Now let me investigate each sub-batch by finding the exact card lines. Let me search in parallel.
Some patterns weren't found — line numbers shifted or text changed. Let me search more broadly for the remaining items.
Let me get more context on the specific cards that need fixing.
Let me check how AddCounters and EntersTapped are handled in game.rs, and look at the remaining card contexts.
Now let me check how AddCounters resolves when TargetSpec::None — the key question for batch 2d.
Let me check how the stack item stores source information.
The StackItemKind::Ability has a source_id. I need to pass this through to execute_effects so AddCounters and RemoveCounters can fall back to the source when there are no targets. Let me look at how the stack item passes data during resolution.
Let me check all callers of execute_effects to plan the source_id plumbing.
Let me understand how triggered abilities get their source_id onto the stack.
Let me check existing EntersTapped usage in cards and how it's handled by the engine.
Good — EntersTapped { filter: "self".into() } is the established pattern. Now let me look at the Sting-Slinger cost issue and understand how Blight cost works in game.rs.
Let me check the remaining cards I found and check for more matches.
Let me check for any other StaticEffect::Custom("Enters tapped") patterns across all sets.
Only the Diregraf Ghoul has the simple "Enters tapped" Custom — the TDM ones are conditional (batch 6). Good.
Now I have the full picture. Let me also check what the RemoveCounters match arm looks like more carefully and read the rest of execute_effects.
Good. I now have a complete picture. Let me implement everything. I'll start with the engine change to execute_effects, then fix all the cards.
Let me first modify the engine to support "add/remove counters on self" when no targets are provided.
Now I'll make the changes. The approach:
source: Option<ObjectId> to execute_effectsAddCounters/RemoveCounters: fall back to source when targets is emptyNow update the execute_effects signature and add the source fallback for AddCounters/RemoveCounters.
Now update the AddCounters match arm to fall back to source:
Now update RemoveCounters the same way:
Now update the test callers of execute_effects:
Good. Now let me add a test for the self-counter behavior, then fix all the cards. Let me first check compilation and tests.
Engine compiles. Now let me add a test for self-counters, then fix all the cards. Let me find the test section in game.rs.
Now let me add a test for self-counters at the end of the test module.
All 159 engine tests pass. Now let me fix all the cards. I'll do them in parallel using sed for efficiency.
Now the 2d self-counter fixes for ECL:
Now the additional RemoveCounters cards found:
Now batch 2e (loot — Icewind Elemental in FDN) and 2f (ETB draw — Mistmeadow Council in ECL):
Now let me also fix the bonus card I found — Refute (FDN) which has counter spell + loot:
Also need to fix Refute's target — it says "Counter target spell" but has TargetSpec::None:
Now let me verify all changes compiled correctly:
Now run all tests: