[KHM] Implemented Provoke the Trolls

This commit is contained in:
Evan Kranzler 2021-01-17 11:10:20 -05:00
parent 62b7bb553f
commit 725ddddbea
2 changed files with 73 additions and 0 deletions

View file

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

View file

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