diff --git a/Mage.Sets/src/mage/cards/a/AshenReaper.java b/Mage.Sets/src/mage/cards/a/AshenReaper.java new file mode 100644 index 0000000000..d625ed39c0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AshenReaper.java @@ -0,0 +1,89 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.MenaceAbility; +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.watchers.Watcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AshenReaper extends CardImpl { + + public AshenReaper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, ""); + + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.ELEMENTAL); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + this.color.setBlack(true); + this.color.setRed(true); + this.nightCard = true; + + // Menace + this.addAbility(new MenaceAbility(false)); + + // At the beginning of your end step, put a +1/+1 counter on Ashen Reaper if a permanent was put into a graveyard from the battlefield this turn. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + new ConditionalOneShotEffect( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), + AshenReaperCondition.instance, "put a +1/+1 counter on {this} " + + "if a permanent was put into a graveyard from the battlefield this turn" + ), TargetController.YOU, false + )); + } + + private AshenReaper(final AshenReaper card) { + super(card); + } + + @Override + public AshenReaper copy() { + return new AshenReaper(this); + } + + public static AshenReaperWatcher makeWatcher() { + return new AshenReaperWatcher(); + } +} + +enum AshenReaperCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return game.getState().getWatcher(AshenReaperWatcher.class).conditionMet(); + } +} + +class AshenReaperWatcher extends Watcher { + + AshenReaperWatcher() { + super(WatcherScope.GAME); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE + && ((ZoneChangeEvent) event).isDiesEvent()) { + condition = true; + } + } +} diff --git a/Mage.Sets/src/mage/cards/i/InvasionOfAzgol.java b/Mage.Sets/src/mage/cards/i/InvasionOfAzgol.java new file mode 100644 index 0000000000..06a2475071 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InvasionOfAzgol.java @@ -0,0 +1,48 @@ +package mage.cards.i; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SiegeAbility; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.a.AshenReaper; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.StaticFilters; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class InvasionOfAzgol extends CardImpl { + + public InvasionOfAzgol(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.BATTLE}, "{B}{R}"); + + this.subtype.add(SubType.SIEGE); + this.setStartingDefense(4); + this.secondSideCardClazz = mage.cards.a.AshenReaper.class; + + // (As a Siege enters, choose an opponent to protect it. You and others can attack it. When it's defeated, exile it, then cast it transformed.) + this.addAbility(new SiegeAbility()); + + // When Invasion of Azgol enters the battlefield, target player sacrifices a creature or planeswalker and loses 1 life. + Ability ability = new EntersBattlefieldTriggeredAbility(new SacrificeEffect( + StaticFilters.FILTER_PERMANENT_CREATURE_OR_PLANESWALKER_A, 1, null + )); + ability.addEffect(new LoseLifeTargetEffect(1).setText("and loses 1 life")); + this.addAbility(ability, AshenReaper.makeWatcher()); + } + + private InvasionOfAzgol(final InvasionOfAzgol card) { + super(card); + } + + @Override + public InvasionOfAzgol copy() { + return new InvasionOfAzgol(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 38b3d23c36..bf64915f8d 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -37,6 +37,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Archangel Elspeth", 6, Rarity.MYTHIC, mage.cards.a.ArchangelElspeth.class)); cards.add(new SetCardInfo("Archpriest of Shadows", 89, Rarity.RARE, mage.cards.a.ArchpriestOfShadows.class)); cards.add(new SetCardInfo("Artistic Refusal", 46, Rarity.UNCOMMON, mage.cards.a.ArtisticRefusal.class)); + cards.add(new SetCardInfo("Ashen Reaper", 232, Rarity.UNCOMMON, mage.cards.a.AshenReaper.class)); cards.add(new SetCardInfo("Assimilate Essence", 47, Rarity.COMMON, mage.cards.a.AssimilateEssence.class)); cards.add(new SetCardInfo("Astral Wingspan", 48, Rarity.UNCOMMON, mage.cards.a.AstralWingspan.class)); cards.add(new SetCardInfo("Atraxa's Fall", 176, Rarity.COMMON, mage.cards.a.AtraxasFall.class)); @@ -143,6 +144,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Into the Fire", 144, Rarity.RARE, mage.cards.i.IntoTheFire.class)); cards.add(new SetCardInfo("Invasion of Alara", 230, Rarity.RARE, mage.cards.i.InvasionOfAlara.class)); cards.add(new SetCardInfo("Invasion of Amonkhet", 231, Rarity.UNCOMMON, mage.cards.i.InvasionOfAmonkhet.class)); + cards.add(new SetCardInfo("Invasion of Azgol", 232, Rarity.UNCOMMON, mage.cards.i.InvasionOfAzgol.class)); cards.add(new SetCardInfo("Invasion of Belenon", 20, Rarity.UNCOMMON, mage.cards.i.InvasionOfBelenon.class)); cards.add(new SetCardInfo("Invasion of Dominaria", 21, Rarity.UNCOMMON, mage.cards.i.InvasionOfDominaria.class)); cards.add(new SetCardInfo("Invasion of Eldraine", 113, Rarity.UNCOMMON, mage.cards.i.InvasionOfEldraine.class));