From 203cba4a3e1e0681fa0f5b0c4dcf177b50a98511 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 26 Apr 2024 01:45:41 -0400 Subject: [PATCH] Spelling and phase reset --- src/game/phases/riders.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game/phases/riders.ts b/src/game/phases/riders.ts index d2e258c..8d887cf 100644 --- a/src/game/phases/riders.ts +++ b/src/game/phases/riders.ts @@ -6,7 +6,7 @@ export class RidersPhase { gameState.lastPrompt = responseMessage; switch (gameState.subPhase) { case 0: // Initial Logic - await RidersPhase.initalLogic(gameState, gameFlow); + await RidersPhase.initialLogic(gameState, gameFlow); break; case 1: // Choice Logic await RidersPhase.choiceLogic(gameState, gameFlow, userInput); @@ -38,6 +38,7 @@ export class RidersPhase { } gameState.lastPrompt = responseMessage; gameState.phase = PHASE_ENUM.EVENT; + gameState.subPhase = 0 await gameState.save(); await gameFlow.executeCurrentPhase(); return; @@ -61,13 +62,14 @@ export class RidersPhase { gameState.totalMileageWholeTrip -= 25 gameState.lastPrompt = responseMessage; gameState.phase = PHASE_ENUM.EVENT; + gameState.subPhase = 0 await gameState.save(); await gameFlow.executeCurrentPhase(); return; } } - static async initalLogic(gameState: GameState, gameFlow: GameFlow): Promise { + static async initialLogic(gameState: GameState, gameFlow: GameFlow): Promise { let responseMessage = ''; gameState.lastPrompt = responseMessage; // Check for random encounter @@ -83,6 +85,7 @@ export class RidersPhase { // If the random factor exceeds the encounter chance, skip to the next phase. if (randomFactor > encounterChance) { gameState.phase = PHASE_ENUM.EVENT; + gameState.subPhase = 0 gameState.save(); return gameFlow.executeCurrentPhase(); }