use of mage.abilities.effects.common.turn.AddExtraTurnControllerEffect in project mage by magefree.
the class PleaForPowerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
// Outcome.Detriment - AI will draw cards all the time (Knowledge choice)
// TODO: add AI hint logic in the choice method, see Tyrant's Choice as example
TwoChoiceVote vote = new TwoChoiceVote("Time (extra turn)", "Knowledge (draw 3 cards)", Outcome.Detriment);
vote.doVotes(source, game);
int timeCount = vote.getVoteCount(true);
int knowledgeCount = vote.getVoteCount(false);
if (timeCount > knowledgeCount) {
return new AddExtraTurnControllerEffect().apply(game, source);
} else {
return controller.drawCards(3, source, game) > 0;
}
}
use of mage.abilities.effects.common.turn.AddExtraTurnControllerEffect in project mage by magefree.
the class UginsNexusExileEffect method replaceEvent.
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
if (permanent != null) {
permanent.moveToExile(null, "", source, game);
new AddExtraTurnControllerEffect().apply(game, source);
return true;
}
return false;
}
Aggregations