use of mage.choices.ChoiceBasicLandType in project mage by magefree.
the class GiantSlugEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller == null || sourcePermanent == null) {
return false;
}
ChoiceImpl choices = new ChoiceBasicLandType();
if (!controller.choose(outcome, choices, game)) {
return false;
}
game.informPlayers(sourcePermanent.getName() + ": Chosen basic land type is " + choices.getChoice());
switch(choices.getChoice()) {
case "Plains":
game.addEffect(new GainAbilitySourceEffect(new PlainswalkAbility(), Duration.EndOfTurn, false), source);
return true;
case "Island":
game.addEffect(new GainAbilitySourceEffect(new IslandwalkAbility(), Duration.EndOfTurn, false), source);
return true;
case "Swamp":
game.addEffect(new GainAbilitySourceEffect(new SwampwalkAbility(), Duration.EndOfTurn, false), source);
return true;
case "Mountain":
game.addEffect(new GainAbilitySourceEffect(new MountainwalkAbility(), Duration.EndOfTurn, false), source);
return true;
case "Forest":
game.addEffect(new GainAbilitySourceEffect(new ForestwalkAbility(), Duration.EndOfTurn, false), source);
return true;
default:
return false;
}
}
Aggregations