pokemon-rogue-battle
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    battlerIndex: number

    The battler index this phase refers to, or the pokemon ID if greater than 3. TODO: Make this either use IDs or BattlerIndexes, not a weird mix of both

    fieldIndex: number
    move: Move
    phaseName: "MoveEffectPhase"

    The string name of the phase, used to identify the phase type for is

    player: boolean
    targets: BattlerIndex[]
    useMode: MoveUseMode

    Methods

    • Unshifts a new MoveEffectPhase with the same properties as this phase. Used to queue the next hit of multi-strike moves.

      Returns void

    • Handles checking for and applying Flinches

      Parameters

      • user: Pokemon

        The Pokemon using this phase's invoked move

      • target: Pokemon

        Pokemon the current target of this phase's invoked move

      • dealsDamage: boolean

        true if the attempted move successfully dealt damage

      Returns void

    • Applies all move effects that trigger in the event of a successful hit:

      • PRE_APPLY effects`
      • Applying damage to the target
      • POST_APPLY effects
      • Invoking applyOnTargetEffects if the move does not hit a substitute
      • Triggering form changes and emergency exit / wimp out if this is the last hit

      Parameters

      • target: Pokemon

        the Pokemon hit by this phase's move.

      • effectiveness: TypeDamageMultiplier

        The effectiveness of the move (as previously evaluated in hitCheck)

      • firstTarget: boolean

        Whether this is the first target successfully struck by the move

      Returns void

    • Applies reactive effects that occur when a Pokémon is hit. (i.e. Effect Spore, Disguise, Liquid Ooze, Beak Blast)

      Parameters

      • user: Pokemon

        The Pokemon using this phase's invoked move

      • target: Pokemon

        Pokemon the current target of this phase's invoked move

      • hitResult: HitResult

        The HitResult of the attempted move

      • wasCritical: boolean = false

        true if the move was a critical hit

      Returns void

    • Applies all effects aimed at the move's target. To be used when the target is successfully and directly hit by the move.

      Parameters

      • user: Pokemon

        The Pokemon using the move

      • target: Pokemon

        The Pokemon targeted by the move

      • hitResult: HitResult

        The HitResult obtained from applying the move

      • firstTarget: boolean

        true if the target is the first Pokemon hit by the attack

      • wasCritical: boolean = false

        true if the move was a critical hit

      Returns void

    • Check whether the move should bypass both the accuracy and semi-invulnerable states.

      Parameters

      Returns undefined | boolean

      true if the move should bypass accuracy and semi-invulnerability

      Accuracy and semi-invulnerability can be bypassed by:

      • An ability like AbilityId.NO_GUARD | No Guard
      • A poison type using Toxic
      • A move like Lock-On or Mind Reader.
      • A field-targeted move like spikes

      Does not check against effects Glaive Rush status (which should not bypass semi-invulnerability), or interactions like Earthquake hitting against Dig, (which should not bypass the accuracy check).

    • Conduct the hit check and type effectiveness for this move against the target

      Checks occur in the following order:

      1. if the move is self-target
      2. if the target is on the field
      3. if the target is hidden by the effects of its commander ability
      4. if the target is in an applicable semi-invulnerable state
      5. if the target has an applicable protection effect
      6. if the move is reflected by magic coat or magic bounce
      7. type effectiveness calculation, including immunities from abilities and typing
      8. if accuracy is checked, whether the roll passes the accuracy check

      Parameters

      Returns HitCheckEntry

      a HitCheckEntry containing the attack's HitCheckResult and effectiveness against the target.

    • Check if the phase is of the given type without requiring instanceof.

      Type Parameters

      • K extends
            | "ActivatePriorityQueuePhase"
            | "AddEnemyBuffModifierPhase"
            | "AttemptCapturePhase"
            | "AttemptRunPhase"
            | "BattleEndPhase"
            | "BerryPhase"
            | "CheckInterludePhase"
            | "CheckStatusEffectPhase"
            | "CheckSwitchPhase"
            | "CommandPhase"
            | "CommonAnimPhase"
            | "DamageAnimPhase"
            | "EggHatchPhase"
            | "EggLapsePhase"
            | "EggSummaryPhase"
            | "EncounterPhase"
            | "EndCardPhase"
            | "EndEvolutionPhase"
            | "EnemyCommandPhase"
            | "EvolutionPhase"
            | "ExpPhase"
            | "FaintPhase"
            | "FormChangePhase"
            | "GameOverPhase"
            | "GameOverModifierRewardPhase"
            | "HideAbilityPhase"
            | "HidePartyExpBarPhase"
            | "LearnMovePhase"
            | "LevelCapPhase"
            | "LevelUpPhase"
            | "LoadMoveAnimPhase"
            | "LoginPhase"
            | "MessagePhase"
            | "ModifierRewardPhase"
            | "MoneyRewardPhase"
            | "MoveAnimPhase"
            | "MoveChargePhase"
            | "MoveEffectPhase"
            | "MoveEndPhase"
            | "MoveHeaderPhase"
            | "MovePhase"
            | "MysteryEncounterPhase"
            | "MysteryEncounterOptionSelectedPhase"
            | "MysteryEncounterBattlePhase"
            | "MysteryEncounterBattleStartCleanupPhase"
            | "MysteryEncounterRewardsPhase"
            | "PostMysteryEncounterPhase"
            | "NewBattlePhase"
            | "NewBiomeEncounterPhase"
            | "NextEncounterPhase"
            | "ObtainStatusEffectPhase"
            | "PartyExpPhase"
            | "PartyHealPhase"
            | "PokemonAnimPhase"
            | "PokemonHealPhase"
            | "PokemonTransformPhase"
            | "PositionalTagPhase"
            | "PostGameOverPhase"
            | "PostSummonPhase"
            | "PostTurnStatusEffectPhase"
            | "QuietFormChangePhase"
            | "ReloadSessionPhase"
            | "ResetStatusPhase"
            | "ReturnPhase"
            | "RevivalBlessingPhase"
            | "RibbonModifierRewardPhase"
            | "ScanIvsPhase"
            | "SelectBiomePhase"
            | "SelectChallengePhase"
            | "SelectGenderPhase"
            | "SelectModifierPhase"
            | "SelectStarterPhase"
            | "SelectTargetPhase"
            | "ShinySparklePhase"
            | "ShowAbilityPhase"
            | "ShowPartyExpBarPhase"
            | "ShowTrainerPhase"
            | "StatStageChangePhase"
            | "SummonMissingPhase"
            | "SummonPhase"
            | "SwitchBiomePhase"
            | "SwitchPhase"
            | "SwitchSummonPhase"
            | "TeraPhase"
            | "TitlePhase"
            | "ToggleDoublePositionPhase"
            | "TrainerVictoryPhase"
            | "TurnEndPhase"
            | "TurnInitPhase"
            | "TurnStartPhase"
            | "UnavailablePhase"
            | "UnlockPhase"
            | "VictoryPhase"
            | "WeatherEffectPhase"

      Parameters

      • phase: K

        The string name of the phase to check.

      Returns this is PhaseMap[K]

      Whether this phase is of the provided type.

      This does not check for subclasses! It only checks if the phase is exactly the given type. This method exists to avoid circular import issues, as using instanceof would require importing each phase.

    • Triggers move effects of the given move effect trigger.

      Parameters

      • triggerType: MoveEffectTrigger

        The MoveEffectTrigger being applied

      • user: Pokemon

        The Pokemon using the move

      • target: null | Pokemon

        The Pokemon targeted by the move

      • OptionalfirstTarget: null | boolean

        Whether the target is the first to be hit by the current strike

      • OptionalselfTarget: boolean

        If defined, limits the effects triggered to either self-targeted effects (if set to true) or targeted effects (if set to false).

      Returns void