mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Condensed references to Unnerve, fixed Copycat always using Copycat
This commit is contained in:
@@ -126,8 +126,13 @@ class PokeBattle_Battler
|
||||
#=============================================================================
|
||||
# Held item consuming/removing
|
||||
#=============================================================================
|
||||
def pbCanConsumeBerry?(_item,alwaysCheckGluttony=true)
|
||||
return false if @battle.pbCheckOpposingAbility(:UNNERVE,@index)
|
||||
def canConsumeBerry?
|
||||
return false if @battle.pbCheckOpposingAbility(:UNNERVE, @index)
|
||||
return true
|
||||
end
|
||||
|
||||
def canConsumePinchBerry?(_item,alwaysCheckGluttony=true)
|
||||
return false if !canConsumeBerry?
|
||||
return true if @hp<=@totalhp/4
|
||||
if alwaysCheckGluttony || NEWEST_BATTLE_MECHANICS
|
||||
return true if @hp<=@totalhp/2 && hasActiveAbility?(:GLUTTONY)
|
||||
|
||||
@@ -1214,9 +1214,14 @@ class PokeBattle_Move_0AF < PokeBattle_Move
|
||||
end
|
||||
end
|
||||
|
||||
def pbChangeUsageCounters(user,specialUsage)
|
||||
super
|
||||
@copied_move = @battle.lastMoveUsed || 0
|
||||
end
|
||||
|
||||
def pbMoveFailed?(user,targets)
|
||||
if @battle.lastMoveUsed<=0 ||
|
||||
@moveBlacklist.include?(pbGetMoveData(@battle.lastMoveUsed,MOVE_FUNCTION_CODE))
|
||||
if @copied_move<=0 ||
|
||||
@moveBlacklist.include?(pbGetMoveData(@copied_move,MOVE_FUNCTION_CODE))
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -1224,7 +1229,7 @@ class PokeBattle_Move_0AF < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
user.pbUseMoveSimple(@battle.lastMoveUsed)
|
||||
user.pbUseMoveSimple(@copied_move)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3547,7 +3552,7 @@ class PokeBattle_Move_0F7 < PokeBattle_Move
|
||||
@willFail = false
|
||||
@willFail = true if user.item==0 || !user.itemActive? || user.unlosableItem?(user.item)
|
||||
if pbIsBerry?(user.item)
|
||||
@willFail = true if @battle.pbCheckOpposingAbility(:UNNERVE,user.index)
|
||||
@willFail = true if !user.canConsumeBerry?
|
||||
return
|
||||
end
|
||||
return if pbIsMegaStone?(user.item)
|
||||
|
||||
@@ -491,7 +491,7 @@ 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)
|
||||
return false if !forced && !battler.canConsumePinchBerry?(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)
|
||||
@@ -513,7 +513,7 @@ def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
|
||||
end
|
||||
|
||||
def pbBattleStatIncreasingBerry(battler,battle,item,forced,stat,increment=1)
|
||||
return false if !forced && !battler.pbCanConsumeBerry?(item)
|
||||
return false if !forced && !battler.canConsumePinchBerry?(item)
|
||||
return false if !battler.pbCanRaiseStatStage?(stat,battler)
|
||||
itemName = PBItems.getName(item)
|
||||
if forced
|
||||
|
||||
@@ -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 = PBItems.getName(item)
|
||||
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 = PBItems.getName(item)
|
||||
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 = PBItems.getName(item)
|
||||
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 = PBItems.getName(item)
|
||||
@@ -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 = PBItems.getName(item)
|
||||
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 = PBItems.getName(item)
|
||||
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 = PBItems.getName(item)
|
||||
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
|
||||
}
|
||||
)
|
||||
@@ -1037,7 +1037,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)
|
||||
@@ -1099,7 +1099,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)
|
||||
@@ -1167,7 +1167,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 = PBItems.getName(item)
|
||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||
@@ -1184,7 +1184,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 = PBItems.getName(item)
|
||||
if !forced
|
||||
@@ -1198,7 +1198,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 = PBItems.getName(item)
|
||||
if !forced
|
||||
@@ -1285,7 +1285,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 || m.id==0
|
||||
|
||||
Reference in New Issue
Block a user