From 725ddddbeace704f67681c4b703667402ff2b947 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 17 Jan 2021 11:10:20 -0500 Subject: [PATCH] [KHM] Implemented Provoke the Trolls --- .../src/mage/cards/p/ProvokeTheTrolls.java | 72 +++++++++++++++++++ Mage.Sets/src/mage/sets/Kaldheim.java | 1 + 2 files changed, 73 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/ProvokeTheTrolls.java diff --git a/Mage.Sets/src/mage/cards/p/ProvokeTheTrolls.java b/Mage.Sets/src/mage/cards/p/ProvokeTheTrolls.java new file mode 100644 index 0000000000..066b18c9b1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/ProvokeTheTrolls.java @@ -0,0 +1,72 @@ +package mage.cards.p; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +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.players.Player; +import mage.target.common.TargetAnyTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ProvokeTheTrolls extends CardImpl { + + public ProvokeTheTrolls(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}"); + + // Provoke the Trolls deals 3 damage to any target. If a creature is dealt damage this way, it gets +5/+0 until end of turn. + this.getSpellAbility().addEffect(new ProvokeTheTrollsEffect()); + this.getSpellAbility().addTarget(new TargetAnyTarget()); + } + + private ProvokeTheTrolls(final ProvokeTheTrolls card) { + super(card); + } + + @Override + public ProvokeTheTrolls copy() { + return new ProvokeTheTrolls(this); + } +} + +class ProvokeTheTrollsEffect extends OneShotEffect { + + ProvokeTheTrollsEffect() { + super(Outcome.Benefit); + staticText = "{this} deals 3 damage to any target. " + + "If a creature is dealt damage this way, it gets +5/+0 until end of turn"; + } + + private ProvokeTheTrollsEffect(final ProvokeTheTrollsEffect effect) { + super(effect); + } + + @Override + public ProvokeTheTrollsEffect copy() { + return new ProvokeTheTrollsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + return player.damage(3, source.getSourceId(), source, game) > 0; + } + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null || permanent.damage(3, source.getSourceId(), source, game) < 1) { + return false; + } + if (permanent.isCreature()) { + game.addEffect(new BoostTargetEffect(3, 0), source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index 500af335b3..dc670b7ac0 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -199,6 +199,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Path to the World Tree", 186, Rarity.UNCOMMON, mage.cards.p.PathToTheWorldTree.class)); cards.add(new SetCardInfo("Pilfering Hawk", 71, Rarity.COMMON, mage.cards.p.PilferingHawk.class)); cards.add(new SetCardInfo("Plains", 394, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Provoke the Trolls", 144, Rarity.COMMON, mage.cards.p.ProvokeTheTrolls.class)); cards.add(new SetCardInfo("Pyre of Heroes", 241, Rarity.RARE, mage.cards.p.PyreOfHeroes.class)); cards.add(new SetCardInfo("Raiders' Karve", 242, Rarity.COMMON, mage.cards.r.RaidersKarve.class)); cards.add(new SetCardInfo("Raise the Draugr", 105, Rarity.COMMON, mage.cards.r.RaiseTheDraugr.class));