ProtectedbattlerThe 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
PrivatefirstIs this the first strike of a move?
PrivatehitThe result of the hit check against each target
PrivatelastIs this the last strike of a move?
PrivatemoveLog to be entered into the user's move history once the move result is resolved.
Note that result logs whether the move was successfully
used in the sense of "Does it have an effect on the user?".
ReadonlyphaseThe string name of the phase, used to identify the phase type for is
ProtectedtargetsProtecteduseProtectedaddUnshifts a new MoveEffectPhase with the same properties as this phase.
Used to queue the next hit of multi-strike moves.
ProtectedapplySub-method of applyOnTargetEffects that handles checking for and applying flinches.
ProtectedapplyApply the result of this phase's move to the given target.
The Pokemon using this phase's invoked move
The Pokemon struck by the move
The effectiveness of the move against the target
A MoveDamageTuple containing the results of damage application.
ProtectedapplySub-method of applyMove that applies damage to the target.
The Pokemon using this phase's invoked move
The Pokemon targeted by the move
The type effectiveness of the move against the target
A MoveDamageTuple containing the results of damage application.
ProtectedapplyApplies all move effects that trigger in the event of a successful hit:
PRE_APPLY effectsPOST_APPLY effectsapplyOnTargetEffects if the move does not hit a substitutethe Pokemon hit by this phase's move.
The effectiveness of the move (as previously evaluated in hitCheck)
Whether this is the first target successfully struck by the move
ProtectedapplySub-method of applyOnTargetEffects that applies reactive effects that occur when a Pokémon is hit.
(i.e. Effect Spore, Disguise, Liquid Ooze, Beak Blast)
ProtectedapplySub-method of applyMoveEffects that applies all effects aimed at the move's target.
To be used when the target is successfully and directly hit by the move.
The Pokemon using the move
The Pokemon targeted by the move
true if the target is the first Pokemon hit by the attack
A MoveDamageTuple containing the results of damage application
PrivateapplyCheck whether the move should bypass both the accuracy and semi-invulnerable states.
true if the move should bypass accuracy and semi-invulnerability
Accuracy and semi-invulnerability can be bypassed by:
ToxicLock-On or Mind Reader.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).
Check whether the move is able to ignore the given semiInvulnerableTag
The semiInvulnerable tag to check against
true if the move can ignore the semi-invulnerable state
PrivateconductCompute targets and the results of hit checks of the invoked move against all targets, organized by battler index.
This is not a pure function; it has the following side effects
this.hitChecks - The results of the hit checks against each targetthis.moveHistoryEntry - Sets success or failure based on the hit check resultsThe targets of the invoked move
End the current phase and start a new one.
The first active, non-fainted target of this phase's invoked move.
Conduct the hit check and type effectiveness for this move against the target
Checks occur in the following order:
a HitCheckEntry containing the attack's HitCheckResult
and effectiveness against the target.
Check whether this Phase is of the given type without requiring instanceof.
The name of the phase to check
Whether this Phase is of the provided type.
ProtectedonPrivatepostPrivateprotectedProtectedqueuePrivatequeueProtectedremoveStart the current phase.
ProtectedtriggerTriggers move effects of the given move effect trigger.
The MoveEffectTrigger being applied
The Pokemon using the move
The Pokemon targeted by the move
OptionalfirstTarget: boolean | nullWhether the target is the first to be hit by the current strike
OptionalselfTarget: booleanIf defined, limits the effects triggered to either self-targeted
effects (if set to true) or targeted effects (if set to false).
ProtectedupdateRemove all substitutes that were broken by this phase's invoked move.
The
MoveUseModecorresponding to how this move was used.