Search in sources :

Example 1 with AddExtraTurnControllerEffect

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;
    }
}
Also used : Player(mage.players.Player) AddExtraTurnControllerEffect(mage.abilities.effects.common.turn.AddExtraTurnControllerEffect) TwoChoiceVote(mage.choices.TwoChoiceVote)

Example 2 with AddExtraTurnControllerEffect

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;
}
Also used : ZoneChangeEvent(mage.game.events.ZoneChangeEvent) Permanent(mage.game.permanent.Permanent) AddExtraTurnControllerEffect(mage.abilities.effects.common.turn.AddExtraTurnControllerEffect)

Aggregations

AddExtraTurnControllerEffect (mage.abilities.effects.common.turn.AddExtraTurnControllerEffect)2 TwoChoiceVote (mage.choices.TwoChoiceVote)1 ZoneChangeEvent (mage.game.events.ZoneChangeEvent)1 Permanent (mage.game.permanent.Permanent)1 Player (mage.players.Player)1