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