Use hasAbilityWithAttr() instead of .get[Passive]Ability()

Co-authored-by: innerthunder <168692175+innerthunder@users.noreply.github.com>
This commit is contained in:
NightKev 2024-09-07 02:47:08 -07:00 committed by GitHub
parent 06f6386099
commit 3faf847d45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2467,7 +2467,7 @@ export default class BattleScene extends SceneBase {
const difficultyWaveIndex = this.gameMode.getWaveForDifficulty(this.currentBattle.waveIndex);
const isFinalBoss = this.gameMode.isWaveFinal(this.currentBattle.waveIndex);
let chances = Math.ceil(difficultyWaveIndex / 10);
if (this.getPlayerPokemon()?.getAbility().hasAttr(BonusItemChanceAbAttr) || this.getPlayerPokemon()?.getPassiveAbility().hasAttr(BonusItemChanceAbAttr)) {
if (this.getPlayerPokemon()?.hasAbilityWithAttr(BonusItemChanceAbAttr)) {
chances += Math.floor(chances * 1.2);
}
if (isFinalBoss) {