From abd11817d6ec035ef8d4adf3a7e671213ecf8703 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 7 Feb 2022 21:10:53 -0500 Subject: [PATCH] [NEO] Implemented Jin-Gitaxias, Progress Tyrant --- .../cards/j/JinGitaxiasProgressTyrant.java | 92 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 93 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/j/JinGitaxiasProgressTyrant.java diff --git a/Mage.Sets/src/mage/cards/j/JinGitaxiasProgressTyrant.java b/Mage.Sets/src/mage/cards/j/JinGitaxiasProgressTyrant.java new file mode 100644 index 0000000000..650efcdcbd --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JinGitaxiasProgressTyrant.java @@ -0,0 +1,92 @@ +package mage.cards.j; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CopySourceSpellEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.game.stack.Spell; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class JinGitaxiasProgressTyrant extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("an artifact, instant, or sorcery spell"); + + static { + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.INSTANT.getPredicate(), + CardType.SORCERY.getPredicate() + )); + } + + public JinGitaxiasProgressTyrant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.PHYREXIAN); + this.subtype.add(SubType.PRAETOR); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Whenever you cast an artifact, instant, or sorcery spell, copy that spell. You may choose new targets for the copy. This ability triggers only once each turn. + this.addAbility(new SpellCastControllerTriggeredAbility( + new CopySourceSpellEffect().setText("copy that spell. You may choose new targets for the copy"), + filter, false, true + ).setTriggersOnce(true)); + + // Whenever an opponent casts an artifact, instant, or sorcery spell, counter that spell. This ability triggers only once each turn. + this.addAbility(new SpellCastOpponentTriggeredAbility( + new JinGitaxiasProgressTyrantEffect(), filter, false + ).setTriggersOnce(true)); + } + + private JinGitaxiasProgressTyrant(final JinGitaxiasProgressTyrant card) { + super(card); + } + + @Override + public JinGitaxiasProgressTyrant copy() { + return new JinGitaxiasProgressTyrant(this); + } +} + +class JinGitaxiasProgressTyrantEffect extends OneShotEffect { + + JinGitaxiasProgressTyrantEffect() { + super(Outcome.Benefit); + staticText = "counter that spell"; + } + + private JinGitaxiasProgressTyrantEffect(final JinGitaxiasProgressTyrantEffect effect) { + super(effect); + } + + @Override + public JinGitaxiasProgressTyrantEffect copy() { + return new JinGitaxiasProgressTyrantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = (Spell) getValue("spellCast"); + if (spell != null) { + spell.counter(source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 2cc0b7bea2..264bd0cdfa 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -143,6 +143,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Ironhoof Boar", 148, Rarity.COMMON, mage.cards.i.IronhoofBoar.class)); cards.add(new SetCardInfo("Island", 285, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Isshin, Two Heavens as One", 224, Rarity.RARE, mage.cards.i.IsshinTwoHeavensAsOne.class)); + cards.add(new SetCardInfo("Jin-Gitaxias, Progress Tyrant", 59, Rarity.MYTHIC, mage.cards.j.JinGitaxiasProgressTyrant.class)); cards.add(new SetCardInfo("Jugan Defends the Temple", 194, Rarity.MYTHIC, mage.cards.j.JuganDefendsTheTemple.class)); cards.add(new SetCardInfo("Jukai Naturalist", 225, Rarity.UNCOMMON, mage.cards.j.JukaiNaturalist.class)); cards.add(new SetCardInfo("Jukai Preserver", 195, Rarity.COMMON, mage.cards.j.JukaiPreserver.class));