From aa2c794910aaef68f95001eacc3735091098e279 Mon Sep 17 00:00:00 2001 From: Daniel Pochert Date: Fri, 8 Nov 2024 05:09:25 +0100 Subject: [PATCH] [Balance/Bug] Boss segments properly heal (#4819) --- src/field/pokemon.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 25a771c9281..45c9caf7477 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -5079,26 +5079,6 @@ export class EnemyPokemon extends Pokemon { } } - heal(amount: integer): integer { - if (this.isBoss()) { - const amountRatio = amount / this.getMaxHp(); - const segmentBypassCount = Math.floor(amountRatio / (1 / this.bossSegments)); - const segmentSize = this.getMaxHp() / this.bossSegments; - for (let s = 1; s < this.bossSegments; s++) { - const hpThreshold = segmentSize * s; - if (this.hp <= Math.round(hpThreshold)) { - const healAmount = Math.min(amount, this.getMaxHp() - this.hp, Math.round(hpThreshold + (segmentSize * segmentBypassCount) - this.hp)); - this.hp += healAmount; - return healAmount; - } else if (s >= this.bossSegmentIndex) { - return super.heal(amount); - } - } - } - - return super.heal(amount); - } - getFieldIndex(): integer { return this.scene.getEnemyField().indexOf(this); }