From c5b2ca79ec8e28bc8ae8a034ce50b6add367ca7e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 30 Nov 2021 19:57:44 -0500 Subject: [PATCH] [VOC] Implemented Millicent, Restless Revenant --- .../cards/m/MillicentRestlessRevenant.java | 131 ++++++++++++++++++ .../src/mage/sets/CrimsonVowCommander.java | 1 + 2 files changed, 132 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MillicentRestlessRevenant.java diff --git a/Mage.Sets/src/mage/cards/m/MillicentRestlessRevenant.java b/Mage.Sets/src/mage/cards/m/MillicentRestlessRevenant.java new file mode 100644 index 0000000000..df218e6399 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MillicentRestlessRevenant.java @@ -0,0 +1,131 @@ +package mage.cards.m; + +import mage.MageInt; +import mage.MageObject; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.cost.SpellCostReductionForEachSourceEffect; +import mage.abilities.hint.Hint; +import mage.abilities.hint.ValueHint; +import mage.abilities.keyword.FlyingAbility; +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.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; +import mage.game.events.DamagedEvent; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentToken; +import mage.game.permanent.token.SpiritWhiteToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MillicentRestlessRevenant extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.SPIRIT); + private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter); + private static final Hint hint = new ValueHint("Spirits you control", xValue); + + public MillicentRestlessRevenant(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.SPIRIT); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // This spell costs {1} less to cast for each Spirit you control. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new SpellCostReductionForEachSourceEffect(1, xValue) + ).addHint(hint)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Millicent, Restless Revenant or another nontoken Spirit you control dies or deals combat damage to a player, create a 1/1 white Spirit creature token with flying. + this.addAbility(new MillicentRestlessRevenantTriggeredAbility()); + } + + private MillicentRestlessRevenant(final MillicentRestlessRevenant card) { + super(card); + } + + @Override + public MillicentRestlessRevenant copy() { + return new MillicentRestlessRevenant(this); + } +} + +class MillicentRestlessRevenantTriggeredAbility extends TriggeredAbilityImpl { + + MillicentRestlessRevenantTriggeredAbility() { + super(Zone.BATTLEFIELD, new CreateTokenEffect(new SpiritWhiteToken())); + } + + private MillicentRestlessRevenantTriggeredAbility(final MillicentRestlessRevenantTriggeredAbility ability) { + super(ability); + } + + @Override + public MillicentRestlessRevenantTriggeredAbility copy() { + return new MillicentRestlessRevenantTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ZONE_CHANGE + || event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent; + switch (event.getType()) { + case ZONE_CHANGE: + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (!zEvent.isDiesEvent()) { + return false; + } + permanent = zEvent.getTarget(); + break; + case DAMAGED_PLAYER: + if (!((DamagedEvent) event).isCombatDamage()) { + return false; + } + permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); + break; + default: + return false; + } + if (permanent == null) { + return false; + } + return permanent.getId().equals(this.getSourceId()) + || (!(permanent instanceof PermanentToken) + && permanent.hasSubtype(SubType.SPIRIT, game)); + } + + @Override + public boolean isInUseableZone(Game game, MageObject source, GameEvent event) { + return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game); + } + + @Override + public String getRule() { + return "Whenever {this} or another nontoken Spirit you control dies or deals combat damage to a player, " + + "create a 1/1 white Spirit creature token with flying."; + } +} diff --git a/Mage.Sets/src/mage/sets/CrimsonVowCommander.java b/Mage.Sets/src/mage/sets/CrimsonVowCommander.java index 7baa9bce4d..d100f65d30 100644 --- a/Mage.Sets/src/mage/sets/CrimsonVowCommander.java +++ b/Mage.Sets/src/mage/sets/CrimsonVowCommander.java @@ -96,6 +96,7 @@ public final class CrimsonVowCommander extends ExpansionSet { cards.add(new SetCardInfo("Mentor of the Meek", 93, Rarity.RARE, mage.cards.m.MentorOfTheMeek.class)); cards.add(new SetCardInfo("Midnight Arsonist", 27, Rarity.RARE, mage.cards.m.MidnightArsonist.class)); cards.add(new SetCardInfo("Midnight Clock", 108, Rarity.RARE, mage.cards.m.MidnightClock.class)); + cards.add(new SetCardInfo("Millicent, Restless Revenant", 1, Rarity.MYTHIC, mage.cards.m.MillicentRestlessRevenant.class)); cards.add(new SetCardInfo("Mirror Entity", 94, Rarity.RARE, mage.cards.m.MirrorEntity.class)); cards.add(new SetCardInfo("Mob Rule", 147, Rarity.RARE, mage.cards.m.MobRule.class)); cards.add(new SetCardInfo("Molten Echoes", 148, Rarity.RARE, mage.cards.m.MoltenEchoes.class));