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;
}
Aggregations