Search in sources :

Example 1 with DrawCardAllEffect

use of mage.abilities.effects.common.DrawCardAllEffect in project mage by magefree.

the class StrategySchmategyffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    int numTimesToDo = 1;
    if (controller != null) {
        // 6 - Repeat this process two more times
        while (numTimesToDo > 0) {
            // ai must try to choose min
            int amount = controller.rollDice(Outcome.Detriment, source, game, 6);
            numTimesToDo--;
            if (amount == 2) {
                List<Permanent> artifactPermanents = game.getBattlefield().getActivePermanents(new FilterArtifactPermanent(), controller.getId(), game);
                for (Permanent permanent : artifactPermanents) {
                    permanent.destroy(source, game, false);
                }
            } else if (amount == 3) {
                List<Permanent> landPermanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LANDS, controller.getId(), game);
                for (Permanent permanent : landPermanents) {
                    permanent.destroy(source, game, false);
                }
            } else if (amount == 4) {
                new DamageEverythingEffect(3, new FilterCreaturePermanent()).apply(game, source);
            } else if (amount == 5) {
                new DiscardHandAllEffect().apply(game, source);
                new DrawCardAllEffect(7).apply(game, source);
            } else if (amount == 6) {
                numTimesToDo += 2;
            }
        }
    }
    return false;
}
Also used : Player(mage.players.Player) FilterArtifactPermanent(mage.filter.common.FilterArtifactPermanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) DrawCardAllEffect(mage.abilities.effects.common.DrawCardAllEffect) Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) FilterArtifactPermanent(mage.filter.common.FilterArtifactPermanent) DamageEverythingEffect(mage.abilities.effects.common.DamageEverythingEffect) List(java.util.List) DiscardHandAllEffect(mage.abilities.effects.common.discard.DiscardHandAllEffect)

Aggregations

List (java.util.List)1 DamageEverythingEffect (mage.abilities.effects.common.DamageEverythingEffect)1 DrawCardAllEffect (mage.abilities.effects.common.DrawCardAllEffect)1 DiscardHandAllEffect (mage.abilities.effects.common.discard.DiscardHandAllEffect)1 FilterArtifactPermanent (mage.filter.common.FilterArtifactPermanent)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1 Player (mage.players.Player)1