Some minor changes.

This commit is contained in:
LevelX2 2015-04-07 16:46:10 +02:00
parent a58afbde4f
commit 2f09b2859c
3 changed files with 13 additions and 24 deletions

View file

@ -315,29 +315,18 @@ public class HumanPlayer extends PlayerImpl {
game.fireSelectTargetEvent(playerId, target.getMessage(), possibleTargets, required, getOptions(target, null)); game.fireSelectTargetEvent(playerId, target.getMessage(), possibleTargets, required, getOptions(target, null));
waitForResponse(game); waitForResponse(game);
if (response.getUUID() != null) { if (response.getUUID() != null) {
if (target.getTargets().contains(response.getUUID())) {
target.remove(response.getUUID());
continue;
}
if (possibleTargets.contains(response.getUUID())) { if (possibleTargets.contains(response.getUUID())) {
if (target instanceof TargetPermanent) { if (target.canTarget(playerId, response.getUUID(), source, game)) {
if (((TargetPermanent)target).canTarget(playerId, response.getUUID(), source, game)) { target.addTarget(response.getUUID(), source, game);
if (target.getTargets().contains(response.getUUID())) { // if already included remove it with
target.remove(response.getUUID());
} else {
target.addTarget(response.getUUID(), source, game);
if(target.doneChosing()){
return true;
}
}
}
} else if (target.canTarget(playerId, response.getUUID(), source, game)) {
if (target.getTargets().contains(response.getUUID())) { // if already included remove it with
target.remove(response.getUUID());
} else {
target.addTarget(response.getUUID(), source, game);
}
if(target.doneChosing()){ if(target.doneChosing()){
return true; return true;
} }
} }
} // else do nothing - allow to pick another target }
} else { } else {
if (target.getTargets().size() >= target.getNumberOfTargets()) { if (target.getTargets().size() >= target.getNumberOfTargets()) {
return true; return true;

View file

@ -92,8 +92,9 @@ public class ReturnFromExileEffect extends OneShotEffect {
switch (zone) { switch (zone) {
case BATTLEFIELD: case BATTLEFIELD:
card.moveToZone(zone, source.getSourceId(), game, tapped); card.moveToZone(zone, source.getSourceId(), game, tapped);
if (!game.isSimulation()) if (!game.isSimulation()) {
game.informPlayers(new StringBuilder(controller.getName()).append(" moves ").append(card.getName()).append(" to ").append(zone.toString()).toString()); game.informPlayers(controller.getName() + " moves " + card.getName() + " to " + zone.toString().toLowerCase());
}
break; break;
case HAND: case HAND:
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED); controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED);
@ -106,8 +107,9 @@ public class ReturnFromExileEffect extends OneShotEffect {
break; break;
default: default:
card.moveToZone(zone, source.getSourceId(), game, tapped); card.moveToZone(zone, source.getSourceId(), game, tapped);
if (!game.isSimulation()) if (!game.isSimulation()) {
game.informPlayers(new StringBuilder(controller.getName()).append(" moves ").append(card.getName()).append(" to ").append(zone.toString()).toString()); game.informPlayers(controller.getName() + " moves " + card.getName() + " to " + zone.toString().toLowerCase());
}
} }
} }
} }

View file

@ -32,7 +32,6 @@ import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect; import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect;
import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect.FaceDownType; import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect.FaceDownType;
@ -44,7 +43,6 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil; import mage.util.CardUtil;
/** /**