From 02d8eebbb8d353fb6e27cad78dc90bd2839bd436 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 8 Apr 2023 18:28:08 -0400 Subject: [PATCH] [MOM] Implement Ichor Shade --- Mage.Sets/src/mage/cards/i/IchorShade.java | 88 +++++++++++++++++++ .../src/mage/sets/MarchOfTheMachine.java | 1 + 2 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/i/IchorShade.java diff --git a/Mage.Sets/src/mage/cards/i/IchorShade.java b/Mage.Sets/src/mage/cards/i/IchorShade.java new file mode 100644 index 00000000000..2050fc904c2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IchorShade.java @@ -0,0 +1,88 @@ +package mage.cards.i; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.constants.WatcherScope; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.watchers.Watcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class IchorShade extends CardImpl { + + public IchorShade(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.PHYREXIAN); + this.subtype.add(SubType.SHADE); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // At the beginning of your end step, if an artifact or creature was put into a graveyard from the battlefield this turn, put a +1/+1 counter on Ichor Shade. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), + TargetController.YOU, IchorShadeCondition.instance, false + ), new IchorShadeWatcher()); + } + + private IchorShade(final IchorShade card) { + super(card); + } + + @Override + public IchorShade copy() { + return new IchorShade(this); + } +} + +enum IchorShadeCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return game.getState().getWatcher(IchorShadeWatcher.class).conditionMet(); + } + + @Override + public String toString() { + return "an artifact or creature was put into a graveyard from the battlefield this turn"; + } +} + +class IchorShadeWatcher extends Watcher { + + IchorShadeWatcher() { + super(WatcherScope.GAME); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() != GameEvent.EventType.ZONE_CHANGE) { + return; + } + Permanent permanent = ((ZoneChangeEvent) event).getTarget(); + if (permanent != null && (permanent.isArtifact(game) || permanent.isCreature(game))) { + condition = true; + } + } + + @Override + public void reset() { + super.reset(); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 0df517fcb4a..a99460450b9 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -114,6 +114,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Herbology Instructor", 189, Rarity.UNCOMMON, mage.cards.h.HerbologyInstructor.class)); cards.add(new SetCardInfo("Hideous Fleshwheeler", 119, Rarity.UNCOMMON, mage.cards.h.HideousFleshwheeler.class)); cards.add(new SetCardInfo("Ichor Drinker", 111, Rarity.COMMON, mage.cards.i.IchorDrinker.class)); + cards.add(new SetCardInfo("Ichor Shade", 112, Rarity.COMMON, mage.cards.i.IchorShade.class)); cards.add(new SetCardInfo("Infected Defector", 18, Rarity.COMMON, mage.cards.i.InfectedDefector.class)); cards.add(new SetCardInfo("Injector Crocodile", 329, Rarity.COMMON, mage.cards.i.InjectorCrocodile.class)); cards.add(new SetCardInfo("Inspired Charge", 19, Rarity.COMMON, mage.cards.i.InspiredCharge.class));