Update so passive works and super(false) the naked boolean

This commit is contained in:
Ethan 2024-06-03 14:54:51 -04:00
parent 5f18404c83
commit a8ea9b9df3
2 changed files with 7 additions and 3 deletions

View File

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

View File

@ -2015,6 +2015,10 @@ export class BonusCritAbAttr extends AbAttr {
* This is used in battle-scene.ts in generateEnemyModifiers. * This is used in battle-scene.ts in generateEnemyModifiers.
*/ */
export class BonusItemChance extends AbAttr { export class BonusItemChance extends AbAttr {
constructor() {
super(false);
}
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
return true; return true;
} }
@ -3512,7 +3516,7 @@ export function initAbilities() {
.attr(SuppressWeatherEffectAbAttr, true), .attr(SuppressWeatherEffectAbAttr, true),
new Ability(Abilities.COMPOUND_EYES, 3) new Ability(Abilities.COMPOUND_EYES, 3)
.attr(BattleStatMultiplierAbAttr, BattleStat.ACC, 1.3) .attr(BattleStatMultiplierAbAttr, BattleStat.ACC, 1.3)
.attr(BonusItemChance, false), .attr(BonusItemChance),
new Ability(Abilities.INSOMNIA, 3) new Ability(Abilities.INSOMNIA, 3)
.attr(StatusEffectImmunityAbAttr, StatusEffect.SLEEP) .attr(StatusEffectImmunityAbAttr, StatusEffect.SLEEP)
.attr(BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) .attr(BattlerTagImmunityAbAttr, BattlerTagType.DROWSY)
@ -3788,7 +3792,7 @@ export function initAbilities() {
.attr(MoveAbilityBypassAbAttr), .attr(MoveAbilityBypassAbAttr),
new Ability(Abilities.SUPER_LUCK, 4) new Ability(Abilities.SUPER_LUCK, 4)
.attr(BonusCritAbAttr) .attr(BonusCritAbAttr)
.attr(BonusItemChance, false), .attr(BonusItemChance),
new Ability(Abilities.AFTERMATH, 4) new Ability(Abilities.AFTERMATH, 4)
.attr(PostFaintContactDamageAbAttr,4) .attr(PostFaintContactDamageAbAttr,4)
.bypassFaint(), .bypassFaint(),