Fix strong winds effect not working on moves

pull/58/head
Flashfyre 2024-04-07 23:18:04 -04:00
parent 8b382dd42e
commit a0e2427974
1 changed files with 4 additions and 1 deletions

View File

@ -751,7 +751,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (moveType === Type.STELLAR) if (moveType === Type.STELLAR)
return this.isTerastallized() ? 2 : 1; return this.isTerastallized() ? 2 : 1;
const types = this.getTypes(true, true); const types = this.getTypes(true, true);
let multiplier = 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;
// Handle strong winds lowering effectiveness of types super effective against pure flying // Handle strong winds lowering effectiveness of types super effective against pure flying
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) 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; multiplier /= 2;
@ -1096,6 +1096,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
typeMultiplier.value = 1; typeMultiplier.value = 1;
if (this.getTypes(true, true).find(t => move.isTypeImmune(t))) if (this.getTypes(true, true).find(t => move.isTypeImmune(t)))
typeMultiplier.value = 0; typeMultiplier.value = 0;
// Handle strong winds lowering effectiveness of types super effective against pure flying
if (this.scene.arena.weather?.weatherType === WeatherType.STRONG_WINDS && !this.scene.arena.weather.isEffectSuppressed(this.scene) && typeMultiplier.value >= 2 && this.isOfType(Type.FLYING) && getTypeDamageMultiplier(move.type, Type.FLYING) === 2)
typeMultiplier.value /= 2;
switch (moveCategory) { switch (moveCategory) {
case MoveCategory.PHYSICAL: case MoveCategory.PHYSICAL: