diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-08-30 21:35:28 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-08-30 21:35:28 +0200 |
commit | 5214cdfbf26bc0bdee5d669a237fb8aefffb78d5 (patch) | |
tree | 7bec19278a0cf8fc1772e8eb6d985391d402c614 /resources/js/game.js | |
parent | 5e2e6753966c19616822915c14795bf62b589f68 (diff) |
story!
Diffstat (limited to 'resources/js/game.js')
-rw-r--r-- | resources/js/game.js | 10 |
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; |