From 133b540a12065dd68089259131e203bc7bf2ff88 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 27 Jun 2019 08:02:01 -0400 Subject: [PATCH] Implemented Gargos, Vicious Watcher --- .../mage/cards/g/GargosViciousWatcher.java | 109 ++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2020.java | 1 + 2 files changed, 110 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GargosViciousWatcher.java diff --git a/Mage.Sets/src/mage/cards/g/GargosViciousWatcher.java b/Mage.Sets/src/mage/cards/g/GargosViciousWatcher.java new file mode 100644 index 0000000000..4f9f0ce1a5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GargosViciousWatcher.java @@ -0,0 +1,109 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.MageObject; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.FightTargetSourceEffect; +import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GargosViciousWatcher extends CardImpl { + + private static final FilterCard filter = new FilterCard("Hydra spells"); + + static { + filter.add(new SubtypePredicate(SubType.HYDRA)); + } + + public GargosViciousWatcher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HYDRA); + this.power = new MageInt(8); + this.toughness = new MageInt(7); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Hydra spells you cast cost {4} less to cast. + this.addAbility(new SimpleStaticAbility(new SpellsCostReductionControllerEffect(filter, 1))); + + // Whenever a creature you control becomes the target of a spell, Gargos, Vicious Watcher fights up to one target creature you don't control. + this.addAbility(new GargosViciousWatcherTriggeredAbility()); + } + + private GargosViciousWatcher(final GargosViciousWatcher card) { + super(card); + } + + @Override + public GargosViciousWatcher copy() { + return new GargosViciousWatcher(this); + } +} + +class GargosViciousWatcherTriggeredAbility extends TriggeredAbilityImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control"); + + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + } + + GargosViciousWatcherTriggeredAbility() { + super(Zone.BATTLEFIELD, new FightTargetSourceEffect()); + this.addTarget(new TargetPermanent(0, 1, filter, false)); + } + + private GargosViciousWatcherTriggeredAbility(final GargosViciousWatcherTriggeredAbility ability) { + super(ability); + } + + @Override + public GargosViciousWatcherTriggeredAbility copy() { + return new GargosViciousWatcherTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TARGETED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent == null + || !permanent.isControlledBy(this.controllerId) + || !permanent.isCreature()) { + return false; + } + MageObject object = game.getObject(event.getSourceId()); + return object instanceof Spell; + } + + @Override + public String getRule() { + return "Whenever a creature you control becomes the target of a spell, " + + "{this} fights up to one target creature you don't control."; + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2020.java b/Mage.Sets/src/mage/sets/CoreSet2020.java index cc6723595c..0c864a74f6 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2020.java +++ b/Mage.Sets/src/mage/sets/CoreSet2020.java @@ -144,6 +144,7 @@ public final class CoreSet2020 extends ExpansionSet { cards.add(new SetCardInfo("Frilled Sea Serpent", 61, Rarity.COMMON, mage.cards.f.FrilledSeaSerpent.class)); cards.add(new SetCardInfo("Frost Lynx", 62, Rarity.COMMON, mage.cards.f.FrostLynx.class)); cards.add(new SetCardInfo("Fry", 140, Rarity.UNCOMMON, mage.cards.f.Fry.class)); + cards.add(new SetCardInfo("Gargos, Vicious Watcher", 172, Rarity.RARE, mage.cards.g.GargosViciousWatcher.class)); cards.add(new SetCardInfo("Gauntlets of Light", 17, Rarity.UNCOMMON, mage.cards.g.GauntletsOfLight.class)); cards.add(new SetCardInfo("Gift of Paradise", 173, Rarity.COMMON, mage.cards.g.GiftOfParadise.class)); cards.add(new SetCardInfo("Glaring Aegis", 18, Rarity.COMMON, mage.cards.g.GlaringAegis.class));