From 26f3f0b425185a9a2179a9aef7caec00e111b5f4 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 2 Jun 2023 08:31:33 -0400 Subject: [PATCH] [LTR] Implement Rosie Cotton of South Lane --- .../mage/cards/r/RosieCottonOfSouthLane.java | 84 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RosieCottonOfSouthLane.java diff --git a/Mage.Sets/src/mage/cards/r/RosieCottonOfSouthLane.java b/Mage.Sets/src/mage/cards/r/RosieCottonOfSouthLane.java new file mode 100644 index 0000000000..6a1a4f5ca6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RosieCottonOfSouthLane.java @@ -0,0 +1,84 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.token.FoodToken; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RosieCottonOfSouthLane extends CardImpl { + + public RosieCottonOfSouthLane(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HALFLING); + this.subtype.add(SubType.PEASANT); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Rosie Cotton of South Lane enters the battlefield, create a Food token. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new FoodToken()))); + + // Whenever you create a token, put a +1/+1 counter on target creature you control other than Rosie. + this.addAbility(new RosieCottonOfSouthLaneTriggeredAbility()); + } + + private RosieCottonOfSouthLane(final RosieCottonOfSouthLane card) { + super(card); + } + + @Override + public RosieCottonOfSouthLane copy() { + return new RosieCottonOfSouthLane(this); + } +} + +class RosieCottonOfSouthLaneTriggeredAbility extends TriggeredAbilityImpl { + + RosieCottonOfSouthLaneTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance())); + this.addTarget(new TargetPermanent(StaticFilters.FILTER_ANOTHER_TARGET_CREATURE)); + } + + private RosieCottonOfSouthLaneTriggeredAbility(final RosieCottonOfSouthLaneTriggeredAbility ability) { + super(ability); + } + + @Override + public RosieCottonOfSouthLaneTriggeredAbility copy() { + return new RosieCottonOfSouthLaneTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.CREATED_TOKEN; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return isControlledBy(event.getPlayerId()); + } + + @Override + public String getRule() { + return "Whenever you create a token, put a +1/+1 counter on target creature you control other than {this}."; + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 8fe3e95e17..e340895360 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -67,6 +67,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Reprieve", 26, Rarity.UNCOMMON, mage.cards.r.Reprieve.class)); cards.add(new SetCardInfo("Ringsight", 220, Rarity.UNCOMMON, mage.cards.r.Ringsight.class)); cards.add(new SetCardInfo("Rising of the Day", 145, Rarity.UNCOMMON, mage.cards.r.RisingOfTheDay.class)); + cards.add(new SetCardInfo("Rosie Cotton of South Lane", 27, Rarity.UNCOMMON, mage.cards.r.RosieCottonOfSouthLane.class)); cards.add(new SetCardInfo("Samwise Gamgee", 222, Rarity.RARE, mage.cards.s.SamwiseGamgee.class)); cards.add(new SetCardInfo("Samwise the Stouthearted", 28, Rarity.UNCOMMON, mage.cards.s.SamwiseTheStouthearted.class)); cards.add(new SetCardInfo("Saruman the White", 67, Rarity.UNCOMMON, mage.cards.s.SarumanTheWhite.class));