From 08eb000453ae20ac8f539ea8245c4dadebb1712f Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Sat, 10 Feb 2024 21:52:28 +0200 Subject: [PATCH] [MKM] Implement Proft's Eidetic Memory (#11779) --- .../src/mage/cards/p/ProftsEideticMemory.java | 69 +++++++++++++++++++ .../src/mage/sets/MurdersAtKarlovManor.java | 1 + .../dynamicvalue/IntPlusDynamicValue.java | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/p/ProftsEideticMemory.java diff --git a/Mage.Sets/src/mage/cards/p/ProftsEideticMemory.java b/Mage.Sets/src/mage/cards/p/ProftsEideticMemory.java new file mode 100644 index 00000000000..785225b7d5d --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/ProftsEideticMemory.java @@ -0,0 +1,69 @@ +package mage.cards.p; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.DrewTwoOrMoreCardsCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.IntPlusDynamicValue; +import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.constants.Duration; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author DominionSpy + */ +public final class ProftsEideticMemory extends CardImpl { + + public ProftsEideticMemory(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + + // When Proft's Eidetic Memory enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); + + // You have no maximum hand size. + this.addAbility(new SimpleStaticAbility(new MaximumHandSizeControllerEffect( + Integer.MAX_VALUE, Duration.WhileOnBattlefield, + MaximumHandSizeControllerEffect.HandSizeModification.SET))); + + // At the beginning of combat on your turn, if you've drawn more than one card this turn, + // put X +1/+1 counters on target creature you control, + // where X is the number of cards you've drawn this turn minus one. + Ability ability = new ConditionalInterveningIfTriggeredAbility( + new BeginningOfCombatTriggeredAbility( + new AddCountersTargetEffect( + CounterType.P1P1.createInstance(), + new IntPlusDynamicValue(-1, CardsDrawnThisTurnDynamicValue.instance)), + TargetController.YOU, false), + DrewTwoOrMoreCardsCondition.instance, + "At the beginning of combat on your turn, if you've drawn more than one card this turn, " + + "put X +1/+1 counters on target creature you control, " + + "where X is the number of cards you've drawn this turn minus one"); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + private ProftsEideticMemory(final ProftsEideticMemory card) { + super(card); + } + + @Override + public ProftsEideticMemory copy() { + return new ProftsEideticMemory(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java index 20141fdafac..37fa92c70db 100644 --- a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java +++ b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java @@ -179,6 +179,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet { cards.add(new SetCardInfo("Pompous Gadabout", 171, Rarity.UNCOMMON, mage.cards.p.PompousGadabout.class)); cards.add(new SetCardInfo("Presumed Dead", 100, Rarity.UNCOMMON, mage.cards.p.PresumedDead.class)); cards.add(new SetCardInfo("Private Eye", 223, Rarity.UNCOMMON, mage.cards.p.PrivateEye.class)); + cards.add(new SetCardInfo("Proft's Eidetic Memory", 67, Rarity.RARE, mage.cards.p.ProftsEideticMemory.class)); cards.add(new SetCardInfo("Public Thoroughfare", 265, Rarity.COMMON, mage.cards.p.PublicThoroughfare.class)); cards.add(new SetCardInfo("Push // Pull", 250, Rarity.UNCOMMON, mage.cards.p.PushPull.class)); cards.add(new SetCardInfo("Rakdos, Patron of Chaos", 224, Rarity.MYTHIC, mage.cards.r.RakdosPatronOfChaos.class)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/IntPlusDynamicValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/IntPlusDynamicValue.java index 27855bc14f5..3742630a3ec 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/IntPlusDynamicValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/IntPlusDynamicValue.java @@ -36,7 +36,7 @@ public class IntPlusDynamicValue implements DynamicValue { @Override public String toString() { - StringBuilder sb = new StringBuilder(baseValue); + StringBuilder sb = new StringBuilder(); sb.append(baseValue).append(" plus "); return sb.append(value.toString()).toString(); }