From 53898eeb8b4dc2edd4ca252b33775fedce18df4b Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Wed, 1 May 2024 20:56:07 +0200 Subject: [PATCH] implement [PIP] Screeching Scorchbeast --- .../mage/cards/s/ScreechingScorchbeast.java | 62 +++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 1 + .../single/pip/ScreechingScorchbeastTest.java | 101 ++++++++++++++++++ .../permanent/token/ZombieMutantToken.java | 30 ++++++ 4 files changed, 194 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/ScreechingScorchbeast.java create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/pip/ScreechingScorchbeastTest.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/ZombieMutantToken.java diff --git a/Mage.Sets/src/mage/cards/s/ScreechingScorchbeast.java b/Mage.Sets/src/mage/cards/s/ScreechingScorchbeast.java new file mode 100644 index 00000000000..3f4224cb92f --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/ScreechingScorchbeast.java @@ -0,0 +1,62 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.OneOrMoreMilledTriggeredAbility; +import mage.abilities.dynamicvalue.common.SavedMilledValue; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersPlayersEffect; +import mage.abilities.keyword.FlyingAbility; +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.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.permanent.token.ZombieMutantToken; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class ScreechingScorchbeast extends CardImpl { + + public ScreechingScorchbeast(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + + this.subtype.add(SubType.BAT); + this.subtype.add(SubType.MUTANT); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Menace + this.addAbility(new MenaceAbility()); + + // Whenever Screeching Scorchbeast attacks, each player gets two rad counters. + this.addAbility(new AttacksTriggeredAbility( + new AddCountersPlayersEffect(CounterType.RAD.createInstance(2), TargetController.EACH_PLAYER) + )); + + // Whenever one or more nonland cards are milled, you may create that many 2/2 black Zombie Mutant creature tokens. Do this only once each turn. + this.addAbility(new OneOrMoreMilledTriggeredAbility( + StaticFilters.FILTER_CARDS_NON_LAND, + new CreateTokenEffect(new ZombieMutantToken(), SavedMilledValue.MANY), + true + ).setDoOnlyOnceEachTurn(true)); + } + + private ScreechingScorchbeast(final ScreechingScorchbeast card) { + super(card); + } + + @Override + public ScreechingScorchbeast copy() { + return new ScreechingScorchbeast(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 7fa2bc2b69c..1bbfee71807 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -269,6 +269,7 @@ public final class Fallout extends ExpansionSet { cards.add(new SetCardInfo("Ruthless Radrat", 48, Rarity.UNCOMMON, mage.cards.r.RuthlessRadrat.class)); cards.add(new SetCardInfo("Scattered Groves", 286, Rarity.RARE, mage.cards.s.ScatteredGroves.class)); cards.add(new SetCardInfo("Scavenger Grounds", 287, Rarity.RARE, mage.cards.s.ScavengerGrounds.class)); + cards.add(new SetCardInfo("Screeching Scorchbeast", 49, Rarity.RARE, mage.cards.s.ScreechingScorchbeast.class)); cards.add(new SetCardInfo("Secure the Wastes", 171, Rarity.RARE, mage.cards.s.SecureTheWastes.class)); cards.add(new SetCardInfo("Securitron Squadron", 23, Rarity.RARE, mage.cards.s.SecuritronSquadron.class)); cards.add(new SetCardInfo("Sentry Bot", 24, Rarity.RARE, mage.cards.s.SentryBot.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/pip/ScreechingScorchbeastTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/pip/ScreechingScorchbeastTest.java new file mode 100644 index 00000000000..0f8d16af86c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/pip/ScreechingScorchbeastTest.java @@ -0,0 +1,101 @@ +package org.mage.test.cards.single.pip; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author Susucr + */ +public class ScreechingScorchbeastTest extends CardTestPlayerBase { + + /** + * {@link mage.cards.s.ScreechingScorchbeast Screeching Scorchbeast} {4}{B}{B} + * Creature — Bat Mutant + * Flying, menace + * Whenever Screeching Scorchbeast attacks, each player gets two rad counters. + * Whenever one or more nonland cards are milled, you may create that many 2/2 black Zombie Mutant creature tokens. Do this only once each turn. + * 5/5 + */ + private static final String beast = "Screeching Scorchbeast"; + + @Test + public void test_Trigger_3NonLand_1Land() { + setStrictChooseMode(true); + skipInitShuffling(); + + addCard(Zone.BATTLEFIELD, playerA, beast); + addCard(Zone.BATTLEFIELD, playerA, "Island", 6); + addCard(Zone.BATTLEFIELD, playerA, "Whetstone"); // {3}: Each player mills two cards. + addCard(Zone.LIBRARY, playerA, "Taiga", 3); + addCard(Zone.LIBRARY, playerA, "Baneslayer Angel", 1); + addCard(Zone.LIBRARY, playerB, "Memnite", 4); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}"); + setChoice(playerA, true); // Yes to first trigger. + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}"); + // The second mill does not trigger the Scrochbeast due to "Do this once each turn" + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Taiga", 3); + assertGraveyardCount(playerA, "Baneslayer Angel", 1); + assertGraveyardCount(playerB, "Memnite", 4); + assertPermanentCount(playerA, "Zombie Mutant Token", 3); + } + + @Test + public void test_Trigger_No_ThenYes() { + setStrictChooseMode(true); + skipInitShuffling(); + + addCard(Zone.BATTLEFIELD, playerA, beast); + addCard(Zone.BATTLEFIELD, playerA, "Island", 6); + addCard(Zone.BATTLEFIELD, playerA, "Whetstone"); // : Each player mills two cards. + addCard(Zone.LIBRARY, playerA, "Taiga", 3); + addCard(Zone.LIBRARY, playerA, "Baneslayer Angel", 1); + addCard(Zone.LIBRARY, playerB, "Memnite", 4); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}"); + setChoice(playerA, false); // No to first trigger. 3 nonlands + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}"); + setChoice(playerA, true); // Yes to second trigger. 2 nonlands + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Taiga", 3); + assertGraveyardCount(playerA, "Baneslayer Angel", 1); + assertGraveyardCount(playerB, "Memnite", 4); + assertPermanentCount(playerA, "Zombie Mutant Token", 2); + + } + + @Test + public void test_NoTrigger_AllLands() { + setStrictChooseMode(true); + skipInitShuffling(); + + addCard(Zone.BATTLEFIELD, playerA, beast); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.BATTLEFIELD, playerA, "Whetstone"); // {3}: Each player mills two cards. + addCard(Zone.LIBRARY, playerA, "Taiga", 2); + addCard(Zone.LIBRARY, playerA, "Taiga", 2); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}"); + // no trigger, no choice. + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, 2); + assertGraveyardCount(playerB, 2); + assertPermanentCount(playerA, "Zombie Mutant Token", 0); + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/ZombieMutantToken.java b/Mage/src/main/java/mage/game/permanent/token/ZombieMutantToken.java new file mode 100644 index 00000000000..c6c2cf8c06f --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/ZombieMutantToken.java @@ -0,0 +1,30 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author Susucr + */ +public final class ZombieMutantToken extends TokenImpl { + + public ZombieMutantToken() { + super("Zombie Mutant Token", "2/2 black Zombie Mutant creature token"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add(SubType.ZOMBIE); + subtype.add(SubType.MUTANT); + power = new MageInt(2); + toughness = new MageInt(2); + } + + private ZombieMutantToken(final ZombieMutantToken token) { + super(token); + } + + @Override + public ZombieMutantToken copy() { + return new ZombieMutantToken(this); + } +}