PokéRogue
    Preparing search index...

    Class ChallengeAbstract

    A challenge object. Exists only to serve as a base class.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    conditions: ChallengeCondition[]
    maxSeverity: number
    maxValue: number
    severity: number
    value: number

    Accessors

    Methods

    • An apply function for FIXED_BATTLE challenges. Derived classes should alter this.

      Parameters

      • _waveIndex: number

        The current wave index

      • _battleConfig: FixedBattleConfig

        The battle config to modify

      Returns boolean

      Whether this function did anything

    • An apply function for FlipStats. Derived classes should alter this.

      Parameters

      • _pokemon: Pokemon

        What Pokémon would learn the move

      • _baseStats: number[]

        What are the stats to flip

      Returns boolean

      Whether this function did anything

    • An apply function for GAME_MODE_MODIFY challenges. Derived classes should alter this.

      Returns boolean

      Whether this function did anything

    • An apply function for AI_LEVEL challenges. Derived classes should alter this.

      Parameters

      • _level: NumberHolder

        The generated level.

      • _levelCap: number

        The current level cap.

      • _isTrainer: boolean

        Whether this is a trainer Pokémon

      • _isBoss: boolean

        Whether this is a non-trainer boss Pokémon

      Returns boolean

      • Whether this function did anything
    • An apply function for MOVE_ACCESS. Derived classes should alter this.

      Parameters

      • _pokemon: Pokemon

        What Pokémon would learn the move

      • _moveSource: MoveSourceType

        What source the Pokémon would get the move from

      • _move: MoveId

        The move in question

      • _level: NumberHolder

        The level threshold for access

      Returns boolean

      Whether this function did anything

    • An apply function for AI_MOVE_SLOTS challenges. Derived classes should alter this.

      Parameters

      • _pokemon: Pokemon

        The Pokémon that is being considered

      • _moveSlots: NumberHolder

        The amount of move slots

      Returns boolean

      Whether this function did anything

    • An apply function for MOVE_WEIGHT. Derived classes should alter this.

      Parameters

      • _pokemon: Pokemon

        What Pokémon would learn the move

      • _moveSource: MoveSourceType

        What source the Pokémon would get the move from

      • _move: MoveId

        The move in question.

      • _weight: NumberHolder

        The base weight of the move

      Returns boolean

      Whether this function did anything

    • An apply function for PARTY_HEAL. Derived classes should alter this.

      Parameters

      Returns boolean

      Whether this function did anything

    • An apply function for PASSIVE_ACCESS challenges. Derived classes should alter this.

      Parameters

      • _pokemon: Pokemon

        The Pokémon to change

      • _hasPassive: BooleanHolder

        Whether it should have its passive

      Returns boolean

      Whether this function did anything

    • An apply function for POKEMON_ADD_TO_PARTY. Derived classes should alter this.

      Parameters

      Returns boolean

      Whether this function did anything

    • An apply function for POKEMON_IN_BATTLE challenges. Derived classes should alter this.

      Parameters

      • _pokemon: Pokemon

        The Pokémon to check the validity of

      • _valid: BooleanHolder

        Holds a boolean that will be set to false if the Pokémon isn't allowed

      Returns boolean

      Whether this function did anything

    • An apply function for PREVENT_REVIVE. Derived classes should alter this.

      Parameters

      • _status: BooleanHolder

        Whether fainting is a permanent status or not

      Returns boolean

      Whether this function did anything

    • An apply function for SHOP. Derived classes should alter this.

      Parameters

      • _status: BooleanHolder

        Whether the shop is or is not available after a wave

      Returns boolean

      Whether this function did anything

    • An apply function for STARTER_COST challenges. Derived classes should alter this.

      Parameters

      • _species: SpeciesId

        The pokémon to change the cost of

      • _cost: NumberHolder

        Holder for the cost of the starter Pokémon

      Returns boolean

      Whether this function did anything.

    • An apply function for STARTER_MODIFY challenges. Derived classes should alter this.

      Parameters

      • _pokemon: Pokemon

        The starter Pokémon to modify.

      Returns boolean

      Whether this function did anything.

    • An apply function for STARTER_POINTS challenges. Derived classes should alter this.

      Parameters

      • _points: NumberHolder

        Holder for amount of starter points the user has to spend

      Returns boolean

      Whether this function did anything

    • An apply function for TYPE_EFFECTIVENESS challenges. Derived classes should alter this.

      Parameters

      • _effectiveness: NumberHolder

        The current effectiveness of the move

      Returns boolean

      Whether this function did anything

    • Adds an unlock condition to this challenge.

      Parameters

      • condition: ChallengeCondition

        The condition to add

      Returns Challenge

      This challenge

    • Decrease the severity of the challenge

      Returns boolean

      Returns true if the value changed

    • Decrease the value of the challenge

      Returns boolean

      Returns true if the value changed

    • Return the description of a challenge's current value.

      Parameters

      • overrideValue: number = ...

        The value to check for; default this.value

      Returns string

      The localised description for the current value.

    • Gets the "difficulty" value of this challenge.

      Returns number

      The difficulty value.

    • Gets the localization key for the challenge

      Returns string

      The i18n key for this challenge as camel case.

    • Gets the minimum difficulty added by this challenge.

      Returns number

      The difficulty value.

    • Return the textual representation of a challenge's current value.

      Parameters

      • overrideValue: number = ...

        The value to check for; default this.value

      Returns string

      The localised text for the current value.

    • Whether to allow choosing this challenge's severity.

      Returns boolean

    • Increase the severity of the challenge

      Returns boolean

      Returns true if the value changed

    • Increase the value of the challenge

      Returns boolean

      Returns true if the value changed

    • Check if an unlockable challenge is unlocked

      Parameters

      Returns boolean

      Whether this challenge is unlocked

    • Clones a challenge, either from another challenge or json. Chainable.

      Parameters

      • _source: any

        The source challenge or json.

      Returns Challenge

      This challenge.