[Documentation] Add some tsdocs to `move.ts`, mark rollout and iceball (P) (#4099)

* Add some tsdocs to `move.ts`, some misc cleanup

* Mark Rollout and Ice Ball as partial
This commit is contained in:
NightKev 2024-09-11 18:05:43 -07:00 committed by GitHub
parent 18dc1029b7
commit 951b568590
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 51 additions and 42 deletions

View File

@ -81,6 +81,16 @@ export enum MoveFlags {
MAKES_CONTACT = 1 << 0, MAKES_CONTACT = 1 << 0,
IGNORE_PROTECT = 1 << 1, IGNORE_PROTECT = 1 << 1,
IGNORE_VIRTUAL = 1 << 2, IGNORE_VIRTUAL = 1 << 2,
/**
* Sound-based moves have the following effects:
* - Pokemon with the {@linkcode Abilities.SOUNDPROOF Soundproof Ability} are unaffected by other Pokemon's sound-based moves.
* - Pokemon affected by {@linkcode Moves.THROAT_CHOP Throat Chop} cannot use sound-based moves for two turns.
* - Sound-based moves used by a Pokemon with {@linkcode Abilities.LIQUID_VOICE Liquid Voice} become Water-type moves.
* - Sound-based moves used by a Pokemon with {@linkcode Abilities.PUNK_ROCK Punk Rock} are boosted by 30%. Pokemon with Punk Rock also take half damage from sound-based moves.
* - All sound-based moves (except Howl) can hit Pokemon behind an active {@linkcode Moves.SUBSTITUTE Substitute}.
*
* cf https://bulbapedia.bulbagarden.net/wiki/Sound-based_move
*/
SOUND_BASED = 1 << 3, SOUND_BASED = 1 << 3,
HIDE_USER = 1 << 4, HIDE_USER = 1 << 4,
HIDE_TARGET = 1 << 5, HIDE_TARGET = 1 << 5,
@ -93,19 +103,20 @@ export enum MoveFlags {
* @see {@linkcode Move.recklessMove()} * @see {@linkcode Move.recklessMove()}
*/ */
RECKLESS_MOVE = 1 << 10, RECKLESS_MOVE = 1 << 10,
/** Indicates a move should be affected by {@linkcode Abilities.BULLETPROOF} */
BALLBOMB_MOVE = 1 << 11, BALLBOMB_MOVE = 1 << 11,
/** Grass types and pokemon with {@linkcode Abilities.OVERCOAT} are immune to powder moves */
POWDER_MOVE = 1 << 12, POWDER_MOVE = 1 << 12,
/** Indicates a move should trigger {@linkcode Abilities.DANCER} */
DANCE_MOVE = 1 << 13, DANCE_MOVE = 1 << 13,
/** Indicates a move should trigger {@linkcode Abilities.WIND_RIDER} */
WIND_MOVE = 1 << 14, WIND_MOVE = 1 << 14,
/** Indicates a move should trigger {@linkcode Abilities.TRIAGE} */
TRIAGE_MOVE = 1 << 15, TRIAGE_MOVE = 1 << 15,
IGNORE_ABILITIES = 1 << 16, IGNORE_ABILITIES = 1 << 16,
/** /** Enables all hits of a multi-hit move to be accuracy checked individually */
* Enables all hits of a multi-hit move to be accuracy checked individually
*/
CHECK_ALL_HITS = 1 << 17, CHECK_ALL_HITS = 1 << 17,
/** /** Indicates a move is able to be redirected to allies in a double battle if the attacker faints */
* Indicates a move is able to be redirected to allies in a double battle if the attacker faints
*/
REDIRECT_COUNTER = 1 << 18, REDIRECT_COUNTER = 1 << 18,
} }
@ -118,22 +129,22 @@ export default class Move implements Localizable {
private _type: Type; private _type: Type;
private _category: MoveCategory; private _category: MoveCategory;
public moveTarget: MoveTarget; public moveTarget: MoveTarget;
public power: integer; public power: number;
public accuracy: integer; public accuracy: number;
public pp: integer; public pp: number;
public effect: string; public effect: string;
public chance: integer; /** The chance of a move's secondary effects activating */
public priority: integer; public chance: number;
public generation: integer; public priority: number;
public attrs: MoveAttr[]; public generation: number;
private conditions: MoveCondition[]; public attrs: MoveAttr[] = [];
private flags: integer; private conditions: MoveCondition[] = [];
private nameAppend: string; /** The move's {@linkcode MoveFlags} */
private flags: number = 0;
private nameAppend: string = "";
constructor(id: Moves, type: Type, category: MoveCategory, defaultMoveTarget: MoveTarget, power: integer, accuracy: integer, pp: integer, chance: integer, priority: integer, generation: integer) { constructor(id: Moves, type: Type, category: MoveCategory, defaultMoveTarget: MoveTarget, power: number, accuracy: number, pp: number, chance: number, priority: number, generation: number) {
this.id = id; this.id = id;
this.nameAppend = "";
this._type = type; this._type = type;
this._category = category; this._category = category;
this.moveTarget = defaultMoveTarget; this.moveTarget = defaultMoveTarget;
@ -144,10 +155,6 @@ export default class Move implements Localizable {
this.priority = priority; this.priority = priority;
this.generation = generation; this.generation = generation;
this.attrs = [];
this.conditions = [];
this.flags = 0;
if (defaultMoveTarget === MoveTarget.USER) { if (defaultMoveTarget === MoveTarget.USER) {
this.setFlag(MoveFlags.IGNORE_PROTECT, true); this.setFlag(MoveFlags.IGNORE_PROTECT, true);
} }
@ -377,7 +384,7 @@ export default class Move implements Localizable {
* @param makesContact The value (boolean) to set the flag to * @param makesContact The value (boolean) to set the flag to
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
makesContact(makesContact: boolean = true): this { // TODO: is true the correct default? makesContact(makesContact: boolean = true): this {
this.setFlag(MoveFlags.MAKES_CONTACT, makesContact); this.setFlag(MoveFlags.MAKES_CONTACT, makesContact);
return this; return this;
} }
@ -388,7 +395,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.CURSE} * example: @see {@linkcode Moves.CURSE}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
ignoresProtect(ignoresProtect: boolean = true): this { // TODO: is `true` the correct default? ignoresProtect(ignoresProtect: boolean = true): this {
this.setFlag(MoveFlags.IGNORE_PROTECT, ignoresProtect); this.setFlag(MoveFlags.IGNORE_PROTECT, ignoresProtect);
return this; return this;
} }
@ -399,7 +406,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.NATURE_POWER} * example: @see {@linkcode Moves.NATURE_POWER}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
ignoresVirtual(ignoresVirtual: boolean = true): this { // TODO: is `true` the correct default? ignoresVirtual(ignoresVirtual: boolean = true): this {
this.setFlag(MoveFlags.IGNORE_VIRTUAL, ignoresVirtual); this.setFlag(MoveFlags.IGNORE_VIRTUAL, ignoresVirtual);
return this; return this;
} }
@ -410,7 +417,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.UPROAR} * example: @see {@linkcode Moves.UPROAR}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
soundBased(soundBased: boolean = true): this { // TODO: is `true` the correct default? soundBased(soundBased: boolean = true): this {
this.setFlag(MoveFlags.SOUND_BASED, soundBased); this.setFlag(MoveFlags.SOUND_BASED, soundBased);
return this; return this;
} }
@ -421,7 +428,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.TELEPORT} * example: @see {@linkcode Moves.TELEPORT}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
hidesUser(hidesUser: boolean = true): this { // TODO: is `true` the correct default? hidesUser(hidesUser: boolean = true): this {
this.setFlag(MoveFlags.HIDE_USER, hidesUser); this.setFlag(MoveFlags.HIDE_USER, hidesUser);
return this; return this;
} }
@ -432,7 +439,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.WHIRLWIND} * example: @see {@linkcode Moves.WHIRLWIND}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
hidesTarget(hidesTarget: boolean = true): this { // TODO: is `true` the correct default? hidesTarget(hidesTarget: boolean = true): this {
this.setFlag(MoveFlags.HIDE_TARGET, hidesTarget); this.setFlag(MoveFlags.HIDE_TARGET, hidesTarget);
return this; return this;
} }
@ -443,7 +450,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.BITE} * example: @see {@linkcode Moves.BITE}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
bitingMove(bitingMove: boolean = true): this { // TODO: is `true` the correct default? bitingMove(bitingMove: boolean = true): this {
this.setFlag(MoveFlags.BITING_MOVE, bitingMove); this.setFlag(MoveFlags.BITING_MOVE, bitingMove);
return this; return this;
} }
@ -454,7 +461,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.WATER_PULSE} * example: @see {@linkcode Moves.WATER_PULSE}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
pulseMove(pulseMove: boolean = true): this { // TODO: is `true` the correct default? pulseMove(pulseMove: boolean = true): this {
this.setFlag(MoveFlags.PULSE_MOVE, pulseMove); this.setFlag(MoveFlags.PULSE_MOVE, pulseMove);
return this; return this;
} }
@ -465,7 +472,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.DRAIN_PUNCH} * example: @see {@linkcode Moves.DRAIN_PUNCH}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
punchingMove(punchingMove: boolean = true): this { // TODO: is `true` the correct default? punchingMove(punchingMove: boolean = true): this {
this.setFlag(MoveFlags.PUNCHING_MOVE, punchingMove); this.setFlag(MoveFlags.PUNCHING_MOVE, punchingMove);
return this; return this;
} }
@ -476,7 +483,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.X_SCISSOR} * example: @see {@linkcode Moves.X_SCISSOR}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
slicingMove(slicingMove: boolean = true): this { // TODO: is `true` the correct default? slicingMove(slicingMove: boolean = true): this {
this.setFlag(MoveFlags.SLICING_MOVE, slicingMove); this.setFlag(MoveFlags.SLICING_MOVE, slicingMove);
return this; return this;
} }
@ -487,7 +494,7 @@ export default class Move implements Localizable {
* @param recklessMove The value to set the flag to * @param recklessMove The value to set the flag to
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
recklessMove(recklessMove: boolean = true): this { // TODO: is `true` the correct default? recklessMove(recklessMove: boolean = true): this {
this.setFlag(MoveFlags.RECKLESS_MOVE, recklessMove); this.setFlag(MoveFlags.RECKLESS_MOVE, recklessMove);
return this; return this;
} }
@ -498,7 +505,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.ELECTRO_BALL} * example: @see {@linkcode Moves.ELECTRO_BALL}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
ballBombMove(ballBombMove: boolean = true): this { // TODO: is `true` the correct default? ballBombMove(ballBombMove: boolean = true): this {
this.setFlag(MoveFlags.BALLBOMB_MOVE, ballBombMove); this.setFlag(MoveFlags.BALLBOMB_MOVE, ballBombMove);
return this; return this;
} }
@ -509,7 +516,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.STUN_SPORE} * example: @see {@linkcode Moves.STUN_SPORE}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
powderMove(powderMove: boolean = true): this { // TODO: is `true` the correct default? powderMove(powderMove: boolean = true): this {
this.setFlag(MoveFlags.POWDER_MOVE, powderMove); this.setFlag(MoveFlags.POWDER_MOVE, powderMove);
return this; return this;
} }
@ -520,7 +527,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.PETAL_DANCE} * example: @see {@linkcode Moves.PETAL_DANCE}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
danceMove(danceMove: boolean = true): this { // TODO: is `true` the correct default? danceMove(danceMove: boolean = true): this {
this.setFlag(MoveFlags.DANCE_MOVE, danceMove); this.setFlag(MoveFlags.DANCE_MOVE, danceMove);
return this; return this;
} }
@ -531,7 +538,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.HURRICANE} * example: @see {@linkcode Moves.HURRICANE}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
windMove(windMove: boolean = true): this { // TODO: is `true` the correct default? windMove(windMove: boolean = true): this {
this.setFlag(MoveFlags.WIND_MOVE, windMove); this.setFlag(MoveFlags.WIND_MOVE, windMove);
return this; return this;
} }
@ -542,7 +549,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.ABSORB} * example: @see {@linkcode Moves.ABSORB}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
triageMove(triageMove: boolean = true): this { // TODO: is `true` the correct default? triageMove(triageMove: boolean = true): this {
this.setFlag(MoveFlags.TRIAGE_MOVE, triageMove); this.setFlag(MoveFlags.TRIAGE_MOVE, triageMove);
return this; return this;
} }
@ -553,7 +560,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.SUNSTEEL_STRIKE} * example: @see {@linkcode Moves.SUNSTEEL_STRIKE}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
ignoresAbilities(ignoresAbilities: boolean = true): this { // TODO: is `true` the correct default? ignoresAbilities(ignoresAbilities: boolean = true): this {
this.setFlag(MoveFlags.IGNORE_ABILITIES, ignoresAbilities); this.setFlag(MoveFlags.IGNORE_ABILITIES, ignoresAbilities);
return this; return this;
} }
@ -564,7 +571,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.TRIPLE_AXEL} * example: @see {@linkcode Moves.TRIPLE_AXEL}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
checkAllHits(checkAllHits: boolean = true): this { // TODO: is `true` the correct default? checkAllHits(checkAllHits: boolean = true): this {
this.setFlag(MoveFlags.CHECK_ALL_HITS, checkAllHits); this.setFlag(MoveFlags.CHECK_ALL_HITS, checkAllHits);
return this; return this;
} }
@ -575,7 +582,7 @@ export default class Move implements Localizable {
* example: @see {@linkcode Moves.METAL_BURST} * example: @see {@linkcode Moves.METAL_BURST}
* @returns The {@linkcode Move} that called this function * @returns The {@linkcode Move} that called this function
*/ */
redirectCounter(redirectCounter: boolean = true): this { // TODO: is `true` the correct default? redirectCounter(redirectCounter: boolean = true): this {
this.setFlag(MoveFlags.REDIRECT_COUNTER, redirectCounter); this.setFlag(MoveFlags.REDIRECT_COUNTER, redirectCounter);
return this; return this;
} }
@ -7138,6 +7145,7 @@ export function initMoves() {
new StatusMove(Moves.CHARM, Type.FAIRY, 100, 20, -1, 0, 2) new StatusMove(Moves.CHARM, Type.FAIRY, 100, 20, -1, 0, 2)
.attr(StatStageChangeAttr, [ Stat.ATK ], -2), .attr(StatStageChangeAttr, [ Stat.ATK ], -2),
new AttackMove(Moves.ROLLOUT, Type.ROCK, MoveCategory.PHYSICAL, 30, 90, 20, -1, 0, 2) new AttackMove(Moves.ROLLOUT, Type.ROCK, MoveCategory.PHYSICAL, 30, 90, 20, -1, 0, 2)
.partial()
.attr(ConsecutiveUseDoublePowerAttr, 5, true, true, Moves.DEFENSE_CURL), .attr(ConsecutiveUseDoublePowerAttr, 5, true, true, Moves.DEFENSE_CURL),
new AttackMove(Moves.FALSE_SWIPE, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 40, -1, 0, 2) new AttackMove(Moves.FALSE_SWIPE, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 40, -1, 0, 2)
.attr(SurviveDamageAttr), .attr(SurviveDamageAttr),
@ -7421,6 +7429,7 @@ export function initMoves() {
.attr(AddArenaTagAttr, ArenaTagType.MUD_SPORT, 5) .attr(AddArenaTagAttr, ArenaTagType.MUD_SPORT, 5)
.target(MoveTarget.BOTH_SIDES), .target(MoveTarget.BOTH_SIDES),
new AttackMove(Moves.ICE_BALL, Type.ICE, MoveCategory.PHYSICAL, 30, 90, 20, -1, 0, 3) new AttackMove(Moves.ICE_BALL, Type.ICE, MoveCategory.PHYSICAL, 30, 90, 20, -1, 0, 3)
.partial()
.attr(ConsecutiveUseDoublePowerAttr, 5, true, true, Moves.DEFENSE_CURL) .attr(ConsecutiveUseDoublePowerAttr, 5, true, true, Moves.DEFENSE_CURL)
.ballBombMove(), .ballBombMove(),
new AttackMove(Moves.NEEDLE_ARM, Type.GRASS, MoveCategory.PHYSICAL, 60, 100, 15, 30, 0, 3) new AttackMove(Moves.NEEDLE_ARM, Type.GRASS, MoveCategory.PHYSICAL, 60, 100, 15, 30, 0, 3)