From 3a5e169b6731f7cf4e69b1d3341d1711763d70c3 Mon Sep 17 00:00:00 2001 From: Temps Ray Date: Wed, 15 May 2024 13:01:07 -0400 Subject: [PATCH] Block comment --- src/ui/battle-info.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 056e2f82f56..2ffa2d8b832 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -265,9 +265,11 @@ export default class BattleInfo extends Phaser.GameObjects.Container { // Check if Player owns all genders and forms of the Pokemon const missingDexAttrs = ((dexEntry.caughtAttr & opponentPokemonDexAttr) < opponentPokemonDexAttr); - // If the opposing Pokemon only has 1 ability and is using the hidden ability, it should have the same - // behavior if it had 2 abilities so it is set to 2 so it lines up with the math checking the proper - // hidden ability abilityAttr which is 4 + /** + * If the opposing Pokemon only has 1 normal ability and is using the hidden ability it should have the same behavior + * if it had 2 normal abilities. This code checks if that is the case and uses the correct opponent Pokemon abilityIndex (2) + * for calculations so it aligns with where the hidden ability is stored in the starter data's abilityAttr (4) + */ const opponentPokemonOneNormalAbility = (pokemon.species.getAbilityCount() == 2); const opponentPokemonAbilityIndex = (opponentPokemonOneNormalAbility && pokemon.abilityIndex === 1) ? 2 : pokemon.abilityIndex; const opponentPokemonAbilityAttr = Math.pow(2, opponentPokemonAbilityIndex);