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
];
export const DarkDealEncounter: MysteryEncounter = new MysteryEncounterBuilder()
export const DarkDealEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.DARK_DEAL)
.withEncounterTier(MysteryEncounterTier.ROGUE)
.withIntroSpriteConfigs([

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ import { AbilityAttr } from "#app/system/game-data";
import { Stat } from "#app/data/pokemon-stat";
import { pokemonInfo } from "#app/locales/en/pokemon-info";
export const TrainingSessionEncounter: MysteryEncounter = new MysteryEncounterBuilder()
export const TrainingSessionEncounter: MysteryEncounter = MysteryEncounterBuilder
.withEncounterType(MysteryEncounterType.TRAINING_SESSION)
.withEncounterTier(MysteryEncounterTier.ULTRA)
.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
* @returns this
*/
withEncounterType(encounterType: MysteryEncounterType): this & Pick<MysteryEncounter, "encounterType"> {
return Object.assign(this, { encounterType: encounterType });
static withEncounterType(encounterType: MysteryEncounterType): MysteryEncounterBuilder & Pick<MysteryEncounter, "encounterType"> {
return Object.assign(new MysteryEncounterBuilder(), { encounterType: encounterType });
}
/**