From ea1a09830059c4faa91bbf890c08657f5743ce19 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 29 Jul 2014 17:44:42 +0200 Subject: [PATCH] * Spellskite - Fixed that target could wrongly not be changed to spellskite in some cases. --- .../src/main/java/mage/player/ai/ComputerPlayer.java | 2 +- .../Mage.Player.Human/src/mage/player/human/HumanPlayer.java | 2 +- Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java | 4 ++-- Mage/src/mage/target/Target.java | 2 +- Mage/src/mage/target/TargetObject.java | 2 +- Mage/src/mage/target/common/TargetCardInHand.java | 2 +- Mage/src/mage/target/common/TargetCreatureOrPlayer.java | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index c85aa0e043..2ce534fb71 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -665,7 +665,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { card = pickWorstCard(cards, null, target, source, game); } if (source != null) { - if (target.canTarget(card.getId(), this.getId(), source, game)) { + if (target.canTarget(this.getId(), card.getId(), source, game)) { return card; } } 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 282d05f7eb..59fc502277 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 @@ -293,7 +293,7 @@ public class HumanPlayer extends PlayerImpl { return true; } } - } else if (target.canTarget(response.getUUID(), playerId, source, game)) { + } else if (target.canTarget(playerId, response.getUUID(), source, game)) { target.addTarget(response.getUUID(), source, game); if(target.doneChosing()){ return true; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java index 6bc3091205..05d9fa0b0b 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java @@ -109,7 +109,7 @@ class SpellskiteEffect extends OneShotEffect { } if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) { Target target = targets.get(0); - if (target.canTarget(source.getSourceId(), stackObject.getControllerId(), sourceAbility, game)) { + if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { oldTarget = game.getObject(targets.getFirstTarget()); target.clearChosen(); target.add(source.getSourceId(), game); @@ -128,7 +128,7 @@ class SpellskiteEffect extends OneShotEffect { name = object.getName(); } if (name != null && player.chooseUse(Outcome.Neutral, new StringBuilder("Change target from ").append(name).append(" to ").append(sourceObject.getName()).append("?").toString(), game)) { - if (target.canTarget(source.getSourceId(), stackObject.getControllerId(), sourceAbility, game)) { + if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { oldTarget = game.getObject(targets.getFirstTarget()); target.remove(targetId); target.addTarget(source.getSourceId(), source, game); diff --git a/Mage/src/mage/target/Target.java b/Mage/src/mage/target/Target.java index 5b10fab8c6..6ce070943a 100644 --- a/Mage/src/mage/target/Target.java +++ b/Mage/src/mage/target/Target.java @@ -66,7 +66,7 @@ public interface Target extends Serializable { void addTarget(UUID id, int amount, Ability source, Game game, boolean skipEvent); boolean canTarget(UUID id, Game game); boolean canTarget(UUID id, Ability source, Game game); - boolean canTarget(UUID id, UUID playerId, Ability source, Game game); + boolean canTarget(UUID playerId, UUID id, Ability source, Game game); boolean isLegal(Ability source, Game game); List getTargetOptions(Ability source, Game game); diff --git a/Mage/src/mage/target/TargetObject.java b/Mage/src/mage/target/TargetObject.java index 1cfba8c3e5..1637bf8b1e 100644 --- a/Mage/src/mage/target/TargetObject.java +++ b/Mage/src/mage/target/TargetObject.java @@ -90,7 +90,7 @@ public abstract class TargetObject extends TargetImpl { } @Override - public boolean canTarget(UUID id, UUID playerId, Ability source, Game game) { + public boolean canTarget(UUID playerId, UUID id, Ability source, Game game) { return canTarget(id, source, game); } diff --git a/Mage/src/mage/target/common/TargetCardInHand.java b/Mage/src/mage/target/common/TargetCardInHand.java index ff329a3d2e..29f7eb9619 100644 --- a/Mage/src/mage/target/common/TargetCardInHand.java +++ b/Mage/src/mage/target/common/TargetCardInHand.java @@ -78,7 +78,7 @@ public class TargetCardInHand extends TargetCard { @Override public boolean canTarget(UUID id, Ability source, Game game) { - return this.canTarget(id, source.getControllerId(), source, game); + return this.canTarget(source.getControllerId(), id, source, game); } @Override diff --git a/Mage/src/mage/target/common/TargetCreatureOrPlayer.java b/Mage/src/mage/target/common/TargetCreatureOrPlayer.java index 55fe173a99..2f5283ed29 100644 --- a/Mage/src/mage/target/common/TargetCreatureOrPlayer.java +++ b/Mage/src/mage/target/common/TargetCreatureOrPlayer.java @@ -92,7 +92,7 @@ public class TargetCreatureOrPlayer extends TargetImpl { @Override public boolean canTarget(UUID id, Ability source, Game game) { - return canTarget(null, id, source, game); + return canTarget(source.getControllerId(), id, source, game); } @Override