From 0e798da20f799fa02ad4e752c6be1fb94e785980 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 30 Dec 2019 22:09:50 -0500 Subject: [PATCH] Implemented Kunoros, Hound of Athreos --- .../mage/cards/k/KunorosHoundOfAthreos.java | 118 ++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + 2 files changed, 119 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KunorosHoundOfAthreos.java diff --git a/Mage.Sets/src/mage/cards/k/KunorosHoundOfAthreos.java b/Mage.Sets/src/mage/cards/k/KunorosHoundOfAthreos.java new file mode 100644 index 0000000000..fe8e6d8b15 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KunorosHoundOfAthreos.java @@ -0,0 +1,118 @@ +package mage.cards.k; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.keyword.MenaceAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KunorosHoundOfAthreos extends CardImpl { + + public KunorosHoundOfAthreos(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HOUND); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Menace + this.addAbility(new MenaceAbility()); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // Creature cards in graveyards can't enter the battlefield. + this.addAbility(new SimpleStaticAbility(new KunorosHoundOfAthreosEnterEffect())); + + // Players can't cast spells from graveyards. + this.addAbility(new SimpleStaticAbility(new KunorosHoundOfAthreosCastEffect())); + } + + private KunorosHoundOfAthreos(final KunorosHoundOfAthreos card) { + super(card); + } + + @Override + public KunorosHoundOfAthreos copy() { + return new KunorosHoundOfAthreos(this); + } +} + +class KunorosHoundOfAthreosEnterEffect extends ContinuousRuleModifyingEffectImpl { + + KunorosHoundOfAthreosEnterEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "creature cards in graveyards can't enter the battlefield"; + } + + private KunorosHoundOfAthreosEnterEffect(final KunorosHoundOfAthreosEnterEffect effect) { + super(effect); + } + + @Override + public KunorosHoundOfAthreosEnterEffect copy() { + return new KunorosHoundOfAthreosEnterEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ZONE_CHANGE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getToZone() != Zone.BATTLEFIELD + || zEvent.getFromZone() != Zone.GRAVEYARD) { + return false; + } + Card card = game.getCard(zEvent.getTargetId()); + return card != null && card.isCreature(); + } +} + +class KunorosHoundOfAthreosCastEffect extends ContinuousRuleModifyingEffectImpl { + + KunorosHoundOfAthreosCastEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "players can't cast spells from graveyards"; + } + + private KunorosHoundOfAthreosCastEffect(final KunorosHoundOfAthreosCastEffect effect) { + super(effect); + } + + @Override + public KunorosHoundOfAthreosCastEffect copy() { + return new KunorosHoundOfAthreosCastEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.CAST_SPELL; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return game.getCard(event.getSourceId()) != null + && game.getState().getZone(event.getSourceId()) == Zone.GRAVEYARD; + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index b8012cc2d2..7dbd7a87f7 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -50,6 +50,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Island", 251, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Klothys's Design", 176, Rarity.UNCOMMON, mage.cards.k.KlothyssDesign.class)); cards.add(new SetCardInfo("Klothys, God of Destiny", 220, Rarity.MYTHIC, mage.cards.k.KlothysGodOfDestiny.class)); + cards.add(new SetCardInfo("Kunoros, Hound of Athreos", 341, Rarity.RARE, mage.cards.k.KunorosHoundOfAthreos.class)); cards.add(new SetCardInfo("Leonin of the Lost Pride", 28, Rarity.COMMON, mage.cards.l.LeoninOfTheLostPride.class)); cards.add(new SetCardInfo("Memory Drain", 54, Rarity.COMMON, mage.cards.m.MemoryDrain.class)); cards.add(new SetCardInfo("Mire's Grasp", 106, Rarity.COMMON, mage.cards.m.MiresGrasp.class));