Fix sturdy
This commit is contained in:
1 parent
1bf2a725c9
commit
3dabfd3c55
4 files changed
+25
-5
No files matched your search
@@ -1284,11 +1284,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false): integer {
|
||||
if (this.isFainted())
|
||||
return 0;
|
||||
const surviveDamage = new Utils.BooleanHolder(false);
|
||||
|
||||
if (this.hp >= 1 && this.hp - damage <= 0 && !preventEndure) {
|
||||
const surviveDamage = new Utils.BooleanHolder(false);
|
||||
if (this.lapseTag(BattlerTagType.ENDURING))
|
||||
surviveDamage.value = true;
|
||||
if (!preventEndure && this.hp - damage <= 0) {
|
||||
if(this.hp >= 1 && this.getTag(BattlerTagType.ENDURING))
|
||||
surviveDamage.value = this.lapseTag(BattlerTagType.ENDURING)
|
||||
else if (this.hp > 1 && this.getTag(BattlerTagType.STURDY))
|
||||
surviveDamage.value = this.lapseTag(BattlerTagType.STURDY)
|
||||
if (!surviveDamage.value)
|
||||
this.scene.applyModifiers(SurviveDamageModifier, this.isPlayer(), this, surviveDamage);
|
||||
if (surviveDamage.value)
|
||||
|
||||
Reference in new issue
Block a user