Constructors

Properties

achvUnlocks: AchvUnlocks
dexData: DexData
eggPity: number[]
eggs: Egg[]
gameStats: GameStats
gender: PlayerGender
runHistory: RunHistoryData
secretId: number
starterData: StarterData
trainerId: number
unlockPity: number[]
unlocks: Unlocks
voucherCounts: VoucherCounts
voucherUnlocks: VoucherUnlocks

Methods

  • Adds a candy to the player's game data for a given PokemonSpecies. Will do nothing if the player does not have the Pokemon owned in their system save data.

    Parameters

    Returns void

  • 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>

    Promise with result true if the session was deleted successfully, false otherwise

  • Parameters

    • species: default
    • forSeen: boolean = false
    • optimistic: boolean = false

    Returns bigint

  • 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.

    This method checks if the 'mappingConfigs' entry exists in localStorage. If it does not exist, the method returns false. If 'mappingConfigs' exists, it parses the configurations and injects each configuration into the input controller for the corresponding gamepad or device key. The method then returns true to indicate success.

  • Parameters

    • scene: default
    • skipVerification: boolean = false
    • sync: boolean = false
    • useCachedSession: boolean = false
    • useCachedSystem: boolean = false

    Returns Promise<boolean>

  • Saves a gamepad setting to localStorage.

    Parameters

    • device: Device
    • localStoragePropertyName: string
    • setting: SettingGamepad | SettingKeyboard

      The gamepad setting to save.

    • settingDefaults: any
    • valueIndex: number

      The index of the value to set for the gamepad setting.

    Returns boolean

    true if the setting is successfully saved.

    This method initializes an empty object for gamepad settings if none exist in localStorage. It then updates the setting in the current scene and iterates over the default gamepad settings to update the specified setting with the new value. Finally, it saves the updated settings back to localStorage and returns true to indicate success.

  • 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 boolean

    true if the configurations are successfully saved.

  • Saves a setting to localStorage

    Parameters

    • setting: string

      string ideally of SettingKeys

    • valueIndex: number

      index of the setting's option

    Returns boolean

    true

  • Parameters

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

      Default true. If true, will display message for unlocked egg move

    • prependSpeciesToMessage: boolean = false

      Default false. If true, will change message from "X Egg Move Unlocked!" to "Bulbasaur X Egg Move Unlocked!"

    Returns Promise<boolean>

  • Parameters

    • pokemon: default
    • 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: default
    • incrementCount: boolean = true
    • trainer: boolean = false

    Returns void

  • Parameters

    • pokemon: default
    • species: default
    • 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

  • 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

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