Shared Power: Fix bug

This commit is contained in:
Kris Johnson 2021-04-15 18:58:07 -06:00
parent e9e58c9f99
commit 284b8f2df0
2 changed files with 3 additions and 2 deletions

View File

@ -1253,7 +1253,7 @@ export const Formats: FormatList = [
],
getSharedPower(pokemon) {
const sharedPower = new Set<string>();
for (const ally of pokemon.allies()) {
for (const ally of pokemon.side.pokemon) {
if (ally.previouslySwitchedIn > 0) {
if (pokemon.battle.dex.currentMod !== 'sharedpower' && ['trace', 'mirrorarmor'].includes(ally.baseAbility)) {
sharedPower.add('noability');
@ -1262,6 +1262,7 @@ export const Formats: FormatList = [
sharedPower.add(ally.baseAbility);
}
}
sharedPower.delete(pokemon.baseAbility);
return sharedPower;
},
onBeforeSwitchIn(pokemon) {

View File

@ -37,7 +37,7 @@ export const Scripts: ModdedBattleScriptsData = {
(this.battle.gen >= 5 && !this.isActive) ||
((this.volatiles['gastroacid'] ||
(neutralizinggas && (this.ability !== ('neutralizinggas' as ID) ||
this.m.abils?.some((k: string) => k === 'ability:neutralizinggas'))
this.m.abils?.includes('ability:neutralizinggas'))
)) && !this.getAbility().isPermanent
)
);