From e7a557f287206d0601934d33197599e133848779 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sun, 10 Jan 2021 19:36:32 -0600 Subject: [PATCH] [KHM] Implemented Vega, the Watcher (#7366) --- .../src/mage/cards/v/VegaTheWatcher.java | 70 +++++++++++++++++++ Mage.Sets/src/mage/sets/Kaldheim.java | 1 + .../SpellCastControllerTriggeredAbility.java | 4 +- 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/v/VegaTheWatcher.java diff --git a/Mage.Sets/src/mage/cards/v/VegaTheWatcher.java b/Mage.Sets/src/mage/cards/v/VegaTheWatcher.java new file mode 100644 index 00000000000..3ea2d993e05 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VegaTheWatcher.java @@ -0,0 +1,70 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.FlyingAbility; +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; + +/** + * + * @author weirddan455 + */ +public final class VegaTheWatcher extends CardImpl { + + public VegaTheWatcher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.BIRD); + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you cast a spell from anywhere other than your hand, draw a card. + this.addAbility(new VegaTheWatcherTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); + } + + private VegaTheWatcher(final VegaTheWatcher card) { + super(card); + } + + @Override + public VegaTheWatcher copy() { + return new VegaTheWatcher(this); + } +} + +class VegaTheWatcherTriggeredAbility extends SpellCastControllerTriggeredAbility { + + public VegaTheWatcherTriggeredAbility(Effect effect, boolean optional) { + super(effect, optional); + this.rule = "Whenever you cast a spell from anywhere other than your hand, draw a card."; + } + + public VegaTheWatcherTriggeredAbility(final VegaTheWatcherTriggeredAbility ability) { + super(ability); + } + + @Override + public VegaTheWatcherTriggeredAbility copy() { + return new VegaTheWatcherTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getZone() != Zone.HAND && super.checkTrigger(event, game); + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index f0145504ccd..a44b52d43b3 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -130,6 +130,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Undersea Invader", 78, Rarity.COMMON, mage.cards.u.UnderseaInvader.class)); cards.add(new SetCardInfo("Valkyrie Harbinger", 374, Rarity.RARE, mage.cards.v.ValkyrieHarbinger.class)); cards.add(new SetCardInfo("Varragoth, Bloodsky Sire", 115, Rarity.RARE, mage.cards.v.VarragothBloodskySire.class)); + cards.add(new SetCardInfo("Vega, the Watcher", 233, Rarity.UNCOMMON, mage.cards.v.VegaTheWatcher.class)); cards.add(new SetCardInfo("Village Rites", 117, Rarity.COMMON, mage.cards.v.VillageRites.class)); cards.add(new SetCardInfo("Volatile Fjord", 273, Rarity.COMMON, mage.cards.v.VolatileFjord.class)); cards.add(new SetCardInfo("Warchanter Skald", 381, Rarity.UNCOMMON, mage.cards.w.WarchanterSkald.class)); diff --git a/Mage/src/main/java/mage/abilities/common/SpellCastControllerTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/SpellCastControllerTriggeredAbility.java index c4b34b53d56..4816d97da35 100644 --- a/Mage/src/main/java/mage/abilities/common/SpellCastControllerTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/SpellCastControllerTriggeredAbility.java @@ -4,6 +4,7 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.constants.Zone; import mage.filter.FilterSpell; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -14,7 +15,6 @@ import mage.target.targetpointer.FixedTarget; */ public class SpellCastControllerTriggeredAbility extends TriggeredAbilityImpl { - private static final FilterSpell spellCard = new FilterSpell("a spell"); protected FilterSpell filter; protected String rule; @@ -25,7 +25,7 @@ public class SpellCastControllerTriggeredAbility extends TriggeredAbilityImpl { protected boolean rememberSource = false; public SpellCastControllerTriggeredAbility(Effect effect, boolean optional) { - this(Zone.BATTLEFIELD, effect, spellCard, optional, false); + this(Zone.BATTLEFIELD, effect, StaticFilters.FILTER_SPELL_A, optional, false); } public SpellCastControllerTriggeredAbility(Effect effect, FilterSpell filter, boolean optional) {