From 1fa97e361573d61ebe5d42addb41ac3bc92f9f03 Mon Sep 17 00:00:00 2001 From: torranx Date: Sun, 1 Sep 2024 03:39:33 +0800 Subject: [PATCH] fix nits --- src/data/ability.ts | 12 ++++++------ src/field/arena.ts | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 1304570a25d..63c12a946bc 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2410,8 +2410,8 @@ export class PostSummonFormChangeByWeatherAbAttr extends PostSummonAbAttr { * @returns whether the form change was triggered */ applyPostSummon(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean { - const isCastformWithForecast = pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST; - const isCherrimWithFlowerGift = pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT; + const isCastformWithForecast = (pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST); + const isCherrimWithFlowerGift = (pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT); if (isCastformWithForecast || isCherrimWithFlowerGift) { if (simulated) { @@ -3110,8 +3110,8 @@ export class PostWeatherChangeFormChangeAbAttr extends PostWeatherChangeAbAttr { * @returns whether the form change was triggered */ applyPostWeatherChange(pokemon: Pokemon, passive: boolean, simulated: boolean, weather: WeatherType, args: any[]): boolean { - const isCastformWithForecast = pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST; - const isCherrimWithFlowerGift = pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT; + const isCastformWithForecast = (pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST); + const isCherrimWithFlowerGift = (pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT); if (isCastformWithForecast || isCherrimWithFlowerGift) { if (simulated) { @@ -4710,8 +4710,8 @@ function setAbilityRevealed(pokemon: Pokemon): void { */ function getPokemonWithWeatherBasedForms(scene: BattleScene) { return scene.getField(true).filter(p => - p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM - || p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM + (p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM) + || (p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM) ); } diff --git a/src/field/arena.ts b/src/field/arena.ts index 5024ebd4594..e8defbd1a8e 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -339,8 +339,8 @@ export class Arena { */ triggerWeatherBasedFormChanges(): void { this.scene.getField(true).forEach( p => { - const isCastformWithForecast = p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM; - const isCherrimWithFlowerGift = p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM; + const isCastformWithForecast = (p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM); + const isCherrimWithFlowerGift = (p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM); if (isCastformWithForecast || isCherrimWithFlowerGift) { new ShowAbilityPhase(this.scene, p.getBattlerIndex()); @@ -354,8 +354,8 @@ export class Arena { */ triggerWeatherBasedFormChangesToNormal(): void { this.scene.getField(true).forEach( p => { - const isCastformWithForecast = p.hasAbility(Abilities.FORECAST, false, true) && p.species.speciesId === Species.CASTFORM; - const isCherrimWithFlowerGift = p.hasAbility(Abilities.FLOWER_GIFT, false, true) && p.species.speciesId === Species.CHERRIM; + const isCastformWithForecast = (p.hasAbility(Abilities.FORECAST, false, true) && p.species.speciesId === Species.CASTFORM); + const isCherrimWithFlowerGift = (p.hasAbility(Abilities.FLOWER_GIFT, false, true) && p.species.speciesId === Species.CHERRIM); if (isCastformWithForecast || isCherrimWithFlowerGift) { new ShowAbilityPhase(this.scene, p.getBattlerIndex());