From e86e5952787a3dd54aef8fc50b23768f09237e43 Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Mon, 13 May 2024 06:33:26 -0500 Subject: [PATCH] Added changes from Discord thread --- src/data/move.ts | 14 ++++++-------- src/field/pokemon.ts | 6 ++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 15f2ad6f969..b55e4277ea5 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1320,17 +1320,15 @@ export class BypassSleepAttr extends MoveAttr { /** * Attribute used for moves that bypass the burn damage reduction of physical moves, currently only facade * Called during damage calculation + * @param user N/A + * @param target N/A + * @param move Move with this attribute + * @param args Utils.BooleanHolder for burnDamageReductionCancelled + * @returns true if the function succeeds */ export class BypassBurnDamageReductionAttr extends MoveAttr { - /** - * Prevents the move's damage from being reduced by burn - * @param user N/A - * @param target N/A - * @param move Move with this attribute - * @param args Utils.BooleanHolder for burnDamageReductionCancelled - * @returns true if the function succeeds - */ + /** Prevents the move's damage from being reduced by burn */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { (args[0] as Utils.BooleanHolder).value = true; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 76c737d6d20..01b267bc669 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1502,10 +1502,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (!isTypeImmune) { damage.value = Math.ceil(((((2 * source.level / 5 + 2) * power.value * sourceAtk.value / targetDef.value) / 50) + 2) * stabMultiplier.value * typeMultiplier.value * arenaAttackTypeMultiplier.value * screenMultiplier.value * ((this.scene.randBattleSeedInt(15) + 85) / 100) * criticalMultiplier.value); if (isPhysical && source.status && source.status.effect === StatusEffect.BURN) { - const burnDamageReductionCancelled = new Utils.BooleanHolder(false); - applyMoveAttrs(BypassBurnDamageReductionAttr, source, this, move, burnDamageReductionCancelled); - - if(!burnDamageReductionCancelled.value){ + if(!move.getAttrs(BypassBurnDamageReductionAttr).length) { + const burnDamageReductionCancelled = new Utils.BooleanHolder(false); applyAbAttrs(BypassBurnDamageReductionAbAttr, source, burnDamageReductionCancelled); if (!burnDamageReductionCancelled.value) damage.value = Math.floor(damage.value / 2);