Added option "10x Faster" for AI vs AI

DigEffect uses reveal instead of guidialog.choose
This commit is contained in:
Maxmtg
2013-06-01 21:58:36 +00:00
parent 60f3b788b4
commit 7fae9ed8b8
3 changed files with 18 additions and 8 deletions

View File

@@ -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")) {

View File

@@ -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;
}
}

View File

@@ -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
}
}
}