* Divine Reckoning - Fixed that only active players in range of controller are asked to choose a creature.

This commit is contained in:
LevelX2 2014-01-17 08:18:36 +01:00
parent af64575eec
commit 47a442ba28
2 changed files with 34 additions and 17 deletions

View file

@ -98,8 +98,9 @@ class DivineReckoningEffect extends OneShotEffect<DivineReckoningEffect> {
@Override
public boolean apply(Game game, Ability source) {
List<Card> chosen = new ArrayList<Card>();
for (UUID playerId : game.getPlayerList()) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
Target target = new TargetControlledPermanent(1, 1, filter, false);
@ -122,6 +123,9 @@ class DivineReckoningEffect extends OneShotEffect<DivineReckoningEffect> {
}
return true;
}
return false;
}
@Override
public DivineReckoningEffect copy() {

View file

@ -418,10 +418,23 @@ public class GameState implements Serializable, Copyable<GameState> {
// this.messages.add(message);
// }
/**
* Returns a list of all players of the game ignoring range or
* if a player has lost or left the game.
*
* @return playerList
*/
public PlayerList getPlayerList() {
return playerList;
}
/**
* Returns a list of all active players of the game, setting the
* playerId to the current player of the list.
*
* @param playerId
* @return playerList
*/
public PlayerList getPlayerList(UUID playerId) {
PlayerList newPlayerList = new PlayerList();
for (Player player: players.values()) {