use of mage.choices.ChoiceLandType in project mage by magefree.
the class VisionCharmEffect method init.
@Override
public void init(Ability source, Game game) {
super.init(source, game);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Choice choice = new ChoiceLandType();
if (!controller.choose(outcome, choice, game)) {
discard();
return;
}
targetLandType = choice.getChoice();
choice = new ChoiceBasicLandType();
if (!controller.choose(outcome, choice, game)) {
discard();
return;
}
targetBasicLandType = SubType.byDescription(choice.getChoice());
if (targetLandType == null || targetBasicLandType == null) {
this.discard();
return;
}
} else {
this.discard();
return;
}
FilterPermanent filter = new FilterLandPermanent();
filter.add(SubType.byDescription(targetLandType).getPredicate());
if (this.affectedObjectsSet) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
affectedObjectList.add(new MageObjectReference(permanent, game));
}
}
}
Aggregations