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

View File

@@ -40,9 +40,11 @@ public class FControlGamePlayback extends IGameEventVisitor.Base<Void> {
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;
} }
} }

View File

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