Add HP Bar Speed setting and fix Grip Claw HP skip bug

This commit is contained in:
Flashfyre committed 2024-04-09 15:34:57 -04:00
1 parent d9849c5e70
commit 2a6042ff7e
4 files changed
+12 -2

No files matched your search

+4 -1
View File
@@ -349,7 +349,10 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
};
const updatePokemonHp = () => {
const duration = !instant ? Utils.clampInt(Math.abs((this.lastHp) - pokemon.hp) * 5, 250, 5000) : 0;
let duration = !instant ? Utils.clampInt(Math.abs((this.lastHp) - pokemon.hp) * 5, 250, 5000) : 0;
const speed = (this.scene as BattleScene).hpBarSpeed;
if (speed)
duration = speed >= 3 ? 0 : duration / Math.pow(2, speed);
this.scene.tweens.add({
targets: this.hpBar,
ease: 'Sine.easeOut',