From c9de57185e5c56668a2c7876f51ec12e5f96db62 Mon Sep 17 00:00:00 2001 From: Madmadness65 Date: Sun, 7 Apr 2024 14:01:48 -0500 Subject: [PATCH] Implement Sand Spit ability; Increase Nymble's starter cost The ability Sand Spit is now functional. Unrelatedly, Nymble has now been doubled in starter cost from 2 to 4 (it's just too good to be too low). --- src/data/ability.ts | 20 +++++++++++++++++++- src/data/pokemon-species.ts | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index bbd35d209c7..2be51626eb5 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -553,6 +553,23 @@ export class PostDefendContactDamageAbAttr extends PostDefendAbAttr { } } +export class PostDefendWeatherChangeAbAttr extends PostDefendAbAttr { + private weatherType: WeatherType; + + constructor(weatherType: WeatherType) { + super(); + + this.weatherType = weatherType; + } + + applyPostDefend(pokemon: Pokemon, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { + if (!pokemon.scene.arena.weather?.isImmutable()) + return pokemon.scene.arena.trySetWeather(this.weatherType, true); + + return false; + } +} + export class PreAttackAbAttr extends AbAttr { applyPreAttack(pokemon: Pokemon, defender: Pokemon, move: PokemonMove, args: any[]): boolean | Promise { return false; @@ -2611,7 +2628,8 @@ export function initAbilities() { .attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.SOUND_BASED), 1.3) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.hasFlag(MoveFlags.SOUND_BASED), 0.5) .ignorable(), - new Ability(Abilities.SAND_SPIT, "Sand Spit (N)", "The Pokémon creates a sandstorm when it's hit by an attack.", 8), + new Ability(Abilities.SAND_SPIT, "Sand Spit", "The Pokémon creates a sandstorm when it's hit by an attack.", 8) + .attr(PostDefendWeatherChangeAbAttr, WeatherType.SANDSTORM), new Ability(Abilities.ICE_SCALES, "Ice Scales", "The Pokémon is protected by ice scales, which halve the damage taken from special moves.", 8) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.SPECIAL, 0.5) .ignorable(), diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index f6dba5687af..53a6b96e3ac 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -2958,7 +2958,7 @@ export const speciesStarters = { [Species.QUAXLY]: 3, [Species.LECHONK]: 2, [Species.TAROUNTULA]: 2, - [Species.NYMBLE]: 2, + [Species.NYMBLE]: 4, [Species.PAWMI]: 3, [Species.TANDEMAUS]: 4, [Species.FIDOUGH]: 3,