Implemented Flame Sweep

This commit is contained in:
Evan Kranzler 2019-06-17 18:30:31 -04:00
parent c4fc04f89c
commit 4258d6f1c1
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,58 @@
package mage.cards.f;
import mage.abilities.effects.common.DamageAllEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.ObjectPlayer;
import mage.filter.predicate.ObjectPlayerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class FlameSweep extends CardImpl {
private static final FilterPermanent filter
= new FilterCreaturePermanent("creature except for creatures you control with flying");
static {
filter.add(FlameSweepPredicate.instance);
}
public FlameSweep(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
// Flame sweep deals 2 damage to each creature except for creatures you control with flying.
this.getSpellAbility().addEffect(new DamageAllEffect(2, filter));
}
private FlameSweep(final FlameSweep card) {
super(card);
}
@Override
public FlameSweep copy() {
return new FlameSweep(this);
}
}
enum FlameSweepPredicate implements ObjectPlayerPredicate<ObjectPlayer<Permanent>> {
instance;
@Override
public boolean apply(ObjectPlayer<Permanent> input, Game game) {
Permanent object = input.getObject();
UUID playerId = input.getPlayerId();
return !(object.isControlledBy(playerId)
&& object.getAbilities(game).stream().anyMatch(
ability -> ability.getClass().equals(FlyingAbility.class)
));
}
}

View file

@ -40,6 +40,7 @@ public final class CoreSet2020 extends ExpansionSet {
cards.add(new SetCardInfo("Dragon Mage", 135, Rarity.UNCOMMON, mage.cards.d.DragonMage.class));
cards.add(new SetCardInfo("Dread Presence", 96, Rarity.RARE, mage.cards.d.DreadPresence.class));
cards.add(new SetCardInfo("Empyrean Eagle", 208, Rarity.UNCOMMON, mage.cards.e.EmpyreanEagle.class));
cards.add(new SetCardInfo("Flame Sweep", 139, Rarity.UNCOMMON, mage.cards.f.FlameSweep.class));
cards.add(new SetCardInfo("Infuriate", 145, Rarity.COMMON, mage.cards.i.Infuriate.class));
cards.add(new SetCardInfo("Kykar, Wind's Fury", 212, Rarity.MYTHIC, mage.cards.k.KykarWindsFury.class));
cards.add(new SetCardInfo("Leyline of Sanctity", 26, Rarity.RARE, mage.cards.l.LeylineOfSanctity.class));