From 1e43371470d04496f644715e6e08933b1a633527 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 4 Apr 2020 00:34:19 -0400 Subject: [PATCH] Implemented Wingfold Pteron --- .../src/mage/cards/w/WingfoldPteron.java | 80 +++++++++++++++++++ .../src/mage/sets/IkoriaLairOfBehemoths.java | 1 + .../main/java/mage/counters/CounterType.java | 11 ++- 3 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/w/WingfoldPteron.java diff --git a/Mage.Sets/src/mage/cards/w/WingfoldPteron.java b/Mage.Sets/src/mage/cards/w/WingfoldPteron.java new file mode 100644 index 00000000000..7579646eca2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WingfoldPteron.java @@ -0,0 +1,80 @@ +package mage.cards.w; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.counters.Counter; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class WingfoldPteron extends CardImpl { + + public WingfoldPteron(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}"); + + this.subtype.add(SubType.DINOSAUR); + this.power = new MageInt(3); + this.toughness = new MageInt(6); + + // Wingfold Pteron enters the battlefield with your choice of a flying counter or a hexproof counter on it. + this.addAbility(new EntersBattlefieldAbility(new WingfoldPteronEffect())); + } + + private WingfoldPteron(final WingfoldPteron card) { + super(card); + } + + @Override + public WingfoldPteron copy() { + return new WingfoldPteron(this); + } +} + +class WingfoldPteronEffect extends OneShotEffect { + + WingfoldPteronEffect() { + super(Outcome.Benefit); + staticText = "with your choice of a flying counter or a hexproof counter on it"; + } + + private WingfoldPteronEffect(final WingfoldPteronEffect effect) { + super(effect); + } + + @Override + public WingfoldPteronEffect copy() { + return new WingfoldPteronEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); + if (player == null || permanent == null) { + return false; + } + Counter counter; + if (player.chooseUse( + Outcome.Neutral, "Choose flying or hexproof", null, + "Flying", "Hexproof", source, game + )) { + counter = CounterType.FLYING.createInstance(); + } else { + counter = CounterType.HEXPROOF.createInstance(); + } + return permanent.addCounters(counter, source, game); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java index 82c0451dd70..41e8e523b74 100644 --- a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java +++ b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java @@ -62,6 +62,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet { cards.add(new SetCardInfo("Trumpeting Gnarr", 213, Rarity.UNCOMMON, mage.cards.t.TrumpetingGnarr.class)); cards.add(new SetCardInfo("Void Beckoner", 104, Rarity.UNCOMMON, mage.cards.v.VoidBeckoner.class)); cards.add(new SetCardInfo("Voracious Greatshark", 70, Rarity.RARE, mage.cards.v.VoraciousGreatshark.class)); + cards.add(new SetCardInfo("Wingfold Pteron", 71, Rarity.COMMON, mage.cards.w.WingfoldPteron.class)); cards.add(new SetCardInfo("Zagoth Crystal", 242, Rarity.UNCOMMON, mage.cards.z.ZagothCrystal.class)); cards.add(new SetCardInfo("Zagoth Mamba", 106, Rarity.UNCOMMON, mage.cards.z.ZagothMamba.class)); } diff --git a/Mage/src/main/java/mage/counters/CounterType.java b/Mage/src/main/java/mage/counters/CounterType.java index 77cc434b4fc..65511a95416 100644 --- a/Mage/src/main/java/mage/counters/CounterType.java +++ b/Mage/src/main/java/mage/counters/CounterType.java @@ -1,9 +1,6 @@ package mage.counters; -import mage.abilities.keyword.DeathtouchAbility; -import mage.abilities.keyword.LifelinkAbility; -import mage.abilities.keyword.MenaceAbility; -import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.*; /** * Enum for counters, names and instances. @@ -53,6 +50,7 @@ public enum CounterType { FEATHER("feather"), FILIBUSTER("filibuster"), FLOOD("flood"), + FLYING("flying"), FUNK("funk"), FURY("fury"), FUNGUS("fungus"), @@ -64,6 +62,7 @@ public enum CounterType { GROWTH("growth"), HATCHLING("hatchling"), HEALING("healing"), + HEXPROOF("hexproof"), HIT("hit"), HOOFPRINT("hoofprint"), HOUR("hour"), @@ -203,6 +202,10 @@ public enum CounterType { return new BoostCounter(-2, -2, amount); case DEATHTOUCH: return new AbilityCounter(DeathtouchAbility.getInstance()); + case FLYING: + return new AbilityCounter(FlyingAbility.getInstance()); + case HEXPROOF: + return new AbilityCounter(HexproofAbility.getInstance()); case LIFELINK: return new AbilityCounter(LifelinkAbility.getInstance()); case MENACE: