- Setup Game State now supports changing the current phase via the ActivePhase option (valid values are Untap, Upkeep, Draw, Main1, Declare Attackers, Declare Blockers, Main2, End of Turn, Cleanup).

This commit is contained in:
jendave
2011-08-07 01:03:25 +00:00
parent ebd2e785ec
commit 00f0702715
2 changed files with 16 additions and 1 deletions

View File

@@ -941,6 +941,7 @@ public class GuiDisplayUtil implements NewConstants {
String t_humanSetupLibrary = "NONE";
String t_computerSetupLibrary = "NONE";
String t_changePlayer = "NONE";
String t_changePhase = "NONE";
String wd = ".";
JFileChooser fc = new JFileChooser(wd);
@@ -988,6 +989,8 @@ public class GuiDisplayUtil implements NewConstants {
t_computerSetupLibrary = categoryValue;
else if (categoryName.toLowerCase().equals("activeplayer"))
t_changePlayer = categoryValue;
else if (categoryName.toLowerCase().equals("activephase"))
t_changePhase = categoryValue;
}
in.close();
@@ -1027,6 +1030,11 @@ public class GuiDisplayUtil implements NewConstants {
AllZone.Phase.updateObservers();
}
if (!t_changePhase.trim().toLowerCase().equals("none")) {
AllZone.Phase.setDevPhaseState(t_changePhase);
AllZone.Phase.updateObservers();
}
if (!t_humanSetupCardsInPlay.trim().toLowerCase().equals("none")) {
for (int i = 0; i < humanSetupCardsInPlay.length; i ++) {
Card c = AllZone.CardFactory.getCard(humanSetupCardsInPlay[i].trim(), AllZone.HumanPlayer);
@@ -1173,7 +1181,7 @@ public class GuiDisplayUtil implements NewConstants {
if(computerDevLibrarySetup.size() > 0)
AllZone.Computer_Library.setCards(computerDevLibrarySetup.toArray());
AllZone.GameAction.checkStateEffects();
AllZone.GameAction.checkStateEffects();
}
}

View File

@@ -610,4 +610,11 @@ public class Phase extends MyObservable
public static int getGameBegins() {
return GameBegins;
}
// this is a hack for the setup game state mode, do not use outside of devSetupGameState code
// as it avoids calling any of the phase effects that may be necessary in a less enforced context
public void setDevPhaseState(String phaseID)
{
this.phaseIndex = findIndex(phaseID);
}
}