From 8c2fcefaeb473c69c2246421ca31d3b6831c5cf9 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 18 Jun 2023 22:33:34 -0400 Subject: [PATCH] [LTC] Implement Frodo, Adventurous Hobbit --- .../mage/cards/f/FrodoAdventurousHobbit.java | 82 +++++++++++++++++++ .../sets/TalesOfMiddleEarthCommander.java | 1 + 2 files changed, 83 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FrodoAdventurousHobbit.java diff --git a/Mage.Sets/src/mage/cards/f/FrodoAdventurousHobbit.java b/Mage.Sets/src/mage/cards/f/FrodoAdventurousHobbit.java new file mode 100644 index 0000000000..9949a76d12 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FrodoAdventurousHobbit.java @@ -0,0 +1,82 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.SourceIsRingBearerCondition; +import mage.abilities.condition.common.YouGainedLifeCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.keyword.TheRingTemptsYouEffect; +import mage.abilities.keyword.PartnerWithAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.game.Game; +import mage.watchers.common.PlayerGainedLifeWatcher; +import mage.watchers.common.TemptedByTheRingWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FrodoAdventurousHobbit extends CardImpl { + + private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 2); + + public FrodoAdventurousHobbit(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{B}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HALFLING); + this.subtype.add(SubType.SCOUT); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Partner with Sam, Loyal Attendant + this.addAbility(new PartnerWithAbility("Sam, Loyal Attendant")); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Whenever Frodo, Adventurous Hobbit attacks, if you gained 3 or more life this turn, the Ring tempts you. Then if Frodo is your Ring-bearer and the Ring has tempted you two or more times this game, draw a card. + Ability ability = new ConditionalInterveningIfTriggeredAbility( + new AttacksTriggeredAbility(new TheRingTemptsYouEffect()), + condition, "Whenever {this} attacks, if you gained 3 or more life this turn, " + + "the Ring tempts you. Then if {this} is your Ring-bearer and the Ring " + + "has tempted you two or more times this game, draw a card." + ); + ability.addEffect(new ConditionalOneShotEffect( + new DrawCardSourceControllerEffect(1), + FrodoAdventurousHobbitCondition.instance + )); + this.addAbility(ability.addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); + } + + private FrodoAdventurousHobbit(final FrodoAdventurousHobbit card) { + super(card); + } + + @Override + public FrodoAdventurousHobbit copy() { + return new FrodoAdventurousHobbit(this); + } +} + +enum FrodoAdventurousHobbitCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return SourceIsRingBearerCondition.instance.apply(game, source) + && TemptedByTheRingWatcher.getCount(source.getControllerId(), game) >= 2; + } +} diff --git a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java index f94256b604..8c65522356 100644 --- a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java +++ b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java @@ -94,6 +94,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet { cards.add(new SetCardInfo("Foreboding Ruins", 310, Rarity.RARE, mage.cards.f.ForebodingRuins.class)); cards.add(new SetCardInfo("Forth Eorlingas!", 56, Rarity.RARE, mage.cards.f.ForthEorlingas.class)); cards.add(new SetCardInfo("Fortified Village", 311, Rarity.RARE, mage.cards.f.FortifiedVillage.class)); + cards.add(new SetCardInfo("Frodo, Adventurous Hobbit", 2, Rarity.MYTHIC, mage.cards.f.FrodoAdventurousHobbit.class)); cards.add(new SetCardInfo("Frontier Warmonger", 217, Rarity.RARE, mage.cards.f.FrontierWarmonger.class)); cards.add(new SetCardInfo("Frontline Medic", 169, Rarity.RARE, mage.cards.f.FrontlineMedic.class)); cards.add(new SetCardInfo("Frostboil Snarl", 312, Rarity.RARE, mage.cards.f.FrostboilSnarl.class));