From 49721f6c9407783d9ac545854f3899fae6b13272 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 3 Jun 2023 09:27:35 -0400 Subject: [PATCH] [LTR] Implement Gimli's Fury --- Mage.Sets/src/mage/cards/g/GimlisFury.java | 69 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GimlisFury.java diff --git a/Mage.Sets/src/mage/cards/g/GimlisFury.java b/Mage.Sets/src/mage/cards/g/GimlisFury.java new file mode 100644 index 0000000000..9b6de2c151 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GimlisFury.java @@ -0,0 +1,69 @@ +package mage.cards.g; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GimlisFury extends CardImpl { + + public GimlisFury(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); + + // Target creature gets +3/+2 until end of turn. If it's legendary, it also gains trample until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(3, 2)); + this.getSpellAbility().addEffect(new GimlisFuryEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private GimlisFury(final GimlisFury card) { + super(card); + } + + @Override + public GimlisFury copy() { + return new GimlisFury(this); + } +} + +class GimlisFuryEffect extends OneShotEffect { + + GimlisFuryEffect() { + super(Outcome.Benefit); + staticText = "If it's legendary, it also gains trample until end of turn"; + } + + private GimlisFuryEffect(final GimlisFuryEffect effect) { + super(effect); + } + + @Override + public GimlisFuryEffect copy() { + return new GimlisFuryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null && permanent.isLegendary(game)) { + game.addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance()) + .setTargetPointer(new FixedTarget(permanent, game)), source); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 23e0ec9afa..310f1c5676 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -47,6 +47,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Gandalf the Grey", 207, Rarity.RARE, mage.cards.g.GandalfTheGrey.class)); cards.add(new SetCardInfo("Gandalf, Friend of the Shire", 50, Rarity.UNCOMMON, mage.cards.g.GandalfFriendOfTheShire.class)); cards.add(new SetCardInfo("Generous Ent", 169, Rarity.COMMON, mage.cards.g.GenerousEnt.class)); + cards.add(new SetCardInfo("Gimli's Fury", 131, Rarity.COMMON, mage.cards.g.GimlisFury.class)); cards.add(new SetCardInfo("Goblin Assailant", 295, Rarity.COMMON, mage.cards.g.GoblinAssailant.class)); cards.add(new SetCardInfo("Gollum's Bite", 85, Rarity.UNCOMMON, mage.cards.g.GollumsBite.class)); cards.add(new SetCardInfo("Gollum, Patient Plotter", 84, Rarity.UNCOMMON, mage.cards.g.GollumPatientPlotter.class));