PokéRogue
    Preparing search index...

    Helper to handle overrides in tests

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    disableShinies: boolean = true

    If true, sets the shiny overrides to disable shinies at the start of each test.

    true

    normalizeIVs: boolean = true

    If true, will set the IV overrides for player and enemy pokemon to 31 at the start of each test.

    true

    normalizeNatures: boolean = true

    If true, will set the Nature overrides for player and enemy pokemon to a neutral nature at the start of each test.

    true

    removeEnemyStartingItems: boolean = true

    If true, removes the starting items from enemies at the start of each test.

    true

    Methods

    • Override confusion to always or never activate

      Parameters

      • activate: boolean | null

        true to force activation, false to force no activation, null to disable the override

      Returns this

      this

    • Override random critical hit rolls to always or never suceed.

      Parameters

      • alwaysCrit: boolean | null

        true to guarantee crits on eligible moves, false to force rolls to fail, null to disable override

      Returns this

      this

      This does not change any effects that guarantee or block critical hits; it merely intercepts any chance-based rolls not already at 100%.
      For instance, a Pokemon at +3 crit stages will still critically hit with the override set to false, whereas one at +2 crit stages (a 50% chance) will not.

    • Override the enabled status of the passive abilities of all enemy Pokemon.

      Parameters

      • hasPassive: boolean | null

        Whether passives should be enabled/disabled, or null to disable the override

      Returns this

      this

      This override should not be used - setting a custom passive ability via passiveAbility will forcibly enable passives without relying on individual species having specific passives. If a granular per-Pokemon override is required, consider using FieldHelper.mockAbility

    • Override enemy Pokemon to have the given amount of boss health segments.

      Parameters

      • healthSegments: number

        The number of segments to give, as follows:

        • 0: Boss segments will be computed normally based on wave and enemy level
        • 1: The Pokemon will not be a boss
        • 2+: The Pokemon will be a boss with the given number of health segments

      Returns this

      this

    • Override the initial IVs of all enemy Pokemon.

      Parameters

      • ivs:
            | 0
            | 1
            | 3
            | 2
            | 4
            | 31
            | 6
            | 10
            | 20
            | 12
            | 15
            | 24
            | 30
            | 22
            | 5
            | 7
            | 8
            | 9
            | 11
            | 13
            | 14
            | 16
            | 17
            | 18
            | 19
            | 25
            | 21
            | 23
            | 26
            | 27
            | 28
            | 29
            | [
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
            ]
            | null

        The IVs to set, either as a single number or a 6-length array. If set to null, the override is disabled.

      Returns this

      this

      This will disable player/enemy IV normalization when called.

    • Override the passive ability of all enemy Pokemon.

      Parameters

      Returns this

      this

      Setting a custom passive ability will force said passive to always be enabled, even if not unlocked.

    • Override enemy Pokemon to either always or never be Shiny.

      Parameters

      • shininess: false | null

        Whether to forcibly enable (true) or disable (false) Shininess, or null to disable the override altogether

      Returns this

      this

    • Override enemy Pokemon to either always or never be Shiny.

      Parameters

      • shininess: true

        Whether to forcibly enable (true) or disable (false) Shininess, or null to disable the override altogether

      • Optionalvariant: Variant

        If provided, will force newly generated Shinies to have the specified Variant.

      Returns this

      this

    • Override the enabled status of the passive abilities of all player Pokemon.

      Parameters

      • hasPassive: boolean | null

        Whether passives should be enabled/disabled, or null to disable the override

      Returns this

      this

      This override should not be used - setting a custom passive ability via passiveAbility will forcibly enable passives without relying on individual species having specific passives. If a granular per-Pokemon override is required, consider using FieldHelper.mockAbility

    • Override the wave level cap.

      Parameters

      • cap: number

        The level cap value to set, or a negative number to disable level caps altogether. 0 disables the override.

      Returns this

      this

    • Log a message to the console with coloration.

      Parameters

      • ...params: any[]

        The parameters to log

      Returns void

    • Override the encounter chance for a mystery encounter.

      Parameters

      • percentage: number

        The encounter chance in %

      Returns this

      this

    • Override the passive ability of all player Pokemon.

      Parameters

      Returns this

      this

      Setting a custom passive ability will force said passive to always be enabled, even if not unlocked.

    • Override the initial IVs of all player Pokemon.

      Parameters

      • ivs:
            | 0
            | 1
            | 3
            | 2
            | 4
            | 31
            | 6
            | 10
            | 20
            | 12
            | 15
            | 24
            | 30
            | 22
            | 5
            | 7
            | 8
            | 9
            | 11
            | 13
            | 14
            | 16
            | 17
            | 18
            | 19
            | 25
            | 21
            | 23
            | 26
            | 27
            | 28
            | 29
            | [
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
                | 0
                | 1
                | 2
                | 3
                | 4
                | 5
                | 6
                | 7
                | 8
                | 9
                | 10
                | 11
                | 12
                | 13
                | 14
                | 15
                | 16
                | 17
                | 18
                | 19
                | 20
                | 21
                | 22
                | 23
                | 24
                | 25
                | 26
                | 27
                | 28
                | 29
                | 30
                | 31,
            ]
            | null

        The IVs to set, either as a single number or a 6-length array. If set to null, the override is disabled.

      Returns this

      this

      This will disable player/enemy IV normalization when called.

    • Override player Pokemon to either always or never be Shiny.

      Parameters

      • shininess: false | null

        Whether to forcibly enable (true) or disable (false) Shininess, or null to disable the override altogether

      Returns this

      this

    • Override player Pokemon to either always or never be Shiny.

      Parameters

      • shininess: true

        Whether to forcibly enable (true) or disable (false) Shininess, or null to disable the override altogether

      • Optionalvariant: Variant

        If provided, will force newly generated Shinies to have the specified Variant.

      Returns this

      this

    • Override the initial species used when creating new starter Pokemon.

      Parameters

      Returns this

      this

      This override is deprecated and heavily discouraged in automated test files; a similar effect can be used by passing an array of SpeciesIds to startBattle

    • Override the starting level of newly generated player Pokemon.

      Parameters

      • level: number

        The starting level to set

      Returns this

      this

    • Override the starting wave index.

      Parameters

      • wave: number | null

        The wave to set, or null to disable the override

      Returns this

      this

    • Override statuses (Paralysis and Freeze) to always or never activate

      Parameters

      • activate: boolean | null

        true to force activation, false to force no activation, null to disable the override

      Returns this

      this

    • Override the arena's current weather.

      Parameters

      Returns this

      this

      Oddly enough, this override is perpetually applied and will supercede any and all attempts to change/remove weather. This behavior is dubious in quality and should hopefully be made sane.