From 64821a50d3f63f8e68d50a60a6399daf24072f6e Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sat, 28 Nov 2020 14:22:38 +0400 Subject: [PATCH] [CMR] fixed Akroma, Vision of Ixidor - missing target in effect (#7209); --- .../mage/cards/a/AkromaVisionOfIxidor.java | 6 ++- .../single/cmr/AkromaVisionOfIxidorTest.java | 43 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/cmr/AkromaVisionOfIxidorTest.java diff --git a/Mage.Sets/src/mage/cards/a/AkromaVisionOfIxidor.java b/Mage.Sets/src/mage/cards/a/AkromaVisionOfIxidor.java index 6c71644820..5e5ad8c2cd 100644 --- a/Mage.Sets/src/mage/cards/a/AkromaVisionOfIxidor.java +++ b/Mage.Sets/src/mage/cards/a/AkromaVisionOfIxidor.java @@ -5,6 +5,7 @@ import mage.MageInt; import mage.abilities.Abilities; import mage.abilities.Ability; import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.*; @@ -14,6 +15,7 @@ import mage.constants.*; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; import java.util.Set; import java.util.UUID; @@ -110,7 +112,9 @@ class AkromaVisionOfIxidorEffect extends OneShotEffect { .mapToInt(b -> b ? 1 : 0) .sum(); if (count > 0) { - game.addEffect(new BoostTargetEffect(count, count, Duration.EndOfTurn), source); + ContinuousEffect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + game.addEffect(effect, source); } } return true; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/cmr/AkromaVisionOfIxidorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/cmr/AkromaVisionOfIxidorTest.java new file mode 100644 index 0000000000..ee85a86d8e --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/cmr/AkromaVisionOfIxidorTest.java @@ -0,0 +1,43 @@ +package org.mage.test.cards.single.cmr; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author JayDi85 + */ + +public class AkromaVisionOfIxidorTest extends CardTestPlayerBase { + + @Test + public void test_MustBoostCreatures() { + // https://github.com/magefree/mage/issues/7209 + + // At the beginning of each combat, until end of turn, each other creature you control gets +1/+1 if it has flying, +1/+1 if it has first strike, and so on + addCard(Zone.BATTLEFIELD, playerA, "Akroma, Vision of Ixidor", 1); + // + // Flying + addCard(Zone.BATTLEFIELD, playerA, "Shalai, Voice of Plenty", 1); // 3/4 + addCard(Zone.BATTLEFIELD, playerB, "Balduvian Bears", 1); // 2/2 + + checkPT("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Akroma, Vision of Ixidor", 6, 6); + checkPT("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shalai, Voice of Plenty", 3, 4); + checkPT("before", 1, PhaseStep.PRECOMBAT_MAIN, playerB, "Balduvian Bears", 2, 2); + + // on combat it must get boost for flying + waitStackResolved(1, PhaseStep.BEGIN_COMBAT); + checkPT("no change for itself", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Akroma, Vision of Ixidor", 6, 6); + checkPT("boost fly", 1, PhaseStep.BEGIN_COMBAT, playerA, "Shalai, Voice of Plenty", 3 + 1, 4 + 1); + checkPT("no change for opponent", 1, PhaseStep.PRECOMBAT_MAIN, playerB, "Balduvian Bears", 2, 2); + + // end boost + checkPT("end boost on end turn", 2, PhaseStep.PRECOMBAT_MAIN, playerA, "Shalai, Voice of Plenty", 3, 4); + + setStrictChooseMode(true); + setStopAt(2, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + } +}