Implemented Thunder Drake

This commit is contained in:
Evan Kranzler 2019-04-18 20:03:39 -04:00
parent d2a74e9062
commit 3bd353bb4d
2 changed files with 85 additions and 0 deletions

View file

@ -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}";
}
}

View file

@ -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));