From b5ef4a7f45866f0bfb33afdce3d0d65050b6d29b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Mar 2014 17:46:12 +0100 Subject: [PATCH] * Attacking Planeswalker - Fixed a bug that it was not able to attack a planeswalker that had hexproof. --- .../Mage.Player.Human/src/mage/player/human/HumanPlayer.java | 2 +- Mage/src/mage/target/common/TargetDefender.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 6789f9c46d..7de3f097d1 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 @@ -662,7 +662,7 @@ public class HumanPlayer extends PlayerImpl { } else { TargetDefender target = new TargetDefender(possibleDefender, attackerId); - target.setNotTarget(true); // player hexproof does not prevent attacking a player + target.setNotTarget(true); // player or planswalker hexproof does not prevent attacking a player if (forcedToAttack) { StringBuilder sb = new StringBuilder(target.getTargetName()); Permanent attacker = game.getPermanent(attackerId); diff --git a/Mage/src/mage/target/common/TargetDefender.java b/Mage/src/mage/target/common/TargetDefender.java index 28c0ffc39f..16a86a0998 100644 --- a/Mage/src/mage/target/common/TargetDefender.java +++ b/Mage/src/mage/target/common/TargetDefender.java @@ -86,6 +86,7 @@ public class TargetDefender extends TargetImpl { MageObject targetSource = game.getObject(sourceId); for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { Player player = game.getPlayer(playerId); + // removed canBeTargeted because it's not correct to check it for attacking target if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -94,6 +95,7 @@ public class TargetDefender extends TargetImpl { } } for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) { + // removed canBeTargeted because it's not correct to check for attacking target if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game)) { count++; if (count >= this.minNumberOfTargets) {