PokéRogue
    Preparing search index...
    Index
    • Parameters

      • fromRaw: boolean = false

        (Default false) Whether to skip initialization of fields that are normally randomized on new game start. Used for the admin panel.

      Returns GameData

    achvUnlocks: AchvUnlocks
    appliedMigrators: AppliedMigrators = {}
    defaultDexData: DexData | null
    dexData: DexData
    eggPity: number[]
    eggs: Egg[]
    gameStats: GameStats
    runHistory: RunHistoryData
    secretId: number
    starterData: StarterData
    trainerId: number
    unlockPity: number[]
    unlocks: Unlocks
    voucherCounts: VoucherCounts
    voucherUnlocks: VoucherUnlocks
    • Adds candy to the player's game data for a given PokemonSpecies.

      Parameters

      • speciesId: SpeciesId

        The species ID of the Pokémon to increment candy for

      • numCandiesToAdd: number

        The number of candies to add to the Pokémon

      Returns boolean

      Whether the candy count was incremented

      Will not increase the candy count past MAX_STARTER_CANDY_COUNT.

    • Checks whether a species has a specified ability index unlocked for its starter

      Parameters

      • species: PokemonSpecies

        The species to check

      • abilityIndex: number

        The ability index to check

      Returns boolean

      Whether that starter has that ability index unlocked

    • Parameters

      • dataStr: string
      • shorten: boolean = false

      Returns string

    • Delete the session data at the given slot when overwriting a save file For deleting the session of a finished run, use tryClearSession

      Parameters

      • slotId: number

        The slot to clear

      Returns Promise<boolean>

      A Promise that resolves with whether the session deletion succeeded

    • Obtain the value of a particular starter by SpeciesID

      Parameters

      • speciesId: SpeciesId

        The SpeciesId of the starter

      • OptionalvalueReduction: number

        The applied value reduction; defaults to the value stored in this.starterData[speciesId].valueReduction

      Returns number

      The value/cost of the starter

    • Increase the number of classic ribbons won with this species.

      Parameters

      • species: PokemonSpecies

        The species to increment the ribbon count for

      • forStarter: boolean = false

        If true, will increment the ribbon count for the root species of the given species

      Returns number

      The number of classic wins after incrementing.

    • Parameters

      • systemDataStr: string
      • OptionalcachedSystemDataStr: string

      Returns Promise<boolean>

    • Checks if an Unlockable has been unlocked.

      Parameters

      Returns boolean

      true if the player has unlocked this Unlockable or an override has enabled it

    • Loads the mapping configurations from localStorage and injects them into the input controller.

      Returns boolean

      true if the configurations are successfully loaded and injected; false if no configurations are found in localStorage.

    • Load stored session data and re-initialize the game with its contents.

      Parameters

      • slotIndex: number

        The 0-indexed position of the save slot to load. Values < 0 are considered invalid.

      Returns Promise<boolean>

      A Promise that resolves with whether the session load succeeded (i.e. whether a save in the given slot exists)

    • Discards local save data and re-populates it with data from the server (or the provided data).

      Parameters

      • systemDataStr: { message?: string; systemDataStr?: string } = {}

        (Optional) Save data to load

      Returns Promise<false>

    • Reset the mappings for the given device to its default values.
      If it's a gamepad, only reset the one currently in use.

      Parameters

      Returns boolean

      Whether the operation was successful

    • Save all data related to the current session to localStorage and/or the backend server.

      Parameters

      • skipVerification: boolean = false

        (Default false) Whether to skip verifying user info before saving

      • sync: boolean = false

        (Default false) Whether to sync data to the server

      • useCachedSession: boolean = false

        (Default false) Whether to use cached session data from localStorage instead of generating new session data

      • useCachedSystem: boolean = false

        (Default false) Whether to use cached system data from localStorage instead of generating new system data

      Returns Promise<boolean>

      A Promise that resolves with whether the save operation succeeded.

    • Saves the mapping configurations for a specified device.

      Parameters

      • deviceName: string

        The name of the device for which the configurations are being saved.

      • config: any

        The configuration object containing custom mapping details.

      Returns void

    • Save the specified tutorial as having the specified completion status.

      Parameters

      • tutorial: Tutorial

        The Tutorial whose completion status is being saved

      • status: boolean

        The completion status to set

      Returns void

    • Parameters

      • species: PokemonSpecies
      • eggMoveIndex: number
      • showMessage: boolean = true

        (Default true) Whether to display a message for the unlocked egg move

      • prependSpeciesToMessage: boolean = false

        (Default false) Whether to change the message from "X Egg Move Unlocked!" to "Bulbasaur X Egg Move Unlocked!"

      Returns Promise<boolean>

    • Parameters

      • pokemon: Pokemon
      • incrementCount: boolean = true
      • fromEgg: boolean = false
      • showMessage: boolean = true

      Returns Promise<boolean>

      true if Pokemon catch unlocked a new starter, false if Pokemon catch did not unlock a starter

    • Parameters

      • pokemon: Pokemon
      • incrementCount: boolean = true
      • trainer: boolean = false

      Returns void

    • Parameters

      • pokemon: Pokemon
      • species: PokemonSpecies
      • incrementCount: boolean = true
      • fromEgg: boolean = false
      • showMessage: boolean = true

      Returns Promise<boolean>

      true if Pokemon catch unlocked a new starter, false if Pokemon catch did not unlock a starter

    • Type Parameters

      • const T

      Parameters

      • returnValue: T
      • message: string = ErrorMessages.FAILED_VALIDATION

      Returns Promise<T>

    • Attempt to clear session data after the end of a run After session data is removed, attempt to update user info so the menu updates To delete an unfinished run instead, use deleteSession

      Parameters

      • slotId: number

      Returns Promise<[success: boolean, newClear: boolean]>

    • Used by the admin panel when searching for user accounts.

      Parameters

      • dataStr: string

        The raw JSON string of the SystemSaveData

      Returns GameData

      • A new GameData instance initialized with the parsed SystemSaveData