From 570f10345bcfa1453696dd2871258958ff9f628b Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 6 Apr 2024 22:10:38 -0400 Subject: [PATCH] Add missing weather effects for fog and strong winds --- src/data/weather.ts | 2 +- src/field/pokemon.ts | 5 ++++- src/phases.ts | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/data/weather.ts b/src/data/weather.ts index 4d08d117d..3402e51ab 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -293,7 +293,7 @@ export function getRandomWeatherType(arena: any /* Importing from arena causes a break; case Biome.MOUNTAIN: weatherPool = [ - { weatherType: WeatherType.STRONG_WINDS, weight: 1 } + { weatherType: WeatherType.NONE, weight: 1 } ]; break; case Biome.BADLANDS: diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index d92287e44..36c7bfde6 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -751,7 +751,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (moveType === Type.STELLAR) return this.isTerastallized() ? 2 : 1; const types = this.getTypes(true, true); - return getTypeDamageMultiplier(moveType, types[0]) * (types.length > 1 ? getTypeDamageMultiplier(moveType, types[1]) : 1) as TypeDamageMultiplier; + let multiplier = getTypeDamageMultiplier(moveType, types[0]) * (types.length > 1 ? getTypeDamageMultiplier(moveType, types[1]) : 1) as TypeDamageMultiplier; + if (this.scene.arena.weather?.weatherType === WeatherType.STRONG_WINDS && !this.scene.arena.weather.isEffectSuppressed(this.scene) && multiplier >= 2 && this.isOfType(Type.FLYING) && getTypeDamageMultiplier(moveType, Type.FLYING) === 2) + multiplier /= 2; + return multiplier; } getMatchupScore(pokemon: Pokemon): number { diff --git a/src/phases.ts b/src/phases.ts index 09dd81a96..9a03888b0 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2318,6 +2318,9 @@ export class MoveEffectPhase extends PokemonPhase { if (moveAccuracy.value === -1) return true; + if (this.scene.arena.weather?.weatherType === WeatherType.FOG) + moveAccuracy.value = Math.floor(moveAccuracy.value * 0.6); + if (!this.move.getMove().getAttrs(OneHitKOAttr).length && this.scene.arena.getTag(ArenaTagType.GRAVITY)) moveAccuracy.value = Math.floor(moveAccuracy.value * 1.67);