PokéRogue
    Preparing search index...

    Class PokemonAbstract

    Hierarchy (View Summary)

    Index
    add addAt addedToScene addIfNotInMoveset addListener addRenderStep addTag addToDisplayList addToUpdateList breakIllusion bringToTop calculateBaseStats calculateStabMultiplier calculateStats canAddTag canApplyAbility canSetStatus canSwitch canTransformInto changeForm checkIfPlayerHasAbilityOfStarter checkIgnoreTypeImmunity clearAlpha clearFusionSpecies clearMask clearStatus copyPosition count createGeometryMask cry cureStatus damage damageAndUpdate destroy destroySubstitute disableInteractive doSetStatus each emit enableFilters eventNames exists faintCry fallbackVariantColor fieldSetup findAndRemoveTags findTag findTags focusFilters focusFiltersOnCamera focusFiltersOverride fusionFaintCry generateAbilityIndex generateAndPopulateMoveset generateFusionSpecies generateName generateNature generateShinyVariant getAbility getAbilityAttrs getAbilityPriorities getAccuracyMultiplier getAll getAlliesGenerator getAlly getAt getAttackDamage getAttackTypeEffectiveness getBaseDamage getBaseTypes getBaseVariant getBattleInfo getBattlerIndex getBattleSpriteAtlasPath getBattleSpriteId getBattleSpriteKey getBounds getBoundsTransformMatrix getByName getCriticalHitResult getCritStage getData getDexAttr getDisplayList getEffectiveStat getEggMoves getEvolution getExpValue getFieldIndex getFieldPositionOffset getFirst getFormKey getFusionBattleSpriteAtlasPath getFusionBattleSpriteId getFusionBattleSpriteKey getFusionFormKey getFusionGender getFusionIconAtlasKey getFusionIconId getFusionSpeciesForm getFusionSpriteId getFusionVariant getGender getHeldItems getHpRatio getIconAtlasKey getIconId getIndex getIndexList getInverseHp getLastNonVirtualMove getLastXMoves getLearnableLevelMoves getLevelMoves getLocalPoint getLocalTransformMatrix getLuck getMatchupScore getMaxHp getMoveCategory getMoveEffectiveness getMoveHistory getMoveQueue getMoveset getMoveType getMoveTypeForItemSpawn getName getNameToRender getNature getOpponent getOpponentDescriptor getOpponents getOpponentsGenerator getParentRotation getPassiveAbility getPersistentTreasureCount getPokeball getRandom getRestrictingTag getSpeciesForm getSprite getSpriteAtlasPath getSpriteId getSpriteKey getSpriteScale getStat getStats getStatStage getStatStageMultiplier getStatStages getSubstituteOffset getTag getTargetRestrictingTag getTeraType getTeraTypeBoost getTintSprite getTypes getUnlockedEggMoves getVariant getWeight getWorldPoint getWorldTransformMatrix hasAbility hasAbilityWithAttr hasFusionSpecies hasPassive hasRestrictingTag hasSameAbilityInRootForm hasSpecies hasTrainer heal hideInfo incData init initBattleInfo initShinySparkle isActive isAllowedInBattle isAllowedInChallenge isAlly isBaseShiny isBoss isBossImmune isDoubleShiny isEnemy isFainted isForciblyGrounded isForciblyUngrounded isFullHp isFusion isFusionShiny isGrounded isMax isMega isMoveSelectable isMoveTargetRestricted isOffsetBySubstitute isOfType isOnField isOpponent isOppositeGender isPlayer isSafeguarded isShiny isTransformed isTrapped iterate lapseTag lapseTags leaveField listenerCount listeners loadAssets loseHeldItem moveAbove moveBelow moveDown moveTo moveUp off on once onChildDestroyed playAnim playSprite pointToContainer populateVariantColorCache preDestroy pushMoveHistory pushMoveQueue queueStatusImmuneMessage randBattleSeedInt randBattleSeedIntRange recordEatenBerry remove removeAll removeAllListeners removeAt removeBetween removedFromScene removeFromDisplayList removeFromUpdateList removeInteractive removeListener removeTag removeTagsBySourceId renderWebGLFilters renderWebGLStep replace replaceInMoveset resetBattleAndWaveData resetSprite resetStatus resetSummonData resetTera resetTeraOnMajorFormChange resetTurnData resetWaveData revealAbility reverse sendToBack setAbove setActive setAll setAlpha setAngle setBelow setBlendMode setCustomNature setData setDataEnabled setDepth setDisplaySize setExclusive setFieldPosition setFiltersAutoFocus setFiltersFocusContext setFiltersForceComposite setFilterSize setFrameRate setIllusion setInteractive setMask setMove setName setNature setPosition setRandomPosition setRenderFilters setRotation setScale setScrollFactor setSize setStat setState setStatStage setTempAbility setToBack setToTop setVertexRoundMode setVisible setW setX setY setZ showInfo shuffle shutdown sort sparkle suppressAbility swap tint toggleData toggleStats toJSON transferSummon transferTagsBySourceId tryPopulateMoveset tryRerollHiddenAbilitySeed trySelectMove trySetShiny trySetShinySeed trySetStatus untint update updateFusionPalette updateInfo updateRenderNodeData updateScale willRender willRenderFilters willRoundVertices
    • Parameters

      • x: number
      • y: number
      • species: PokemonSpecies
      • level: number
      • OptionalabilityIndex: number
      • OptionalformIndex: number
      • Optionalgender: Gender
      • Optionalshiny: boolean
      • Optionalvariant: Variant
      • Optionalivs: number[]
      • Optionalnature: Nature
      • OptionaldataSource: Pokemon | PokemonData

      Returns Pokemon

    abilityIndex: number
    active: boolean

    The active state of this Game Object. A Game Object with an active state of true is processed by the Scenes UpdateList, if added to it. An active object is one which is having its logic and internal systems updated.

    alpha: number

    The alpha value of the Game Object.

    This is a global value, impacting the entire Game Object, not just a region of it. The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render flag, preventing the Game Object from being drawn until the alpha is raised above 0 again.

    angle: number

    The angle of this Game Object as expressed in degrees.

    Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left and -90 is up.

    If you prefer to work in radians, see the rotation property instead.

    battleData: PokemonBattleData = ...

    Data that resets only on battle end (hit count, harvest berries, etc.) Kept between waves.

    battleInfo: BattleInfo
    blendMode: string | number | BlendModes

    Sets the Blend Mode being used by this Game Object.

    This can be a const, such as Phaser.BlendModes.SCREEN, or an integer, such as 4 (for Overlay)

    Under WebGL only the following Blend Modes are available:

    • NORMAL
    • ADD
    • MULTIPLY
    • SCREEN
    • ERASE

    Canvas has more available depending on browser support.

    You can also create your own custom Blend Modes in WebGL.

    Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these reasons try to be careful about the construction of your Scene and the frequency with which blend modes are used.

    body: Body | StaticBody | BodyType | null

    If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body.

    cameraFilter: number

    A bitmask that controls if this Game Object is drawn by a Camera or not. Not usually set directly, instead call Camera.ignore, however you can set this property directly using the Camera.id property:

    customPokemonData: CustomPokemonData = ...

    A Data Manager. It allows you to store, query and get key/value paired information specific to this Game Object. null by default. Automatically created if you use getData or setData or setDataEnabled.

    depth: number

    The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type.

    The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order of Game Objects, without actually moving their position in the display list.

    The default depth is zero. A Game Object with a higher depth value will always render in front of one with a lower value.

    Setting the depth will queue a depth sort event within the Scene.

    displayHeight: number

    The displayed height of this Game Object.

    This value takes into account the scale factor.

    Setting this value will adjust the Game Object's scale property.

    displayList: DisplayList | Layer

    Holds a reference to the Display List that contains this Game Object.

    This is set automatically when this Game Object is added to a Scene or Layer.

    You should treat this property as being read-only.

    displayOriginX: number

    Internal value to allow Containers to be used for input and physics. Do not change this value. It has no effect other than to break things.

    displayOriginY: number

    Internal value to allow Containers to be used for input and physics. Do not change this value. It has no effect other than to break things.

    displayWidth: number

    The displayed width of this Game Object.

    This value takes into account the scale factor.

    Setting this value will adjust the Game Object's scale property.

    evoCounter: number
    exclusive: boolean

    Does this Container exclusively manage its children?

    The default is true which means a child added to this Container cannot belong in another Container, which includes the Scene display list.

    If you disable this then this Container will no longer exclusively manage its children. This allows you to create all kinds of interesting graphical effects, such as replicating Game Objects without reparenting them all over the Scene. However, doing so will prevent children from receiving any kind of input event or have their physics bodies work by default, as they're no longer a single entity on the display list, but are being replicated where-ever this Container is.

    exp: number
    fieldPosition: FieldPosition

    The position of this Pokémon on the field

    filterCamera: Camera

    The Camera used for filters. You can use this to alter the perspective of filters. It is not necessary to use this camera for ordinary rendering.

    This is only available if you use the enableFilters method.

    filters: FiltersInternalExternal | null

    The filter lists for this Game Object. This is an object with internal and external properties. Each list is a Phaser.GameObjects.Components.FilterList object.

    This is only available if you use the enableFilters method.

    filtersAutoFocus: boolean

    Whether filterCamera should update every frame to focus on the Game Object. Disable this if you want to manually control the camera.

    filtersFocusContext: boolean

    Whether the filters should focus on the context, rather than attempt to focus on the Game Object. This is enabled automatically when enabling filters on objects which don't have well-defined bounds.

    This effectively sets the internal filters to render the same way as the external filters.

    This is only used if filtersAutoFocus is enabled.

    The "context" is the framebuffer to which the Game Object is rendered. This is usually the main framebuffer, but might be another framebuffer. It can even be several different framebuffers if the Game Object is rendered multiple times.

    filtersForceComposite: boolean

    Whether the Filters component should always draw to a framebuffer, even if there are no active filters.

    first: GameObject | null

    Returns the first Game Object within the Container, or null if it is empty.

    You can move the cursor by calling Container.next and Container.previous.

    formIndex: number
    friendship: number

    The Pokémon's current friendship value, ranging from 0 to 255.

    fusionAbilityIndex: number
    fusionCustomPokemonData: CustomPokemonData | null
    fusionFormIndex: number
    fusionGender: Gender
    fusionLuck: number
    fusionShiny: boolean
    fusionSpecies: PokemonSpecies | null

    If this Pokémon is a fusion, the species it is fused with; null if not a fusion

    fusionTeraType: PokemonType
    fusionVariant: Variant
    gender: Gender
    hasTransformComponent: boolean

    A property indicating that a Game Object has this component.

    height: number

    The native (un-scaled) height of this Game Object.

    Changing this value will not change the size that the Game Object is rendered in-game. For that you need to either set the scale of the Game Object (setScale) or use the displayHeight property.

    hp: number
    id: number

    This pokemon's Personality value/PID, used to determine various parameters of this Pokemon. Represented as a random 32-bit unsigned integer. TODO: Stop treating this like a unique ID and stop treating 0 as no pokemon

    ignoreDestroy: boolean

    This Game Object will ignore all calls made to its destroy method if this flag is set to true. This includes calls that may come from a Group, Container or the Scene itself. While it allows you to persist a Game Object across Scenes, please understand you are entirely responsible for managing references to and from this Game Object.

    input: InteractiveObject | null

    If this Game Object is enabled for input then this property will contain an InteractiveObject instance. Not usually set directly. Instead call GameObject.setInteractive().

    isDestroyed: boolean

    Whether this Game Object has been destroyed. Check this property to avoid bugs caused by calling methods on a destroyed Game Object, e.g. in a Tween or Timer.

    This is a read-only property that is automatically set to true when the Game Object is destroyed. You should not set this property directly. It is set before preDestroy is called or the DESTROY event is emitted.

    isTerastallized: boolean

    Whether this Pokémon is currently Terastallized

    ivs: number[]
    last: GameObject | null

    Returns the last Game Object within the Container, or null if it is empty.

    You can move the cursor by calling Container.next and Container.previous.

    length: number

    The number of Game Objects inside this Container.

    level: number
    list: GameObject[]

    An array holding the children of this Container.

    localTransform: TransformMatrix

    Internal Transform Matrix used for local space conversion.

    luck: number

    The Mask this Game Object is using during render, or null if no mask has been set.

    maxFilterSize: Vector2

    The maximum size of the base filter texture. Filters may use a larger texture after the base texture is rendered. The maximum texture size is at least 4096 in WebGL, based on the hardware. You may set this lower to save memory or prevent resizing.

    maxSize: number

    Containers can have an optional maximum size. If set to anything above 0 it will constrict the addition of new Game Objects into the Container, capping off the maximum limit the Container can grow in size to.

    metBiome: -1 | BiomeId

    The ID of the biome this Pokémon was met in

    Primarily used for display in the summary screen.

    metLevel: number

    The level at which this Pokémon was met

    Primarily used for displaying in the summary screen

    metSpecies: SpeciesId
    metWave: number

    The wave index at which this Pokémon was met/encountered

    moveset: PokemonMove[]
    mysteryEncounterBattleEffects?: (pokemon: Pokemon) => void

    Used by Mystery Encounters to execute pokemon-specific logic (such as stat boosts) at start of battle

    name: string

    The name of this Game Object. Empty by default and never populated by Phaser, this is left for developers to use.

    nature: Nature
    next: GameObject | null

    Returns the next Game Object within the Container, or null if it is empty.

    You can move the cursor by calling Container.next and Container.previous.

    nickname?: string

    The Pokemon's current nickname, or undefined if it currently lacks one. If omitted, references to this should refer to the default name for this Pokemon's species.

    originX: number

    Internal value to allow Containers to be used for input and physics. Do not change this value. It has no effect other than to break things.

    originY: number

    Internal value to allow Containers to be used for input and physics. Do not change this value. It has no effect other than to break things.

    parentContainer: Container

    The parent Container of this Game Object, if it has one.

    passive: boolean
    pauseEvolutions: boolean
    pokeball: PokeballType
    pokerus: boolean
    position: number

    An internal cursor position used for iterating through the Container's children via methods such as first, next, previous and last.

    previous: GameObject | null

    Returns the previous Game Object within the Container, or null if it is empty.

    You can move the cursor by calling Container.next and Container.previous.

    queuedBerryStatChanges: {
        stages: number;
        stat: ATK | DEF | SPATK | SPDEF | SPD | ACC | EVA;
    }[] = []

    Stat stages queued by berry eating to be run in a single phase

    renderFilters: boolean

    Whether any filters should be rendered on this Game Object. This is true by default, even if there are no filters yet. Disable this to skip filter rendering.

    Use willRenderFilters() to see if there are any active filters.

    renderFlags: number

    The flags that are compared against RENDER_MASK to determine if this Game Object will render or not. The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. If those components are not used by your custom class then you can use this bitmask as you wish.

    rotation: number

    The angle of this Game Object in radians.

    Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left and -PI/2 is up.

    If you prefer to work in degrees, see the angle property instead.

    scale: number

    This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object to the same value, at the same time. When reading this value the result returned is (scaleX + scaleY) / 2.

    Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this isn't the case, use the scaleX or scaleY properties instead.

    scaleX: number

    The horizontal scale of this Game Object.

    scaleY: number

    The vertical scale of this Game Object.

    scene: Scene

    A reference to the Scene to which this Game Object belongs.

    Game Objects can only belong to one Scene.

    You should consider this property as being read-only. You cannot move a Game Object to another Scene by simply changing it.

    scrollFactorX: number

    The horizontal scroll factor of this Container.

    The scroll factor controls the influence of the movement of a Camera upon this Container.

    When a camera scrolls it will change the location at which this Container is rendered on-screen. It does not change the Containers actual position values.

    For a Container, setting this value will only update the Container itself, not its children. If you wish to change the scrollFactor of the children as well, use the setScrollFactor method.

    A value of 1 means it will move exactly in sync with a camera. A value of 0 means it will not move at all, even if the camera moves. Other values control the degree to which the camera movement is mapped to this Container.

    Please be aware that scroll factor values other than 1 are not taken in to consideration when calculating physics collisions. Bodies always collide based on their world position, but changing the scroll factor is a visual adjustment to where the textures are rendered, which can offset them from physics bodies if not accounted for in your code.

    scrollFactorY: number

    The vertical scroll factor of this Container.

    The scroll factor controls the influence of the movement of a Camera upon this Container.

    When a camera scrolls it will change the location at which this Container is rendered on-screen. It does not change the Containers actual position values.

    For a Container, setting this value will only update the Container itself, not its children. If you wish to change the scrollFactor of the children as well, use the setScrollFactor method.

    A value of 1 means it will move exactly in sync with a camera. A value of 0 means it will not move at all, even if the camera moves. Other values control the degree to which the camera movement is mapped to this Container.

    Please be aware that scroll factor values other than 1 are not taken in to consideration when calculating physics collisions. Bodies always collide based on their world position, but changing the scroll factor is a visual adjustment to where the textures are rendered, which can offset them from physics bodies if not accounted for in your code.

    shiny: boolean
    shinySparkle: Sprite
    state: string | number

    The current state of this Game Object.

    Phaser itself will never modify this value, although plugins may do so.

    Use this property to track the state of a Game Object during its lifetime. For example, it could change from a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. If you need to store complex data about your Game Object, look at using the Data Component instead.

    stats: number[]
    status: Status | null

    This Pokemon's current non-volatile status condition, or null if none exist.

    Make private

    stellarTypesBoosted: PokemonType[]

    The set of Types that have been boosted by this Pokémon's Stellar Terastallization.

    summonData: PokemonSummonData = ...

    Data that resets on switch or battle end (stat stages, battler tags, etc.)

    switchOutStatus: boolean = false

    Indicates whether this Pokémon has left or is about to leave the field

    When true on a Wild Pokemon, this indicates it is about to flee.

    tabIndex: number

    The Tab Index of the Game Object. Reserved for future use by plugins and the Input Manager.

    teraType: PokemonType

    The type this Pokémon turns into when Terastallized

    turnData: PokemonTurnData = ...

    Per-turn data like hit count & flinch tracking

    type: string

    A textual representation of this Game Object, i.e. sprite. Used internally by Phaser but is available for your own custom classes to populate.

    usedTMs: MoveId[] = []

    The set of all TMs that have been used on this Pokémon

    Used to allow re-learning TM moves (e.g. via the Memory Mushroom)

    variant: Variant
    vertexRoundMode: string

    The current vertex rounding mode of this Game Object. This is used by the WebGL Renderer to determine how to round the vertex positions. It can have several values:

    • off - No rounding is applied.
    • safe - Rounding is applied if the object is 'safe'.
    • safeAuto - Rounding is applied if the object is 'safe' and the camera has roundPixels enabled.
    • full - Rounding is always applied.
    • fullAuto - Rounding is always applied if the camera has roundPixels enabled.

    A 'safe' object is one that is not rotated or scaled by any transform matrix while rendering. The effective transform is a simple translation. In such cases, rounding will affect all vertices the same way.

    Using full rounding can cause vertices to wobble, because they might not be aligned to the pixel grid. Full rounding gives a janky look like PS1 games.

    You can use other values if you want to create your own custom rounding modes.

    visible: boolean

    The visible state of the Game Object.

    An invisible Game Object will skip rendering, but will still process update logic.

    w: number

    The w position of this Game Object.

    waveData: PokemonWaveData = ...

    Wave data correponding to moves/ability information revealed

    width: number

    The native (un-scaled) width of this Game Object.

    Changing this value will not change the size that the Game Object is rendered in-game. For that you need to either set the scale of the Game Object (setScale) or use the displayWidth property.

    x: number

    The x position of this Game Object.

    y: number

    The y position of this Game Object.

    z: number

    The z position of this Game Object.

    Note: The z position does not control the rendering order of 2D Game Objects. Use Phaser.GameObjects.Components.Depth#depth instead.

    RENDER_MASK: number

    The bitmask that GameObject.renderFlags is compared against to determine if the Game Object will render or not.

    • get levelExp(): number

      The amount of EXP the Pokemon has earned within its current level

      Returns number

    • Adds the given Game Object, or array of Game Objects, to this Container.

      Each Game Object must be unique within the Container.

      If you try to add a Layer, it will throw an error.

      Type Parameters

      Parameters

      • child: T | T[]

        The Game Object, or array of Game Objects, to add to the Container.

      Returns this

      This Container instance.

    • Adds the given Game Object, or array of Game Objects, to this Container at the specified position.

      Existing Game Objects in the Container are shifted up.

      Each Game Object must be unique within the Container.

      Type Parameters

      Parameters

      • child: T | T[]

        The Game Object, or array of Game Objects, to add to the Container.

      • Optionalindex: number

        The position to insert the Game Object/s at. Default 0.

      Returns this

      This Container instance.

    • This callback is invoked when this Game Object is added to a Scene.

      Can be overridden by custom Game Objects, but be aware of some Game Objects that will use this, such as Sprites, to add themselves into the Update List.

      You can also listen for the ADDED_TO_SCENE event from this Game Object.

      Returns void

    • Places a specified move in a specified slot unless the moveset contains an acceptable alternative move fulfilling the filter

      Parameters

      • replacement: MoveId

        The move to insert in moveset

      • preferredSlot: 0 | 1 | 2 | 3

        The preferred slot to put the move in

      • altMoveFilter: (move: Move) => boolean = ...

        (Optional) A filtering function mapping a Move to a boolean; if a move in the moveset fulfills it, the replacement is not done

      Returns void

    • Add a listener for a given event.

      Parameters

      • event: string | symbol

        The event name.

      • fn: Function

        The listener function.

      • Optionalcontext: any

        The context to invoke the listener with. Default this.

      Returns this

      this.

    • Adds a render step function to this Game Object's WebGL render pipeline.

      The first render step in _renderSteps is run first. It should call the next render step in the list. This allows render steps to control the rendering flow.

      Parameters

      • fn: RenderWebGLStep

        The render step function to add.

      • Optionalindex: number

        The index in the render list to add the step to. Omit to add to the end.

      Returns this

      This Game Object instance.

    • Add a new BattlerTag of the specified tagType

      Parameters

      • tagType: BattlerTagType

        The type of tag to add

      • turnCount: number = 0

        The number of turns the tag should last; default 0

      • OptionalsourceMove: MoveId

        The id of the move that causing the tag to be added, if caused by a move

      • OptionalsourceId: number

        The id of the pokemon causing the tag to be added, if caused by a Pokémon

      Returns boolean

      Whether the tag was successfully added

      Also ensures the tag is able to be applied, similar to canAddTag

    • Adds this Game Object to the given Display List.

      If no Display List is specified, it will default to the Display List owned by the Scene to which this Game Object belongs.

      A Game Object can only exist on one Display List at any given time, but may move freely between them.

      If this Game Object is already on another Display List when this method is called, it will first be removed from it, before being added to the new list.

      You can query which list it is on by looking at the Phaser.GameObjects.GameObject#displayList property.

      If a Game Object isn't on any display list, it will not be rendered. If you just wish to temporarily disable it from rendering, consider using the setVisible method, instead.

      Parameters

      • OptionaldisplayList: DisplayList | Layer

        The Display List to add to. Defaults to the Scene Display List.

      Returns this

      This Game Object.

    • Adds this Game Object to the Update List belonging to the Scene.

      When a Game Object is added to the Update List it will have its preUpdate method called every game frame. This method is passed two parameters: time and delta.

      If you wish to run your own logic within preUpdate then you should always call super.preUpdate(time, delta) within it, or it may fail to process required operations, such as Sprite animations.undefined

      Returns this

      This Game Object.

    • Break the illusion of this pokemon, if it has an active illusion.

      Returns boolean

      Whether an illusion was broken.

    • Brings the given Game Object to the top of this Container. This will cause it to render on-top of any other objects in the Container.

      Type Parameters

      Parameters

      • child: T

        The Game Object to bring to the top of the Container.

      Returns this

      This Container instance.

    • Determine the STAB multiplier for a move used against this pokemon.

      Parameters

      • source: Pokemon

        The attacking Pokemon

      • move: Move

        The Move used in the attack

      • ignoreSourceAbility: boolean

        If true, ignores the attacking Pokemon's ability effects

      • simulated: boolean

        If true, suppresses changes to game state during the calculation

      Returns number

      The STAB multiplier for the move used against this Pokemon

    • Check whether this Pokémon can apply its current ability

      Parameters

      • passive: boolean = false

        Whether to check the passive (true) or non-passive (false) ability; default false

      Returns boolean

      Whether the ability can be applied

      This should rarely be directly called, as hasAbility and hasAbilityWithAttr already call this.

    • Check if a status effect can be applied to this Pokemon.

      Parameters

      • effect: StatusEffect

        The StatusEffect whose applicability is being checked

      • quiet: boolean = false

        Whether to suppress in-battle messages for status checks; default false

      • overrideStatus: boolean = false

        Whether to allow overriding the Pokemon's current status with a different one; default false

      • sourcePokemon: Pokemon | null = null

        The Pokemon applying the status effect to the target, or null if the status is applied from a non-Pokemon source (hazards, etc.); default null

      • ignoreField: boolean = false

        Whether to ignore field effects (weather, terrain, etc.) preventing status application; default false

      Returns boolean

      Whether effect can be applied to this Pokemon.

    • Determine whether this Pokemon can be switched out (e.g. it is not trapped, locked into using a move, or using Commander/being commanded).

      Returns boolean

      Whether the pokemon is able to switch

      Pokemon that aren't on the field can always switch

    • Return whether this Pokemon can transform into an opposing Pokemon.

      Parameters

      Returns boolean

      Whether this Pokemon can transform into target.

    • Helper function to check if the player already owns the starter data of this Pokémon's current ability

      Parameters

      • ownedAbilityAttrs: number

        The owned abilityAttr of this Pokemon's root form

      Returns boolean

      true if the player already has it, false otherwise

    • Clears the alpha value associated with this Game Object.

      Immediately sets the alpha back to 1 (fully opaque).undefined

      Returns this

      This Game Object instance.

    • Clears the mask that this Game Object was using.

      This only works in the Canvas Renderer. In WebGL, use a Mask filter instead (see Phaser.GameObjects.Components.FilterList#addMask).

      Parameters

      • OptionaldestroyMask: boolean

        Destroy the mask before clearing it? Default false.

      Returns this

      This Game Object instance.

    • Perform the action of clearing a Pokemon's status

      Parameters

      • confusion: boolean

        Whether to also clear this Pokémon's confusion

      • reloadAssets: boolean

        Whether to reload this pokemon's assets

      Returns void

      This is a helper to resetStatus, which should be called directly instead of this method

    • Copies an object's coordinates to this Game Object's position.

      Parameters

      Returns this

      This Game Object instance.

    • Returns the total number of Game Objects in this Container that have a property matching the given value.

      For example: count('visible', true) would count all the elements that have their visible property set.

      You can optionally limit the operation to the startIndex - endIndex range.

      Parameters

      • property: string

        The property to check.

      • value: any

        The value to check.

      • OptionalstartIndex: number

        An optional start index to search from. Default 0.

      • OptionalendIndex: number

        An optional end index to search up to (but not included) Default Container.length.

      Returns number

      The total number of Game Objects in this Container with a property matching the given value.

    • Creates and returns a Geometry Mask. This mask can be used by any Game Object, including this one.

      To create the mask you need to pass in a reference to a Graphics Game Object.

      If you do not provide a graphics object, and this Game Object is an instance of a Graphics object, then it will use itself to create the mask.

      This means you can call this method to create a Geometry Mask from any Graphics Game Object.

      This only works in the Canvas Renderer. In WebGL, use a Mask filter instead (see Phaser.GameObjects.Components.FilterList#addMask).

      Type Parameters

      Parameters

      • Optionalgraphics: Shape | Graphics

        A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask.

      Returns GeometryMask

      This Geometry Mask that was created.

    • Helper function for the Move phase that queues the status cure message, resets it, and updates the info display.

      Parameters

      • effect: StatusEffect

        The effect to cure. If this does not match the current status, nothing happens.

      • msg: string = ...

        If provided, will override the default message displayed when removing status. Used for moves that thaw the user out

      Returns void

    • Submethod called by damageAndUpdate to apply damage to this Pokemon and adjust its HP.

      Parameters

      • damage: number

        The damage to deal

      • ignoreSegments: boolean = false

        (Default false) Whether to ignore boss segments

      • preventEndure: boolean = false

        (Default false) Whether to allow the damage to bypass an Endure/Sturdy effect

      • ignoreFaintPhase: boolean = false

        (Default false) Whether to ignore adding a FaintPhase if this damage causes a faint

      Returns number

      The actual damage dealt

    • Given the damage, adds a new DamagePhase and update HP values, etc.

      Parameters

      • damage: number

        The damage to inflict on this Pokémon

      • __namedParameters: {
            ignoreFaintPhase?: boolean;
            ignoreSegments?: boolean;
            isCritical?: boolean;
            result?: DamageResult;
            source?: Pokemon;
        } = {}
        • OptionalignoreFaintPhase?: boolean

          Whether to ignore adding a FaintPhase if this damage causes a faint; default false

        • OptionalignoreSegments?: boolean

          Whether to ignore boss segments

        • OptionalisCritical?: boolean

          Whether the attack was a critical hit

        • Optionalresult?: DamageResult

          An enum if it's super effective, not very effective, etc; default HitResult.EFFECTIVE

        • Optionalsource?: Pokemon

          The Pokémon inflicting the damage, or undefined if not caused by a Pokémon

      Returns number

      Amount of damage actually done

      Checks for Indirect hits to account for Endure/Reviver Seed applying correctly

    • If this Pokemon has a Substitute on the field, removes its sprite from the field.

      Returns void

    • If this Game Object has previously been enabled for input, this will disable it.

      An object that is disabled for input stops processing or being considered for input events, but can be turned back on again at any time by simply calling setInteractive() with no arguments provided.

      If want to completely remove interaction from this Game Object then use removeInteractive instead.

      Parameters

      • OptionalresetCursor: boolean

        Should the currently active Input cursor, if any, be reset to the default cursor? Default false.

      Returns this

      This GameObject.

    • Set this Pokemon's non-volatile status condition to the specified effect.

      Parameters

      Returns void

      Clears this pokemon's pendingStatus in its turnData.

      ⚠️ This method does not check for feasibility; that is the responsibility of the caller.

    • Set this Pokemon's non-volatile status condition to the specified effect.

      Parameters

      • effect: SLEEP
      • OptionalsleepTurnsRemaining: number

        (Optional) The number of turns to inflict sleep for (the actual number of sleep turns is 1 less than the input value).
        If not specified, defaults to 1/3 chance of 1 turn of sleep, 2/3 chance of 2 turns of sleep.

      Returns void

      Clears this pokemon's pendingStatus in its Pokemon#turnData.

      ⚠️ This method does not check for feasibility; that is the responsibility of the caller.

    • Set this Pokemon's non-volatile status condition to the specified effect.

      Parameters

      • effect: StatusEffect

        The StatusEffect to set

      • OptionalsleepTurnsRemaining: number

        (Optional) The number of turns to inflict sleep for (the actual number of sleep turns is 1 less than the input value).
        If not specified, defaults to 1/3 chance of 1 turn of sleep, 2/3 chance of 2 turns of sleep.
        Has no effect if the status effect being inflicted is not sleep.

      Returns void

      Clears this pokemon's pendingStatus in its Pokemon#turnData.

      ⚠️ This method does not check for feasibility; that is the responsibility of the caller.

    • Passes all Game Objects in this Container to the given callback.

      A copy of the Container is made before passing each entry to your callback. This protects against the callback itself modifying the Container.

      If you know for sure that the callback will not change the size of this Container then you can use the more performant Container.iterate method instead.

      Parameters

      • callback: Function

        The function to call.

      • Optionalcontext: object

        Value to use as this when executing callback.

      • ...args: any[]

        Additional arguments that will be passed to the callback, after the child.

      Returns this

      This Container instance.

    • Calls each of the listeners registered for a given event.

      Parameters

      • event: string | symbol

        The event name.

      • ...args: any[]

        Additional arguments that will be passed to the event handler.

      Returns boolean

      true if the event had listeners, else false.

    • Enable this Game Object to have filters.

      You need to call this method if you want to use the filterCamera and filters properties. It sets up the necessary data structures. You may disable filter rendering with the renderFilters property.

      This is a WebGL only feature. It will return early if not available.undefined

      Returns this

      undefined

    • Return an array listing the events for which the emitter has registered listeners.undefined

      Returns (string | symbol)[]

      undefined

    • Returns true if the given Game Object is a direct child of this Container.

      This check does not scan nested Containers.

      Type Parameters

      Parameters

      • child: T

        The Game Object to check for within this Container.

      Returns boolean

      True if the Game Object is an immediate child of this Container, otherwise false.

    • Play this Pokémon's faint cry, pausing its animation until the cry is finished.

      Parameters

      • callback: () => any

        A function to be called once the cry has finished playing

      Returns void

    • Gracefully handle errors loading a variant sprite. Log if it fails and attempt to fall back on non-experimental sprites before giving up.

      Parameters

      • cacheKey: string

        The cache key for the variant color sprite

      • attemptedSpritePath: string

        The sprite path that failed to load

      • useExpSprite: boolean

        Whether the attempted sprite was experimental

      • battleSpritePath: string

        The filename of the sprite

      • ...optionalParams: any[]

        Any additional params to log

      Returns Promise<void>

    • Perform miscellaneous setup for when the Pokemon is summoned, like generating the substitute sprite

      Parameters

      • OptionalresetSummonData: boolean

        Whether to additionally reset the Pokemon's summon data (default: false)

      Returns void

    • Find and remove all BattlerTags matching the given function and invoke their onRemove methods.

      Parameters

      • tagFilter: (tag: BattlerTag) => boolean

        A function dictating which tags to remove

      Returns void

      Removes all matching tags; to remove only the first matching tag, use removeTag instead.

    • Find the first BattlerTag matching the specified predicate

      Type Parameters

      Parameters

      • tagFilter: (tag: BattlerTag) => tag is T

        The predicate to match against

      Returns T | undefined

      The first matching tag, or undefined if none match

      Equivalent to this.summonData.tags.find(tagFilter).

    • Find the first BattlerTag matching the specified predicate

      Parameters

      • tagFilter: (tag: BattlerTag) => boolean

        The predicate to match against

      Returns BattlerTag | undefined

      The first matching tag, or undefined if none match

      Equivalent to this.summonData.tags.find(tagFilter).

    • Return the list of BattlerTags that satisfy the given predicate

      Type Parameters

      Parameters

      • tagFilter: (tag: BattlerTag) => tag is T

        The predicate to match against

      Returns T[]

      The filtered list of tags

      Equivalent to this.summonData.tags.filter(tagFilter).

    • Return the list of BattlerTags that satisfy the given predicate

      Parameters

      • tagFilter: (tag: BattlerTag) => boolean

        The predicate to match against

      Returns BattlerTag[]

      The filtered list of tags

      Equivalent to this.summonData.tags.filter(tagFilter).

    • Focus the filter camera. This sets the size and position of the filter camera to match the GameObject. This is called automatically on render if filtersAutoFocus is enabled.

      This will focus on the GameObject's raw dimensions if available. If the GameObject has no dimensions, this will focus on the context: the camera belonging to the DrawingContext used to render the GameObject. Context focus occurs during rendering, as the context is not known until then.undefined

      Returns this

      undefined

    • Focus the filter camera on a specific camera. This is used internally when filtersFocusContext is enabled.

      Parameters

      • camera: Camera

        The camera to focus on.

      Returns this

      undefined

    • Manually override the focus of the filter camera. This allows you to set the size and position of the filter camera manually. It deactivates filtersAutoFocus when called.

      The camera will set scroll to place the game object at the given position within a rectangle of the given width and height. For example, calling focusFiltersOverride(400, 200, 800, 600) will focus the camera to place the object's center 100 pixels above the center of the camera (which is at 400x300).

      Parameters

      • Optionalx: number

        The x-coordinate of the focus point, relative to the filter size. Default is the center.

      • Optionaly: number

        The y-coordinate of the focus point, relative to the filter size. Default is the center.

      • Optionalwidth: number

        The width of the focus area. Default is the filter width.

      • Optionalheight: number

        The height of the focus area. Default is the filter height.

      Returns this

      undefined

    • Play this Pokémon's fusion faint cry, which is a mixture of the faint cries for both of its species

      Parameters

      • callback: () => any

        A function to be called once the cry has finished playing

      Returns void

    • Generate abilityIndex based on species and hidden ability if not pre-defined.

      Returns number

    • Generate a semi-random moveset for this Pokémon

      Parameters

      Returns void

    • Generate a fusion species and add it to this Pokémon

      Parameters

      • OptionalforStarter: boolean

        Whether this fusion is being generated for a starter Pokémon; default false

      Returns void

    • Sets the Pokemon's name. Only called when loading a Pokemon so this function needs to be called when initializing hardcoded Pokemon or else it will not display the form index name properly.

      Returns void

    • Randomly generate and set this Pokémon's nature

      Parameters

      • OptionalnaturePool: Nature[]

        An optional array of Natures to choose from. If not provided, all natures will be considered.

      Returns void

    • Randomly generate a shiny variant

      Returns Variant

      The randomly chosen shiny variant

      Variants are returned with the following probabilities:

      Variant Description Probability
      0 Basic shiny 60%
      1 Rare variant 30%
      2 Epic variant 10%
    • Get this Pokemon's non-passive Ability, factoring in fusions, overrides and ability-changing effects.

      Should rarely be called directly in favor of hasAbility or hasAbilityWithAttr, both of which check both ability slots and account for suppression.

      Parameters

      • ignoreOverride: boolean = false

        Whether to ignore any overrides caused by Transform; default false

      Returns Ability

      The non-passive Ability of this Pokemon.

      hasAbility and hasAbilityWithAttr are the intended ways to check abilities in most cases

    • Gets a list of all instances of a given ability attribute among abilities this pokemon has. Accounts for all the various effects which can affect whether an ability will be present or in effect, and both passive and non-passive.

      Type Parameters

      • T extends
            | "AddSecondStrikeAbAttr"
            | "AlliedFieldDamageReductionAbAttr"
            | "AllyMoveCategoryPowerBoostAbAttr"
            | "AllyStatMultiplierAbAttr"
            | "AlwaysHitAbAttr"
            | "ArenaTrapAbAttr"
            | "BattlerTagImmunityAbAttr"
            | "BlockCritAbAttr"
            | "BlockItemTheftAbAttr"
            | "BlockNonDirectDamageAbAttr"
            | "BlockOneHitKOAbAttr"
            | "BlockRecoilDamageAttr"
            | "BlockRedirectAbAttr"
            | "BlockStatusDamageAbAttr"
            | "BonusCritAbAttr"
            | "BypassBurnDamageReductionAbAttr"
            | "BypassSpeedChanceAbAttr"
            | "ChangeMovePriorityAbAttr"
            | "ChangeMovePriorityInBracketAbAttr"
            | "CheckTrappedAbAttr"
            | "CommanderAbAttr"
            | "ConditionalCritAbAttr"
            | "ConditionalUserFieldBattlerTagImmunityAbAttr"
            | "ConditionalUserFieldProtectStatAbAttr"
            | "ConditionalUserFieldStatusEffectImmunityAbAttr"
            | "ConfusionOnStatusEffectAbAttr"
            | "CopyFaintedAllyAbilityAbAttr"
            | "CudChewConsumeBerryAbAttr"
            | "CudChewRecordBerryAbAttr"
            | "DoubleBattleChanceAbAttr"
            | "DoubleBerryEffectAbAttr"
            | "DownloadAbAttr"
            | "EffectSporeAbAttr"
            | "ExecutedMoveAbAttr"
            | "FetchBallAbAttr"
            | "FieldMovePowerBoostAbAttr"
            | "FieldMoveTypePowerBoostAbAttr"
            | "FieldMultiplyStatAbAttr"
            | "FieldPreventExplosiveMovesAbAttr"
            | "FieldPriorityMoveImmunityAbAttr"
            | "FlinchEffectAbAttr"
            | "FlinchStatStageChangeAbAttr"
            | "ForceSwitchOutImmunityAbAttr"
            | "ForewarnAbAttr"
            | "FormBlockDamageAbAttr"
            | "FriskAbAttr"
            | "FullHpResistTypeAbAttr"
            | "GorillaTacticsAbAttr"
            | "HealFromBerryUseAbAttr"
            | "IgnoreContactAbAttr"
            | "IgnoreMoveEffectsAbAttr"
            | "IgnoreOpponentStatStagesAbAttr"
            | "IgnoreProtectOnContactAbAttr"
            | "IgnoreTypeImmunityAbAttr"
            | "IgnoreTypeStatusEffectImmunityAbAttr"
            | "IllusionBreakAbAttr"
            | "IllusionPostBattleAbAttr"
            | "IllusionPreSummonAbAttr"
            | "IncreasePpUsedAbAttr"
            | "InfiltratorAbAttr"
            | "IntimidateImmunityAbAttr"
            | "LowHpMoveTypePowerBoostAbAttr"
            | "MaxMultiHitAbAttr"
            | "MoneyAbAttr"
            | "MoodyAbAttr"
            | "MoveAbilityBypassAbAttr"
            | "MoveDamageBoostAbAttr"
            | "MoveEffectChanceMultiplierAbAttr"
            | "MoveHealBoostAbAttr"
            | "MoveImmunityAbAttr"
            | "MoveImmunityStatStageChangeAbAttr"
            | "MovePowerBoostAbAttr"
            | "MoveTypeChangeAbAttr"
            | "MoveTypePowerBoostAbAttr"
            | "MultCritAbAttr"
            | "NoFusionAbilityAbAttr"
            | "NoTransformAbilityAbAttr"
            | "NonSuperEffectiveImmunityAbAttr"
            | "PokemonTypeChangeAbAttr"
            | "PostAttackAbAttr"
            | "PostAttackApplyBattlerTagAbAttr"
            | "PostAttackApplyStatusEffectAbAttr"
            | "PostAttackContactApplyStatusEffectAbAttr"
            | "PostAttackStealHeldItemAbAttr"
            | "PostBattleAbAttr"
            | "PostBattleInitAbAttr"
            | "PostBattleInitFormChangeAbAttr"
            | "PostBattleLootAbAttr"
            | "PostBiomeChangeAbAttr"
            | "PostBiomeChangeTerrainChangeAbAttr"
            | "PostBiomeChangeWeatherChangeAbAttr"
            | "PostDamageAbAttr"
            | "PostDamageForceSwitchAbAttr"
            | "PostDancingMoveAbAttr"
            | "PostDefendAbAttr"
            | "PostDefendAbilityGiveAbAttr"
            | "PostDefendAbilitySwapAbAttr"
            | "PostDefendApplyArenaTrapTagAbAttr"
            | "PostDefendApplyBattlerTagAbAttr"
            | "PostDefendApplyStatusEffectAbAttr"
            | "PostDefendContactApplyTagChanceAbAttr"
            | "PostDefendContactDamageAbAttr"
            | "PostDefendHpGatedStatStageChangeAbAttr"
            | "PostDefendIllusionBreakAbAttr"
            | "PostDefendMoveDisableAbAttr"
            | "PostDefendPerishSongAbAttr"
            | "PostDefendStatStageChangeAbAttr"
            | "PostDefendStealHeldItemAbAttr"
            | "PostDefendTerrainChangeAbAttr"
            | "PostDefendTypeChangeAbAttr"
            | "PostDefendWeatherChangeAbAttr"
            | "PostFaintAbAttr"
            | "PostFaintContactDamageAbAttr"
            | "PostFaintHPDamageAbAttr"
            | "PostFaintUnsuppressedWeatherFormChangeAbAttr"
            | "PostIntimidateStatStageChangeAbAttr"
            | "PostItemLostAbAttr"
            | "PostItemLostApplyBattlerTagAbAttr"
            | "PostKnockOutAbAttr"
            | "PostKnockOutStatStageChangeAbAttr"
            | "PostMoveUsedAbAttr"
            | "PostReceiveCritStatStageChangeAbAttr"
            | "PostSetStatusAbAttr"
            | "PostStatStageChangeAbAttr"
            | "PostStatStageChangeStatStageChangeAbAttr"
            | "PostSummonAbAttr"
            | "PostSummonAddArenaTagAbAttr"
            | "PostSummonAddBattlerTagAbAttr"
            | "PostSummonAllyHealAbAttr"
            | "PostSummonClearAllyStatStagesAbAttr"
            | "PostSummonCopyAbilityAbAttr"
            | "PostSummonCopyAllyStatsAbAttr"
            | "PostSummonFormChangeAbAttr"
            | "PostSummonFormChangeByWeatherAbAttr"
            | "PostSummonHealStatusAbAttr"
            | "PostSummonMessageAbAttr"
            | "PostSummonRemoveArenaTagAbAttr"
            | "PostSummonRemoveBattlerTagAbAttr"
            | "PostSummonRemoveEffectAbAttr"
            | "PostSummonStatStageChangeAbAttr"
            | "PostSummonStatStageChangeOnArenaAbAttr"
            | "PostSummonTerrainChangeAbAttr"
            | "PostSummonTransformAbAttr"
            | "PostSummonUnnamedMessageAbAttr"
            | "PostSummonUserFieldRemoveStatusEffectAbAttr"
            | "PostSummonWeatherChangeAbAttr"
            | "PostSummonWeatherSuppressedFormChangeAbAttr"
            | "PostTerrainChangeAbAttr"
            | "PostTurnAbAttr"
            | "PostTurnFormChangeAbAttr"
            | "PostTurnHealAbAttr"
            | "PostTurnHurtIfSleepingAbAttr"
            | "PostTurnResetStatusAbAttr"
            | "PostTurnRestoreBerryAbAttr"
            | "PostTurnStatusHealAbAttr"
            | "PostVictoryAbAttr"
            | "PostVictoryFormChangeAbAttr"
            | "PostWeatherChangeAbAttr"
            | "PostWeatherChangeFormChangeAbAttr"
            | "IceFaceFormChangeAbAttr"
            | "PostWeatherLapseAbAttr"
            | "PostWeatherLapseDamageAbAttr"
            | "PostWeatherLapseHealAbAttr"
            | "PreApplyBattlerTagAbAttr"
            | "PreApplyBattlerTagImmunityAbAttr"
            | "PreAttackAbAttr"
            | "PreAttackFieldMoveTypePowerBoostAbAttr"
            | "PreAttackWeatherOverrideAbAttr"
            | "PreDefendAbAttr"
            | "PreDefendFullHpEndureAbAttr"
            | "PreLeaveFieldAbAttr"
            | "PreLeaveFieldClearWeatherAbAttr"
            | "PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr"
            | "PreSetStatusAbAttr"
            | "PreSetStatusEffectImmunityAbAttr"
            | "PreStatStageChangeAbAttr"
            | "PreSummonAbAttr"
            | "PreSwitchOutAbAttr"
            | "PreSwitchOutFormChangeAbAttr"
            | "PreSwitchOutHealAbAttr"
            | "PreSwitchOutResetStatusAbAttr"
            | "PreWeatherDamageAbAttr"
            | "PreWeatherEffectAbAttr"
            | "PreventBerryUseAbAttr"
            | "PreventBypassSpeedChanceAbAttr"
            | "ProtectStatAbAttr"
            | "ReceivedMoveDamageMultiplierAbAttr"
            | "ReceivedTypeDamageMultiplierAbAttr"
            | "RedirectMoveAbAttr"
            | "RedirectTypeMoveAbAttr"
            | "ReduceBerryUseThresholdAbAttr"
            | "ReduceBurnDamageAbAttr"
            | "ReduceStatusEffectDurationAbAttr"
            | "ReflectStatStageChangeAbAttr"
            | "ReflectStatusMoveAbAttr"
            | "ReverseDrainAbAttr"
            | "RunSuccessAbAttr"
            | "SpeedBoostAbAttr"
            | "StabBoostAbAttr"
            | "StatMultiplierAbAttr"
            | "StatStageChangeCopyAbAttr"
            | "StatStageChangeMultiplierAbAttr"
            | "StatusEffectImmunityAbAttr"
            | "SuppressWeatherEffectAbAttr"
            | "SyncEncounterNatureAbAttr"
            | "SynchronizeStatusAbAttr"
            | "TerrainEventTypeChangeAbAttr"
            | "TypeImmunityAbAttr"
            | "TypeImmunityHealAbAttr"
            | "UserFieldBattlerTagImmunityAbAttr"
            | "UserFieldMoveTypePowerBoostAbAttr"
            | "UserFieldStatusEffectImmunityAbAttr"
            | "VariableMovePowerAbAttr"
            | "VariableMovePowerBoostAbAttr"
            | "WeightMultiplierAbAttr"
            | "UngroundedAbAttr"
            | "WonderSkinAbAttr"
            | "AiMovegenMoveStatsAbAttr"
            | "SummonTerrainAiMovegenMoveStatsAbAttr"

      Parameters

      • attrType: T

        AbAttr The ability attribute to check for.

      • canApply: boolean = true

        Whether to check if the ability is currently active; Default true

      • ignoreOverride: boolean = false

        Whether to ignore ability changing effects; Default false

      Returns AbAttrMap[T][]

      An array of all the ability attributes on this ability.

    • Return the ability priorities of the pokemon's ability and, if enabled, its passive ability

      Returns [activePriority: number] | [activePriority: number, passivePriority: number]

      A tuple containing the ability priorities of the pokemon

    • Calculates the accuracy multiplier of the user against a target.

      This method considers various factors such as the user's accuracy level, the target's evasion level, abilities, and modifiers to compute the final accuracy multiplier.

      Parameters

      • target: Pokemon

        The target Pokémon against which the move is used.

      • sourceMove: Move

        The move being used by the user.

      Returns number

      The calculated accuracy multiplier.

    • Returns all Game Objects in this Container.

      You can optionally specify a matching criteria using the property and value arguments.

      For example: getAll('body') would return only Game Objects that have a body property.

      You can also specify a value to compare the property to:

      getAll('visible', true) would return only Game Objects that have their visible property set to true.

      Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, and you set startIndex to 0 and endIndex to 50, it would return matches from only the first 50 Game Objects.

      Type Parameters

      Parameters

      • Optionalproperty: string

        The property to test on each Game Object in the Container.

      • Optionalvalue: any

        If property is set then the property must strictly equal this value to be included in the results.

      • OptionalstartIndex: number

        An optional start index to search from. Default 0.

      • OptionalendIndex: number

        An optional end index to search up to (but not included) Default Container.length.

      Returns T[]

      An array of matching Game Objects from this Container.

    • Returns the Game Object at the given position in this Container.

      Type Parameters

      Parameters

      • index: number

        The position to get the Game Object from.

      Returns T

      The Game Object at the specified index, or null if none found.

    • Calculates the damage of an attack made by another Pokemon against this Pokemon

      Parameters

      • __namedParameters: GetAttackDamageParams

        Type for the parameters of Pokemon.getAttackDamage

        • Optionaleffectiveness?: number

          If defined, used in place of calculated effectiveness values

        • OptionalignoreAbility?: boolean

          If true, ignores this Pokemon's defensive ability effects

        • OptionalignoreAllyAbility?: boolean

          If true, ignores the ally Pokemon's ability effects

        • OptionalignoreSourceAbility?: boolean

          If true, ignores the attacking Pokemon's ability effects

        • OptionalignoreSourceAllyAbility?: boolean

          If true, ignores the ability effects of the attacking pokemon's ally

        • OptionalisCritical?: boolean

          If true, calculates damage for a critical hit

        • move: Move

          The move used in the attack

        • Optionalsimulated?: boolean

          If true, suppresses changes to game state during the calculation

        • source: Pokemon

          The attacking Pokemon

      Returns DamageCalculationResult

      The DamageCalculationResult

    • Calculates the base damage of the given move against this Pokemon when attacked by the given source.
      Used during damage calculation and for Shell Side Arm's forecasting effect.

      Parameters

      • __namedParameters: GetBaseDamageParams

        Type for the parameters of Pokemon.getBaseDamage

        • OptionalignoreAbility?: boolean

          If true, ignores this Pokemon's defensive ability effects

        • OptionalignoreAllyAbility?: boolean

          If true, ignores the ally Pokemon's ability effects

        • OptionalignoreSourceAbility?: boolean

          If true, ignores the attacking Pokemon's ability effects

        • OptionalignoreSourceAllyAbility?: boolean

          If true, ignores the ability effects of the attacking pokemon's ally

        • OptionalisCritical?: boolean

          If true, calculates damage for a critical hit

        • move: Move

          The move used in the attack

        • moveCategory: MoveCategory

          The move's MoveCategory after variable-category effects are applied

        • Optionalsimulated?: boolean

          If true, suppresses changes to game state during the calculation

        • source: Pokemon

          The attacking Pokemon

      Returns number

      The move's base damage against this Pokemon when used by the source Pokemon.

    • Helper to getTypes that handles computing a Pokemon's normal typing.

      Parameters

      • bypassSummonData: boolean = false
      • useIllusion: boolean = false

      Returns PokemonType[]

    • Return the base pokemon's variant. Equivalent to getVariant if this pokemon is not a fusion.

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion; default false

      Returns Variant

      The shiny variant of this Pokemon's base species.

    • Parameters

      • Optionalback: boolean
      • OptionalignoreOverride: boolean

      Returns string

    • Parameters

      • Optionalback: boolean
      • OptionalignoreOverride: boolean

      Returns string

    • Parameters

      • Optionalback: boolean
      • OptionalignoreOverride: boolean

      Returns string

    • Gets the bounds of this Container. It works by iterating all children of the Container, getting their respective bounds, and then working out a min-max rectangle from that. It does not factor in if the children render or not, all are included.

      Some children are unable to return their bounds, such as Graphics objects, in which case they are skipped.

      Depending on the quantity of children in this Container it could be a really expensive call, so cache it and only poll it as needed.

      The values are stored and returned in a Rectangle object.

      Parameters

      • Optionaloutput: Rectangle

        A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created.

      Returns Rectangle

      The values stored in the output object.

    • Returns the world transform matrix as used for Bounds checks.

      The returned matrix is temporary and shouldn't be stored.undefined

      Returns TransformMatrix

      The world transform matrix.

    • Searches for the first instance of a child with its name property matching the given argument. Should more than one child have the same name only the first is returned.

      Type Parameters

      Parameters

      • name: string

        The name to search for.

      Returns T

      The first child with a matching name, or null if none were found.

    • Determine whether the given move will score a critical hit against this Pokemon.

      Parameters

      Returns boolean

      Whether the move will critically hit the defender.

    • Calculate the critical-hit stage of a move used against this pokemon by the given source.

      Parameters

      Returns number

      The final critical-hit stage value

    • Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist.

      You can also access values via the values object. For example, if you had a key called gold you can do either:

      sprite.getData('gold');
      

      Or access the value directly:

      sprite.data.values.gold;
      

      You can also pass in an array of keys, in which case an array of values will be returned:

      sprite.getData([ 'gold', 'armor', 'health' ]);
      

      This approach is useful for destructuring arrays in ES6.

      Parameters

      • key: string | string[]

        The key of the value to retrieve, or an array of keys.

      Returns any

      The value belonging to the given key, or an array of values, the order of which will match the input array.

    • Returns a reference to the underlying display list array that contains this Game Object, which will be either the Scene's Display List or the internal list belonging to its parent Container, if it has one.

      If this Game Object is not on a display list or in a container, it will return null.

      You should be very careful with this method, and understand that it returns a direct reference to the internal array used by the Display List. Mutating this array directly can cause all kinds of subtle and difficult to debug issues in your game.undefined

      Returns GameObject[] | null

      The internal Display List array of Game Objects, or null.

    • Calculates and retrieves the final value of a stat considering any held items, move effects, opponent abilities, and whether there was a critical hit.

      Parameters

      • stat: ATK | DEF | SPATK | SPDEF | SPD

        The desired stat to check

      • __namedParameters: GetEffectiveStatParams = {}

        Parameters for Pokemon#getEffectiveStat

        • OptionalforDefend?: boolean

          Whether the stat is being calculated as though the move is being used against this Pokémon.

          false

          Currently only used to ignore the weather boost for sandstorm/snow when the opponent has Mega Sol.

        • OptionalignoreAbility?: boolean

          Whether to ignore the user's ability during the calculation

          false

        • OptionalignoreAllyAbility?: boolean

          Whether to ignore the ability of the opponent's ally

          false

          For example, the effects of the ally's Flower Gift ability

        • OptionalignoreHeldItems?: boolean

          Whether to ignore this pokemon's held items

          false

        • OptionalignoreOppAbility?: boolean

          Whether to ignore the opponent's ability during the calculation

          false

        • OptionalisCritical?: boolean

          Whether the move being used will land as a critical hit

          false

          Used to ignore offensive/defensive stat stage drops/boosts.

        • Optionalmove?: Move

          The move being used in the interaction

          Passed to respect the effects of moves that ignore stat changes.

        • Optionalopponent?: Pokemon

          The other pokemon in the interaction

          Used to respect the abilities for the interaction; (unaware, mega sol, ally's flower gift)

        • Optionalsimulated?: boolean

          Whether to suppress changes to game state

          true

          Passed to the applyAbAttrs method invocations

      Returns number

      The final in-battle value for the given stat.

    • Gets the first Game Object in this Container.

      You can also specify a property and value to search for, in which case it will return the first Game Object in this Container with a matching property and / or value.

      For example: getFirst('visible', true) would return the first Game Object that had its visible property set.

      You can limit the search to the startIndex - endIndex range.

      Type Parameters

      Parameters

      • property: string

        The property to test on each Game Object in the Container.

      • value: any

        The value to test the property against. Must pass a strict (===) comparison check.

      • OptionalstartIndex: number

        An optional start index to search from. Default 0.

      • OptionalendIndex: number

        An optional end index to search up to (but not included) Default Container.length.

      Returns T

      The first matching Game Object, or null if none was found.

    • Parameters

      • Optionalback: boolean
      • OptionalignoreOverride: boolean

      Returns string

    • Parameters

      • Optionalback: boolean
      • OptionalignoreOverride: boolean

      Returns string

    • Parameters

      • Optionalback: boolean
      • OptionalignoreOverride: boolean

      Returns string

    • Return this Pokemon's fusion's Gender.

      Parameters

      • ignoreOverride: boolean = false

        Whether to ignore any overrides caused by Transform; default false

      • useIllusion: boolean = false

        Whether to consider this pokemon's illusion if present; default false

      Returns Gender

      The Gender of this Pokemon's fusion.

    • Parameters

      • ignoreOverride: boolean = false
      • useIllusion: boolean = true

      Returns string

    • Parameters

      • OptionalignoreOverride: boolean
      • useIllusion: boolean = true

      Returns string

    • Return the SpeciesForm of this Pokemon's fusion counterpart.

      Parameters

      • ignoreOverride: boolean = false

        Whether to ignore species overrides caused by Transform; default false

      • useIllusion: boolean = false

        Whether to consider the species of this Pokemon's illusion; default false

      Returns PokemonSpeciesForm

      The PokemonSpeciesForm of this Pokemon's fusion counterpart.

    • Parameters

      • OptionalignoreOverride: boolean

      Returns string

    • Get the shiny variant of this Pokémon's fusion species

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion

      Returns Variant

      The shiny variant of this pokemon's fusion species.

      Always returns 0 if the pokemon is not a fusion.

    • Return this Pokemon's Gender.

      Parameters

      • ignoreOverride: boolean = false

        Whether to ignore any overrides caused by Transform; default false

      • useIllusion: boolean = false

        Whether to consider this pokemon's illusion if present; default false

      Returns Gender

      the Gender of this Pokemon.

    • Return the ratio of this Pokémon's current HP to its maximum HP

      Parameters

      • precise: boolean = false

        Whether to return the exact HP ratio (e.g. 0.54321), or one rounded to the nearest %; default false

      Returns number

      The current HP ratio

    • Parameters

      • ignoreOverride: boolean = false
      • useIllusion: boolean = true

      Returns string

    • Parameters

      • OptionalignoreOverride: boolean
      • useIllusion: boolean = false

      Returns string

    • Returns the index of the given Game Object in this Container.

      Type Parameters

      Parameters

      • child: T

        The Game Object to search for in this Container.

      Returns number

      The index of the Game Object in this Container, or -1 if not found.

    • Returns an array containing the display list index of either this Game Object, or if it has one, its parent Container. It then iterates up through all of the parent containers until it hits the root of the display list (which is index 0 in the returned array).

      Used internally by the InputPlugin but also useful if you wish to find out the display depth of this Game Object and all of its ancestors.undefined

      Returns number[]

      An array of display list position indexes.

    • Return the most recently executed TurnMove this Pokemon has used that is:

      Parameters

      • ignoreStruggle: boolean = false

        Whether to additionally ignore MoveId.STRUGGLE; default false

      • ignoreFollowUp: boolean = true

        Whether to ignore moves with a use type of MoveUseMode.FOLLOW_UP (e.g. ones called by Copycat/Mirror Move); default true.

      Returns TurnMove | undefined

      The last move this Pokemon has used satisfying the aforementioned conditions, or undefined if no applicable moves have been used since switching in.

    • Return a list of the most recent move entries in this Pokemon's move history. The retrieved values are sorted in order from NEWEST to OLDEST.

      Parameters

      • moveCount: number = 1

        The maximum number of move entries to retrieve. If negative, retrieves the Pokemon's entire move history (equivalent to reversing the output of getMoveHistory). Default is 1.

      Returns readonly TurnMove[]

      An array of TurnMoves, as specified above.

    • Get all level up moves in a given range for a particular pokemon.

      Parameters

      • startingLevel: {
            includeEvolutionMoves?: boolean;
            includePrevolutionMoves?: boolean;
            includeRelearnerMoves?: boolean;
            learnSituation?: LearnMoveSituation;
            startingLevel?: number;
        } = {}

        (Default this.level) Don't include moves below this level

      Returns LevelMovesWithSource

      A list of moves and the levels they can be learned at, along with the source of the move

    • Takes the given x and y coordinates and converts them into local space for this Game Object, taking into account parent and local transforms, and the Display Origin.

      The returned Vector2 contains the translated point in its properties.

      A Camera needs to be provided in order to handle modified scroll factors. If no camera is specified, it will use the main camera from the Scene to which this Game Object belongs.

      Parameters

      • x: number

        The x position to translate.

      • y: number

        The y position to translate.

      • Optionalpoint: Vector2

        A Vector2, or point-like object, to store the results in.

      • Optionalcamera: Camera

        The Camera which is being tested against. If not given will use the Scene default camera.

      Returns Vector2

      The translated point.

    • Gets the local transform matrix for this Game Object.

      Parameters

      • OptionaltempMatrix: TransformMatrix

        The matrix to populate with the values from this Game Object.

      Returns TransformMatrix

      The populated Transform Matrix.

    • Return this pokemon's overall luck value, based on its shininess (1 pt per variant lvl).

      Returns number

      The luck value of this Pokemon.

    • Compute the given Pokémon's matchup score against this Pokémon

      Parameters

      • opponent: Pokemon

        The Pokemon to compare this Pokémon against

      Returns number

      A score value based on how favorable this Pokémon is when fighting the given Pokémon

      In most cases, this score ranges from near-zero to 16, but the maximum possible matchup score is 64.

    • Calculate the effectiveness of the move against this Pokémon, including modifiers from move and ability attributes

      Parameters

      • source: Pokemon

        The attacking Pokémon.

      • move: Move

        The move being used by the attacking Pokémon.

      • ignoreAbility: boolean = false

        Whether to ignore abilities that might affect type effectiveness or immunity; default false

      • simulated: boolean = true

        (Default true) Whether to apply abilities via simulated calls.
        ⚠️ Should only ever be false during MoveEffectPhase

      • Optionalcancelled: BooleanHolder<boolean>

        Stores whether the move was cancelled by a non-type-based immunity.

      • useIllusion: boolean = false

        Whether to consider an active illusion

      Returns TypeDamageMultiplier

      The type damage multiplier, indicating the effectiveness of the move

    • Return all the PokemonMoves that make up this Pokemon's moveset.

      Parameters

      • ignoreOverride: boolean = false

        Whether to ignore any overrides caused by Transform; default false

      Returns PokemonMove[]

      An array of PokemonMove, as described above.

      Takes into account player/enemy moveset overrides (which will also override PP count).

    • Calculates the type of a move when used by this Pokemon after type-changing move and ability attributes have applied.

      Parameters

      • move: Move

        Move The move being used.

      • simulated: boolean = true

        If true, prevents showing abilities applied in this calculation.

      Returns PokemonType

      The PokemonType of the move after attributes are applied

    • Return the type of a move, considering abilities, when used by this Pokémon for the purposes of spawning items.

      Parameters

      • move: Move

        The move being used

      Returns PokemonType[]

      An array of PokemonTypes that the move is considered to be for item spawning purposes.

      This method should not be used if the move has the VariableMoveTypeAttr attribute.

    • Return this Pokemon's name.

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion; default false

      Returns string

      This Pokemon's name.

      getNameToRender - gets this Pokemon's display name.

    • Return the name that will be displayed when this Pokemon is sent out into battle.

      Parameters

      • useIllusion: { prependFormName?: boolean; useIllusion?: boolean } = {}

        (Default true) Whether to consider this Pokemon's illusion if present

      Returns string

      The name to render for this Pokemon.

    • Returns the pokemon that oppose this one and are active in non-speed order

      Parameters

      • onField: boolean = true

        whether to also check if the pokemon is currently on the field (defaults to true)

      Returns Pokemon[]

    • Gets the sum total rotation of all of this Game Object's parent Containers.

      The returned value is in radians and will be zero if this Game Object has no parent container.undefined

      Returns number

      The sum total rotation, in radians, of all parent containers of this Game Object.

    • Get the number of persistent treasure items this Pokemon has

      Returns number

      The number of persistent treasure items this Pokémon has

      Persistent treasure items are defined as held items that give money after battle, such as the Lucky Egg or the Amulet Coin. Used exclusively for Gimmighoul's evolution condition

    • Returns a random Game Object from this Container.

      Type Parameters

      Parameters

      • OptionalstartIndex: number

        An optional start index. Default 0.

      • Optionallength: number

        An optional length, the total number of elements (from the startIndex) to choose from.

      Returns T

      A random child from the Container, or null if the Container is empty.

    • Parameters

      • ignoreOverride: boolean = false

      Returns string

    • Parameters

      • OptionalignoreOverride: boolean

      Returns string

    • Parameters

      • OptionalignoreOverride: boolean

      Returns string

    • Retrieves the entire set of stats of this Pokemon.

      Parameters

      • bypassSummonData: boolean = true

        Whether to prefer actual stats (true) or in-battle overridden stats (false); default true

      Returns number[]

      The numeric values of this Pokemon's stats as an array.

    • Calculate the stat stage multiplier of the user against an opponent

      Parameters

      • stat: ATK | DEF | SPATK | SPDEF | SPD

        The EffectiveStat to calculate

      • Optionalopponent: Pokemon

        The Pokemon being targeted

      • Optionalmove: Move

        The Move being used

      • ignoreOppAbility: boolean = false

        determines whether the effects of the opponent's abilities (i.e. Unaware) should be ignored; default false

      • isCritical: boolean = false

        determines whether a critical hit has occurred or not; default false

      • simulated: boolean = true

        determines whether effects are applied without altering game state; default true

      • ignoreHeldItems: boolean = false

        determines whether this Pokemon's held items should be ignored during the stat calculation; default false

      Returns number

      the stat stage multiplier to be used for effective stat calculation

      This does not apply to evasion or accuracy

    • Retrieves the entire set of in-battle stat stages of the Pokemon.

      Returns number[]

      the numeric values of the Pokemon's in-battle stat stages if available, a fresh stat stage array otherwise

    • Returns the Pokemon's offset from its current field position in the event that it has a Substitute doll in effect. The offset is returned in [ x, y ] format.

      Returns [number, number]

    • Return the BattlerTag preventing this Pokemon from using a move against the given target.

      Parameters

      • moveId: MoveId

        The MoveId of the move being used

      • target: Pokemon

        The Pokemon being targeted by the move

      Returns MoveRestrictionBattlerTag | undefined

      The first BattlerTag preventing this Pokemon from using moveId against target (if one exists).

      Currently used solely to prevent Pollen Puff from being used on an ally with Heal Block active.

    • Helper function to calculateStabMultiplier that handles computing boosts from a Pokemon being Terastallized.

      Parameters

      • teraType: PokemonType

        This Pokemon's Tera Type

      • moveType: PokemonType

        The type of the Move being used

      • matchesSourceType: boolean

        Whether the move type matches this Pokemon's base type

      Returns number

      The additional STAB bonus this Pokemon receives from terastallization.

      Unlike most other functions used during damage calculation, this is computed from the perspective of the attacker (given it functions entirely independently of the defender's stats, abilities, etc.).

    • Evaluate and return this Pokemon's typing.

      Parameters

      • includeTeraType: {
            bypassSummonData?: boolean;
            forMoveGen?: boolean;
            ignoreThirdType?: boolean;
            includeTeraType?: boolean;
            returnOriginalTypesIfStellar?: boolean;
            useIllusion?: boolean;
        } = {}

        (Default true) Whether to use this Pokemon's Tera type if Terastallized

      Returns [PokemonType, ...PokemonType[]]

      A non-empty array of PokemonTypes corresponding to this Pokemon's typing (real or perceived).

    • Check which egg moves have been unlocked for this Pokemon.

      Returns MoveId[]

      An array of all MoveIds that are egg moves and unlocked for this Pokemon.

      Looks at either the species it was met at or the first Species in its evolution line that can act as a starter and provides those egg moves.

    • Return this Pokemon's shiny variant. If a fusion, returns the maximum of the two variants. Only meaningful if this pokemon is actually shiny.

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion; default false

      Returns Variant

      The shiny variant of this Pokemon.

    • Gets the weight of the Pokemon with subtractive modifiers (Autotomize) happening first and then multiplicative modifiers happening after (Heavy Metal and Light Metal)

      Returns number

      the kg of the Pokemon (minimum of 0.1)

    • Gets the world position of this Game Object, factoring in any parent Containers.

      Parameters

      • Optionalpoint: Vector2

        A Vector2, or point-like object, to store the result in.

      • OptionaltempMatrix: TransformMatrix

        A temporary matrix to hold the Game Object's values.

      • OptionalparentMatrix: TransformMatrix

        A temporary matrix to hold parent values.

      Returns Vector2

      The world position of this Game Object.

    • Gets the world transform matrix for this Game Object, factoring in any parent Containers.

      Parameters

      • OptionaltempMatrix: TransformMatrix

        The matrix to populate with the values from this Game Object.

      • OptionalparentMatrix: TransformMatrix

        A temporary matrix to hold parent values during the calculations.

      Returns TransformMatrix

      The populated Transform Matrix.

    • Check whether a pokemon has the specified ability in effect, either as a normal or passive ability. Accounts for all the various effects which can disable or modify abilities.

      Parameters

      • ability: AbilityId

        The Ability to check for

      • canApply: boolean = true

        Whether to check if the ability is currently active; default true

      • ignoreOverride: boolean = false

        Whether to ignore any overrides caused by Transform; default false

      Returns boolean

      Whether this Pokemon has the given ability

    • Check whether this pokemon has an ability with the specified attribute in effect, either as a normal or passive ability. Accounts for all the various effects which can disable or modify abilities.

      Parameters

      • attrType:
            | "AddSecondStrikeAbAttr"
            | "AlliedFieldDamageReductionAbAttr"
            | "AllyMoveCategoryPowerBoostAbAttr"
            | "AllyStatMultiplierAbAttr"
            | "AlwaysHitAbAttr"
            | "ArenaTrapAbAttr"
            | "BattlerTagImmunityAbAttr"
            | "BlockCritAbAttr"
            | "BlockItemTheftAbAttr"
            | "BlockNonDirectDamageAbAttr"
            | "BlockOneHitKOAbAttr"
            | "BlockRecoilDamageAttr"
            | "BlockRedirectAbAttr"
            | "BlockStatusDamageAbAttr"
            | "BonusCritAbAttr"
            | "BypassBurnDamageReductionAbAttr"
            | "BypassSpeedChanceAbAttr"
            | "ChangeMovePriorityAbAttr"
            | "ChangeMovePriorityInBracketAbAttr"
            | "CheckTrappedAbAttr"
            | "CommanderAbAttr"
            | "ConditionalCritAbAttr"
            | "ConditionalUserFieldBattlerTagImmunityAbAttr"
            | "ConditionalUserFieldProtectStatAbAttr"
            | "ConditionalUserFieldStatusEffectImmunityAbAttr"
            | "ConfusionOnStatusEffectAbAttr"
            | "CopyFaintedAllyAbilityAbAttr"
            | "CudChewConsumeBerryAbAttr"
            | "CudChewRecordBerryAbAttr"
            | "DoubleBattleChanceAbAttr"
            | "DoubleBerryEffectAbAttr"
            | "DownloadAbAttr"
            | "EffectSporeAbAttr"
            | "ExecutedMoveAbAttr"
            | "FetchBallAbAttr"
            | "FieldMovePowerBoostAbAttr"
            | "FieldMoveTypePowerBoostAbAttr"
            | "FieldMultiplyStatAbAttr"
            | "FieldPreventExplosiveMovesAbAttr"
            | "FieldPriorityMoveImmunityAbAttr"
            | "FlinchEffectAbAttr"
            | "FlinchStatStageChangeAbAttr"
            | "ForceSwitchOutImmunityAbAttr"
            | "ForewarnAbAttr"
            | "FormBlockDamageAbAttr"
            | "FriskAbAttr"
            | "FullHpResistTypeAbAttr"
            | "GorillaTacticsAbAttr"
            | "HealFromBerryUseAbAttr"
            | "IgnoreContactAbAttr"
            | "IgnoreMoveEffectsAbAttr"
            | "IgnoreOpponentStatStagesAbAttr"
            | "IgnoreProtectOnContactAbAttr"
            | "IgnoreTypeImmunityAbAttr"
            | "IgnoreTypeStatusEffectImmunityAbAttr"
            | "IllusionBreakAbAttr"
            | "IllusionPostBattleAbAttr"
            | "IllusionPreSummonAbAttr"
            | "IncreasePpUsedAbAttr"
            | "InfiltratorAbAttr"
            | "IntimidateImmunityAbAttr"
            | "LowHpMoveTypePowerBoostAbAttr"
            | "MaxMultiHitAbAttr"
            | "MoneyAbAttr"
            | "MoodyAbAttr"
            | "MoveAbilityBypassAbAttr"
            | "MoveDamageBoostAbAttr"
            | "MoveEffectChanceMultiplierAbAttr"
            | "MoveHealBoostAbAttr"
            | "MoveImmunityAbAttr"
            | "MoveImmunityStatStageChangeAbAttr"
            | "MovePowerBoostAbAttr"
            | "MoveTypeChangeAbAttr"
            | "MoveTypePowerBoostAbAttr"
            | "MultCritAbAttr"
            | "NoFusionAbilityAbAttr"
            | "NoTransformAbilityAbAttr"
            | "NonSuperEffectiveImmunityAbAttr"
            | "PokemonTypeChangeAbAttr"
            | "PostAttackAbAttr"
            | "PostAttackApplyBattlerTagAbAttr"
            | "PostAttackApplyStatusEffectAbAttr"
            | "PostAttackContactApplyStatusEffectAbAttr"
            | "PostAttackStealHeldItemAbAttr"
            | "PostBattleAbAttr"
            | "PostBattleInitAbAttr"
            | "PostBattleInitFormChangeAbAttr"
            | "PostBattleLootAbAttr"
            | "PostBiomeChangeAbAttr"
            | "PostBiomeChangeTerrainChangeAbAttr"
            | "PostBiomeChangeWeatherChangeAbAttr"
            | "PostDamageAbAttr"
            | "PostDamageForceSwitchAbAttr"
            | "PostDancingMoveAbAttr"
            | "PostDefendAbAttr"
            | "PostDefendAbilityGiveAbAttr"
            | "PostDefendAbilitySwapAbAttr"
            | "PostDefendApplyArenaTrapTagAbAttr"
            | "PostDefendApplyBattlerTagAbAttr"
            | "PostDefendApplyStatusEffectAbAttr"
            | "PostDefendContactApplyTagChanceAbAttr"
            | "PostDefendContactDamageAbAttr"
            | "PostDefendHpGatedStatStageChangeAbAttr"
            | "PostDefendIllusionBreakAbAttr"
            | "PostDefendMoveDisableAbAttr"
            | "PostDefendPerishSongAbAttr"
            | "PostDefendStatStageChangeAbAttr"
            | "PostDefendStealHeldItemAbAttr"
            | "PostDefendTerrainChangeAbAttr"
            | "PostDefendTypeChangeAbAttr"
            | "PostDefendWeatherChangeAbAttr"
            | "PostFaintAbAttr"
            | "PostFaintContactDamageAbAttr"
            | "PostFaintHPDamageAbAttr"
            | "PostFaintUnsuppressedWeatherFormChangeAbAttr"
            | "PostIntimidateStatStageChangeAbAttr"
            | "PostItemLostAbAttr"
            | "PostItemLostApplyBattlerTagAbAttr"
            | "PostKnockOutAbAttr"
            | "PostKnockOutStatStageChangeAbAttr"
            | "PostMoveUsedAbAttr"
            | "PostReceiveCritStatStageChangeAbAttr"
            | "PostSetStatusAbAttr"
            | "PostStatStageChangeAbAttr"
            | "PostStatStageChangeStatStageChangeAbAttr"
            | "PostSummonAbAttr"
            | "PostSummonAddArenaTagAbAttr"
            | "PostSummonAddBattlerTagAbAttr"
            | "PostSummonAllyHealAbAttr"
            | "PostSummonClearAllyStatStagesAbAttr"
            | "PostSummonCopyAbilityAbAttr"
            | "PostSummonCopyAllyStatsAbAttr"
            | "PostSummonFormChangeAbAttr"
            | "PostSummonFormChangeByWeatherAbAttr"
            | "PostSummonHealStatusAbAttr"
            | "PostSummonMessageAbAttr"
            | "PostSummonRemoveArenaTagAbAttr"
            | "PostSummonRemoveBattlerTagAbAttr"
            | "PostSummonRemoveEffectAbAttr"
            | "PostSummonStatStageChangeAbAttr"
            | "PostSummonStatStageChangeOnArenaAbAttr"
            | "PostSummonTerrainChangeAbAttr"
            | "PostSummonTransformAbAttr"
            | "PostSummonUnnamedMessageAbAttr"
            | "PostSummonUserFieldRemoveStatusEffectAbAttr"
            | "PostSummonWeatherChangeAbAttr"
            | "PostSummonWeatherSuppressedFormChangeAbAttr"
            | "PostTerrainChangeAbAttr"
            | "PostTurnAbAttr"
            | "PostTurnFormChangeAbAttr"
            | "PostTurnHealAbAttr"
            | "PostTurnHurtIfSleepingAbAttr"
            | "PostTurnResetStatusAbAttr"
            | "PostTurnRestoreBerryAbAttr"
            | "PostTurnStatusHealAbAttr"
            | "PostVictoryAbAttr"
            | "PostVictoryFormChangeAbAttr"
            | "PostWeatherChangeAbAttr"
            | "PostWeatherChangeFormChangeAbAttr"
            | "IceFaceFormChangeAbAttr"
            | "PostWeatherLapseAbAttr"
            | "PostWeatherLapseDamageAbAttr"
            | "PostWeatherLapseHealAbAttr"
            | "PreApplyBattlerTagAbAttr"
            | "PreApplyBattlerTagImmunityAbAttr"
            | "PreAttackAbAttr"
            | "PreAttackFieldMoveTypePowerBoostAbAttr"
            | "PreAttackWeatherOverrideAbAttr"
            | "PreDefendAbAttr"
            | "PreDefendFullHpEndureAbAttr"
            | "PreLeaveFieldAbAttr"
            | "PreLeaveFieldClearWeatherAbAttr"
            | "PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr"
            | "PreSetStatusAbAttr"
            | "PreSetStatusEffectImmunityAbAttr"
            | "PreStatStageChangeAbAttr"
            | "PreSummonAbAttr"
            | "PreSwitchOutAbAttr"
            | "PreSwitchOutFormChangeAbAttr"
            | "PreSwitchOutHealAbAttr"
            | "PreSwitchOutResetStatusAbAttr"
            | "PreWeatherDamageAbAttr"
            | "PreWeatherEffectAbAttr"
            | "PreventBerryUseAbAttr"
            | "PreventBypassSpeedChanceAbAttr"
            | "ProtectStatAbAttr"
            | "ReceivedMoveDamageMultiplierAbAttr"
            | "ReceivedTypeDamageMultiplierAbAttr"
            | "RedirectMoveAbAttr"
            | "RedirectTypeMoveAbAttr"
            | "ReduceBerryUseThresholdAbAttr"
            | "ReduceBurnDamageAbAttr"
            | "ReduceStatusEffectDurationAbAttr"
            | "ReflectStatStageChangeAbAttr"
            | "ReflectStatusMoveAbAttr"
            | "ReverseDrainAbAttr"
            | "RunSuccessAbAttr"
            | "SpeedBoostAbAttr"
            | "StabBoostAbAttr"
            | "StatMultiplierAbAttr"
            | "StatStageChangeCopyAbAttr"
            | "StatStageChangeMultiplierAbAttr"
            | "StatusEffectImmunityAbAttr"
            | "SuppressWeatherEffectAbAttr"
            | "SyncEncounterNatureAbAttr"
            | "SynchronizeStatusAbAttr"
            | "TerrainEventTypeChangeAbAttr"
            | "TypeImmunityAbAttr"
            | "TypeImmunityHealAbAttr"
            | "UserFieldBattlerTagImmunityAbAttr"
            | "UserFieldMoveTypePowerBoostAbAttr"
            | "UserFieldStatusEffectImmunityAbAttr"
            | "VariableMovePowerAbAttr"
            | "VariableMovePowerBoostAbAttr"
            | "WeightMultiplierAbAttr"
            | "UngroundedAbAttr"
            | "WonderSkinAbAttr"
            | "AiMovegenMoveStatsAbAttr"
            | "SummonTerrainAiMovegenMoveStatsAbAttr"

        The AbAttr | attribute to check for

      • canApply: boolean = true

        Whether to check if the ability is currently active; default true

      • ignoreOverride: boolean = false

        Whether to ignore any overrides caused by Transform; default false

      Returns boolean

      Whether this Pokemon has an ability with the given AbAttr.

    • Checks if a pokemon has a passive either from:

      • bought with starter candy
      • set by override
      • is a boss pokemon

      Returns boolean

      true if the Pokemon has a passive

    • Get whether the given move is currently disabled for this Pokémon by a move restriction tag.

      Parameters

      • moveId: MoveId

        The ID of the move to check

      Returns boolean

      true if the move is disabled for this Pokemon, otherwise false

      ⚠️ Only checks for restrictions due to a battler tag, not due to the move's own attributes.

    • Check whether or not this Pokémon's root form has the same ability

      Parameters

      • abilityIndex: number

        The ability index to check

      Returns boolean

      Whether the Pokemon's root form has the same ability

    • Check whether this Pokemon either is or is fused with the given SpeciesId.

      Parameters

      • species: SpeciesId

        The SpeciesId to check against.

      • OptionalformKey: string

        If provided, will require the species to be in the given form.

      Returns boolean

      Whether this Pokemon has this species as either its base or fusion counterpart.

    • Restore a specific amount of HP to this Pokémon

      Parameters

      • amount: number

        The amount of HP to restore

      Returns number

      The true amount of HP restored; may be less than amount if amount would overheal

    • Increase a value for the given key within this Game Object's Data Manager. If the key doesn't already exist in the Data Manager then it is created with a value of 0 before being increased.

      If the Game Object has not been enabled for data (via setDataEnabled) then it will be enabled before setting the value.

      If the key doesn't already exist in the Data Manager then it is created.

      When the value is first set, a setdata event is emitted from this Game Object.

      Parameters

      • key: string

        The key to change the value for.

      • Optionalamount: number

        The amount to increase the given key by. Pass a negative value to decrease the key. Default 1.

      Returns this

      This GameObject.

    • Checks if this Pokemon is allowed in battle (ie: not fainted, and allowed under any active challenges).

      Parameters

      • onField: boolean = false

        Whether to also check if the pokemon is currently on the field; default false

      Returns boolean

      Whether this pokemon is considered "active", as described above. Returns false if there is no active BattleScene or the pokemon is disallowed.

    • Check if this pokemon is both not fainted and allowed to be used based on currently active challenges.

      Returns boolean

      Whether this Pokemon is allowed to partake in battle.

    • Check if this pokemon is allowed based on any active challenges. Usually should not be called directly in favor of consulting ().

      Returns boolean

      Whether this Pokemon is allowed under the current challenge conditions.

    • Check whether the specified Pokémon is an ally

      Parameters

      Returns boolean

      Whether the 2 Pokemon are on the same party

    • Get whether this Pokémon's base species is shiny

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion; default false

      Returns boolean

      Whether the pokemon is shiny

    • Check whether this Pokemon is doubly shiny (both normal and fusion are shiny).

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion; default false

      Returns boolean

      Whether this pokemon's base and fusion counterparts are both shiny.

    • Checks if a pokemon is fainted (ie: its hp <= 0). Usually should not be called directly in favor of calling ().

      Parameters

      • checkStatus: boolean = false

        Whether to also check that the pokemon's status is StatusEffect.FAINT; default false

      Returns boolean

      Whether this Pokemon is fainted, as described above.

    • Return whether this Pokemon is currently fused with anything.

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion; default false

      Returns boolean

      Whether this Pokemon is currently fused with another species.

    • Get whether this Pokémon's fusion species is shiny

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion; default true

      Returns boolean

      Whether this Pokémon's fusion species is shiny, or false if there is no fusion

    • Return whether this Pokemon is currently on the ground.

      Parameters

      • ignoreSemiInvulnerable: boolean = false

        (Default false) Whether to ignore the target's semi-invulnerable state when determining groundedness

      • useIllusion: boolean = false

        (Default false) Whether to use this Pokemon's illusion for typing-related calculations

      Returns boolean

      Whether this Pokemon is currently grounded, as described above.

      To be considered grounded, a Pokemon must either:

    • Parameters

      • formKey: string = ...

        (Default this.getFormKey()) The form key to check

      Returns boolean

      Whether this Pokémon is in a Dynamax or Gigantamax form

    • Parameters

      • formKey: string = ...

        (Default this.getFormKey()) The form key to check

      Returns boolean

      Whether this Pokémon is in a Mega or Primal form

    • Determine whether the given move is selectable by this Pokemon.

      Parameters

      • moveId: MoveId

        The MoveId to check

      Returns [selectable: boolean, msg: string]

      A tuple containing whether the move can be selected and the text to display if it cannot

      Checks both the move's own restrictions and any BattlerTag-imposed restrictions.

    • Return whether this Pokemon is restricted from using a move against the given target.

      Parameters

      • moveId: MoveId

        The MoveId of the move being used

      • target: Pokemon

        The Pokemon being targeted by the move

      Returns boolean

      Whether moveId is unable to target target due to a restricting effect

      Currently used solely to prevent Pollen Puff from being used on an ally with Heal Block active.

    • Returns whether or not the Pokemon's position on the field is offset because the Pokemon has a Substitute active.

      Returns boolean

    • Check if this Pokemon's typing includes the specified type.

      Parameters

      • type: PokemonType

        The PokemonType to check

      • includeTeraType: {
            bypassSummonData?: boolean;
            ignoreThirdType?: boolean;
            includeTeraType?: boolean;
            returnOriginalTypesIfStellar?: boolean;
            useIllusion?: boolean;
        } = {}

        (Default true) Whether to use this Pokemon's tera type if Terastallized

      Returns boolean

      Whether this Pokemon is of the specified type.

    • Check whether the specified Pokémon is an opponent

      Parameters

      Returns boolean

      Whether the 2 Pokemon belong to different parties

    • Check the specified pokemon is considered to be the opposite gender as this pokemon

      Parameters

      • pokemon: Pokemon

        The Pokémon to compare against

      Returns boolean

      Whether the pokemon are considered to be opposite genders

    • Check if this Pokémon is protected by Safeguard

      Parameters

      • attacker: Pokemon

        The Pokémon responsible for the interaction that needs to check against Safeguard

      Returns boolean

      Whether this Pokémon is protected by Safeguard

    • Check whether this Pokémon is shiny, including its fusion species

      Parameters

      • useIllusion: boolean = false

        Whether to consider an active illusion

      Returns boolean

      Whether this Pokemon is shiny

    • Determines whether this Pokemon is prevented from running or switching due to effects from moves and/or abilities.

      Parameters

      • trappedAbMessages: string[] = []

        If defined, ability trigger messages (e.g. from Shadow Tag) are forwarded through this array.

      • simulated: boolean = true

        If true, applies abilities via simulated calls.

      Returns boolean

      true if the pokemon is trapped

    • Passes all Game Objects in this Container to the given callback.

      Only use this method when you absolutely know that the Container will not be modified during the iteration, i.e. by removing or adding to its contents.

      Parameters

      • callback: Function

        The function to call.

      • Optionalcontext: object

        Value to use as this when executing callback.

      • ...args: any[]

        Additional arguments that will be passed to the callback, after the child.

      Returns this

      This Container instance.

    • Causes a Pokemon to leave the field (such as in preparation for a switch out/escape).

      Parameters

      • clearEffects: boolean = true

        Whether effects should be cleared, or passed to the next pokemon (e.g. due to Baton Pass)

      • hideInfo: boolean = true

        Indicates if this should also play the animation to hide the Pokemon's info container

      • destroy: boolean = false

      Returns void

    • Return the number of listeners listening to a given event.

      Parameters

      • event: string | symbol

        The event name.

      Returns number

      The number of listeners.

    • Return the listeners registered for a given event.

      Parameters

      • event: string | symbol

        The event name.

      Returns Function[]

      The registered listeners.

    • Load all assets needed for this Pokemon's use in battle

      Parameters

      • ignoreOverride: boolean = true

        Whether to ignore overrides caused by Transform; default true

      • useIllusion: boolean = false

        Whether to consider this pokemon's active illusion; default false

      Returns Promise<void>

      A promise that resolves once all the corresponding assets have been loaded.

    • Reduces one of this Pokemon's held item stacks by 1, removing it if applicable. Does nothing if this Pokemon is somehow not the owner of the held item.

      Parameters

      • heldItem: PokemonHeldItemModifier

        The item stack to be reduced.

      • forBattle: boolean = true

        Whether to trigger in-battle effects (such as Unburden) after losing the item. Default: true Should be false for all item loss occurring outside of battle (MEs, etc.).

      Returns boolean

      Whether the item was removed successfully.

    • Moves a Game Object above another one within this Container. If the Game Object is already above the other, it isn't moved.

      These 2 Game Objects must already be children of this Container.

      Type Parameters

      Parameters

      • child1: T

        The Game Object to move above base Game Object.

      • child2: T

        The base Game Object.

      Returns this

      This Container instance.

    • Moves a Game Object below another one within this Container. If the Game Object is already below the other, it isn't moved.

      These 2 Game Objects must already be children of this Container.

      Type Parameters

      Parameters

      • child1: T

        The Game Object to move below base Game Object.

      • child2: T

        The base Game Object.

      Returns this

      This Container instance.

    • Moves the given Game Object down one place in this Container, unless it's already at the bottom.

      Type Parameters

      Parameters

      • child: T

        The Game Object to be moved in the Container.

      Returns this

      This Container instance.

    • Moves a Game Object to a new position within this Container.

      The Game Object must already be a child of this Container.

      The Game Object is removed from its old position and inserted into the new one. Therefore the Container size does not change. Other children will change position accordingly.

      Type Parameters

      Parameters

      • child: T

        The Game Object to move.

      • index: number

        The new position of the Game Object in this Container.

      Returns this

      This Container instance.

    • Moves the given Game Object up one place in this Container, unless it's already at the top.

      Type Parameters

      Parameters

      • child: T

        The Game Object to be moved in the Container.

      Returns this

      This Container instance.

    • Remove the listeners of a given event.

      Parameters

      • event: string | symbol

        The event name.

      • Optionalfn: Function

        Only remove the listeners that match this function.

      • Optionalcontext: any

        Only remove the listeners that have this context.

      • Optionalonce: boolean

        Only remove one-time listeners.

      Returns this

      this.

    • Add a listener for a given event.

      Parameters

      • event: string | symbol

        The event name.

      • fn: Function

        The listener function.

      • Optionalcontext: any

        The context to invoke the listener with. Default this.

      Returns this

      this.

    • Add a one-time listener for a given event. The listener is automatically removed the first time the event is emitted, so it will never be called more than once.

      Parameters

      • event: string | symbol

        The event name.

      • fn: Function

        The listener function.

      • Optionalcontext: any

        The context to invoke the listener with. Default this.

      Returns this

      this.

    • Internal handler, called when a child is destroyed.

      Returns void

    • Attempts to animate a given Phaser.GameObjects.Sprite

      Parameters

      • sprite: Sprite

        The sprite to animate

      • tintSprite: Sprite | null

        A sprite placed on top of the original sprite to add a color tint

      • key: string

        The animation key

      Returns void

      Phaser.GameObjects.Sprite.play

    • Takes a Point-like object, such as a Vector2, or object with public x and y properties, and transforms it into the space of this Container, then returns it in the output object.

      Parameters

      • source: Vector2Like

        The Source Point to be transformed.

      • Optionaloutput: Vector2Like

        A destination object to store the transformed point in. If none given a Vector2 will be created and returned.

      Returns Vector2Like

      The transformed point.

    • Attempt to process variant sprite color caches.

      Parameters

      • cacheKey: string

        the cache key for the variant color sprite

      • useExpSprite: boolean

        Whether experimental sprites should be used if present

      • battleSpritePath: string

        the filename of the sprite

      Returns Promise<void>

    • Internal destroy handler, called as part of the destroy process.

      Returns void

    • Add a move to the end of this Pokemon's move history, used to record its most recently executed actions.

      Parameters

      • turnMove: TurnMove

        The move to add to the history

      Returns void

    • Display an immunity message for a failed status application.

      Parameters

      • quiet: boolean

        Whether to suppress message and return early

      • reason: MISTY | ELECTRIC | GRASSY | PSYCHIC | "overlap" | "other" = "other"

        The reason for the status application failure; can be "overlap" (already has same status), "other" (generic fail message) or a TerrainType for terrain-based blockages. Default "other"

      Returns void

    • Generate a random number using the current battle's seed, or the global seed if globalScene.currentBattle is falsy

      Parameters

      • range: number

        How large of a range of random numbers to choose from.

      • min: number = 0

        (Default 0) The minimum integer to pick

      Returns number

      A random integer between min and min + range - 1

      If range <= 1, this returns min

    • Generate a random number within the specified range

      Parameters

      • min: number

        The minimum integer to generate

      • max: number

        The maximum integer to generate

      Returns number

      A random integer between min and max (inclusive)

    • Record a berry being eaten for ability and move triggers. Only tracks things that proc every time a berry is eaten.

      Parameters

      • berryType: BerryType

        The type of berry being eaten.

      • updateHarvest: boolean = true

        Whether to track the berry for harvest; default true.

      Returns void

    • Removes the given Game Object, or array of Game Objects, from this Container.

      The Game Objects must already be children of this Container.

      You can also optionally call destroy on each Game Object that is removed from the Container.

      Type Parameters

      Parameters

      • child: T | T[]

        The Game Object, or array of Game Objects, to be removed from the Container.

      • OptionaldestroyChild: boolean

        Optionally call destroy on each child successfully removed from this Container. Default false.

      Returns this

      This Container instance.

    • Removes all Game Objects from this Container.

      You can also optionally call destroy on each Game Object that is removed from the Container.

      Parameters

      • OptionaldestroyChild: boolean

        Optionally call destroy on each Game Object successfully removed from this Container. Default false.

      Returns this

      This Container instance.

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: string | symbol

        The event name.

      Returns this

      this.

    • Removes the Game Object at the given position in this Container.

      You can also optionally call destroy on the Game Object, if one is found.

      Parameters

      • index: number

        The index of the Game Object to be removed.

      • OptionaldestroyChild: boolean

        Optionally call destroy on the Game Object if successfully removed from this Container. Default false.

      Returns this

      This Container instance.

    • Removes the Game Objects between the given positions in this Container.

      You can also optionally call destroy on each Game Object that is removed from the Container.

      Parameters

      • OptionalstartIndex: number

        An optional start index to search from. Default 0.

      • OptionalendIndex: number

        An optional end index to search up to (but not included) Default Container.length.

      • OptionaldestroyChild: boolean

        Optionally call destroy on each Game Object successfully removed from this Container. Default false.

      Returns this

      This Container instance.

    • This callback is invoked when this Game Object is removed from a Scene.

      Can be overridden by custom Game Objects, but be aware of some Game Objects that will use this, such as Sprites, to remove themselves from the Update List.

      You can also listen for the REMOVED_FROM_SCENE event from this Game Object.

      Returns void

    • Removes this Game Object from the Display List it is currently on.

      A Game Object can only exist on one Display List at any given time, but may be freely removed and added back at a later stage.

      You can query which list it is on by looking at the Phaser.GameObjects.GameObject#displayList property.

      If a Game Object isn't on any Display List, it will not be rendered. If you just wish to temporarily disable it from rendering, consider using the setVisible method, instead.undefined

      Returns this

      This Game Object.

    • Removes this Game Object from the Scene's Update List.

      When a Game Object is on the Update List, it will have its preUpdate method called every game frame. Calling this method will remove it from the list, preventing this.

      Removing a Game Object from the Update List will stop most internal functions working. For example, removing a Sprite from the Update List will prevent it from being able to run animations.undefined

      Returns this

      This Game Object.

    • If this Game Object has previously been enabled for input, this will queue it for removal, causing it to no longer be interactive. The removal happens on the next game step, it is not immediate.

      The Interactive Object that was assigned to this Game Object will be destroyed, removed from the Input Manager and cleared from this Game Object.

      If you wish to re-enable this Game Object at a later date you will need to re-create its InteractiveObject by calling setInteractive again.

      If you wish to only temporarily stop an object from receiving input then use disableInteractive instead, as that toggles the interactive state, where-as this erases it completely.

      If you wish to resize a hit area, don't remove and then set it as being interactive. Instead, access the hitarea object directly and resize the shape being used. I.e.: sprite.input.hitArea.setSize(width, height) (assuming the shape is a Rectangle, which it is by default.)

      Parameters

      • OptionalresetCursor: boolean

        Should the currently active Input cursor, if any, be reset to the default cursor? Default false.

      Returns this

      This GameObject.

    • Remove the listeners of a given event.

      Parameters

      • event: string | symbol

        The event name.

      • Optionalfn: Function

        Only remove the listeners that match this function.

      • Optionalcontext: any

        Only remove the listeners that have this context.

      • Optionalonce: boolean

        Only remove one-time listeners.

      Returns this

      this.

    • Remove all tags that were applied by a Pokémon with the given sourceId, invoking their onRemove methods.

      Parameters

      • sourceId: number

        Tags with this id as their sourceId will be removed

      Returns void

    • Render this object using filters.

      This function's scope is not guaranteed, so it doesn't refer to this.

      Parameters

      • renderer: WebGLRenderer

        The WebGL Renderer instance to render with.

      • gameObject: GameObject

        The Game Object being rendered.

      • drawingContext: DrawingContext

        The current drawing context.

      • OptionalparentMatrix: TransformMatrix

        The parent matrix of the Game Object, if it has one.

      • OptionalrenderStep: number

        The index of this function in the Game Object's list of render processes. Used to support multiple rendering functions. Default 0.

      Returns RenderWebGLStep

      undefined

    • Run a step in the render process. This is called automatically by the Render module.

      In most cases, it just runs the renderWebGL function.

      When _renderSteps has more than one entry, such as when Filters are enabled for this object, it allows those processes to defer renderWebGL and otherwise manage the flow of rendering.

      Parameters

      • renderer: WebGLRenderer

        The WebGL Renderer instance to render with.

      • gameObject: GameObject

        The Game Object being rendered.

      • drawingContext: DrawingContext

        The current drawing context.

      • OptionalparentMatrix: TransformMatrix

        The parent matrix of the Game Object, if it has one.

      • OptionalrenderStep: number

        Which step of the rendering process should be run? Default 0.

      • OptionaldisplayList: GameObject[]

        The display list which is currently being rendered. If not provided, it will be created with the Game Object.

      • OptionaldisplayListIndex: number

        The index of the Game Object within the display list. Default 0.

      Returns void

    • Replaces a Game Object in this Container with the new Game Object. The new Game Object cannot already be a child of this Container.

      Type Parameters

      Parameters

      • oldChild: T

        The Game Object in this Container that will be replaced.

      • newChild: T

        The Game Object to be added to this Container.

      • OptionaldestroyChild: boolean

        Optionally call destroy on the Game Object if successfully removed from this Container. Default false.

      Returns this

      This Container instance.

    • Iterate through the moveset and replace the first instance of the target move with the replacement move. Does nothing if the replacement move is already in the moveset

      Parameters

      • target: MoveId

        The id of the move that should be replaced

      • replacement: MoveId

        The move that replaces target

      Returns void

    • Reset this Pokémon's per-battle battleData as well as any transient waveData for the current wave.

      Returns void

      Should be called once per arena transition (new biome/trainer battle/Mystery Encounter).

    • Resets the pokemon's field sprite properties, including position, alpha, and scale

      Returns void

    • Reset this Pokémon's status

      Parameters

      • revive: boolean = true

        Whether revive should be cured; default true

      • confusion: boolean = false

        Whether to also cure confusion; default false

      • reloadAssets: boolean = false

        Whether to reload the assets or not; default false

      • asPhase: boolean = true

        Whether to reset the status in a phase or immediately; default true

      Returns void

    • Reset this Pokémon's Terastallization state

      Returns void

      Responsible for all of the cleanup required when a pokemon goes from being terastallized to no longer terastallized:

      • Resetting stellar type boosts
      • Updating the Pokémon's terastallization-dependent form
      • Adjusting the sprite render node data to remove the Tera effect
    • End this Pokémon's Terastallization if it is (or is about to be) in a Mega, Primal, Gigantamax, or Eternamax form, as these forms are incompatible with Terastallization.

      Parameters

      • OptionalformKey: string

        The form key to check; default this Pokémon's current form key. Pass the incoming form's key to end Terastallization before the form change is applied.

      Returns void

      When called without a form key, this must run after formIndex has been updated so that isMega and isMax reflect the new form.

    • Reverses the order of all Game Objects in this Container.undefined

      Returns this

      This Container instance.

    • Sends the given Game Object to the bottom of this Container. This will cause it to render below any other objects in the Container.

      Type Parameters

      Parameters

      • child: T

        The Game Object to send to the bottom of the Container.

      Returns this

      This Container instance.

    • Move this Game Object so that it appears above the given Game Object.

      This means it will render immediately after the other object in the display list.

      Both objects must belong to the same display list, or parent container.

      This method does not change this Game Objects depth value, it simply alters its list position.

      Parameters

      • gameObject: GameObject

        The Game Object that this Game Object will be moved to be above.

      Returns this

      This Game Object instance.

    • Sets the active property of this Game Object and returns this Game Object for further chaining. A Game Object with its active property set to true will be updated by the Scenes UpdateList.

      Parameters

      • value: boolean

        True if this Game Object should be set as active, false if not.

      Returns this

      This GameObject.

    • Sets the property to the given value on all Game Objects in this Container.

      Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, and you set startIndex to 0 and endIndex to 50, it would return matches from only the first 50 Game Objects.

      Parameters

      • property: string

        The property that must exist on the Game Object.

      • value: any

        The value to set the property to.

      • OptionalstartIndex: number

        An optional start index to search from. Default 0.

      • OptionalendIndex: number

        An optional end index to search up to (but not included) Default Container.length.

      Returns this

      This Container instance.

    • Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.

      Parameters

      • Optionalvalue: number

        The alpha value applied across the whole Game Object. Default 1.

      Returns this

      This Game Object instance.

    • Sets the angle of this Game Object.

      Parameters

      • Optionaldegrees: number

        The rotation of this Game Object, in degrees. Default 0.

      Returns this

      This Game Object instance.

    • Move this Game Object so that it appears below the given Game Object.

      This means it will render immediately under the other object in the display list.

      Both objects must belong to the same display list, or parent container.

      This method does not change this Game Objects depth value, it simply alters its list position.

      Parameters

      • gameObject: GameObject

        The Game Object that this Game Object will be moved to be below.

      Returns this

      This Game Object instance.

    • Sets the Blend Mode being used by this Game Object.

      This can be a const, such as Phaser.BlendModes.SCREEN, or an integer, such as 4 (for Overlay)

      Under WebGL only the following Blend Modes are available:

      • NORMAL
      • ADD
      • MULTIPLY
      • SCREEN
      • ERASE (only works when rendering to a framebuffer, like a Render Texture)

      Canvas has more available depending on browser support.

      You can also create your own custom Blend Modes in WebGL.

      Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these reasons try to be careful about the construction of your Scene and the frequency with which blend modes are used.

      Parameters

      • value: string | number | BlendModes

        The BlendMode value. Either a string, a CONST or a number.

      Returns this

      This Game Object instance.

    • Allows you to store a key value pair within this Game Objects Data Manager.

      If the Game Object has not been enabled for data (via setDataEnabled) then it will be enabled before setting the value.

      If the key doesn't already exist in the Data Manager then it is created.

      sprite.setData('name', 'Red Gem Stone');
      

      You can also pass in an object of key value pairs as the first argument:

      sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });
      

      To get a value back again you can call getData:

      sprite.getData('gold');
      

      Or you can access the value directly via the values property, where it works like any other variable:

      sprite.data.values.gold += 50;
      

      When the value is first set, a setdata event is emitted from this Game Object.

      If the key already exists, a changedata event is emitted instead, along an event named after the key. For example, if you updated an existing key called PlayerLives then it would emit the event changedata-PlayerLives. These events will be emitted regardless if you use this method to set the value, or the direct values setter.

      Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. This means the keys gold and Gold are treated as two unique values within the Data Manager.

      Type Parameters

      • T extends unknown

      Parameters

      • key: string | T

        The key to set the value for. Or an object of key value pairs. If an object the data argument is ignored.

      • Optionalvalue: any

        The value to set for the given key. If an object is provided as the key this argument is ignored.

      Returns this

      This GameObject.

    • Adds a Data Manager component to this Game Object.undefined

      Returns this

      This GameObject.

    • Sets the depth of this Game Object. If the value argument is not provided, the depth defaults to 0.

      The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order of Game Objects, without actually moving their position in the display list.

      A Game Object with a higher depth value will always render in front of one with a lower value.

      Setting the depth will queue a depth sort event within the Scene.

      Parameters

      • value: number

        The depth of this Game Object. Ensure this value is only ever a number data-type.

      Returns this

      This Game Object instance.

    • Sets the display size of this Game Object.

      Calling this will adjust the scaleX and scaleY properties so that the Game Object is rendered at the specified pixel dimensions. It is the equivalent of setting the scale manually, but expressed in pixels rather than as a multiplier.

      Parameters

      • width: number

        The width of this Game Object.

      • height: number

        The height of this Game Object.

      Returns this

      This Game Object instance.

    • Does this Container exclusively manage its children?

      The default is true which means a child added to this Container cannot belong in another Container, which includes the Scene display list.

      If you disable this then this Container will no longer exclusively manage its children. This allows you to create all kinds of interesting graphical effects, such as replicating Game Objects without reparenting them all over the Scene. However, doing so will prevent children from receiving any kind of input event or have their physics bodies work by default, as they're no longer a single entity on the display list, but are being replicated where-ever this Container is.

      Parameters

      • Optionalvalue: boolean

        The exclusive state of this Container. Default true.

      Returns this

      This Container.

    • Set the field position of this Pokémon

      Parameters

      • fieldPosition: FieldPosition

        The new field position

      • Optionalduration: number

        How long the transition should take, in milliseconds; if 0 or undefined, the position is changed instantly

      Returns Promise<void>

    • Sets whether the filter camera should automatically re-focus on the Game Object every frame. Sets the filtersAutoFocus property.

      Parameters

      • value: boolean

        Whether filters should be updated every frame.

      Returns this

      undefined

    • Set whether the filters should focus on the context. Sets the filtersFocusContext property.

      Parameters

      • value: boolean

        Whether the filters should focus on the context.

      Returns this

      undefined

    • Set whether the filters should always draw to a framebuffer. Sets the filtersForceComposite property.

      Parameters

      • value: boolean

        Whether the object should always draw to a framebuffer, even if there are no active filters.

      Returns this

      undefined

    • Set the base size of the filter camera. This is the size of the texture that internal filters will be drawn to. External filters are drawn to the size of the context (usually the game canvas).

      This is typically the size of the GameObject. It is set automatically when the Game Object is rendered and filtersAutoFocus is enabled. Turn off auto focus to set it manually.

      Technically, larger framebuffers may be used to provide padding. This is the size of the final framebuffer used for "internal" rendering.

      Parameters

      • width: number

        Base width of the filter texture.

      • height: number

        Base height of the filter texture.

      Returns this

      undefined

    • Set this pokemon's illusion to the data of the given pokemon.

      Parameters

      Returns boolean

      When setting the illusion of a wild pokemon, a PokemonSpecies is generally passed. When setting the illusion of a pokemon in this way, the fields required by illusion data but missing from PokemonSpecies are set as follows

      • pokeball and nickname are both inherited from this pokemon
      • shiny will always be set if this pokemon OR its fusion is shiny
      • variant will always be 0
      • Fields related to fusion will be set to undefined or 0 as appropriate
      • The gender is set to be the same as this pokemon, if it is compatible with the provided pokemon.
        • If the provided pokemon can only ever exist as one gender, it is always that gender
        • If this pokemon is genderless but the provided pokemon isn't, then a gender roll is done based on this pokemon's ID
    • Pass this Game Object to the Input Manager to enable it for Input.

      Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced input detection.

      If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific shape for it to use.

      You can also provide an Input Configuration Object as the only argument to this method.

      Parameters

      • OptionalhitArea: any

        Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame.

      • Optionalcallback: HitAreaCallback

        The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback.

      • OptionaldropZone: boolean

        Should this Game Object be treated as a drop zone target? Default false.

      Returns this

      This GameObject.

    • Sets the mask that this Game Object will use to render with.

      The mask must have been previously created and must be a GeometryMask. This only works in the Canvas Renderer. In WebGL, use a Mask filter instead (see Phaser.GameObjects.Components.FilterList#addMask).

      If a mask is already set on this Game Object it will be immediately replaced.

      Masks are positioned in global space and are not relative to the Game Object to which they are applied. The reason for this is that multiple Game Objects can all share the same mask.

      Masks have no impact on physics or input detection. They are purely a rendering component that allows you to limit what is visible during the render pass.

      Parameters

      • mask: GeometryMask

        The mask this Game Object will use when rendering.

      Returns this

      This Game Object instance.

    • Create a new PokemonMove and set it to the specified move index in this Pokémon's moveset.

      Parameters

      • moveIndex: number

        The index of the move to set

      • moveId: MoveId

        The ID of the move to set

      Returns void

    • Sets the name property of this Game Object and returns this Game Object for further chaining. The name property is not populated by Phaser and is presented for your own use.

      Parameters

      • value: string

        The name to be given to this Game Object.

      Returns this

      This GameObject.

    • Sets the position of this Game Object.

      Parameters

      • Optionalx: number

        The x position of this Game Object. Default 0.

      • Optionaly: number

        The y position of this Game Object. If not set it will use the x value. Default x.

      • Optionalz: number

        The z position of this Game Object. Default 0.

      • Optionalw: number

        The w position of this Game Object. Default 0.

      Returns this

      This Game Object instance.

    • Sets the position of this Game Object to be a random position within the confines of the given area.

      If no area is specified a random position between 0 x 0 and the game width x height is used instead.

      The position does not factor in the size of this Game Object, meaning that only the origin is guaranteed to be within the area.

      Parameters

      • Optionalx: number

        The x position of the top-left of the random area. Default 0.

      • Optionaly: number

        The y position of the top-left of the random area. Default 0.

      • Optionalwidth: number

        The width of the random area.

      • Optionalheight: number

        The height of the random area.

      Returns this

      This Game Object instance.

    • Set whether the filters should be rendered. Sets the renderFilters property.

      Parameters

      • value: boolean

        Whether the filters should be rendered.

      Returns this

      undefined

    • Sets the rotation of this Game Object.

      Parameters

      • Optionalradians: number

        The rotation of this Game Object, in radians. Default 0.

      Returns this

      This Game Object instance.

    • Sets the scale of this Game Object.

      Parameters

      • Optionalx: number

        The horizontal scale of this Game Object. Default 1.

      • Optionaly: number

        The vertical scale of this Game Object. If not set it will use the x value. Default x.

      Returns this

      This Game Object instance.

    • Sets the scroll factor of this Container and optionally all of its children.

      The scroll factor controls the influence of the movement of a Camera upon this Game Object.

      When a camera scrolls it will change the location at which this Game Object is rendered on-screen. It does not change the Game Objects actual position values.

      A value of 1 means it will move exactly in sync with a camera. A value of 0 means it will not move at all, even if the camera moves. Other values control the degree to which the camera movement is mapped to this Game Object.

      Please be aware that scroll factor values other than 1 are not taken in to consideration when calculating physics collisions. Bodies always collide based on their world position, but changing the scroll factor is a visual adjustment to where the textures are rendered, which can offset them from physics bodies if not accounted for in your code.

      Parameters

      • x: number

        The horizontal scroll factor of this Game Object.

      • Optionaly: number

        The vertical scroll factor of this Game Object. If not set it will use the x value. Default x.

      • OptionalupdateChildren: boolean

        Apply this scrollFactor to all Container children as well? Default false.

      Returns this

      This Game Object instance.

    • Sets the internal size of this Game Object, as used for frame or physics body creation.

      This will not change the size that the Game Object is rendered in-game. For that you need to either set the scale of the Game Object (setScale) or call the setDisplaySize method, which is the same thing as changing the scale but allows you to do so by giving pixel values.

      If you have enabled this Game Object for input, changing the size will not change the size of the hit area. To do this you should adjust the input.hitArea object directly.

      Parameters

      • width: number

        The width of this Game Object.

      • height: number

        The height of this Game Object.

      Returns this

      This Game Object instance.

    • Change one of this Pokemon's PermanentStats to the specified value.

      Parameters

      • stat: HP | ATK | DEF | SPATK | SPDEF | SPD

        The PermanentStat to be overwritten

      • value: number

        The stat value to set. Ignored if <=0

      • bypassSummonData: boolean = true

        Whether to write to actual stats (true) or in-battle overridden stats (false); default true

      Returns void

    • Sets the current state of this Game Object.

      Phaser itself will never modify the State of a Game Object, although plugins may do so.

      For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. The state value should typically be an integer (ideally mapped to a constant in your game code), but could also be a string. It is recommended to keep it light and simple. If you need to store complex data about your Game Object, look at using the Data Component instead.

      Parameters

      • value: string | number

        The state of the Game Object.

      Returns this

      This GameObject.

    • Set this Pokémon's temporary ability, activating it if it normally activates on summon.

      Parameters

      • abilityId: AbilityId

        The ID of the temporary ability to set

      • passive: boolean = false

        (Default false) Whether to set the passive ability instead of the non-passive one

      Returns void

      Also clears primal weather if it is from the ability being changed.

    • Sets this Game Object to the back of the display list, or the back of its parent container.

      Being at the back means it will render below everything else.

      This method does not change this Game Objects depth value, it simply alters its list position.undefined

      Returns this

      This Game Object instance.

    • Sets this Game Object to be at the top of the display list, or the top of its parent container.

      Being at the top means it will render on top of everything else.

      This method does not change this Game Objects depth value, it simply alters its list position.undefined

      Returns this

      This Game Object instance.

    • Sets the vertex round mode of this Game Object. This is used by the WebGL Renderer to determine how to round the vertex positions.

      Parameters

      • mode: string

        The vertex round mode to set. Can be 'off', 'safe', 'safeAuto', 'full' or 'fullAuto'.

      Returns this

      This GameObject.

    • Sets the visibility of this Game Object.

      An invisible Game Object will skip rendering, but will still process update logic.

      Parameters

      • value: boolean

        The visible state of the Game Object.

      Returns this

      This Game Object instance.

    • Sets the w position of this Game Object.

      Parameters

      • Optionalvalue: number

        The w position of this Game Object. Default 0.

      Returns this

      This Game Object instance.

    • Sets the x position of this Game Object.

      Parameters

      • Optionalvalue: number

        The x position of this Game Object. Default 0.

      Returns this

      This Game Object instance.

    • Sets the y position of this Game Object.

      Parameters

      • Optionalvalue: number

        The y position of this Game Object. Default 0.

      Returns this

      This Game Object instance.

    • Sets the z position of this Game Object.

      Note: The z position does not control the rendering order of 2D Game Objects. Use Phaser.GameObjects.Components.Depth#setDepth instead.

      Parameters

      • Optionalvalue: number

        The z position of this Game Object. Default 0.

      Returns this

      This Game Object instance.

    • Shuffles all Game Objects in this Container using the Fisher-Yates implementation.undefined

      Returns this

      This Container instance.

    • Removes all listeners from this EventEmitter. This method is called automatically by the Scene Systems when the parent Scene shuts down, ensuring that all event bindings are cleared and no stale references remain.

      Returns void

    • Sort the contents of this Container so the items are in order based on the given property. For example: sort('alpha') would sort the elements based on the value of their alpha property.

      Parameters

      • property: string

        The property to lexically sort by.

      • Optionalhandler: Function

        Provide your own custom handler function. Will receive 2 children which it should compare and return a negative, zero, or positive number.

      Returns this

      This Container instance.

    • Play the shiny sparkle animation and effects, if applicable

      Returns void

    • Suppresses an ability and calls its onlose attributes

      Returns void

    • Swaps the position of two Game Objects in this Container. Both Game Objects must belong to this Container.

      Type Parameters

      Parameters

      • child1: T

        The first Game Object to swap.

      • child2: T

        The second Game Object to swap.

      Returns this

      This Container instance.

    • Parameters

      • color: number
      • Optionalalpha: number
      • Optionalduration: number
      • Optionalease: string

      Returns void

    • Toggle a boolean value for the given key within this Game Object's Data Manager. If the key doesn't already exist in the Data Manager then it is created with a value of false before being toggled to true.

      If the Game Object has not been enabled for data (via setDataEnabled) then it will be enabled before setting the value.

      If the key doesn't already exist in the Data Manager then it is created.

      When the value is first set, a setdata event is emitted from this Game Object.

      Parameters

      • key: string

        The key to toggle the value for.

      Returns this

      This GameObject.

    • Returns a JSON representation of the Game Object.undefined

      Returns JSONGameObject

      A JSON representation of the Game Object.

    • Transfer stat changes and volatile status effects from another Pokemon to this one.

      Parameters

      • source: Pokemon

        The Pokemon whose stats/Tags are to be passed on from (i.e. the one having switched out)

      Returns void

      Used to implement Baton Pass and switching via the Baton item.

    • Change the sourceId of all tags on this Pokémon with the given sourceId to newSourceId.

      Parameters

      • sourceId: number

        The id of the pokemon whose tags are to be transferred

      • newSourceId: number

        The id of the pokemon to which the tags are being transferred

      Returns void

    • Attempt to populate this Pokemon's moveset based on those from a Starter

      Parameters

      • moveset: StarterMoveset

        The StarterMoveset to use; will override corresponding slots of this Pokemon's moveset

      • ignoreValidate: boolean = false

        Whether to ignore validating the passed-in moveset; default false

      Returns void

    • Used by Mystery Encounters to override a Pokemon's ability to be its hidden ability

      Parameters

      • haThreshold: number

        The denominator for the HA chance (1 / haThreshold)

      Returns void

    • Attempt to select the move at the move index.

      Parameters

      • moveIndex: number

        The index of the move to select

      • OptionalignorePp: boolean

        Whether to ignore PP when checking if the move is usable (defaults to false)

      Returns [isUsable: boolean, failureMessage: string]

      A tuple containing a boolean indicating if the move can be selected, and a string with the reason if it cannot be selected

    • Attempt to set the Pokémon's shininess based on the trainer's trainer ID and secret ID. Endless Pokemon in the end biome are unable to be set to shiny

      Parameters

      • OptionalthresholdOverride: number

        number that is divided by 2^16 (65536) to get the shiny chance, overrides shinyThreshold if set (bypassing shiny rate modifiers such as Shiny Charm)

      Returns boolean

      true if the Pokemon has been set as a shiny, false otherwise

      The exact mechanic is that it calculates E as the XOR of the player's trainer ID and secret ID. F is calculated as the XOR of the first 16 bits of the Pokemon's ID with the last 16 bits. The XOR of E and F are then compared to the shinyThreshold (or thresholdOverride if set) to see whether or not to generate a shiny. The base shiny odds are BASE_SHINY_CHANCE / 65536

    • Tries to set a Pokémon's shininess based on seed

      Parameters

      • OptionalthresholdOverride: number

        number that is divided by 2^16 (65536) to get the shiny chance, overrides shinyThreshold if set (bypassing shiny rate modifiers such as Shiny Charm)

      • OptionalapplyModifiersToOverride: boolean

        If thresholdOverride is set and this is true, will apply Shiny Charm and event modifiers to thresholdOverride

      • OptionalmaxThreshold: number

        The maximum threshold allowed after applying modifiers

      Returns boolean

      Whether this Pokémon was set to shiny

      For manual use only, usually to roll a Pokemon's shiny chance a second time. If it rolls shiny, or if it's already shiny, also sets a random variant and give the Pokemon the associated luck.

      The base shiny odds are BASE_SHINY_CHANCE / 65536

    • Attempt to set this Pokemon's status to the specified condition. Enqueues a new ObtainStatusEffectPhase to trigger animations, etc.

      Parameters

      • effect: StatusEffect

        The StatusEffect to set

      • OptionalsourcePokemon: Pokemon

        The Pokemon applying the status effect to the target, or null if the status is applied from a non-Pokemon source (hazards, etc.); default null

      • OptionalsleepTurnsRemaining: number

        The number of turns to set StatusEffect.SLEEP for; defaults to a random number between 2 and 4 and is unused for non-Sleep statuses

      • sourceText: string | null = null

        The text to show for the source of the status effect, if any; default null

      • OptionaloverrideStatus: boolean

        Whether to allow overriding the Pokemon's current status with a different one; default false

      • quiet: boolean = true

        Whether to suppress in-battle messages for status checks; default true

      • OptionaloverrideMessage: string

        String containing text to be displayed upon status setting; defaults to normal key for status and is used exclusively for Rest

      Returns boolean

      Whether the status effect phase was successfully created.

      doSetStatus - alternate function that sets status immediately (albeit without condition checks).

    • Parameters

      • duration: number
      • Optionalease: string

      Returns void

    • Override this method in your own custom Game Objects to perform per-frame update logic. This method is called by the Scene's Update List on every game frame, if the Game Object is on that list. It is not called automatically — the Game Object must be added to the Update List via addToUpdateList or by having a preUpdate method.

      This base implementation is intentionally empty, allowing Game Objects to be used in an Object Pool without requiring any update logic.

      Parameters

      • ...args: any[]

        Any arguments that are passed to the update method.

      Returns void

    • Parameters

      • OptionalignoreOverride: boolean

      Returns void

    • Compares the renderMask with the renderFlags to see if this Game Object will render or not. Also checks the Game Object against the given Cameras exclusion list.

      Parameters

      • camera: Camera

        The Camera to check against this Game Object.

      Returns boolean

      True if the Game Object should be rendered, otherwise false.

    • Whether this Game Object will render filters. This is true if it has active filters, and if the renderFilters property is also true.undefined

      Returns boolean

      Whether the Game Object will render filters.

    • Checks if this Game Object should round its vertices, based on the given Camera and the vertexRoundMode of this Game Object. This is used by the WebGL Renderer to determine how to round the vertex positions.

      You can override this method in your own custom Game Object classes to provide custom logic for vertex rounding.

      Parameters

      • camera: Camera

        The Camera to check against this Game Object.

      • onlyTranslated: boolean

        If true, the object is only translated, not scaled or rotated.

      Returns boolean

      True if the Game Object should be rounded, otherwise false.