diff --git a/src/game/gameFlow.ts b/src/game/gameFlow.ts index 9f31f14..bbc2a7d 100644 --- a/src/game/gameFlow.ts +++ b/src/game/gameFlow.ts @@ -15,9 +15,9 @@ class GameFlow { // Handle the setup phase, e.g., initial purchases await this.handleSetupPhase(userInput); break; - case PHASE_ENUM.RIDERS_ATTACK: - // Handle a riders attack phase - await this.handleRidersAttack(userInput); + case PHASE_ENUM.START_TURN: + break; + case PHASE_ENUM.ACTION_CHOICE: break; case PHASE_ENUM.TRAVEL: // Handle travel logic @@ -31,9 +31,11 @@ class GameFlow { // Handle hunting logic await this.handleHunt(); break; - case PHASE_ENUM.ENCOUNTER: - // Handle encounters, which might include interactions with NPCs or obstacles - await this.handleEncounter(); + case PHASE_ENUM.EATING: + break; + case PHASE_ENUM.RIDERS_ATTACK: + // Handle a riders attack phase + await this.handleRidersAttack(userInput); break; case PHASE_ENUM.EVENT: // Handle random events that can occur @@ -76,9 +78,10 @@ class GameFlow { supplies: this.gameState.amountSpentOnMiscellaneousSupplies.toString(), }; - const parsedMessage = `${MessageService.getRandomMessage(MessageFileName.Oregon_Template, placeholders)}` + console.log(JSON.stringify(placeholders, null, 4)) + //const parsedMessage = `${MessageService.getRandomMessage(MessageFileName.Oregon_Template, placeholders)}` - await CommentPoster.postComment(`c_${this.gameState.comment.id}`, parsedMessage) + //await CommentPoster.postComment(`c_${this.gameState.comment.id}`, parsedMessage) } @@ -250,8 +253,13 @@ class GameFlow { } } break; - default: + case 6: //Advance Phase + this.gameState.phase = PHASE_ENUM.START_TURN + this.executeCurrentPhase() + break; + default: + responseMessage = `@J something went wrong come and fix it.\n\n ${JSON.stringify(this.gameState, null, 4)}` break; } diff --git a/src/game/gameState.ts b/src/game/gameState.ts index 3e052f1..93bcfce 100644 --- a/src/game/gameState.ts +++ b/src/game/gameState.ts @@ -92,12 +92,14 @@ export default GameState // Enumeration for different phases of the game. export enum PHASE_ENUM { SETUP = 'SETUP', + START_TURN = 'START_TURN', + ACTION_CHOICE = 'ACTION_CHOICE', TRAVEL = 'TRAVEL', FORT = 'FORT', HUNT = 'HUNT', - ENCOUNTER = 'ENCOUNTER', + EATING = 'EATING', + RIDERS_ATTACK = 'RIDERS_ATTACK', EVENT = 'EVENT', MOUNTAIN = 'MOUNTAIN', DEATH_CHECK = 'DEATH_CHECK', - RIDERS_ATTACK = 'RIDERS_ATTACK', } \ No newline at end of file