Implemented Gargos, Vicious Watcher

This commit is contained in:
Evan Kranzler 2019-06-27 08:02:01 -04:00
parent a337cf726f
commit 133b540a12
2 changed files with 110 additions and 0 deletions

View file

@ -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.";
}
}

View file

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