summaryrefslogtreecommitdiff
path: root/resources/js/game.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/game.js')
-rw-r--r--resources/js/game.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/resources/js/game.js b/resources/js/game.js
index 3ce2aed..0841729 100644
--- a/resources/js/game.js
+++ b/resources/js/game.js
@@ -25,6 +25,7 @@ const Game = {
isLoadingArea: false,
isProgressingTurn: false,
playerIsChoosingNextMonster: false,
+ isStoryBattle: false,
doBattleAnimation: true,
opponentActionTimeout: null,
didTechniqueHit: false,
@@ -120,9 +121,13 @@ const Game = {
Memory.state.currentArea.monsterProgress = 0;
if (Memory.state.currentArea.encounters.length > 0) {
await Game.encounterWildMonster();
- } else {
+ } else if (Memory.state.currentArea.trainers.length > 0) {
await Game.encounterTrainer();
+ } else {
+ UI.showMap();
}
+
+ Game.isStoryBattle = false;
} else {
await Game.encounterNextTrainerMonster();
}
@@ -146,6 +151,7 @@ const Game = {
// whole party defeated
if (!Memory.state.player.monsters.some((monster) => monster.hp > 0)) {
Memory.state.Game.isInBattle = false;
+ Game.isStoryBattle = false;
if (Memory.state.currentArea.monsterProgress < Memory.state.currentArea.requiredEncounters) {
Memory.state.currentArea.monsterProgress = 0;
@@ -1012,6 +1018,8 @@ const Game = {
/**
* @param {Area} area
+ *
+ * @returns {boolean}
*/
isTown (area) {
return area.encounters.length === 0 && area.trainers.length === 0;