Abilities<ManaAbility> mana = land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
for (ManaAbility ability : mana) {
types.add(ability.getNetMana(game));
}
}
Choice choice = new ChoiceImpl(true);
choice.setMessage("Pick a mana color");
if (types.getBlack() > 0) {
choice.getChoices().add("Black");
}
if (types.getRed() > 0) {
choice.getChoices().add("Red");
}
if (types.getBlue() > 0) {
choice.getChoices().add("Blue");
}
if (types.getGreen() > 0) {
choice.getChoices().add("Green");
}
if (types.getWhite() > 0) {
choice.getChoices().add("White");
}
if (types.getAny() > 0) {
choice.getChoices().add("Black");
choice.getChoices().add("Red");
choice.getChoices().add("Blue");
choice.getChoices().add("Green");
choice.getChoices().add("White");
}
if (choice.getChoices().size() > 0) {
Player player = game.getPlayer(source.getControllerId());
if (choice.getChoices().size() == 1) {
choice.setChoice(choice.getChoices().iterator().next());
} else {
player.choose(outcome, choice, game);
}
if (choice.getChoice().equals("Black")) {
player.getManaPool().addMana(Mana.BlackMana, game, source);
} else if (choice.getChoice().equals("Blue")) {
player.getManaPool().addMana(Mana.BlueMana, game, source);
} else if (choice.getChoice().equals("Red")) {
player.getManaPool().addMana(Mana.RedMana, game, source);
} else if (choice.getChoice().equals("Green")) {
player.getManaPool().addMana(Mana.GreenMana, game, source);
} else if (choice.getChoice().equals("White")) {
player.getManaPool().addMana(Mana.WhiteMana, game, source);
}
}
return true;
}