Rename and optimize

pull/892/head
Temps Ray 2024-05-14 21:15:08 -04:00
parent 83c65529ff
commit 5d6e04e20d
1 changed files with 2 additions and 2 deletions

View File

@ -268,8 +268,8 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
// If the opposing Pokemon only has 1 ability and is using the hidden ability, it should have the same // 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 // 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 // hidden ability abilityAttr which is 4
const opponentPokemonOneAbility = (pokemon.species.getAbilityCount() == 2); const opponentPokemonOneNormalAbility = (pokemon.species.getAbilityCount() == 2);
const opponentPokemonAbilityIndex = (pokemon.abilityIndex === 1 && opponentPokemonOneAbility) ? 2 : pokemon.abilityIndex; const opponentPokemonAbilityIndex = (opponentPokemonOneNormalAbility && pokemon.abilityIndex === 1) ? 2 : pokemon.abilityIndex;
const opponentPokemonAbilityAttr = Math.pow(2, opponentPokemonAbilityIndex); const opponentPokemonAbilityAttr = Math.pow(2, opponentPokemonAbilityIndex);
const rootFormHasHiddenAbility = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr & opponentPokemonAbilityAttr; const rootFormHasHiddenAbility = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr & opponentPokemonAbilityAttr;