Add comments to IgnoreWeatherTypeDebuffAttr for documentation

This commit is contained in:
AJ Fontaine 2024-05-06 22:31:25 -04:00 committed by GitHub
parent 1997b0e5c6
commit b5c6854854
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;