[MKM] Implement Proft's Eidetic Memory (#11779)

This commit is contained in:
Matthew Wilson 2024-02-10 21:52:28 +02:00 committed by GitHub
parent bbe2ede8dc
commit 08eb000453
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 71 additions and 1 deletions

View file

@ -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);
}
}

View file

@ -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));

View file

@ -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();
}