[LTR] Implement Gimli's Fury

This commit is contained in:
theelk801 2023-06-03 09:27:35 -04:00
parent 6067362a0f
commit 49721f6c94
2 changed files with 70 additions and 0 deletions

View file

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

View file

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