"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)

オープン
#13,067 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
game-dev

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
2.7k
フォーク
1.1k
平均マージ
20時間 38分
マージ済み PR(30日)
323

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Card-Forge/forge のほかの issue

Card-Forge/forge の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。