diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 95ecc9c17af..458226d1c1a 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -604,20 +604,18 @@ export abstract class Pokemon extends Phaser.GameObjects.Container { /** Generate `abilityIndex` based on species and hidden ability if not pre-defined. */ private generateAbilityIndex(): number { - // Roll for hidden ability chance, applying any ability charms for enemy mons const hiddenAbilityChance = new NumberHolder(BASE_HIDDEN_ABILITY_CHANCE); + // Ability Charms should only affect wild Pokemon + // TODO: move this `if` check into the ability charm code if (!this.hasTrainer()) { globalScene.applyModifiers(HiddenAbilityRateBoosterModifier, true, hiddenAbilityChance); } - // If the roll succeeded and we have one, use HA; otherwise pick a random ability - const hasHiddenAbility = !randSeedInt(hiddenAbilityChance.value); - if (this.species.abilityHidden && hasHiddenAbility) { - return 2; - } + // Neither RNG roll depends on the outcome of the other, so that Ability Charms do not affect RNG. + const regularAbility = this.species.ability2 !== this.species.ability1 ? randSeedInt(2) : 0; + const useHiddenAbility = this.species.abilityHidden ? !randSeedInt(hiddenAbilityChance.value) : false; - // only use random ability if species has a second ability - return this.species.ability2 !== this.species.ability1 ? randSeedInt(2) : 0; + return useHiddenAbility ? 2 : regularAbility; } /**