Implemented Towering-Wave Mystic

This commit is contained in:
Evan Kranzler 2020-01-01 02:45:21 -05:00
parent 8037a393e4
commit 8b42b9570a
2 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,82 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ToweringWaveMystic extends CardImpl {
public ToweringWaveMystic(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.MERFOLK);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Whenever Towering-Wave Mystic deals damage, target player puts that many cards from the top of their library into their graveyard.
this.addAbility(new ToweringWaveMysticTriggeredAbility());
}
private ToweringWaveMystic(final ToweringWaveMystic card) {
super(card);
}
@Override
public ToweringWaveMystic copy() {
return new ToweringWaveMystic(this);
}
}
class ToweringWaveMysticTriggeredAbility extends TriggeredAbilityImpl {
ToweringWaveMysticTriggeredAbility() {
super(Zone.BATTLEFIELD, null, false);
this.addTarget(new TargetPlayer());
}
private ToweringWaveMysticTriggeredAbility(final ToweringWaveMysticTriggeredAbility ability) {
super(ability);
}
@Override
public ToweringWaveMysticTriggeredAbility copy() {
return new ToweringWaveMysticTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE
|| event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!event.getSourceId().equals(this.getSourceId())) {
return false;
}
this.getEffects().clear();
this.addEffect(new PutTopCardOfLibraryIntoGraveTargetEffect(event.getAmount()));
return true;
}
@Override
public String getRule() {
return "Whenever {this} deals damage, target player puts that many cards " +
"from the top of their library into their graveyard.";
}
}

View file

@ -84,6 +84,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
cards.add(new SetCardInfo("The Akroan War", 124, Rarity.RARE, mage.cards.t.TheAkroanWar.class));
cards.add(new SetCardInfo("The Binding of the Titans", 166, Rarity.UNCOMMON, mage.cards.t.TheBindingOfTheTitans.class));
cards.add(new SetCardInfo("Thirst for Meaning", 74, Rarity.COMMON, mage.cards.t.ThirstForMeaning.class));
cards.add(new SetCardInfo("Towering-Wave Mystic", 77, Rarity.COMMON, mage.cards.t.ToweringWaveMystic.class));
cards.add(new SetCardInfo("Treeshaker Chimera", 297, Rarity.RARE, mage.cards.t.TreeshakerChimera.class));
cards.add(new SetCardInfo("Tymaret Calls the Dead", 118, Rarity.RARE, mage.cards.t.TymaretCallsTheDead.class));
cards.add(new SetCardInfo("Underworld Breach", 161, Rarity.RARE, mage.cards.u.UnderworldBreach.class));