[KHM] Implemented Vega, the Watcher (#7366)

This commit is contained in:
Daniel Bomar 2021-01-10 19:36:32 -06:00 committed by GitHub
parent 0943ae1bb7
commit e7a557f287
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 2 deletions

View file

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

View file

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

View file

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