From 90df06b92886ad98e03effba678de27c340f7c84 Mon Sep 17 00:00:00 2001 From: Tiago Gil <73337790+TiagoMDG@users.noreply.github.com> Date: Wed, 28 Jun 2023 01:23:28 +0100 Subject: [PATCH] [LTR] Implement Ent's Fury (#10532) --- Mage.Sets/src/mage/cards/e/EntsFury.java | 85 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 86 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/EntsFury.java diff --git a/Mage.Sets/src/mage/cards/e/EntsFury.java b/Mage.Sets/src/mage/cards/e/EntsFury.java new file mode 100644 index 0000000000..07f992cf90 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EntsFury.java @@ -0,0 +1,85 @@ +package mage.cards.e; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.FightTargetsEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TiagoMDG + */ +public final class EntsFury extends CardImpl { + public EntsFury(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[] { CardType.SORCERY }, "{1}{G}"); + + // Put a +1/+1 counter on target creature you control if its power is 4 or greater. + // Then that creature gets +1/+1 until end of turn and fights target + // creature you don't control. + + this.getSpellAbility().addEffect(new EntsFuryEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); + } + + private EntsFury(final EntsFury card) { + super(card); + } + + @Override + public EntsFury copy() { + return new EntsFury(this); + } +} + +class EntsFuryEffect extends OneShotEffect { + + public EntsFuryEffect() { + super(Outcome.Benefit); + this.staticText = "Put a +1/+1 counter on target creature you control if its power is 4 or greater. " + + "Then that creature gets +1/+1 until end of turn and fights target creature you don't control."; + } + + public EntsFuryEffect(final EntsFuryEffect effect) { + super(effect); + } + + @Override + public EntsFuryEffect copy() { + return new EntsFuryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null){ + return false; + } + + // Checks if the creature's power is 4 or greater + if (permanent.getPower().getValue() >= 4){ + permanent.addCounters(CounterType.P1P1.createInstance(1), source.getControllerId(), source, game); + } + + // Adds temporary +1/+1 until end of turn and adds fight effect + ContinuousEffect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(effect, source); + return new FightTargetsEffect(false).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index d3f8e0ce11..ca8e4a53ad 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -69,6 +69,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Elven Farsight", 161, Rarity.COMMON, mage.cards.e.ElvenFarsight.class)); cards.add(new SetCardInfo("Elvish Mariner", 283, Rarity.RARE, mage.cards.e.ElvishMariner.class)); cards.add(new SetCardInfo("Enraged Huorn", 162, Rarity.COMMON, mage.cards.e.EnragedHuorn.class)); + cards.add(new SetCardInfo("Ent's Fury", 164, Rarity.COMMON, mage.cards.e.EntsFury.class)); cards.add(new SetCardInfo("Ent-Draught Basin", 238, Rarity.UNCOMMON, mage.cards.e.EntDraughtBasin.class)); cards.add(new SetCardInfo("Entish Restoration", 163, Rarity.UNCOMMON, mage.cards.e.EntishRestoration.class)); cards.add(new SetCardInfo("Eomer of the Riddermark", 121, Rarity.UNCOMMON, mage.cards.e.EomerOfTheRiddermark.class));