Block comment

pull/892/head
Temps Ray 2024-05-15 13:01:07 -04:00
parent 5d6e04e20d
commit 3a5e169b67
1 changed files with 5 additions and 3 deletions

View File

@ -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);