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

@@ -490,13 +490,14 @@ DEF_MULT = 2
FINAL_DMG_MULT = 3
def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
return false if !forced && !battler.canHeal?
return false if !forced && !battler.pbCanConsumeBerry?(item,false)
itemName = PBItems.getName(item)
battle.pbCommonAnimation("EatBerry",battler) if !forced
amt = (NEWEST_BATTLE_MECHANICS) ? battler.pbRecoverHP(battler.totalhp/2) : battler.pbRecoverHP(battler.totalhp/8)
if amt>0
if forced
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}")
PBDebug.log("[Item triggered] Forced consuming of #{itemName}")
battle.pbDisplay(_INTL("{1}'s HP was restored.",battler.pbThis))
else
battle.pbDisplay(_INTL("{1} restored its health using its {2}!",battler.pbThis,itemName))
@@ -515,12 +516,12 @@ def pbBattleStatIncreasingBerry(battler,battle,item,forced,stat,increment=1)
return false if !forced && !battler.pbCanConsumeBerry?(item)
return false if !battler.pbCanRaiseStatStage?(stat,battler)
itemName = PBItems.getName(item)
if !forced
battle.pbCommonAnimation("EatBerry",battler)
return battler.pbRaiseStatStageByCause(stat,increment,battler,itemName)
if forced
PBDebug.log("[Item triggered] Forced consuming of #{itemName}")
return battler.pbRaiseStatStage(stat,increment,battler)
end
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}")
return battler.pbRaiseStatStage(stat,increment,battler)
battle.pbCommonAnimation("EatBerry",battler)
return battler.pbRaiseStatStageByCause(stat,increment,battler,itemName)
end
# For abilities that grant immunity to moves of a particular type, and raises