|
|
|
|
@@ -97,7 +97,7 @@ BattleHandlers::HPHealItem.add(:IAPAPABERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::HPHealItem.add(:LANSATBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && !battler.pbCanConsumeBerry?(item)
|
|
|
|
|
next false if !forced && !battler.canConsumePinchBerry?(item)
|
|
|
|
|
next false if battler.effects[PBEffects::FocusEnergy]>=2
|
|
|
|
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
|
|
|
|
battler.effects[PBEffects::FocusEnergy] = 2
|
|
|
|
|
@@ -126,7 +126,7 @@ BattleHandlers::HPHealItem.add(:MAGOBERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::HPHealItem.add(:MICLEBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && !battler.pbCanConsumeBerry?(item)
|
|
|
|
|
next false if !forced && !battler.canConsumePinchBerry?(item)
|
|
|
|
|
next false if !battler.effects[PBEffects::MicleBerry]
|
|
|
|
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
|
|
|
|
battler.effects[PBEffects::MicleBerry] = true
|
|
|
|
|
@@ -145,7 +145,7 @@ BattleHandlers::HPHealItem.add(:MICLEBERRY,
|
|
|
|
|
BattleHandlers::HPHealItem.add(:ORANBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !battler.canHeal?
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if !forced && battler.hp>battler.totalhp/2
|
|
|
|
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
|
|
|
|
battler.pbRecoverHP(10)
|
|
|
|
|
@@ -175,7 +175,7 @@ BattleHandlers::HPHealItem.add(:SALACBERRY,
|
|
|
|
|
BattleHandlers::HPHealItem.add(:SITRUSBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !battler.canHeal?
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if !forced && battler.hp>battler.totalhp/2
|
|
|
|
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
|
|
|
|
battler.pbRecoverHP(battler.totalhp/4)
|
|
|
|
|
@@ -213,7 +213,7 @@ BattleHandlers::HPHealItem.add(:WIKIBERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::StatusCureItem.add(:ASPEARBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if battler.status!=PBStatuses::FROZEN
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
|
|
|
|
@@ -226,7 +226,7 @@ BattleHandlers::StatusCureItem.add(:ASPEARBERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::StatusCureItem.add(:CHERIBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if battler.status!=PBStatuses::PARALYSIS
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
|
|
|
|
@@ -239,7 +239,7 @@ BattleHandlers::StatusCureItem.add(:CHERIBERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::StatusCureItem.add(:CHESTOBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if battler.status!=PBStatuses::SLEEP
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
|
|
|
|
@@ -252,7 +252,7 @@ BattleHandlers::StatusCureItem.add(:CHESTOBERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::StatusCureItem.add(:LUMBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if battler.status==PBStatuses::NONE &&
|
|
|
|
|
battler.effects[PBEffects::Confusion]==0
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
@@ -322,7 +322,7 @@ BattleHandlers::StatusCureItem.add(:MENTALHERB,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::StatusCureItem.add(:PECHABERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if battler.status!=PBStatuses::POISON
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
|
|
|
|
@@ -335,7 +335,7 @@ BattleHandlers::StatusCureItem.add(:PECHABERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::StatusCureItem.add(:PERSIMBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if battler.effects[PBEffects::Confusion]==0
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
|
|
|
|
@@ -353,7 +353,7 @@ BattleHandlers::StatusCureItem.add(:PERSIMBERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::StatusCureItem.add(:RAWSTBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if battler.status!=PBStatuses::BURN
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
|
|
|
|
@@ -370,7 +370,7 @@ BattleHandlers::StatusCureItem.add(:RAWSTBERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::PriorityBracketChangeItem.add(:CUSTAPBERRY,
|
|
|
|
|
proc { |item,battler,subPri,battle|
|
|
|
|
|
next if !battler.pbCanConsumeBerry?(item)
|
|
|
|
|
next if !battler.canConsumePinchBerry?(item)
|
|
|
|
|
next 1 if subPri<1
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
@@ -1034,7 +1034,7 @@ BattleHandlers::TargetItemOnHit.add(:ENIGMABERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::TargetItemOnHit.add(:JABOCABERRY,
|
|
|
|
|
proc { |item,user,target,move,battle|
|
|
|
|
|
next if battle.pbCheckOpposingAbility(:UNNERVE,target.index)
|
|
|
|
|
next if !target.canConsumeBerry?
|
|
|
|
|
next if !move.physicalMove?
|
|
|
|
|
next if !user.takesIndirectDamage?
|
|
|
|
|
battle.pbCommonAnimation("EatBerry",target)
|
|
|
|
|
@@ -1096,7 +1096,7 @@ BattleHandlers::TargetItemOnHit.add(:ROCKYHELMET,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::TargetItemOnHit.add(:ROWAPBERRY,
|
|
|
|
|
proc { |item,user,target,move,battle|
|
|
|
|
|
next if battle.pbCheckOpposingAbility(:UNNERVE,target.index)
|
|
|
|
|
next if !target.canConsumeBerry?
|
|
|
|
|
next if !move.specialMove?
|
|
|
|
|
next if !user.takesIndirectDamage?
|
|
|
|
|
battle.pbCommonAnimation("EatBerry",target)
|
|
|
|
|
@@ -1164,7 +1164,7 @@ BattleHandlers::TargetItemOnHit.add(:WEAKNESSPOLICY,
|
|
|
|
|
BattleHandlers::TargetItemOnHitPositiveBerry.add(:ENIGMABERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !battler.canHeal?
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
|
|
|
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
|
|
|
|
@@ -1181,7 +1181,7 @@ BattleHandlers::TargetItemOnHitPositiveBerry.add(:ENIGMABERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::TargetItemOnHitPositiveBerry.add(:KEEBERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if !battler.pbCanRaiseStatStage?(PBStats::DEFENSE,battler)
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
if !forced
|
|
|
|
|
@@ -1195,7 +1195,7 @@ BattleHandlers::TargetItemOnHitPositiveBerry.add(:KEEBERRY,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::TargetItemOnHitPositiveBerry.add(:MARANGABERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
next false if !battler.pbCanRaiseStatStage?(PBStats::SPDEF,battler)
|
|
|
|
|
itemName = GameData::Item.get(item).name
|
|
|
|
|
if !forced
|
|
|
|
|
@@ -1282,7 +1282,7 @@ BattleHandlers::UserItemAfterMoveUse.add(:SHELLBELL,
|
|
|
|
|
|
|
|
|
|
BattleHandlers::EndOfMoveItem.add(:LEPPABERRY,
|
|
|
|
|
proc { |item,battler,battle,forced|
|
|
|
|
|
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
|
|
|
|
next false if !forced && !battler.canConsumeBerry?
|
|
|
|
|
found = []
|
|
|
|
|
battler.pokemon.moves.each_with_index do |m,i|
|
|
|
|
|
next if m.total_pp<=0 || m.pp==m.total_pp
|
|
|
|
|
|