From 4ccc7b71e06e148780adfdc84e8de28ffd5b717a Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 10 Jun 2023 08:45:34 -0400 Subject: [PATCH] [LTR] Implement Celeborn the Wise --- .../src/mage/cards/c/CelebornTheWise.java | 81 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 82 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CelebornTheWise.java diff --git a/Mage.Sets/src/mage/cards/c/CelebornTheWise.java b/Mage.Sets/src/mage/cards/c/CelebornTheWise.java new file mode 100644 index 00000000000..86ffbbbf9fd --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CelebornTheWise.java @@ -0,0 +1,81 @@ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksWithCreaturesTriggeredAbility; +import mage.abilities.common.ScryTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.keyword.ScryEffect; +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.FilterPermanent; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CelebornTheWise extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(SubType.ELF, "Elves"); + + public CelebornTheWise(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever you attack with one or more Elves, scry 1. + this.addAbility(new AttacksWithCreaturesTriggeredAbility( + new ScryEffect(1, false), 1, filter + )); + + // Whenever you scry, Celeborn the Wise gets +1/+1 until end of turn for each card you looked at while scrying this way. + this.addAbility(new ScryTriggeredAbility(new BoostSourceEffect( + CelebornTheWiseValue.instance, CelebornTheWiseValue.instance, Duration.EndOfTurn + ))); + } + + private CelebornTheWise(final CelebornTheWise card) { + super(card); + } + + @Override + public CelebornTheWise copy() { + return new CelebornTheWise(this); + } +} + +enum CelebornTheWiseValue implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return (Integer) effect.getValue("amount"); + } + + @Override + public CelebornTheWiseValue copy() { + return this; + } + + @Override + public String getMessage() { + return "card you looked at while scrying this way"; + } + + @Override + public String toString() { + return "1"; + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 676e1463450..de230aa8199 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -39,6 +39,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Call of the Ring", 79, Rarity.RARE, mage.cards.c.CallOfTheRing.class)); cards.add(new SetCardInfo("Captain of Umbar", 45, Rarity.COMMON, mage.cards.c.CaptainOfUmbar.class)); cards.add(new SetCardInfo("Cast into the Fire", 118, Rarity.COMMON, mage.cards.c.CastIntoTheFire.class)); + cards.add(new SetCardInfo("Celeborn the Wise", 156, Rarity.UNCOMMON, mage.cards.c.CelebornTheWise.class)); cards.add(new SetCardInfo("Chance-Met Elves", 157, Rarity.COMMON, mage.cards.c.ChanceMetElves.class)); cards.add(new SetCardInfo("Claim the Precious", 81, Rarity.COMMON, mage.cards.c.ClaimThePrecious.class)); cards.add(new SetCardInfo("Council's Deliberation", 46, Rarity.UNCOMMON, mage.cards.c.CouncilsDeliberation.class));