Skip to content

Commit

Permalink
Merge pull request #507 from m-h-c-t/stage-frostking
Browse files Browse the repository at this point in the history
added frost king stager and exemption
  • Loading branch information
AardWolf authored Dec 17, 2023
2 parents 021664d + 79ab4c8 commit 5bb4f33
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
33 changes: 33 additions & 0 deletions src/scripts/hunt-filter/exemptions/environments/iceFortress.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type {IMessageExemption} from "@scripts/hunt-filter/interfaces";
import type {IntakeMessage} from "@scripts/types/mhct";

class IceFortressExemption implements IMessageExemption {
readonly description = "Frost King transitions in Ice Fortress";
readonly property = "stage";
getExemptions(
pre: IntakeMessage,
post: IntakeMessage
): (keyof IntakeMessage)[] | null {
if (
pre.stage === "Barrier Down" &&
post.stage === "Barrier Up" &&
pre.mouse === "Frost King"
) {
return ["stage"];
}
else if (
pre.stage === "Barrier Up" &&
post.stage === "Barrier Down"
) {
// Possibly we could check things like what the old barrier level was but this should be fine
// This is the hunt that led to the destruction of the barrier
return ["stage"];
}

return null;
}
}

export const iceFortressExemptions = [
new IceFortressExemption(),
];
2 changes: 2 additions & 0 deletions src/scripts/hunt-filter/exemptions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {bountifulBeanstalkExemptions} from './environments/bountifulBeanstalk';
import {clawShotCityExemptions} from './environments/clawShotCity';
import {floatingIslandsExemptions} from './environments/floatingIslands';
import {icebergExemptions} from './environments/iceberg';
import {iceFortressExemptions} from './environments/iceFortress';
import {superBrieFactoryExemptions} from './environments/superBrieFactory';
import {valourRiftExemptions} from './environments/valourRift';

Expand All @@ -13,6 +14,7 @@ export const MessageExemptions: IMessageExemption[] = [
...bountifulBeanstalkExemptions,
...clawShotCityExemptions,
...icebergExemptions,
...iceFortressExemptions,
...floatingIslandsExemptions,
...superBrieFactoryExemptions,
...valourRiftExemptions,
Expand Down
6 changes: 4 additions & 2 deletions src/scripts/modules/stages/environments/iceFortress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {type User} from '@scripts/types/hg';
import {type IntakeMessage} from '@scripts/types/mhct';

export class IceFortressStager implements IStager {
readonly environment: string = 'Ice Fortress';
readonly environment: string = "Ice Fortress";

addStage(message: IntakeMessage, userPre: User, userPost: User, journal: unknown): void {
const quest: QuestIceFortress | undefined = userPre.quests.QuestIceFortress;
Expand All @@ -15,7 +15,9 @@ export class IceFortressStager implements IStager {

if (quest.shield.is_broken) {
// Not adding stages of of right now b/c transition rejection
// message.stage = "Boss";
message.stage = "Shield Down";
} else {
message.stage = "Shield Up";
}
}
}

0 comments on commit 5bb4f33

Please sign in to comment.