Update comments to adjust ways of working

This commit is contained in:
hayuna 2024-05-16 16:44:25 +02:00 committed by GitHub
parent d94e7134d1
commit eb49ebe4e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2036,10 +2036,10 @@ export class VariablePowerAttr extends MoveAttr {
export class LessPPMorePowerAttr extends VariablePowerAttr { export class LessPPMorePowerAttr extends VariablePowerAttr {
/** /**
* Power up moves when less PP user has * Power up moves when less PP user has
* @param user Pokemon that used the move * @param user {@linkcode Pokemon} using this move
* @param target The target of the move * @param target {@linkcode Pokemon} target of this move
* @param move Move with this attribute * @param move {@linkcode Move} being used
* @param args Utils.NumberHolder for calculating power * @param args [0] {@linkcode Utils.NumberHolder} of power
* @returns true if the function succeeds * @returns true if the function succeeds
*/ */
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
@ -2047,6 +2047,7 @@ export class LessPPMorePowerAttr extends VariablePowerAttr {
let ppUsed = user.moveset.find((m) => m.moveId === move.id).ppUsed; let ppUsed = user.moveset.find((m) => m.moveId === move.id).ppUsed;
let ppRemains = ppMax - ppUsed; let ppRemains = ppMax - ppUsed;
/** Reduce to 0 to avoid negative numbers if user has 1PP before attack and target has Ability.PRESSURE */
if(ppRemains < 0) ppRemains = 0; if(ppRemains < 0) ppRemains = 0;
const power = args[0] as Utils.NumberHolder; const power = args[0] as Utils.NumberHolder;