Add missing weather effects for fog and strong winds

pull/51/head
Flashfyre 2024-04-06 22:10:38 -04:00
parent 9ee9a0a86b
commit 570f10345b
3 changed files with 8 additions and 2 deletions

View File

@ -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:

View File

@ -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 {

View File

@ -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);