diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 6323f1cc630..9543dc0a9c5 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -36,6 +36,7 @@ import mage.abilities.*; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.*; import mage.abilities.effects.ReplacementEffect; +import mage.abilities.effects.RequirementEffect; import mage.abilities.mana.ManaAbility; import mage.cards.Card; import mage.cards.Cards; @@ -527,14 +528,22 @@ public class HumanPlayer extends PlayerImpl { selectDefender(game.getCombat().getDefenders(), attacker.getId(), game); } else if (filterAttack.match(attacker, null, playerId, game) && game.getStack().isEmpty()) { -// if (game.getState().getTriggered().isEmpty() && game.getState().getDelayed().isEmpty()) - game.getCombat().removeAttacker(attacker.getId(), game); + removeAttackerIfPossible(game, attacker); } } } } } + private void removeAttackerIfPossible(Game game, Permanent attacker) { + for (RequirementEffect effect : game.getContinuousEffects().getApplicableRequirementEffects(attacker, game)) { + if (effect.mustAttack(game)) { + return; // we can't cancel attacking + } + } + game.getCombat().removeAttacker(attacker.getId(), game); + } + protected boolean selectDefender(Set defenders, UUID attackerId, Game game) { if (defenders.size() == 1) { declareAttacker(attackerId, defenders.iterator().next(), game); diff --git a/Mage.Server/plugins/mage-player-human.jar b/Mage.Server/plugins/mage-player-human.jar index d22341095b3..ad2f1035acc 100644 Binary files a/Mage.Server/plugins/mage-player-human.jar and b/Mage.Server/plugins/mage-player-human.jar differ