* Myriad - Fixed a bug that the token was also created to attack the definding player.

This commit is contained in:
LevelX2 2016-11-19 23:12:02 +01:00
parent 82688fd6f2
commit 03c766a485
2 changed files with 9 additions and 2 deletions

View file

@ -1059,7 +1059,14 @@ public class HumanPlayer extends PlayerImpl {
}
}
if (chooseTarget(Outcome.Damage, target, null, game)) {
declareAttacker(attackerId, response.getUUID(), game, true);
UUID defenderId = response.getUUID();
for (Player player : game.getPlayers().values()) {
if (player.getId().equals(response.getUUID())) {
defenderId = player.getId(); // get the correct player object
break;
}
}
declareAttacker(attackerId, defenderId, game, true);
return true;
}
}

View file

@ -98,7 +98,7 @@ class MyriadEffect extends OneShotEffect {
}
List<Permanent> tokens = new ArrayList<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
if (playerId != defendingPlayerId && controller.hasOpponent(playerId, game)) {
if (!playerId.equals(defendingPlayerId) && controller.hasOpponent(playerId, game)) {
Player opponent = game.getPlayer(playerId);
if (opponent != null && controller.chooseUse(Outcome.PutCreatureInPlay,
"Put a copy of " + sourceObject.getIdName() + " onto battlefield attacking " + opponent.getName() + "?", source, game)) {