From f3557acfaa1268e580eff4e8ea8c159e5a28f803 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Fri, 26 Jul 2024 05:22:39 -0700 Subject: [PATCH] Update `getAbility()` and `getAbilityCount()` for the ability changes --- src/data/pokemon-species.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index e23b22f1bce7..de6daeb37b0e 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -182,14 +182,7 @@ export abstract class PokemonSpeciesForm { * @returns Number of abilities */ getAbilityCount(): integer { - let count = 1; - if (this.ability2 !== Abilities.NONE) { - count += 1; - } - if (this.abilityHidden !== Abilities.NONE) { - count += 1; - } - return count; + return this.abilityHidden !== Abilities.NONE ? 3 : 2; } /** @@ -202,7 +195,7 @@ export abstract class PokemonSpeciesForm { if (abilityIndex === 0) { ret = this.ability1; } else if (abilityIndex === 1) { - if (this.ability2 !== Abilities.NONE) { + if (this.ability2 !== this.ability1) { ret = this.ability2; } else { ret = this.abilityHidden;