Skip to content

Commit

Permalink
Update getAbility() and getAbilityCount() for the ability changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DayKev committed Jul 26, 2024
1 parent f0335af commit f3557ac
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/data/pokemon-species.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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;
Expand Down

0 comments on commit f3557ac

Please sign in to comment.