mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 14:52:19 +02:00
Add Documentation
This commit is contained in:
parent
38252cc8d8
commit
8731d271ca
@ -312,7 +312,7 @@ export class Arena {
|
|||||||
/**
|
/**
|
||||||
* Attempts to set a new weather to the battle
|
* Attempts to set a new weather to the battle
|
||||||
* @param weather {@linkcode WeatherType} new {@linkcode WeatherType} to set
|
* @param weather {@linkcode WeatherType} new {@linkcode WeatherType} to set
|
||||||
* @param hasPokemonSource boolean if the new weather is from a pokemon
|
* @param user {@linkcode Pokemon} that caused the weather effect
|
||||||
* @returns true if new weather set, false if no weather provided or attempting to set the same weather as currently in use
|
* @returns true if new weather set, false if no weather provided or attempting to set the same weather as currently in use
|
||||||
*/
|
*/
|
||||||
trySetWeather(weather: WeatherType, user?: Pokemon): boolean {
|
trySetWeather(weather: WeatherType, user?: Pokemon): boolean {
|
||||||
@ -406,6 +406,13 @@ export class Arena {
|
|||||||
return !(this.terrain?.terrainType === (terrain || undefined));
|
return !(this.terrain?.terrainType === (terrain || undefined));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to set a new terrain effect to the battle
|
||||||
|
* @param terrain {@linkcode TerrainType} new {@linkcode TerrainType} to set
|
||||||
|
* @param ignoreAnim boolean if the terrain animation should be ignored
|
||||||
|
* @param user {@linkcode Pokemon} that caused the terrain effect
|
||||||
|
* @returns true if new terrain set, false if no terrain provided or attempting to set the same terrain as currently in use
|
||||||
|
*/
|
||||||
trySetTerrain(terrain: TerrainType, ignoreAnim = false, user?: Pokemon): boolean {
|
trySetTerrain(terrain: TerrainType, ignoreAnim = false, user?: Pokemon): boolean {
|
||||||
if (!this.canSetTerrain(terrain)) {
|
if (!this.canSetTerrain(terrain)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -2014,7 +2014,20 @@ export class ResetNegativeStatStageModifier extends PokemonHeldItemModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modifier used for held items, namely Mystical Rock, that extend the
|
||||||
|
* duration of weather and terrain effects.
|
||||||
|
* @extends PokemonHeldItemModifier
|
||||||
|
* @see {@linkcode apply}
|
||||||
|
*/
|
||||||
export class FieldEffectModifier extends PokemonHeldItemModifier {
|
export class FieldEffectModifier extends PokemonHeldItemModifier {
|
||||||
|
/**
|
||||||
|
* Provides two more turns per stack to any weather or terrain effect caused
|
||||||
|
* by the holder.
|
||||||
|
* @param pokemon {@linkcode Pokemon} that holds the held item
|
||||||
|
* @param fieldDuration {@linkcode NumberHolder} that stores the current field effect duration
|
||||||
|
* @returns `true` if the field effect extension was applied successfully
|
||||||
|
*/
|
||||||
override apply(_pokemon: Pokemon, fieldDuration: NumberHolder): boolean {
|
override apply(_pokemon: Pokemon, fieldDuration: NumberHolder): boolean {
|
||||||
fieldDuration.value += 2 * this.stackCount;
|
fieldDuration.value += 2 * this.stackCount;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user