Spelling and phase reset
parent
3ae3f152ad
commit
203cba4a3e
|
@ -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<void> {
|
||||
static async initialLogic(gameState: GameState, gameFlow: GameFlow): Promise<void> {
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue