[WOE] Implement Spider Food (#11010)

* [WOE] Implement Spider Food

* fix "up to on"
This commit is contained in:
Susucre 2023-08-25 15:34:58 +02:00 committed by GitHub
parent e0caa1c0a9
commit 57dd90777a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,53 @@
package mage.cards.s;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.permanent.token.FoodToken;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author Susucr
*/
public final class SpiderFood extends CardImpl {
private static final FilterPermanent filter
= new FilterPermanent("artifact, enchantment, or creature with flying");
static {
filter.add(Predicates.or(
CardType.ARTIFACT.getPredicate(),
CardType.ENCHANTMENT.getPredicate(),
Predicates.and(
CardType.CREATURE.getPredicate(),
new AbilityPredicate(FlyingAbility.class)
)
));
}
public SpiderFood(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
// Destroy up to one target artifact, enchantment, or creature with flying. Create a Food token.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(0, 1, filter));
this.getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken()));
}
private SpiderFood(final SpiderFood card) {
super(card);
}
@Override
public SpiderFood copy() {
return new SpiderFood(this);
}
}

View file

@ -212,6 +212,7 @@ public final class WildsOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Spell Stutter", 69, Rarity.COMMON, mage.cards.s.SpellStutter.class));
cards.add(new SetCardInfo("Spellbook Vendor", 31, Rarity.RARE, mage.cards.s.SpellbookVendor.class));
cards.add(new SetCardInfo("Spellscorn Coven", 237, Rarity.UNCOMMON, mage.cards.s.SpellscornCoven.class));
cards.add(new SetCardInfo("Spider Food", 186, Rarity.COMMON, mage.cards.s.SpiderFood.class));
cards.add(new SetCardInfo("Spiteful Hexmage", 108, Rarity.RARE, mage.cards.s.SpitefulHexmage.class));
cards.add(new SetCardInfo("Splashy Spellcaster", 70, Rarity.UNCOMMON, mage.cards.s.SplashySpellcaster.class));
cards.add(new SetCardInfo("Stingblade Assassin", 109, Rarity.COMMON, mage.cards.s.StingbladeAssassin.class));