From ad0e0bf06b6be205d81e566de0d8cf42e56f2c17 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Mon, 19 Jun 2023 16:24:07 -0400 Subject: [PATCH] [LTC] Implement Pippin, Warden of Isengard --- .../mage/cards/p/PippinWardenOfIsengard.java | 70 +++++++++++++++++++ .../sets/TalesOfMiddleEarthCommander.java | 1 + 2 files changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PippinWardenOfIsengard.java diff --git a/Mage.Sets/src/mage/cards/p/PippinWardenOfIsengard.java b/Mage.Sets/src/mage/cards/p/PippinWardenOfIsengard.java new file mode 100644 index 00000000000..372b6dc9f4a --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PippinWardenOfIsengard.java @@ -0,0 +1,70 @@ +package mage.cards.p; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.PartnerWithAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.common.FilterControlledPermanent; +import mage.game.permanent.token.FoodToken; +import mage.target.common.TargetControlledPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PippinWardenOfIsengard extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.FOOD, "Foods"); + + public PippinWardenOfIsengard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{G}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HALFLING); + this.subtype.add(SubType.ADVISOR); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Partner with Merry, Warden of Isengard + this.addAbility(new PartnerWithAbility("Merry, Warden of Isengard")); + + // {1}, {T}: Create a Food token. + Ability ability = new SimpleActivatedAbility(new CreateTokenEffect(new FoodToken()), new GenericManaCost(1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {T}, Sacrifice four Foods: Other creatures you control get +3/+3 and gain haste until end of turn. Activate only as a sorcery. + ability = new ActivateAsSorceryActivatedAbility(new BoostControlledEffect( + 3, 3, Duration.EndOfTurn, true + ).setText("other creatures you control get +3/+3"), new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(4, filter))); + ability.addEffect(new GainAbilityControlledEffect( + HasteAbility.getInstance(), Duration.EndOfTurn + ).setText("and gain haste until end of turn")); + this.addAbility(ability); + } + + private PippinWardenOfIsengard(final PippinWardenOfIsengard card) { + super(card); + } + + @Override + public PippinWardenOfIsengard copy() { + return new PippinWardenOfIsengard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java index e38d283b4de..02c6b610687 100644 --- a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java +++ b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java @@ -171,6 +171,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet { cards.add(new SetCardInfo("Path of Ancestry", 322, Rarity.COMMON, mage.cards.p.PathOfAncestry.class)); cards.add(new SetCardInfo("Path to Exile", 175, Rarity.UNCOMMON, mage.cards.p.PathToExile.class)); cards.add(new SetCardInfo("Pillar of the Paruns", 372, Rarity.MYTHIC, mage.cards.p.PillarOfTheParuns.class)); + cards.add(new SetCardInfo("Pippin, Warden of Isengard", 65, Rarity.RARE, mage.cards.p.PippinWardenOfIsengard.class)); cards.add(new SetCardInfo("Plea for Power", 195, Rarity.RARE, mage.cards.p.PleaForPower.class)); cards.add(new SetCardInfo("Port Town", 323, Rarity.RARE, mage.cards.p.PortTown.class)); cards.add(new SetCardInfo("Prairie Stream", 324, Rarity.RARE, mage.cards.p.PrairieStream.class));