Allow Penalized Looping choices to fort and to hunt. Utilized setup phase 2 + for penalized fort shopping.

master
j 2024-04-17 00:49:19 -04:00
parent 4982d2c80a
commit 46cfe43c75
1 changed files with 15 additions and 16 deletions

View File

@ -29,7 +29,7 @@ class GameFlow {
break;
case PHASE_ENUM.FORT:
// Handle interactions at the fort
await this.handleFort();
await this.handleSetupPhase(userInput);
break;
case PHASE_ENUM.HUNT:
// Handle hunting logic
@ -258,7 +258,7 @@ class GameFlow {
case 6:
//Advance Phase
this.gameState.subPhase = 0;
this.gameState.phase = PHASE_ENUM.START_TURN
this.gameState.phase === PHASE_ENUM.SETUP ? this.gameState.phase = PHASE_ENUM.START_TURN : this.gameState.phase = PHASE_ENUM.ACTION_CHOICE;
await this.gameState.save()
this.executeCurrentPhase()
break;
@ -325,23 +325,24 @@ class GameFlow {
errorMessage: `⚠️ You do not have enough money to purchase ${amount} units of ${itemType}. You have $${this.gameState.cashLeftAfterInitialPurchases} remaining.`
};
}
let modifier: number
this.gameState.phase !== PHASE_ENUM.FORT ? modifier = 1 : modifier = 2 / 3;
// Update gameState based on itemType
switch (itemType) {
case PurchaseOption.OXEN:
this.gameState.amountSpentOnAnimals += totalCost;
this.gameState.amountSpentOnAnimals += totalCost * modifier;
break;
case PurchaseOption.FOOD:
this.gameState.amountSpentOnFood += totalCost;
this.gameState.amountSpentOnFood += totalCost * modifier;
break;
case PurchaseOption.AMMO:
this.gameState.amountSpentOnAmmunition += totalCost * 50;
this.gameState.amountSpentOnAmmunition += totalCost * 50 * modifier;
break;
case PurchaseOption.CLOTHING:
this.gameState.amountSpentOnClothing += totalCost;
this.gameState.amountSpentOnClothing += totalCost * modifier;
break;
case PurchaseOption.MISC:
this.gameState.amountSpentOnMiscellaneousSupplies += totalCost;
this.gameState.amountSpentOnMiscellaneousSupplies += totalCost * modifier;
break;
// Add cases for other item types
}
@ -415,6 +416,8 @@ class GameFlow {
break;
case "3": // Stop at the Next Fort (if applicable)
if (this.gameState.fortOptionFlag) {
this.gameState.subPhase = 2
this.gameState.totalMileageWholeTrip -= 45;
this.gameState.phase = PHASE_ENUM.FORT;
await this.gameState.save()
this.executeCurrentPhase()
@ -457,19 +460,15 @@ class GameFlow {
return;
}
private async handleTravel(): Promise<void> {
// Logic for handling the travel phase
}
private async handleRidersAttack(userInput?: string | number): Promise<void> {
// Logic for handling a riders attack, may involve checking userInput for response to attack
}
private async handleTravel(): Promise<void> {
// Logic for handling the travel phase
}
private async handleFort(): Promise<void> {
// Logic for interacting at the fort, such as purchasing supplies
}
private async handleHunt(userInput?: string | number): Promise<void> {
// Logic for the hunt phase, determining success based on gameState attributes
@ -493,7 +492,7 @@ class GameFlow {
responseMessage += `Better luck next time! Maybe practice your aim some more.\n\n`
this.gameState.amountSpentOnAmmunition -= 50
}
this.gameState.phase = PHASE_ENUM.TRAVEL;
this.gameState.phase = PHASE_ENUM.ACTION_CHOICE;
await this.gameState.save();
await this.executeCurrentPhase();
return;