-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
113 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {type User} from '@scripts/types/hg'; | ||
import {type IntakeMessage} from '@scripts/types/mhct'; | ||
import {type IStager} from '../stages.types'; | ||
|
||
export class LivingGardenStager implements IStager { | ||
readonly environment: string = 'Living Garden'; | ||
|
||
/** | ||
* Read the bucket / vial state to determine the stage for Living & Twisted garden. | ||
*/ | ||
addStage(message: IntakeMessage, userPre: User, userPost: User, journal: unknown): void { | ||
const quest = userPre.quests.QuestLivingGarden; | ||
if (!quest) { | ||
throw new Error('QuestLivingGarden is undefined'); | ||
} | ||
|
||
const container_status = (quest.is_normal) ? quest.minigame.bucket_state : quest.minigame.vials_state; | ||
message.stage = (container_status === "dumped") ? "Pouring" : "Not Pouring"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {type User} from '@scripts/types/hg'; | ||
import {type IntakeMessage} from '@scripts/types/mhct'; | ||
import {type IStager} from '../stages.types'; | ||
|
||
export class TwistedGardenStager implements IStager { | ||
readonly environment: string = 'Twisted Garden'; | ||
|
||
/** | ||
* Read the bucket / vial state to determine the stage for Living & Twisted garden. | ||
*/ | ||
addStage(message: IntakeMessage, userPre: User, userPost: User, journal: unknown): void { | ||
const quest = userPre.quests.QuestLivingGarden; | ||
if (!quest) { | ||
throw new Error('QuestLivingGarden is undefined'); | ||
} | ||
|
||
const container_status = (quest.is_normal) ? quest.minigame.bucket_state : quest.minigame.vials_state; | ||
message.stage = (container_status === "dumped") ? "Pouring" : "Not Pouring"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export type QuestLivingGarden = LivingGardenState | TwistedGardenState | ||
|
||
interface LivingGardenState { | ||
is_normal: true | ||
minigame: { | ||
bucket_state: PourStatus | ||
} | ||
} | ||
|
||
interface TwistedGardenState { | ||
is_normal: false | ||
minigame: { | ||
vials_state: PourStatus | ||
} | ||
} | ||
|
||
type PourStatus = 'filling' | 'dumped'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters