mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Added option "10x Faster" for AI vs AI
DigEffect uses reveal instead of guidialog.choose
This commit is contained in:
@@ -115,7 +115,7 @@ public class DigEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
boolean hasRevealed = true;
|
boolean hasRevealed = true;
|
||||||
if (sa.hasParam("Reveal")) {
|
if (sa.hasParam("Reveal")) {
|
||||||
GuiChoose.one("Revealing cards from library", top);
|
game.getAction().reveal(top, p);
|
||||||
// Singletons.getModel().getGameAction().revealToCopmuter(top.toArray());
|
// Singletons.getModel().getGameAction().revealToCopmuter(top.toArray());
|
||||||
// - for when it exists
|
// - for when it exists
|
||||||
} else if (sa.hasParam("RevealOptional")) {
|
} else if (sa.hasParam("RevealOptional")) {
|
||||||
|
|||||||
@@ -39,10 +39,12 @@ public class FControlGamePlayback extends IGameEventVisitor.Base<Void> {
|
|||||||
private int combatDelay = 400;
|
private int combatDelay = 400;
|
||||||
private int castDelay = 400;
|
private int castDelay = 400;
|
||||||
private int resolveDelay = 400;
|
private int resolveDelay = 400;
|
||||||
|
|
||||||
|
private boolean fasterPlayback = false;
|
||||||
|
|
||||||
private void pauseForEvent(int delay) {
|
private void pauseForEvent(int delay) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(delay);
|
Thread.sleep(fasterPlayback ? delay / 10 : delay);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// TODO Auto-generated catch block ignores the exception, but sends it to System.err and probably forge.log.
|
// TODO Auto-generated catch block ignores the exception, but sends it to System.err and probably forge.log.
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -179,9 +181,12 @@ public class FControlGamePlayback extends IGameEventVisitor.Base<Void> {
|
|||||||
releaseGameThread();
|
releaseGameThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endGame() {
|
/**
|
||||||
fc.stopGame();
|
* TODO: Write javadoc for this method.
|
||||||
releaseGameThread();
|
* @param isFast
|
||||||
|
*/
|
||||||
|
public void setSpeed(boolean isFast) {
|
||||||
|
fasterPlayback = isFast;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ public class InputPlaybackControl extends InputSyncronizedBase implements InputS
|
|||||||
FControlGamePlayback control;
|
FControlGamePlayback control;
|
||||||
|
|
||||||
private boolean isPaused = false;
|
private boolean isPaused = false;
|
||||||
|
private boolean isFast = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Write javadoc for Constructor.
|
* TODO: Write javadoc for Constructor.
|
||||||
@@ -37,7 +38,7 @@ public class InputPlaybackControl extends InputSyncronizedBase implements InputS
|
|||||||
if ( isPaused )
|
if ( isPaused )
|
||||||
ButtonUtil.setButtonText("Resume", "Step");
|
ButtonUtil.setButtonText("Resume", "Step");
|
||||||
else {
|
else {
|
||||||
ButtonUtil.setButtonText("Pause", "End game");
|
ButtonUtil.setButtonText("Pause", isFast ? "1x Speed" : "10x Faster");
|
||||||
showMessage("Press pause to pause game.");
|
showMessage("Press pause to pause game.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,8 +63,12 @@ public class InputPlaybackControl extends InputSyncronizedBase implements InputS
|
|||||||
protected void onCancel() {
|
protected void onCancel() {
|
||||||
if ( isPaused ) {
|
if ( isPaused ) {
|
||||||
control.singleStep();
|
control.singleStep();
|
||||||
} else
|
} else {
|
||||||
control.endGame();
|
isFast = !isFast;
|
||||||
|
control.setSpeed(isFast);
|
||||||
|
setPause(isPaused); // update message
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user