Only reset timers for rounds after combat ends, and not when changing maps.

* Previously, if you started conversation, entered some other activity or dialog, the round timers were reset each time, making the rounds less likely to happen.
This commit is contained in:
Oskar Wiksten
2013-07-13 11:35:03 +02:00
parent f9902799f9
commit 11c154f5df
5 changed files with 11 additions and 12 deletions

View File

@@ -45,16 +45,9 @@ public final class Dialogs {
context.gameRoundController.resume();
}
});
//setBlurrywindow(d);
d.show();
}
/*
private static void setBlurrywindow(Dialog d) {
d.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}
*/
public static void showKeyArea(final MainActivity currentActivity, final ControllerContext context, String phraseID) {
showConversation(currentActivity, context, phraseID, null);
}

View File

@@ -59,6 +59,7 @@ public final class CombatController implements VisualEffectCompletedCallback {
currentActiveMonster = null;
world.model.uiSelections.selectedPosition = null;
world.model.uiSelections.selectedMonster = null;
controllers.gameRoundController.resetRoundTimers();
if (pickupLootBags && totalExpThisFight > 0) {
controllers.itemController.lootMonsterBags(killedMonsterBags, totalExpThisFight);
} else {

View File

@@ -27,7 +27,7 @@ public final class GameRoundController implements TimedMessageTask.Callback {
if (world.model.uiSelections.isInCombat) return false;
onNewTick();
--ticksUntilNextRound;
if (ticksUntilNextRound <= 0) {
onNewRound();
@@ -42,13 +42,16 @@ public final class GameRoundController implements TimedMessageTask.Callback {
return true;
}
public void resume() {
world.model.uiSelections.isMainActivityVisible = true;
public void resetRoundTimers() {
restartWaitForNextRound();
restartWaitForNextFullRound();
}
public void resume() {
world.model.uiSelections.isMainActivityVisible = true;
roundTimer.start();
}
}
private void restartWaitForNextFullRound() {
ticksUntilNextFullRound = Constants.TICKS_PER_FULLROUND;

View File

@@ -89,6 +89,7 @@ public final class MapController {
m.resetTemporaryData();
}
controllers.monsterSpawnController.spawnAll(world.model.currentMap, world.model.currentTileMap);
controllers.gameRoundController.resetRoundTimers();
}
public void rest(MapObject area) {

View File

@@ -129,6 +129,7 @@ public final class Savegames {
controllers.actorStatsController.recalculatePlayerStats(world.model.player);
controllers.mapController.resetMapsNotRecentlyVisited();
controllers.movementController.prepareMapAsCurrentMap(world.model.currentMap, res, false);
controllers.gameRoundController.resetRoundTimers();
}
public static FileHeader quickload(Context androidContext, int slot) {