diff options
Diffstat (limited to 'resources/js/game.js')
-rw-r--r-- | resources/js/game.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/resources/js/game.js b/resources/js/game.js index c2b20da..61e2211 100644 --- a/resources/js/game.js +++ b/resources/js/game.js @@ -27,6 +27,7 @@ const Game = { playerIsChoosingNextMonster: false, isStoryBattle: false, didWinStoryBattle: true, + didJustLoseBattle: false, doBattleAnimation: true, opponentActionTimeout: null, didTechniqueHit: false, @@ -183,6 +184,7 @@ const Game = { // whole party defeated if (!Memory.state.player.monsters.some((monster) => monster.hp > 0)) { Memory.state.Game.isInBattle = false; + Game.didJustLoseBattle = true; Game.didWinStoryBattle = false; Game.isStoryBattle = false; @@ -220,6 +222,8 @@ const Game = { UI.openPlayerDefeatedMonsterSelection(monsterSelectionNode); } } + + Game.didJustLoseBattle = false; }, /** @@ -816,7 +820,7 @@ const Game = { // on leave let onLeaveStoryIsDone = true; - if (Memory.state.currentArea.events?.onLeave?.length > 0) { + if (Memory.state.currentArea.events?.onLeave?.length > 0 && !Game.didJustLoseBattle) { Game.isLoadingArea = false; for (const event of Memory.state.currentArea.events.onLeave) { |