Shared Power: Fix sharing weather suppression (#8637)

* Shared Power: Fix weather suppresion sharing

* Update scripts.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
This commit is contained in:
Hisuian Zoroark
2022-01-24 00:13:58 -05:00
committed by GitHub
parent 61e3cc2d21
commit 8a99f0f8bc

View File

@@ -5,7 +5,9 @@ export const Scripts: ModdedBattleScriptsData = {
for (const pokemon of this.battle.getAllActive()) {
const innates = Object.keys(pokemon.volatiles).filter(x => x.startsWith('ability:'));
if (pokemon && !pokemon.ignoringAbility() &&
(pokemon.getAbility().suppressWeather || innates.some(x => this.battle.dex.abilities.get(x).suppressWeather))) {
(pokemon.getAbility().suppressWeather || innates.some(x => (
this.battle.dex.abilities.get(x.replace('ability:', '')).suppressWeather
)))) {
return true;
}
}