diff --git a/.gitignore b/.gitignore index 61d6b76f85..92368d784d 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ Mage.Server.Plugins/Mage.Game.FreeForAll/target Mage.Server.Plugins/Mage.Game.MomirDuel/target Mage.Server.Plugins/Mage.Game.MomirGame/target/ Mage.Server.Plugins/Mage.Game.PennyDreadfulCommanderFreeForAll/target +Mage.Server.Plugins/Mage.Game.FreeformCommanderFreeForAll/target/ Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/target Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/target Mage.Server.Plugins/Mage.Player.AI.DraftBot/target diff --git a/Mage.Sets/src/mage/cards/b/BalanWanderingKnight.java b/Mage.Sets/src/mage/cards/b/BalanWanderingKnight.java index 27c266242e..72d7390a34 100644 --- a/Mage.Sets/src/mage/cards/b/BalanWanderingKnight.java +++ b/Mage.Sets/src/mage/cards/b/BalanWanderingKnight.java @@ -29,7 +29,7 @@ package mage.cards.b; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability;; +import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedMultipleSourceCondition; diff --git a/Mage.Sets/src/mage/cards/b/BarrinMasterWizard.java b/Mage.Sets/src/mage/cards/b/BarrinMasterWizard.java index 9e23d7f46b..b6dcf5c3c1 100644 --- a/Mage.Sets/src/mage/cards/b/BarrinMasterWizard.java +++ b/Mage.Sets/src/mage/cards/b/BarrinMasterWizard.java @@ -38,6 +38,8 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -59,7 +61,7 @@ public class BarrinMasterWizard extends CardImpl { //{2}, Sacrifice a permanent: Return target creature to its owner's hand. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{2}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledPermanent()))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BloodswornSteward.java b/Mage.Sets/src/mage/cards/b/BloodswornSteward.java index a4c7aebca3..8ed3d569f3 100644 --- a/Mage.Sets/src/mage/cards/b/BloodswornSteward.java +++ b/Mage.Sets/src/mage/cards/b/BloodswornSteward.java @@ -29,7 +29,7 @@ package mage.cards.b; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability;; +import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostControlledEffect; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AnnihilatorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AnnihilatorTest.java new file mode 100644 index 0000000000..79e622d52d --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AnnihilatorTest.java @@ -0,0 +1,35 @@ +package org.mage.test.cards.abilities.keywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +public class AnnihilatorTest extends CardTestPlayerBase { + + @Test + public void testCardsSacrificedToAnnihilatorTrigger() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + + // Annihilator 6 (Whenever this creature attacks, defending player sacrifices two permanents.) + addCard(Zone.BATTLEFIELD, playerB, "Emrakul, the Aeons Torn"); + + attack(2, playerB, "Emrakul, the Aeons Torn"); + setChoice(playerA, "Island"); + setChoice(playerA, "Island"); + setChoice(playerA, "Island"); + setChoice(playerA, "Mountain"); + setChoice(playerA, "Mountain"); + setChoice(playerA, "Mountain"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 5); + assertPermanentCount(playerA, 1); + } + + +} diff --git a/Mage/src/main/java/mage/abilities/keyword/AnnihilatorAbility.java b/Mage/src/main/java/mage/abilities/keyword/AnnihilatorAbility.java index 735641adc5..a16a527a63 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AnnihilatorAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AnnihilatorAbility.java @@ -33,6 +33,7 @@ import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -90,7 +91,7 @@ public class AnnihilatorAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Annihilator " + count + "(Whenever this creature attacks, defending player sacrifices " + return "Annihilator " + count + " (Whenever this creature attacks, defending player sacrifices " + (count == 1 ? "a permanent" : CardUtil.numberToText(count) + " permanents") + ".)"; } @@ -123,9 +124,9 @@ class AnnihilatorEffect extends OneShotEffect { player = game.getPlayer(defendingPlayerId); } if (player != null) { - int amount = Math.min(count, game.getBattlefield().countAll(StaticFilters.FILTER_CONTROLLED_PERMANENT, player.getId(), game)); + int amount = Math.min(count, game.getBattlefield().countAll(new FilterControlledPermanent(), player.getId(), game)); if (amount > 0) { - Target target = new TargetControlledPermanent(amount, amount, StaticFilters.FILTER_CONTROLLED_PERMANENT, true); + Target target = new TargetControlledPermanent(amount, amount, new FilterControlledPermanent(), true); if (target.canChoose(player.getId(), game)) { while (player.canRespond() && target.canChoose(player.getId(), game) diff --git a/pom.xml b/pom.xml index 0c230fe0f4..895f7cd7d3 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ so remove this arg with update that fixes the problem https://jira.codehaus.org/browse/MCOMPILER-209 --> - false + true