Hierarchy

Constructors

Properties

accuracy: number
attrs: MoveAttr[] = []
chance: number

The chance of a move's secondary effects activating

chargeAnim: ChargeAnim = ...

The animation to play during the move's charging phase

chargeAttrs: MoveAttr[] = []

Move attributes that apply during the move's charging phase

effect: string
generation: number
id: Moves
moveTarget: MoveTarget
name: string
power: number
pp: number
priority: number

Accessors

Methods

  • Adds a new MoveAttr to the move (appends to the attr array) if the MoveAttr also comes with a condition, also adds that to the conditions array: MoveCondition Almost identical to attr, except you are passing in a MoveAttr object, instead of a constructor and it's arguments

    Parameters

    Returns this

    the called object Move

  • Applies each MoveCondition function of this move to the params, determines if the move can be used prior to calling each attribute's apply()

    Parameters

    Returns boolean

    boolean: false if any of the apply()'s return false, else true

  • Adds a new MoveAttr to the move (appends to the attr array) if the MoveAttr also comes with a condition, also adds that to the conditions array: MoveCondition

    Type Parameters

    Parameters

    • AttrType: T

      MoveAttr the constructor of a MoveAttr class

    • Rest...args: ConstructorParameters<T>

      the args needed to instantiate a the given class

    Returns this

    the called object Move

  • Calculates the accuracy of a move in battle based on various conditions and attributes.

    Parameters

    • user: default

      Pokemon The Pokémon using the move.

    • target: default

      Pokemon The Pokémon being targeted by the move.

    • simulated: boolean = false

    Returns number

    The calculated accuracy of the move.

  • Calculates the power of a move in battle based on various conditions and attributes.

    Parameters

    • source: default

      Pokemon The Pokémon using the move.

    • target: default

      Pokemon The Pokémon being targeted by the move.

    • simulated: boolean = false

    Returns number

    The calculated power of the move.

  • Returns true if this move can be given additional strikes by enhancing effects. Currently used for Parental Bond and Multi-Lens.

    Parameters

    • user: default

      The Pokemon using the move

    • restrictSpread: boolean = false

      true if the enhancing effect should not affect multi-target moves (default false)

    Returns boolean

  • Adds an attribute to this move to be applied during the move's charging phase

    Type Parameters

    Parameters

    • ChargeAttrType: T

      the type of MoveAttr being added

    • Rest...args: ConstructorParameters<T>

      the parameters to construct the given MoveAttr with

    Returns this

    this Move (for chaining API purposes)

  • Sets the text to be displayed during this move's charging phase. References to the user Pokemon should be written as "{USER}", and references to the target Pokemon should be written as "{TARGET}".

    Parameters

    • chargeText: string

      the text to set

    Returns this

    this Move (for chaining API purposes)

  • Checks if the move flag applies to the pokemon(s) using/receiving the move

    Parameters

    Returns boolean

    boolean

  • Adds a move condition to the move

    Parameters

    • condition: MoveCondition | MoveConditionFunc

      MoveCondition or MoveConditionFunc, appends to conditions array a new MoveCondition object

    Returns this

    the called object Move

  • Internal dev flag for documenting edge cases. When using this, please document the known edge case.

    Returns this

    the called object Move

  • Takes as input a boolean function and returns the first MoveAttr in attrs that matches true

    Parameters

    • attrPredicate: ((attr: MoveAttr) => boolean)
        • (attr): boolean
        • Parameters

          Returns boolean

    Returns MoveAttr

    the first MoveAttr element in attrs that makes the input function return true

  • Get all move attributes that match attrType

    Type Parameters

    Parameters

    Returns T[]

    Array of attributes that match attrType, Empty Array if none match.

  • Gets all charge attributes of the given attribute type.

    Type Parameters

    Parameters

    Returns T[]

    Array of attributes that match attrType, or an empty array if no matches are found.

  • Sees if a move has a custom failure text (by looking at each MoveAttr of this move)

    Parameters

    Returns null | string

    string of the custom failure text, or null if it uses the default text ("But it failed!")

  • Parameters

    • user: default
    • simulated: boolean = true

    Returns number

  • Calculates the targetBenefitScore across all the attributes

    Parameters

    Returns number

    integer representing the total benefitScore

  • Calculates the userBenefitScore across all the attributes and conditions

    Parameters

    Returns number

    integer representing the total benefitScore

  • Check if a move has an attribute that matches attrType

    Type Parameters

    Parameters

    Returns boolean

    true if the move has attribute attrType

  • Checks if this move has an attribute of the given type.

    Type Parameters

    Parameters

    Returns boolean

    true if a matching attribute is found; false otherwise

  • Getter function that returns if this Move has a MoveFlag

    Parameters

    Returns boolean

    boolean

  • Checks if the move would hit its target's Substitute instead of the target itself.

    Parameters

    Returns boolean

    true if the move can bypass the target's Substitute; false otherwise.

  • Getter function that returns if the move targets the user or its ally

    Returns boolean

    boolean

  • Getter function that returns if the move hits multiple targets

    Returns boolean

    boolean

  • Checks if the move is immune to certain types. Currently looks at cases of Grass types with powder moves and Dark types with moves affected by Prankster.

    Parameters

    • user: default

      the source of this move

    • target: default

      the target of this move

    • type: Type

      the type of the move's target

    Returns boolean

    boolean

  • Returns void

  • Sets the MoveFlags.MAKES_CONTACT flag for the calling Move

    Parameters

    • setFlag: boolean = true

      Default true, set to false if the move doesn't make contact

    Returns this

    The Move that called this function

  • Marks the move as "partial": appends texts to the move name

    Returns this

    the called object Move

  • Queues the charge text to display to the player

    Parameters

    Returns void

  • Sets the move target of this move

    Parameters

    Returns this

    the called object Move

  • Marks the move as "unimplemented": appends texts to the move name

    Returns this

    the called object Move