mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
MagicStack: fix fizzle removing too much Targets (#4873)
* MagicStack: fix fizzle removing too much Targets * Fix Dead Ringers * Clean up useless check
This commit is contained in:
@@ -2506,4 +2506,34 @@ public class GameSimulationTest extends SimulationTest {
|
||||
AssertJUnit.assertTrue(transformedHeliodToken.isTransformed());
|
||||
AssertJUnit.assertTrue(transformedHeliodToken.isBackSide());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicSpellFizzling() {
|
||||
Game game = initAndCreateGame();
|
||||
Player p = game.getPlayers().get(0);
|
||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
||||
|
||||
addCardToZone("Swamp", p, ZoneType.Library);
|
||||
Card bear = addCard("Bear Cub", p);
|
||||
|
||||
addCards("Swamp", 5, p);
|
||||
Card destroy = addCardToZone("Annihilate", p, ZoneType.Hand);
|
||||
SpellAbility destroySA = destroy.getFirstSpellAbility();
|
||||
destroySA.getTargets().add(bear);
|
||||
|
||||
addCards("Island", 2, p);
|
||||
Card fizzle = addCardToZone("Mage's Guile", p, ZoneType.Hand);
|
||||
SpellAbility fizzleSA = fizzle.getFirstSpellAbility();
|
||||
fizzleSA.getTargets().add(bear);
|
||||
|
||||
GameSimulator sim = createSimulator(game, p);
|
||||
game = sim.getSimulatedGameState();
|
||||
|
||||
sim.simulateSpellAbility(destroySA, false);
|
||||
AssertJUnit.assertEquals(1, game.getStackZone().size());
|
||||
sim.simulateSpellAbility(fizzleSA);
|
||||
|
||||
// spell should fizzle so no card was drawn
|
||||
AssertJUnit.assertEquals(0, game.getPlayers().get(0).getCardsIn(ZoneType.Hand).size());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user