From e399e233d7cf17c85fbc076133138b97574d0e1c Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Sat, 18 Jan 2025 01:30:37 +0000 Subject: [PATCH] [DSC] Implement Rendmaw, Creaking Nest --- .../src/mage/cards/r/RendmawCreakingNest.java | 132 ++++++++++++++++++ .../sets/DuskmournHouseOfHorrorCommander.java | 1 + .../permanent/token/Black22BirdToken.java | 32 +++++ 3 files changed, 165 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RendmawCreakingNest.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/Black22BirdToken.java diff --git a/Mage.Sets/src/mage/cards/r/RendmawCreakingNest.java b/Mage.Sets/src/mage/cards/r/RendmawCreakingNest.java new file mode 100644 index 00000000000..fcf91f09500 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RendmawCreakingNest.java @@ -0,0 +1,132 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.combat.GoadTargetEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.token.Black22BirdToken; +import mage.game.permanent.token.Token; +import mage.game.stack.Spell; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author PurpleCrowbar + */ +public final class RendmawCreakingNest extends CardImpl { + + public RendmawCreakingNest(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{B}{G}"); + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.SCARECROW); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Menace + this.addAbility(new MenaceAbility(false)); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // When Rendmaw, Creaking Nest enters and whenever you play a card with two or more card types, each player creates a tapped 2/2 black Bird creature token with flying. The tokens are goaded for the rest of the game. + this.addAbility(new RendmawCreakingNestTriggeredAbility()); + } + + private RendmawCreakingNest(final RendmawCreakingNest card) { + super(card); + } + + @Override + public RendmawCreakingNest copy() { + return new RendmawCreakingNest(this); + } +} + +class RendmawCreakingNestTriggeredAbility extends TriggeredAbilityImpl { + + RendmawCreakingNestTriggeredAbility() { + super(Zone.BATTLEFIELD, new RendmawCreakingNestEffect()); + setTriggerPhrase("When {this} enters and whenever you play a card with two or more card types, "); + } + + private RendmawCreakingNestTriggeredAbility(final RendmawCreakingNestTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD + || event.getType() == GameEvent.EventType.SPELL_CAST + || event.getType() == GameEvent.EventType.LAND_PLAYED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + switch (event.getType()) { + case ENTERS_THE_BATTLEFIELD: + return event.getTargetId().equals(getSourceId()); + case SPELL_CAST: + if (!event.getPlayerId().equals(this.getControllerId())) { + return false; + } + Spell spell = game.getSpellOrLKIStack(event.getTargetId()); + return spell != null && spell.getCardType(game).size() >= 2; + case LAND_PLAYED: + if (!event.getPlayerId().equals(this.getControllerId())) { + return false; + } + Card card = game.getCard(event.getTargetId()); + return card != null && card.getCardType(game).size() >= 2; + default: + return false; + } + } + + @Override + public RendmawCreakingNestTriggeredAbility copy() { + return new RendmawCreakingNestTriggeredAbility(this); + } +} + +class RendmawCreakingNestEffect extends OneShotEffect { + + RendmawCreakingNestEffect() { + super(Outcome.Benefit); + staticText = "each player creates a tapped 2/2 black Bird creature token with flying. " + + "The tokens are goaded for the rest of the game"; + } + + private RendmawCreakingNestEffect(final RendmawCreakingNestEffect effect) { + super(effect); + } + + @Override + public RendmawCreakingNestEffect copy() { + return new RendmawCreakingNestEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + if (!game.getPlayer(playerId).isInGame()) { + continue; + } + Token token = new Black22BirdToken(); + token.putOntoBattlefield(1, game, source, playerId, true, false); + token.getLastAddedTokenIds().forEach(id -> game.addEffect( + new GoadTargetEffect().setDuration(Duration.EndOfGame).setTargetPointer(new FixedTarget(id, game)), source + )); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorrorCommander.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorrorCommander.java index 3f71ee7f462..29f49bf67b8 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorrorCommander.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorrorCommander.java @@ -213,6 +213,7 @@ public final class DuskmournHouseOfHorrorCommander extends ExpansionSet { cards.add(new SetCardInfo("Reanimate", 155, Rarity.RARE, mage.cards.r.Reanimate.class)); cards.add(new SetCardInfo("Redress Fate", 9, Rarity.RARE, mage.cards.r.RedressFate.class)); cards.add(new SetCardInfo("Reliquary Tower", 295, Rarity.UNCOMMON, mage.cards.r.ReliquaryTower.class)); + cards.add(new SetCardInfo("Rendmaw, Creaking Nest", 5, Rarity.MYTHIC, mage.cards.r.RendmawCreakingNest.class)); cards.add(new SetCardInfo("Retreat to Coralhelm", 126, Rarity.UNCOMMON, mage.cards.r.RetreatToCoralhelm.class)); cards.add(new SetCardInfo("Return to Dust", 102, Rarity.UNCOMMON, mage.cards.r.ReturnToDust.class)); cards.add(new SetCardInfo("Sakura-Tribe Elder", 194, Rarity.COMMON, mage.cards.s.SakuraTribeElder.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/Black22BirdToken.java b/Mage/src/main/java/mage/game/permanent/token/Black22BirdToken.java new file mode 100644 index 00000000000..d2bcac3187c --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/Black22BirdToken.java @@ -0,0 +1,32 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author PurpleCrowbar + */ +public final class Black22BirdToken extends TokenImpl { + + public Black22BirdToken() { + super("Bird Token", "2/2 black Bird creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add(SubType.BIRD); + power = new MageInt(2); + toughness = new MageInt(2); + + addAbility(FlyingAbility.getInstance()); + } + + private Black22BirdToken(final Black22BirdToken token) { + super(token); + } + + @Override + public Black22BirdToken copy() { + return new Black22BirdToken(this); + } +}