Merge branch 'focusbandfix' of https://github.com/GriffinDZ/pokerogue into focusbandfix

pull/850/head
Griffin Zody 2024-05-14 17:32:20 -06:00
commit 8e911ed39e
1 changed files with 2 additions and 2 deletions

View File

@ -1657,7 +1657,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return result;
}
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false): integer {
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false, statusDamage: boolean = false): integer {
if (this.isFainted())
return 0;
const surviveDamage = new Utils.BooleanHolder(false);
@ -1667,7 +1667,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
surviveDamage.value = this.lapseTag(BattlerTagType.ENDURING)
else if (this.hp > 1 && this.getTag(BattlerTagType.STURDY))
surviveDamage.value = this.lapseTag(BattlerTagType.STURDY)
if (!surviveDamage.value)
if (!statusDamage && !surviveDamage.value)
this.scene.applyModifiers(SurviveDamageModifier, this.isPlayer(), this, surviveDamage);
if (surviveDamage.value)
damage = this.hp - 1;