From 95cc9f6d49e03fb93225c24131aa3bd9fb2b9e77 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Thu, 16 Oct 2025 11:25:39 -0700 Subject: [PATCH] [Misc] Ability Charms no longer affect the number of RNG rolls (#6652) --- src/field/pokemon.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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; } /**