mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- 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:
@@ -941,6 +941,7 @@ public class GuiDisplayUtil implements NewConstants {
|
|||||||
String t_humanSetupLibrary = "NONE";
|
String t_humanSetupLibrary = "NONE";
|
||||||
String t_computerSetupLibrary = "NONE";
|
String t_computerSetupLibrary = "NONE";
|
||||||
String t_changePlayer = "NONE";
|
String t_changePlayer = "NONE";
|
||||||
|
String t_changePhase = "NONE";
|
||||||
|
|
||||||
String wd = ".";
|
String wd = ".";
|
||||||
JFileChooser fc = new JFileChooser(wd);
|
JFileChooser fc = new JFileChooser(wd);
|
||||||
@@ -988,6 +989,8 @@ public class GuiDisplayUtil implements NewConstants {
|
|||||||
t_computerSetupLibrary = categoryValue;
|
t_computerSetupLibrary = categoryValue;
|
||||||
else if (categoryName.toLowerCase().equals("activeplayer"))
|
else if (categoryName.toLowerCase().equals("activeplayer"))
|
||||||
t_changePlayer = categoryValue;
|
t_changePlayer = categoryValue;
|
||||||
|
else if (categoryName.toLowerCase().equals("activephase"))
|
||||||
|
t_changePhase = categoryValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
in.close();
|
in.close();
|
||||||
@@ -1027,6 +1030,11 @@ public class GuiDisplayUtil implements NewConstants {
|
|||||||
AllZone.Phase.updateObservers();
|
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")) {
|
if (!t_humanSetupCardsInPlay.trim().toLowerCase().equals("none")) {
|
||||||
for (int i = 0; i < humanSetupCardsInPlay.length; i ++) {
|
for (int i = 0; i < humanSetupCardsInPlay.length; i ++) {
|
||||||
Card c = AllZone.CardFactory.getCard(humanSetupCardsInPlay[i].trim(), AllZone.HumanPlayer);
|
Card c = AllZone.CardFactory.getCard(humanSetupCardsInPlay[i].trim(), AllZone.HumanPlayer);
|
||||||
@@ -1173,7 +1181,7 @@ public class GuiDisplayUtil implements NewConstants {
|
|||||||
if(computerDevLibrarySetup.size() > 0)
|
if(computerDevLibrarySetup.size() > 0)
|
||||||
AllZone.Computer_Library.setCards(computerDevLibrarySetup.toArray());
|
AllZone.Computer_Library.setCards(computerDevLibrarySetup.toArray());
|
||||||
|
|
||||||
AllZone.GameAction.checkStateEffects();
|
AllZone.GameAction.checkStateEffects();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -610,4 +610,11 @@ public class Phase extends MyObservable
|
|||||||
public static int getGameBegins() {
|
public static int getGameBegins() {
|
||||||
return GameBegins;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user