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

Hierarchy (view full)

Constructors

Properties

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

Methods

  • Modifies the data or game state in some way to apply the challenge.

    Parameters

    • challengeType: ChallengeType

      Which challenge type this is being applied for.

    • args: any[]

      Irrelevant. See the specific challenge's apply function for additional information.

    Returns boolean

  • 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

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

    Parameters

    • Optional overrideValue: number

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

    Returns string

    The localised description for the current value.

  • Gets the "difficulty" value of this challenge.

    Returns number

    The difficulty value.

  • Gets the minimum difficulty added by this challenge.

    Returns number

    The difficulty value.

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

    Parameters

    • Optional overrideValue: number

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

    Returns string

    The localised name for the current value.

  • Gets the localisation key for the challenge

    Returns 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

    Returns true if the value changed

  • Increase the value of the challenge

    Returns boolean

    Returns true if the value changed

  • If this challenge is of a particular type

    Parameters

    Returns boolean

    This challenge

  • Used for unlockable challenges to check if they're 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 of json.

    Returns Challenge

    This challenge.