Implemented Desecrated Tomb

This commit is contained in:
Evan Kranzler 2018-06-13 08:51:27 -04:00
parent 88dd1a8a33
commit 6bb8b68952
2 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1,89 @@
package mage.cards.d;
import java.util.Set;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeGroupEvent;
import mage.game.permanent.token.BatToken;
/**
*
* @author TheElk801
*/
public final class DesecratedTomb extends CardImpl {
public DesecratedTomb(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Whenever one or more creature cards leave your graveyard, create a 1/1 black Bat creature token with flying.
this.addAbility(new DesecratedTombTriggeredAbility());
}
public DesecratedTomb(final DesecratedTomb card) {
super(card);
}
@Override
public DesecratedTomb copy() {
return new DesecratedTomb(this);
}
}
class DesecratedTombTriggeredAbility extends TriggeredAbilityImpl {
public DesecratedTombTriggeredAbility() {
super(Zone.BATTLEFIELD, new CreateTokenEffect(new BatToken()), false);
}
public DesecratedTombTriggeredAbility(final DesecratedTombTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE_GROUP;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
if (zEvent != null && Zone.GRAVEYARD == zEvent.getFromZone()
&& Zone.GRAVEYARD != zEvent.getToZone()
&& zEvent.getCards() != null) {
for (Card card : zEvent.getCards()) {
if (card != null) {
UUID cardOwnerId = card.getOwnerId();
Set<CardType> cardType = card.getCardType();
if (cardOwnerId != null
&& card.getOwnerId().equals(getControllerId())
&& cardType != null
&& card.isCreature()) {
return true;
}
}
}
}
return false;
}
@Override
public DesecratedTombTriggeredAbility copy() {
return new DesecratedTombTriggeredAbility(this);
}
@Override
public String getRule() {
return "Whenever one or more creature cards leave your graveyard, create a 1/1 black Bat creature token with flying";
}
}

View file

@ -40,6 +40,7 @@ public final class CoreSet2019 extends ExpansionSet {
cards.add(new SetCardInfo("Colossal Dreadmaw", 172, Rarity.COMMON, mage.cards.c.ColossalDreadmaw.class)); cards.add(new SetCardInfo("Colossal Dreadmaw", 172, Rarity.COMMON, mage.cards.c.ColossalDreadmaw.class));
cards.add(new SetCardInfo("Daybreak Chaplain", 10, Rarity.COMMON, mage.cards.d.DaybreakChaplain.class)); cards.add(new SetCardInfo("Daybreak Chaplain", 10, Rarity.COMMON, mage.cards.d.DaybreakChaplain.class));
cards.add(new SetCardInfo("Demon of Catastrophes", 91, Rarity.RARE, mage.cards.d.DemonOfCatastrophes.class)); cards.add(new SetCardInfo("Demon of Catastrophes", 91, Rarity.RARE, mage.cards.d.DemonOfCatastrophes.class));
cards.add(new SetCardInfo("Desecrated Tomb", 230, Rarity.RARE, mage.cards.d.DesecratedTomb.class));
cards.add(new SetCardInfo("Diregraf Ghoul", 92, Rarity.UNCOMMON, mage.cards.d.DiregrafGhoul.class)); cards.add(new SetCardInfo("Diregraf Ghoul", 92, Rarity.UNCOMMON, mage.cards.d.DiregrafGhoul.class));
cards.add(new SetCardInfo("Disperse", 50, Rarity.COMMON, mage.cards.d.Disperse.class)); cards.add(new SetCardInfo("Disperse", 50, Rarity.COMMON, mage.cards.d.Disperse.class));
cards.add(new SetCardInfo("Divination", 51, Rarity.COMMON, mage.cards.d.Divination.class)); cards.add(new SetCardInfo("Divination", 51, Rarity.COMMON, mage.cards.d.Divination.class));