From b5c68548548bb52401965bf40614c61c758cebac Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Mon, 6 May 2024 22:31:25 -0400 Subject: [PATCH] Add comments to IgnoreWeatherTypeDebuffAttr for documentation --- src/data/move.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/data/move.ts b/src/data/move.ts index 1a66f30e7f8..b684eee2305 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -842,14 +842,27 @@ export class SacrificialFullRestoreAttr extends SacrificialAttr { } } +/** + * Attribute used for moves which ignore type-based debuffs from weather, namely Hydro Steam. + * Called during damage calculation after getting said debuff from getAttackTypeMultiplier in the Pokemon class. + */ export class IgnoreWeatherTypeDebuffAttr extends MoveAttr { public weather: WeatherType; constructor(weather: WeatherType){ super(); this.weather = weather; } + /** + * Changes the type-based weather modifier if this move's power would be reduced by it + * @param user Pokemon that used the move + * @param target N/A + * @param move Move with this attribute + * @param args Utils.NumberHolder for arenaAttackTypeMultiplier + * @returns true if the function succeeds + */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const weatherModifier=args[0] as Utils.NumberHolder; + //If the type-based attack power modifier due to weather (e.g. Water moves in Sun) is below 1, set it to 1 if (user.scene.arena.weather?.weatherType === this.weather) weatherModifier.value = Math.max(weatherModifier.value, 1); return true;