From 1970a54dad5338353dccec8612912889f363ccd3 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 9 Jun 2023 18:56:56 -0400 Subject: [PATCH] [LTR] Implement Glorious Gale --- Mage.Sets/src/mage/cards/g/GloriousGale.java | 67 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 68 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GloriousGale.java diff --git a/Mage.Sets/src/mage/cards/g/GloriousGale.java b/Mage.Sets/src/mage/cards/g/GloriousGale.java new file mode 100644 index 0000000000..c4ccf7c457 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GloriousGale.java @@ -0,0 +1,67 @@ +package mage.cards.g; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.target.TargetSpell; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GloriousGale extends CardImpl { + + public GloriousGale(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + // Counter target creature spell. If it was a legendary spell, the Ring tempts you. + this.getSpellAbility().addEffect(new GloriousGaleEffect()); + this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_CREATURE)); + } + + private GloriousGale(final GloriousGale card) { + super(card); + } + + @Override + public GloriousGale copy() { + return new GloriousGale(this); + } +} + +class GloriousGaleEffect extends OneShotEffect { + + GloriousGaleEffect() { + super(Outcome.Benefit); + staticText = "counter target creature spell. If it was a legendary spell, the Ring tempts you"; + } + + private GloriousGaleEffect(final GloriousGaleEffect effect) { + super(effect); + } + + @Override + public GloriousGaleEffect copy() { + return new GloriousGaleEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getSpell(getTargetPointer().getFirst(game, source)); + if (spell == null) { + return false; + } + game.getStack().counter(spell.getId(), source, game); + if (spell.isLegendary(game)) { + game.temptWithTheRing(source.getControllerId()); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index c31e911594..8cf8101cfc 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -75,6 +75,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Gift of Strands", 170, Rarity.UNCOMMON, mage.cards.g.GiftOfStrands.class)); cards.add(new SetCardInfo("Gimli's Axe", 130, Rarity.COMMON, mage.cards.g.GimlisAxe.class)); cards.add(new SetCardInfo("Gimli's Fury", 131, Rarity.COMMON, mage.cards.g.GimlisFury.class)); + cards.add(new SetCardInfo("Glorious Gale", 51, Rarity.COMMON, mage.cards.g.GloriousGale.class)); cards.add(new SetCardInfo("Goblin Assailant", 295, Rarity.COMMON, mage.cards.g.GoblinAssailant.class)); cards.add(new SetCardInfo("Goblin Fireleaper", 133, Rarity.UNCOMMON, mage.cards.g.GoblinFireleaper.class)); cards.add(new SetCardInfo("Gollum's Bite", 85, Rarity.UNCOMMON, mage.cards.g.GollumsBite.class));