[CMR] fixed Akroma, Vision of Ixidor - missing target in effect (#7209);

This commit is contained in:
Oleg Agafonov 2020-11-28 14:22:38 +04:00
parent 4d50dfd475
commit 64821a50d3
2 changed files with 48 additions and 1 deletions

View file

@ -5,6 +5,7 @@ import mage.MageInt;
import mage.abilities.Abilities; import mage.abilities.Abilities;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility; import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.*; import mage.abilities.keyword.*;
@ -14,6 +15,7 @@ import mage.constants.*;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
@ -110,7 +112,9 @@ class AkromaVisionOfIxidorEffect extends OneShotEffect {
.mapToInt(b -> b ? 1 : 0) .mapToInt(b -> b ? 1 : 0)
.sum(); .sum();
if (count > 0) { 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; return true;

View file

@ -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();
}
}