"Return under its owner's control with a +1/+1 counter": the counter is put by the spell's controller, not the permanent's controller (CR 122.6a)

Aperta
#13,067 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
game-dev

Direzione di ricerca

Start in ChangeZoneEffect.changeKnownOriginResolve, where the Destination$ Battlefield branch with WithCountersType calls table.put(activator, ...) around line 643, and check the other addCounter calls that pass the activator. The counter's putter should be the player the card enters under, per CR 122.6a. Run the failing test returnedWithCounterIsPutByItsController in forge-gui-desktop (forge.ai). Done when it passes and Stocking the Pantry gets its supply counter, while the existing counter tests still pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
When a card is returned to the battlefield under its owner's control "with a +1/+1 counter on it" by an opponent's spell (Otherworldly Journey, Parting Gust, ...), Forge records the opponent (the activating player) as the player who put the counter. The owner's "whenever you put one or more +1/+1 counters on a creature you control" abilities (Stocking the Pantry, and other CounterAddedOnce ... ValidSource$ You triggers) therefore do not trigger.

To Reproduce

  1. Player B controls Runeclaw Bear and Stocking the Pantry.
  2. Player A casts Otherworldly Journey targeting Runeclaw Bear.
  3. At the next end step the Bear returns under B's control with a +1/+1 counter.
  4. Stocking the Pantry does not trigger; it has no supply counter.

Expected behavior
CR 122.6: putting counters on an object includes "an object that's given counters as it enters the battlefield." CR 122.6a: "If an object enters the battlefield with counters on it, the effect causing the object to be given counters may specify which player puts those counters on it. If the effect doesn't specify a player, the object's controller puts those counters on it." The Bear's controller is B, so B put the counter and Stocking the Pantry triggers (B gets a supply counter).

Additional context
Master 2a3d3fd774, ChangeZoneEffect.changeKnownOriginResolve: for Destination$ Battlefield with WithCountersType, line 643 does table.put(activator, gameCard, cType, cAmount), so the source of the counters is the activating player rather than the controller the card enters under. The other WithCountersType paths (addCounter(cType, cAmount, activator, ...) at lines 781, 826, 835) use the activator the same way. When B casts the Journey on their own Bear, Stocking the Pantry does trigger (control test below passes), which isolates the putter as the cause.

Failing test (forge-gui-desktop, forge.ai; fails with expected:<1> but was:<0> on master):

@Test
public void returnedWithCounterIsPutByItsController() {
    Game game = initAndCreateGame();
    Player p = game.getPlayers().get(1);
    Player opp = game.getPlayers().get(0);
    fillLibrary(p, 10);
    fillLibrary(opp, 10);
    addCards("Plains", 2, p);
    Card bear = addCard("Runeclaw Bear", opp);
    Card pantry = addCard("Stocking the Pantry", opp);
    Card journey = addCardToZone("Otherworldly Journey", p, ZoneType.Hand);
    game.getAction().checkStateEffects(true);

    SpellAbility sa = journey.getFirstSpellAbility();
    sa.setActivatingPlayer(p);
    sa.getTargets().add(bear);
    AssertJUnit.assertTrue(ComputerUtil.playStack(sa, p, game));
    playUntilNextTurn(game);

    // the Bear is back under opp's control with one +1/+1 counter (checked), but:
    AssertJUnit.assertEquals("Stocking the Pantry should get a supply counter", 1,
            pantry.getCounters(CounterType.getType("SUPPLY")));
}

Found with the help of an AI coding agent (Claude Code); reviewed before posting.

Lingua principale
Java
Stelle
2.7k
Fork
1.1k
Merge medio
20h 38m
PR unite (30g)
323

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Card-Forge/forge

Tutte le issue di Card-Forge/forge

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.