From 3bd353bb4db51084b61eb7bb63e12e35f0451beb Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 18 Apr 2019 20:03:39 -0400 Subject: [PATCH] Implemented Thunder Drake --- Mage.Sets/src/mage/cards/t/ThunderDrake.java | 84 ++++++++++++++++++++ Mage.Sets/src/mage/sets/WarOfTheSpark.java | 1 + 2 files changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/ThunderDrake.java diff --git a/Mage.Sets/src/mage/cards/t/ThunderDrake.java b/Mage.Sets/src/mage/cards/t/ThunderDrake.java new file mode 100644 index 00000000000..6ee8ae338e5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/ThunderDrake.java @@ -0,0 +1,84 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.watchers.common.CastSpellLastTurnWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ThunderDrake extends CardImpl { + + public ThunderDrake(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.ELEMENTAL); + this.subtype.add(SubType.DRAKE); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you cast you cast your second spell each turn, put a +1/+1 counter on Thunder Drake. + this.addAbility(new ThunderDrakeTriggeredAbility(), new CastSpellLastTurnWatcher()); + } + + private ThunderDrake(final ThunderDrake card) { + super(card); + } + + @Override + public ThunderDrake copy() { + return new ThunderDrake(this); + } +} + +class ThunderDrakeTriggeredAbility extends TriggeredAbilityImpl { + + ThunderDrakeTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance())); + } + + private ThunderDrakeTriggeredAbility(final ThunderDrakeTriggeredAbility ability) { + super(ability); + } + + @Override + public ThunderDrakeTriggeredAbility copy() { + return new ThunderDrakeTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(controllerId)) { + CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class); + if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 2) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever you cast your second spell each turn, put a +1/+1 counter on {this}"; + } +} diff --git a/Mage.Sets/src/mage/sets/WarOfTheSpark.java b/Mage.Sets/src/mage/sets/WarOfTheSpark.java index 54159ef59aa..a99041299b2 100644 --- a/Mage.Sets/src/mage/sets/WarOfTheSpark.java +++ b/Mage.Sets/src/mage/sets/WarOfTheSpark.java @@ -259,6 +259,7 @@ public final class WarOfTheSpark extends ExpansionSet { cards.add(new SetCardInfo("Tezzeret, Master of the Bridge", 275, Rarity.MYTHIC, mage.cards.t.TezzeretMasterOfTheBridge.class)); cards.add(new SetCardInfo("The Elderspell", 89, Rarity.RARE, mage.cards.t.TheElderspell.class)); cards.add(new SetCardInfo("The Wanderer", 37, Rarity.UNCOMMON, mage.cards.t.TheWanderer.class)); + cards.add(new SetCardInfo("Thunder Drake", 73, Rarity.COMMON, mage.cards.t.ThunderDrake.class)); cards.add(new SetCardInfo("Thundering Ceratok", 179, Rarity.COMMON, mage.cards.t.ThunderingCeratok.class)); cards.add(new SetCardInfo("Tibalt's Rager", 147, Rarity.UNCOMMON, mage.cards.t.TibaltsRager.class)); cards.add(new SetCardInfo("Tibalt, Rakish Instigator", 146, Rarity.UNCOMMON, mage.cards.t.TibaltRakishInstigator.class));