make MysteryEncounterBuilder.withEncounterType() static

This commit is contained in:
Felix Staud 2024-07-09 22:21:43 -07:00 committed by ImperialSympathizer
parent 1e39a89af5
commit 5a5806185f
9 changed files with 11 additions and 11 deletions

View File

@ -67,7 +67,7 @@ const excludedBosses = [
Species.PECHARUNT Species.PECHARUNT
]; ];
export const DarkDealEncounter: MysteryEncounter = new MysteryEncounterBuilder() export const DarkDealEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.DARK_DEAL) .withEncounterType(MysteryEncounterType.DARK_DEAL)
.withEncounterTier(MysteryEncounterTier.ROGUE) .withEncounterTier(MysteryEncounterTier.ROGUE)
.withIntroSpriteConfigs([ .withIntroSpriteConfigs([

View File

@ -11,7 +11,7 @@ import { modifierTypes } from "#app/modifier/modifier-type";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { randSeedInt } from "#app/utils"; import { randSeedInt } from "#app/utils";
export const DepartmentStoreSaleEncounter: MysteryEncounter = new MysteryEncounterBuilder() export const DepartmentStoreSaleEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.DEPARTMENT_STORE_SALE) .withEncounterType(MysteryEncounterType.DEPARTMENT_STORE_SALE)
.withEncounterTier(MysteryEncounterTier.COMMON) .withEncounterTier(MysteryEncounterTier.COMMON)
.withIntroSpriteConfigs([ .withIntroSpriteConfigs([

View File

@ -36,7 +36,7 @@ const validMovesForSteal = [
Moves.GIGA_DRAIN Moves.GIGA_DRAIN
]; ];
export const FightOrFlightEncounter: MysteryEncounter = new MysteryEncounterBuilder() export const FightOrFlightEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.FIGHT_OR_FLIGHT) .withEncounterType(MysteryEncounterType.FIGHT_OR_FLIGHT)
.withEncounterTier(MysteryEncounterTier.COMMON) .withEncounterTier(MysteryEncounterTier.COMMON)
.withIntroSpriteConfigs([]) // Set in onInit() .withIntroSpriteConfigs([]) // Set in onInit()

View File

@ -15,7 +15,7 @@ import {
import * as Utils from "../../../utils"; import * as Utils from "../../../utils";
import { PartyMemberStrength } from "#enums/party-member-strength"; import { PartyMemberStrength } from "#enums/party-member-strength";
export const MysteriousChallengersEncounter: MysteryEncounter = new MysteryEncounterBuilder() export const MysteriousChallengersEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.MYSTERIOUS_CHALLENGERS) .withEncounterType(MysteryEncounterType.MYSTERIOUS_CHALLENGERS)
.withEncounterTier(MysteryEncounterTier.GREAT) .withEncounterTier(MysteryEncounterTier.GREAT)
.withIntroSpriteConfigs([]) // These are set in onInit() .withIntroSpriteConfigs([]) // These are set in onInit()

View File

@ -15,7 +15,7 @@ import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
import { GameOverPhase } from "#app/phases"; import { GameOverPhase } from "#app/phases";
import { randSeedInt } from "#app/utils"; import { randSeedInt } from "#app/utils";
export const MysteriousChestEncounter: MysteryEncounter = new MysteryEncounterBuilder() export const MysteriousChestEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.MYSTERIOUS_CHEST) .withEncounterType(MysteryEncounterType.MYSTERIOUS_CHEST)
.withEncounterTier(MysteryEncounterTier.COMMON) .withEncounterTier(MysteryEncounterTier.COMMON)
.withIntroSpriteConfigs([ .withIntroSpriteConfigs([

View File

@ -22,7 +22,7 @@ import { randSeedInt } from "#app/utils";
import Pokemon, { PlayerPokemon } from "#app/field/pokemon"; import Pokemon, { PlayerPokemon } from "#app/field/pokemon";
import { StatusEffect } from "#app/data/status-effect"; import { StatusEffect } from "#app/data/status-effect";
export const ShadyVitaminDealerEncounter: MysteryEncounter = new MysteryEncounterBuilder() export const ShadyVitaminDealerEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.SHADY_VITAMIN_DEALER) .withEncounterType(MysteryEncounterType.SHADY_VITAMIN_DEALER)
.withEncounterTier(MysteryEncounterTier.COMMON) .withEncounterTier(MysteryEncounterTier.COMMON)
.withIntroSpriteConfigs([ .withIntroSpriteConfigs([

View File

@ -21,7 +21,7 @@ import { Status, StatusEffect } from "../../status-effect";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { BerryType } from "#enums/berry-type"; import { BerryType } from "#enums/berry-type";
export const SleepingSnorlaxEncounter: MysteryEncounter = new MysteryEncounterBuilder() export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.SLEEPING_SNORLAX) .withEncounterType(MysteryEncounterType.SLEEPING_SNORLAX)
.withEncounterTier(MysteryEncounterTier.ULTRA) .withEncounterTier(MysteryEncounterTier.ULTRA)
.withIntroSpriteConfigs([ .withIntroSpriteConfigs([

View File

@ -24,7 +24,7 @@ import { AbilityAttr } from "#app/system/game-data";
import { Stat } from "#app/data/pokemon-stat"; import { Stat } from "#app/data/pokemon-stat";
import { pokemonInfo } from "#app/locales/en/pokemon-info"; import { pokemonInfo } from "#app/locales/en/pokemon-info";
export const TrainingSessionEncounter: MysteryEncounter = new MysteryEncounterBuilder() export const TrainingSessionEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.TRAINING_SESSION) .withEncounterType(MysteryEncounterType.TRAINING_SESSION)
.withEncounterTier(MysteryEncounterTier.ULTRA) .withEncounterTier(MysteryEncounterTier.ULTRA)
.withIntroSpriteConfigs([ .withIntroSpriteConfigs([

View File

@ -360,12 +360,12 @@ export class MysteryEncounterBuilder implements Partial<MysteryEncounter> {
*/ */
/** /**
* Defines the type of encounter which is used as an identifier, should be tied to a unique MysteryEncounterType * @statif Defines the type of encounter which is used as an identifier, should be tied to a unique MysteryEncounterType
* @param encounterType * @param encounterType
* @returns this * @returns this
*/ */
withEncounterType(encounterType: MysteryEncounterType): this & Pick<MysteryEncounter, "encounterType"> { static withEncounterType(encounterType: MysteryEncounterType): MysteryEncounterBuilder & Pick<MysteryEncounter, "encounterType"> {
return Object.assign(this, { encounterType: encounterType }); return Object.assign(new MysteryEncounterBuilder(), { encounterType: encounterType });
} }
/** /**