From 21f2e6981c0fe57199986115f8200d66943368d3 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Sun, 14 Jul 2024 22:51:26 -0700 Subject: [PATCH] [Bug] Remove redundant damage number popups (#3024) * Remove magic number from Belly Drum's attr * Remove redundant damage number popup * Fix merge issue and remove another duplicate damage number instance --- src/data/move.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 1de060af3c0..54f81a48055 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2528,20 +2528,17 @@ export class HalfHpStatMaxAttr extends StatChangeAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise { return new Promise(resolve => { - const damage = user.damageAndUpdate(Math.floor(user.getMaxHp() / 2), HitResult.OTHER, false, true); - if (damage) { - user.scene.damageNumberHandler.add(user, damage); - } + user.damageAndUpdate(Math.floor(user.getMaxHp() / 2), HitResult.OTHER, false, true); user.updateInfo().then(() => { const ret = super.apply(user, target, move, args); - user.scene.queueMessage(getPokemonMessage(user, ` cut its own HP\nand maximized its ${getBattleStatName(this.stats[0])}!`)); + user.scene.queueMessage(getPokemonMessage(user, ` cut its own HP\nand maximized its ${getBattleStatName(this.stats[BattleStat.ATK])}!`)); resolve(ret); }); }); } getCondition(): MoveConditionFunc { - return (user, target, move) => user.getHpRatio() > 0.5 && user.summonData.battleStats[this.stats[0]] < 6; + return (user, target, move) => user.getHpRatio() > 0.5 && user.summonData.battleStats[this.stats[BattleStat.ATK]] < 6; } // TODO: Add benefit score that considers HP cut @@ -2558,10 +2555,7 @@ export class CutHpStatBoostAttr extends StatChangeAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise { return new Promise(resolve => { - const damage = user.damageAndUpdate(Math.floor(user.getMaxHp() / this.cutRatio), HitResult.OTHER, false, true); - if (damage) { - user.scene.damageNumberHandler.add(user, damage); - } + user.damageAndUpdate(Math.floor(user.getMaxHp() / this.cutRatio), HitResult.OTHER, false, true); user.updateInfo().then(() => { const ret = super.apply(user, target, move, args); resolve(ret);