From 9a26221048184d9bc63bb6b4a83b7157c41b9333 Mon Sep 17 00:00:00 2001 From: jmlundeen Date: Sat, 6 Dec 2025 08:19:46 -0600 Subject: [PATCH] fix TDFC not loading as commander --- .../test/commander/CommanderTypeTest.java | 76 +++++++++++++++++++ .../java/mage/game/command/Commander.java | 1 + 2 files changed, 77 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/commander/CommanderTypeTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/CommanderTypeTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/CommanderTypeTest.java new file mode 100644 index 00000000000..607324085ae --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/commander/CommanderTypeTest.java @@ -0,0 +1,76 @@ +package org.mage.test.commander; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestCommander4Players; + +public class CommanderTypeTest extends CardTestCommander4Players { + + /* + Sephiroth, Fabled SOLDIER + {2}{B} + Legendary Creature - Human Avatar Soldier + Whenever Sephiroth enters or attacks, you may sacrifice another creature. If you do, draw a card. + Whenever another creature dies, target opponent loses 1 life and you gain 1 life. If this is the fourth time this ability has resolved this turn, transform Sephiroth. + 3/3 + */ + private static final String sephirothFabledSOLDIER = "Sephiroth, Fabled SOLDIER"; + + /* + Sephiroth, One-Winged Angel + Legendary Creature - Angel Nightmare Avatar + Flying + Super Nova -- As this creature transforms into Sephiroth, One-Winged Angel, you get an emblem with "Whenever a creature dies, target opponent loses 1 life and you gain 1 life." + Whenever Sephiroth attacks, you may sacrifice any number of other creatures. If you do, draw that many cards. + 5/5 + */ + private static final String sephirothOneWingedAngel = "Sephiroth, One-Winged Angel"; + + /* + Grizzly Bears + {1}{G} + Creature - Bear + + 2/2 + */ + private static final String grizzlyBears = "Grizzly Bears"; + + @Test + public void testCommanderTypeTransform() { + addCustomEffect_TargetDestroy(playerA); + addCard(Zone.COMMAND, playerA, sephirothFabledSOLDIER); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 8); + addCard(Zone.BATTLEFIELD, playerA, grizzlyBears, 5); + + // Cast commander + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, sephirothFabledSOLDIER); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + setChoice(playerA, "Yes"); // Sacrifice another creature to draw a card + setChoice(playerA, grizzlyBears); + + // Trigger death of another creature 5 times to transform + addTarget(playerA, playerB, 6); + for (int i = 0; i < 4; i++) { + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "target destroy", grizzlyBears); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + } + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "target destroy", sephirothOneWingedAngel); + setChoice(playerA, "Yes"); // move to command zone + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + + // re-cast commander + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, sephirothFabledSOLDIER); + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerB, 20 - 6); + assertLife(playerA, 20 + 6); + assertPermanentCount(playerA, sephirothFabledSOLDIER, 1); + assertGraveyardCount(playerA, grizzlyBears, 5); + assertEmblemCount(playerA, 1); // Emblem from second side + } +} diff --git a/Mage/src/main/java/mage/game/command/Commander.java b/Mage/src/main/java/mage/game/command/Commander.java index 7ff69e6101d..24f01ee4f2c 100644 --- a/Mage/src/main/java/mage/game/command/Commander.java +++ b/Mage/src/main/java/mage/game/command/Commander.java @@ -52,6 +52,7 @@ public class Commander extends CommandObjectImpl { case MODAL: case MODAL_LEFT: case MODAL_RIGHT: + case TRANSFORMED_LEFT: case ADVENTURE_SPELL: // can be used from command zone if (canUseAbilityFromCommandZone(spellAbility)) {