diff --git a/src/field/arena.ts b/src/field/arena.ts index b3a455c865b..4f243789567 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -312,7 +312,7 @@ export class Arena { /** * Attempts to set a new weather to the battle * @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 */ trySetWeather(weather: WeatherType, user?: Pokemon): boolean { @@ -406,6 +406,13 @@ export class Arena { 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 { if (!this.canSetTerrain(terrain)) { return false; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index e5c790ef512..7c9207bbea5 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -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 { + /** + * 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 { fieldDuration.value += 2 * this.stackCount; return true;