mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-11 19:02:16 +02:00
Add comments to IgnoreWeatherTypeDebuffAttr for documentation
This commit is contained in:
parent
1997b0e5c6
commit
b5c6854854
@ -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 {
|
export class IgnoreWeatherTypeDebuffAttr extends MoveAttr {
|
||||||
public weather: WeatherType;
|
public weather: WeatherType;
|
||||||
constructor(weather: WeatherType){
|
constructor(weather: WeatherType){
|
||||||
super();
|
super();
|
||||||
this.weather = weather;
|
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 {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
const weatherModifier=args[0] as Utils.NumberHolder;
|
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)
|
if (user.scene.arena.weather?.weatherType === this.weather)
|
||||||
weatherModifier.value = Math.max(weatherModifier.value, 1);
|
weatherModifier.value = Math.max(weatherModifier.value, 1);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user