[LTR] Implement Glorious Gale

This commit is contained in:
theelk801 2023-06-09 18:56:56 -04:00
parent 93e1dc0515
commit 1970a54dad
2 changed files with 68 additions and 0 deletions

View file

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

View file

@ -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("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 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("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 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("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)); cards.add(new SetCardInfo("Gollum's Bite", 85, Rarity.UNCOMMON, mage.cards.g.GollumsBite.class));