Search in sources :

Example 1 with BoostOpponentsEffect

use of mage.abilities.effects.common.continuous.BoostOpponentsEffect in project mage by magefree.

the class BiteOfTheBlackRoseEffect 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 discard a card all the time (Psychosis choice)
    // TODO: add AI hint logic in the choice method, see Tyrant's Choice as example
    TwoChoiceVote vote = new TwoChoiceVote("Sickness (-2/-2)", "Psychosis (discard cards)", Outcome.Detriment);
    vote.doVotes(source, game);
    int sicknessCount = vote.getVoteCount(true);
    int psychosisCount = vote.getVoteCount(false);
    if (sicknessCount > psychosisCount) {
        // sickness
        game.addEffect(new BoostOpponentsEffect(-2, -2, Duration.EndOfTurn), source);
    } else {
        // psychosis or tied
        new DiscardEachPlayerEffect(StaticValue.get(2), false, TargetController.OPPONENT).apply(game, source);
    }
    return true;
}
Also used : Player(mage.players.Player) BoostOpponentsEffect(mage.abilities.effects.common.continuous.BoostOpponentsEffect) DiscardEachPlayerEffect(mage.abilities.effects.common.discard.DiscardEachPlayerEffect) TwoChoiceVote(mage.choices.TwoChoiceVote)

Aggregations

BoostOpponentsEffect (mage.abilities.effects.common.continuous.BoostOpponentsEffect)1 DiscardEachPlayerEffect (mage.abilities.effects.common.discard.DiscardEachPlayerEffect)1 TwoChoiceVote (mage.choices.TwoChoiceVote)1 Player (mage.players.Player)1