From 0e23fae6347c34c1bce6206edbb08ce2bf8a9a2d Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Thu, 3 Feb 2022 12:57:27 -0600 Subject: [PATCH] [NEO] Implemented Tribute to Horobi / Echo of Death's Wail --- .../src/mage/cards/e/EchoOfDeathsWail.java | 67 ++++++++++++++++ .../src/mage/cards/t/TributeToHorobi.java | 80 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 2 + .../game/permanent/token/RatRogueToken.java | 31 +++++++ 4 files changed, 180 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/EchoOfDeathsWail.java create mode 100644 Mage.Sets/src/mage/cards/t/TributeToHorobi.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/RatRogueToken.java diff --git a/Mage.Sets/src/mage/cards/e/EchoOfDeathsWail.java b/Mage.Sets/src/mage/cards/e/EchoOfDeathsWail.java new file mode 100644 index 00000000000..299618e0783 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/EchoOfDeathsWail.java @@ -0,0 +1,67 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainControlAllEffect; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.predicate.permanent.TokenPredicate; + +/** + * + * @author weirddan455 + */ +public final class EchoOfDeathsWail extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(SubType.RAT, "all Rat tokens"); + + static { + filter.add(TokenPredicate.TRUE); + } + + public EchoOfDeathsWail(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, ""); + + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + this.color.setBlack(true); + this.nightCard = true; + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // When Echo of Death's Wail enters the battlefield, gain control of all Rat tokens. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainControlAllEffect(Duration.Custom, filter))); + + // Whenever Echo of Death's Wail attacks, you may sacrifice another creature. If you do, draw a card. + this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid( + new DrawCardSourceControllerEffect(1), + new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE) + ))); + } + + private EchoOfDeathsWail(final EchoOfDeathsWail card) { + super(card); + } + + @Override + public EchoOfDeathsWail copy() { + return new EchoOfDeathsWail(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TributeToHorobi.java b/Mage.Sets/src/mage/cards/t/TributeToHorobi.java new file mode 100644 index 00000000000..720eae122a7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TributeToHorobi.java @@ -0,0 +1,80 @@ +package mage.cards.t; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SagaAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSagaAndReturnTransformedEffect; +import mage.abilities.keyword.TransformAbility; +import mage.constants.Outcome; +import mage.constants.SagaChapter; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.game.permanent.token.RatRogueToken; + +/** + * + * @author weirddan455 + */ +public final class TributeToHorobi extends CardImpl { + + public TributeToHorobi(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + + this.subtype.add(SubType.SAGA); + this.secondSideCardClazz = mage.cards.e.EchoOfDeathsWail.class; + + // (As this Saga enters and after your draw step, add a lore counter.) + SagaAbility sagaAbility = new SagaAbility(this); + + // I, II — Each opponent creates a 1/1 black Rat Rouge creature token. + sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_II, new TributeToHorobiTokenEffect()); + + // III — Exile this Saga, then return it to the battlefield transformed under your control. + this.addAbility(new TransformAbility()); + sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_III, new ExileSagaAndReturnTransformedEffect()); + + this.addAbility(sagaAbility); + } + + private TributeToHorobi(final TributeToHorobi card) { + super(card); + } + + @Override + public TributeToHorobi copy() { + return new TributeToHorobi(this); + } +} + +class TributeToHorobiTokenEffect extends OneShotEffect { + + public TributeToHorobiTokenEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Each opponent creates a 1/1 black Rat Rouge creature token"; + } + + private TributeToHorobiTokenEffect(final TributeToHorobiTokenEffect effect) { + super(effect); + } + + @Override + public TributeToHorobiTokenEffect copy() { + return new TributeToHorobiTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean success = false; + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + if (new RatRogueToken().putOntoBattlefield(1, game, source, opponentId)) { + success = true; + } + } + return success; + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 6f6a9d6cddb..ca93576b533 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -52,6 +52,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Coiling Stalker", 179, Rarity.COMMON, mage.cards.c.CoilingStalker.class)); cards.add(new SetCardInfo("Covert Technician", 49, Rarity.UNCOMMON, mage.cards.c.CovertTechnician.class)); cards.add(new SetCardInfo("Dokuchi Shadow-Walker", 94, Rarity.COMMON, mage.cards.d.DokuchiShadowWalker.class)); + cards.add(new SetCardInfo("Echo of Death's Wail", 124, Rarity.RARE, mage.cards.e.EchoOfDeathsWail.class)); cards.add(new SetCardInfo("Eiganjo Exemplar", 10, Rarity.COMMON, mage.cards.e.EiganjoExemplar.class)); cards.add(new SetCardInfo("Eiganjo Uprising", 217, Rarity.RARE, mage.cards.e.EiganjoUprising.class)); cards.add(new SetCardInfo("Enormous Energy Blade", 96, Rarity.UNCOMMON, mage.cards.e.EnormousEnergyBlade.class)); @@ -143,6 +144,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Thirst for Knowledge", 85, Rarity.UNCOMMON, mage.cards.t.ThirstForKnowledge.class)); cards.add(new SetCardInfo("Thousand-Faced Shadow", 86, Rarity.RARE, mage.cards.t.ThousandFacedShadow.class)); cards.add(new SetCardInfo("Towashi Guide-Bot", 262, Rarity.UNCOMMON, mage.cards.t.TowashiGuideBot.class)); + cards.add(new SetCardInfo("Tribute to Horobi", 124, Rarity.RARE, mage.cards.t.TributeToHorobi.class)); cards.add(new SetCardInfo("Twinshot Sniper", 168, Rarity.UNCOMMON, mage.cards.t.TwinshotSniper.class)); cards.add(new SetCardInfo("Unstoppable Ogre", 169, Rarity.COMMON, mage.cards.u.UnstoppableOgre.class)); cards.add(new SetCardInfo("Upriser Renegade", 170, Rarity.UNCOMMON, mage.cards.u.UpriserRenegade.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/RatRogueToken.java b/Mage/src/main/java/mage/game/permanent/token/RatRogueToken.java new file mode 100644 index 00000000000..38859d9970f --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/RatRogueToken.java @@ -0,0 +1,31 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * + * @author weirddan455 + */ +public class RatRogueToken extends TokenImpl { + + public RatRogueToken() { + super("Rat Rogue", "1/1 black Rat Rogue creature token"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add(SubType.RAT); + subtype.add(SubType.ROGUE); + power = new MageInt(1); + toughness = new MageInt(1); + } + + private RatRogueToken(final RatRogueToken token) { + super(token); + } + + @Override + public RatRogueToken copy() { + return new RatRogueToken(this); + } +}