mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-24 02:29:25 +01:00
[Docs] Fix up docs related to move phase (#6862)
* [Docs] Fix up docs related to move phase * Fix `MoveUseMode` invalid TSDoc linkcodes * bulk suggestion Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
b1f482e22c
commit
7f2f163a9a
@ -871,14 +871,15 @@ export abstract class Move implements Localizable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies each {@linkcode MoveCondition} function of this move to the params, determines if the move can be used prior to calling each attribute's apply()
|
||||
* @param user - {@linkcode Pokemon} to apply conditions to
|
||||
* @param target - {@linkcode Pokemon} to apply conditions to
|
||||
* @param move - {@linkcode Move} to apply conditions to
|
||||
* @param sequence - The sequence number where the condition check occurs, or `-1` to check all; defaults to 4. Pass -1 to check all
|
||||
* @returns boolean: false if any of the apply()'s return false, else true
|
||||
* Apply this move's conditions prior to move effect application.
|
||||
* @param user - The {@linkcode Pokemon} using this move
|
||||
* @param target - The {@linkcode Pokemon} targeted by this move
|
||||
* @param sequence - (Default `4`) The sequence number where the condition check occurs, or `-1` to check all
|
||||
* @returns Whether all conditions passed
|
||||
* @remarks
|
||||
* Only applies conditions intrinsic to the particular move being used.
|
||||
*/
|
||||
applyConditions(user: Pokemon, target: Pokemon, sequence: -1 | 2 | 3 | 4 = 4): boolean {
|
||||
public applyConditions(user: Pokemon, target: Pokemon, sequence: -1 | 2 | 3 | 4 = 4): boolean {
|
||||
let conditionsArray: MoveCondition[];
|
||||
switch (sequence) {
|
||||
case -1:
|
||||
|
||||
@ -59,6 +59,7 @@ export const MoveUseMode = {
|
||||
* **cannot be reflected by other reflecting effects**.
|
||||
*/
|
||||
REFLECTED: 5,
|
||||
|
||||
/**
|
||||
* This "move" was created by a transparent effect that **does not count as using a move**,
|
||||
* such as {@linkcode DelayedAttackAttr | Future Sight/Doom Desire}.
|
||||
@ -77,9 +78,10 @@ export type MoveUseMode = ObjectValues<typeof MoveUseMode>;
|
||||
// Please update the markdown tables if any new `MoveUseMode`s get added.
|
||||
|
||||
/**
|
||||
* Check if a given {@linkcode MoveUseMode} is virtual (i.e. called by another move or effect).
|
||||
* Check if a given `MoveUseMode` is virtual (i.e. called by another move or effect).
|
||||
* Virtual moves are ignored by most moveset-related effects due to not being executed directly.
|
||||
* @returns Whether {@linkcode useMode} is virtual.
|
||||
* @param useMode - The {@linkcode MoveUseMode} to check
|
||||
* @returns Whether `useMode` is virtual.
|
||||
* @remarks
|
||||
* This function is equivalent to the following truth table:
|
||||
*
|
||||
@ -97,10 +99,10 @@ export function isVirtual(useMode: MoveUseMode): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given {@linkcode MoveUseMode} should ignore pre-move cancellation checks
|
||||
* Check if a given `MoveUseMode` should ignore pre-move cancellation checks
|
||||
* from {@linkcode StatusEffect.PARALYSIS} and {@linkcode BattlerTagLapseType.MOVE}-type effects.
|
||||
* @param useMode - The {@linkcode MoveUseMode} to check.
|
||||
* @returns Whether {@linkcode useMode} should ignore status and otehr cancellation checks.
|
||||
* @param useMode - The {@linkcode MoveUseMode} to check
|
||||
* @returns Whether `useMode` should ignore status and other cancellation checks.
|
||||
* @remarks
|
||||
* This function is equivalent to the following truth table:
|
||||
*
|
||||
@ -118,10 +120,10 @@ export function isIgnoreStatus(useMode: MoveUseMode): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given {@linkcode MoveUseMode} should ignore PP.
|
||||
* Check if a given `MoveUseMode` should ignore PP.
|
||||
* PP-ignoring moves will ignore normal PP consumption as well as associated failure checks.
|
||||
* @param useMode - The {@linkcode MoveUseMode} to check.
|
||||
* @returns Whether {@linkcode useMode} ignores PP.
|
||||
* @param useMode - The {@linkcode MoveUseMode} to check
|
||||
* @returns Whether `useMode` ignores PP consumption.
|
||||
* @remarks
|
||||
* This function is equivalent to the following truth table:
|
||||
*
|
||||
@ -139,11 +141,11 @@ export function isIgnorePP(useMode: MoveUseMode): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given {@linkcode MoveUseMode} is reflected.
|
||||
* Check if a given `MoveUseMode` is reflected.
|
||||
* Reflected moves cannot be reflected, copied, or cancelled by status effects,
|
||||
* nor will they trigger {@linkcode PostDancingMoveAbAttr | Dancer}.
|
||||
* @param useMode - The {@linkcode MoveUseMode} to check.
|
||||
* @returns Whether {@linkcode useMode} is reflected.
|
||||
* @param useMode - The {@linkcode MoveUseMode} to check
|
||||
* @returns Whether `useMode` is reflected.
|
||||
* @remarks
|
||||
* This function is equivalent to the following truth table:
|
||||
*
|
||||
|
||||
@ -5003,20 +5003,24 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
/**
|
||||
* Queue the status cure message, reset the status, and update the info display
|
||||
* Helper function for the Move phase that queues the status cure message,
|
||||
* resets it, and updates the info display.
|
||||
* @param effect - The effect to cure. If this does not match the current status, nothing happens.
|
||||
* @param msg - A custom message to display when curing the status effect (used for curing freeze due to move use)
|
||||
* @param msg - If provided, will override the default message displayed when removing status.
|
||||
* Used for moves that thaw the user out
|
||||
*/
|
||||
public cureStatus(effect: StatusEffect, msg?: string): void {
|
||||
// TODO: Distinguish this more from `resetStatus`
|
||||
public cureStatus(effect: StatusEffect, msg = getStatusEffectHealText(effect, getPokemonNameWithAffix(this))): void {
|
||||
if (effect !== this.status?.effect) {
|
||||
return;
|
||||
}
|
||||
// Freeze healed by move uses its own msg
|
||||
globalScene.phaseManager.queueMessage(msg ?? getStatusEffectHealText(effect, getPokemonNameWithAffix(this)));
|
||||
// cannot use `asPhase=true` as it will cause status to be reset _after_ this phase ends
|
||||
|
||||
globalScene.phaseManager.queueMessage(msg);
|
||||
// cannot use `asPhase=true` as it will cause status to be reset _after_ the move phase ends
|
||||
this.resetStatus(undefined, undefined, undefined, false);
|
||||
this.updateInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset this Pokémon's status
|
||||
* @param revive - Whether revive should be cured; default `true`
|
||||
|
||||
Loading…
Reference in New Issue
Block a user