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

Hierarchy (view full)

Constructors

Properties

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

Methods

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

    Parameters

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    • level: IntegerHolder

      Utils.IntegerHolder The generated level.

    • levelCap: number

      Number The current level cap.

    • isTrainer: boolean

      Boolean Whether this is a trainer pokemon.

    • isBoss: boolean

      Boolean Whether this is a non-trainer boss pokemon.

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    • pokemon: default

      PokemonSpecies The pokemon to check the validity of.

    • valid: BooleanHolder

      Utils.BooleanHolder A BooleanHolder, the value gets set to false if the pokemon isn't allowed.

    • dexAttr: DexAttrProps

      DexAttrProps The dex attributes of the pokemon.

    • soft: boolean = false

      boolean If true, allow it if it could become a valid pokemon.

    • OptionalcheckEvolutions: boolean

      boolean If true, check the pokemon's future evolutions

    • OptionalcheckForms: boolean

      boolean If true, check the pokemon's alternative forms

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    Returns boolean

    boolean Whether this function did anything.

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

    Parameters

    Returns boolean

    boolean Whether this function did anything.

  • Decrease the severity of the challenge

    Returns boolean

    boolean Returns true if the value changed

  • Decrease the value of the challenge

    Returns boolean

    boolean Returns true if the value changed

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

    Parameters

    • OptionaloverrideValue: number

      integer The value to check for. If undefined, gets the current value.

    Returns string

    string The localised description for the current value.

  • Gets the "difficulty" value of this challenge.

    Returns number

    integer The difficulty value.

  • Gets the minimum difficulty added by this challenge.

    Returns number

    integer The difficulty value.

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

    Parameters

    • OptionaloverrideValue: number

      integer The value to check for. If undefined, gets the current value.

    Returns string

    string The localised name for the current value.

  • Gets the localisation key for the challenge

    Returns string

    string The i18n key for this challenge

  • Whether to allow choosing this challenge's severity.

    Returns boolean

  • Increase the severity of the challenge

    Returns boolean

    boolean Returns true if the value changed

  • Increase the value of the challenge

    Returns boolean

    boolean Returns true if the value changed

  • Used for unlockable challenges to check if they're unlocked.

    Parameters

    Returns boolean

    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.