mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-19 09:07:24 -05:00
24 lines
764 B
TypeScript
24 lines
764 B
TypeScript
export const Scripts: ModdedBattleScriptsData = {
|
|
gen: 8,
|
|
field: {
|
|
suppressingWeather() {
|
|
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.getAbility(x).suppressWeather))) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
},
|
|
pokemon: {
|
|
hasAbility(ability) {
|
|
if (this.ignoringAbility()) return false;
|
|
if (Array.isArray(ability)) return ability.some(abil => this.hasAbility(abil));
|
|
const abilityid = this.battle.toID(ability);
|
|
return this.ability === abilityid || !!this.volatiles['ability:' + abilityid];
|
|
},
|
|
},
|
|
};
|