mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Fix GameSimulatorTest and add a testcase I forgot to add before.
This commit is contained in:
@@ -222,11 +222,12 @@ public class GameCopier {
|
||||
}
|
||||
if (c.isFaceDown()) {
|
||||
boolean isCreature = newCard.isCreature();
|
||||
boolean hasManaCost = !newCard.getManaCost().isNoCost();
|
||||
newCard.setState(CardStateName.FaceDown, true);
|
||||
if (c.isManifested()) {
|
||||
newCard.setManifested(true);
|
||||
// TODO: Should be able to copy other abilities...
|
||||
if (isCreature && ! newCard.getManaCost().isNoCost()) {
|
||||
if (isCreature && hasManaCost) {
|
||||
newCard.addSpellAbility(CardFactoryUtil.abilityManifestFaceUp(newCard, newCard.getManaCost()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GameSimulator {
|
||||
eval.getScoreForGameState(origGame, origAiPlayer);
|
||||
// Print debug info.
|
||||
printDiff(origLines, simLines);
|
||||
throw new RuntimeException("Game copy error");
|
||||
throw new RuntimeException("Game copy error. See diff output above for details.");
|
||||
}
|
||||
eval.setDebugging(false);
|
||||
|
||||
|
||||
@@ -391,6 +391,32 @@ public class GameSimulatorTest extends TestCase {
|
||||
assertNull(findSAWithPrefix(manifestedCreatureCopy, "Unmanifest"));
|
||||
}
|
||||
|
||||
public void testManifest3() {
|
||||
Game game = initAndCreateGame();
|
||||
Player p = game.getPlayers().get(1);
|
||||
addCard("Plains", p);
|
||||
addCard("Plains", p);
|
||||
Card soulSummons = addCardToZone("Soul Summons", p, ZoneType.Hand);
|
||||
addCardToZone("Dryad Arbor", p, ZoneType.Library);
|
||||
|
||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
||||
game.getAction().checkStateEffects(true);
|
||||
|
||||
SpellAbility manifestSA = soulSummons.getSpellAbilities().get(0);
|
||||
|
||||
GameSimulator sim = createSimulator(game, p);
|
||||
sim.simulateSpellAbility(manifestSA);
|
||||
Game simGame = sim.getSimulatedGameState();
|
||||
Card manifestedCreature = findCardWithName(simGame, "");
|
||||
assertNotNull(manifestedCreature);
|
||||
assertNull(findSAWithPrefix(manifestedCreature, "Unmanifest"));
|
||||
|
||||
GameCopier copier = new GameCopier(simGame);
|
||||
Game copy = copier.makeCopy();
|
||||
Card manifestedCreatureCopy = findCardWithName(copy, "");
|
||||
assertNull(findSAWithPrefix(manifestedCreatureCopy, "Unmanifest"));
|
||||
}
|
||||
|
||||
public void testTypeOfPermanentChanging() {
|
||||
String sarkhanCardName = "Sarkhan, the Dragonspeaker";
|
||||
Game game = initAndCreateGame();
|
||||
|
||||
Reference in New Issue
Block a user