Fixed not getting berry's effect at full HP or under Heal Block when using Bug Bite/Pluck

This commit is contained in:
Maruno17
2020-09-09 21:37:37 +01:00
parent 9c808d4c86
commit 891cc2791f
4 changed files with 26 additions and 22 deletions

View File

@@ -8,7 +8,7 @@ class PokeBattle_Battler
amt = 1 if amt<1 && !fainted?
oldHP = @hp
self.hp -= amt
PBDebug.log("[HP change] #{pbThis} lost #{amt} HP (#{oldHP}=>#{@hp})")
PBDebug.log("[HP change] #{pbThis} lost #{amt} HP (#{oldHP}=>#{@hp})") if amt>0
raise _INTL("HP less than 0") if @hp<0
raise _INTL("HP greater than total HP") if @hp>@totalhp
@battle.scene.pbHPChanged(self,oldHP,anim) if anyAnim && amt>0
@@ -22,7 +22,7 @@ class PokeBattle_Battler
amt = 1 if amt<1 && @hp<@totalhp
oldHP = @hp
self.hp += amt
PBDebug.log("[HP change] #{pbThis} gained #{amt} HP (#{oldHP}=>#{@hp})")
PBDebug.log("[HP change] #{pbThis} gained #{amt} HP (#{oldHP}=>#{@hp})") if amt>0
raise _INTL("HP less than 0") if @hp<0
raise _INTL("HP greater than total HP") if @hp>@totalhp
@battle.scene.pbHPChanged(self,oldHP,anim) if anyAnim && amt>0