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
PrivateisWhether this phase represents a stat stage increase, set after splitting changes by sign
Private ReadonlyoptionsReadonlyphaseThe string name of the phase, used to identify the phase type for is
Private ReadonlyselfWhether the target caused its own stat changes for this phase
PrivateapplyApply stat stage multiplier abilities to every requested change.
The Pokemon receiving the stat changes
PrivateapplyApply the resolved changes, queue battle messages, trigger reactive abilities/items, and end the phase.
The Pokemon receiving the stat changes
The clamped per-stat deltas to apply
PrivatebuildBuild a stat change message for a group of changes that share the same magnitude.
The changes described by this message (all sharing one stages value)
The localised message string
PrivatecheckInvoke abilities that may block or reflect a set of stat drops,
adding any blocked stats to cancelledStats.
The Pokemon receiving the stat changes
The Pokemon that caused the change, if present; used to resolve the target for Mirror Armor's reflection effect.
The negative stat changes to evaluate
A set containing each BattleStat whose change was cancelled; will be modified by this method
PrivatecheckIf this is the last queued StatStageChangePhase for the target,
consume a held White Herb (if any) to reset negative stat stages.
The Pokemon to check
PrivateformatFormat a list of changes into a localised stat-name fragment (e.g. "Attack, Defense, and Speed").
The changes whose stat names should be listed
The localised fragment, or the generic "stats" string for 5+
PrivategetCompute the relative change for each requested change by clamping to [-6, 6].
The Pokemon receiving the stat changes
A new array of StatChanges
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.
PrivateplayPrivatequeueQueue one battle message per distinct stage change magnitude.
The applied changes
PrivateremoveRemove any negative stat changes that are blocked by field effects or abilities,
updating options.changes in place.
The Pokemon receiving the stat changes
PrivatesplitIf both positive and negative stage changes are present,
split the negative changes into a follow-up StatStageChangePhase.
Start the current phase.
Called automatically by the PhaseManager when it is this Phase's turn to run.
PrivatetriggerTrigger abilities that react to stat stage changes, such as Opportunist and Defiant.
The Pokemon whose stats have changed
PrivateupdateWrite each clamped change to the target's stat stages and flag turn data accordingly.
The Pokemon receiving the stat changes
The applied changes
Phase responsible for resolving, animating, and applying one or more stat changes. they will be split into one phase for raises and one phase for drops.
Changes to multiple stats may be applied at once. If both raises and drops are provided to the same phase, it will be split into one phase for raises and one phase for drops.