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