abilities: properly ignore only opportunist on opportunist boosts

pull/460/head
Madi Simpson 2024-05-04 13:26:13 -07:00
parent 5dda2258dd
commit db2e8db11a
2 changed files with 5 additions and 3 deletions

View File

@ -2106,7 +2106,7 @@ export class StatChangeMultiplierAbAttr extends AbAttr {
export class StatChangeThiefAbAttr extends AbAttr { export class StatChangeThiefAbAttr extends AbAttr {
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> {
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, (args[0] as BattleStat[]), (args[1] as integer), true, true)); pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, (args[0] as BattleStat[]), (args[1] as integer), true, false, true));
return true; return true;
} }
} }

View File

@ -2661,8 +2661,9 @@ export class StatChangePhase extends PokemonPhase {
private levels: integer; private levels: integer;
private showMessage: boolean; private showMessage: boolean;
private ignoreAbilities: boolean; private ignoreAbilities: boolean;
private ignoreOpportunist: boolean;
constructor(scene: BattleScene, battlerIndex: BattlerIndex, selfTarget: boolean, stats: BattleStat[], levels: integer, showMessage: boolean = true, ignoreAbilities: boolean = false) { constructor(scene: BattleScene, battlerIndex: BattlerIndex, selfTarget: boolean, stats: BattleStat[], levels: integer, showMessage: boolean = true, ignoreAbilities: boolean = false, ignoreOpportunist: boolean = false) {
super(scene, battlerIndex); super(scene, battlerIndex);
this.selfTarget = selfTarget; this.selfTarget = selfTarget;
@ -2670,6 +2671,7 @@ export class StatChangePhase extends PokemonPhase {
this.levels = levels; this.levels = levels;
this.showMessage = showMessage; this.showMessage = showMessage;
this.ignoreAbilities = ignoreAbilities; this.ignoreAbilities = ignoreAbilities;
this.ignoreOpportunist = ignoreOpportunist;
} }
start() { start() {
@ -2717,7 +2719,7 @@ export class StatChangePhase extends PokemonPhase {
for (let stat of filteredStats) for (let stat of filteredStats)
pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6); pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6);
if (levels.value > 0 && !this.ignoreAbilities) if (levels.value > 0 && !this.ignoreOpportunist)
for (let opponent of pokemon.getOpponents()) for (let opponent of pokemon.getOpponents())
applyAbAttrs(StatChangeThiefAbAttr, opponent, null, this.stats, levels.value); applyAbAttrs(StatChangeThiefAbAttr, opponent, null, this.stats, levels.value);