From e4d74d9c1c705b85efe89761caba8fa8b720618f Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Tue, 22 Apr 2025 21:00:07 -0500 Subject: [PATCH] Cleanup EnemyBattleInfo's hp method to use `super` --- src/ui/battle-info/enemy-battle-info.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/ui/battle-info/enemy-battle-info.ts b/src/ui/battle-info/enemy-battle-info.ts index 355f23c80e4..50ae2a6cff4 100644 --- a/src/ui/battle-info/enemy-battle-info.ts +++ b/src/ui/battle-info/enemy-battle-info.ts @@ -198,25 +198,7 @@ export class EnemyBattleInfo extends BattleInfo { resolve: (r: void | PromiseLike) => void, instant?: boolean, ): void { - let duration = !instant ? Phaser.Math.Clamp(Math.abs(this.lastHp - pokemon.hp) * 5, 250, 5000) : 0; - const speed = globalScene.hpBarSpeed; - if (speed) { - duration = speed >= 3 ? 0 : duration / Math.pow(2, speed); - } - globalScene.tweens.add({ - targets: this.hpBar, - ease: "Sine.easeOut", - scaleX: pokemon.getHpRatio(true), - duration: duration, - onUpdate: () => { - this.updateHpFrame(); - }, - onComplete: () => { - this.updateHpFrame(); - resolve(); - }, - }); + super.updatePokemonHp(pokemon, resolve, instant); this.lastHp = pokemon.hp; - this.lastMaxHp = pokemon.getMaxHp(); } }