mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Merge branch 'master' into dev
This commit is contained in:
@@ -98,7 +98,12 @@ class Game_Character
|
|||||||
end
|
end
|
||||||
|
|
||||||
def jump_speed_real
|
def jump_speed_real
|
||||||
return (2 ** (3 + 1)) * 0.8 * 40.0 / Graphics.frame_rate # Walking speed
|
self.jump_speed_real = (2 ** (3 + 1)) * 0.8 if !@jump_speed_real # 3 is walking speed
|
||||||
|
return @jump_speed_real
|
||||||
|
end
|
||||||
|
|
||||||
|
def jump_speed_real=(val)
|
||||||
|
@jump_speed_real = val * 40.0 / Graphics.frame_rate
|
||||||
end
|
end
|
||||||
|
|
||||||
def move_frequency=(val)
|
def move_frequency=(val)
|
||||||
@@ -654,6 +659,7 @@ class Game_Character
|
|||||||
if real_distance > 0 # Jumping to somewhere else
|
if real_distance > 0 # Jumping to somewhere else
|
||||||
@jump_count = 0
|
@jump_count = 0
|
||||||
else # Jumping on the spot
|
else # Jumping on the spot
|
||||||
|
@jump_speed_real = nil # Reset jump speed
|
||||||
@jump_count = Game_Map::REAL_RES_X / jump_speed_real # Number of frames to jump one tile
|
@jump_count = Game_Map::REAL_RES_X / jump_speed_real # Number of frames to jump one tile
|
||||||
end
|
end
|
||||||
@stop_count = 0
|
@stop_count = 0
|
||||||
|
|||||||
@@ -124,8 +124,13 @@ class PokeBattle_Battler
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Held item consuming/removing
|
# Held item consuming/removing
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def pbCanConsumeBerry?(_item, check_gluttony = true)
|
def canConsumeBerry?
|
||||||
return false if @battle.pbCheckOpposingAbility(:UNNERVE, @index)
|
return false if @battle.pbCheckOpposingAbility(:UNNERVE, @index)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
def canConsumePinchBerry?(_item, check_gluttony = true)
|
||||||
|
return false if !canConsumeBerry?
|
||||||
return true if @hp <= @totalhp / 4
|
return true if @hp <= @totalhp / 4
|
||||||
return true if @hp <= @totalhp / 2 && (!check_gluttony || hasActiveAbility?(:GLUTTONY))
|
return true if @hp <= @totalhp / 2 && (!check_gluttony || hasActiveAbility?(:GLUTTONY))
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -1202,9 +1202,14 @@ class PokeBattle_Move_0AF < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pbChangeUsageCounters(user,specialUsage)
|
||||||
|
super
|
||||||
|
@copied_move = @battle.lastMoveUsed
|
||||||
|
end
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
if !@battle.lastMoveUsed ||
|
if !@copied_move ||
|
||||||
@moveBlacklist.include?(GameData::Move.get(@battle.lastMoveUsed).function_code)
|
@moveBlacklist.include?(GameData::Move.get(@copied_move).function_code)
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -1212,7 +1217,7 @@ class PokeBattle_Move_0AF < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
user.pbUseMoveSimple(@battle.lastMoveUsed)
|
user.pbUseMoveSimple(@copied_move)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -3528,9 +3533,7 @@ class PokeBattle_Move_0F7 < PokeBattle_Move
|
|||||||
@willFail = false
|
@willFail = false
|
||||||
@willFail = true if !user.item || !user.itemActive? || user.unlosableItem?(user.item)
|
@willFail = true if !user.item || !user.itemActive? || user.unlosableItem?(user.item)
|
||||||
return if @willFail
|
return if @willFail
|
||||||
if user.item.is_berry? && @battle.pbCheckOpposingAbility(:UNNERVE,user.index)
|
@willFail = true if user.item.is_berry? && !user.canConsumeBerry?
|
||||||
@willFail = true
|
|
||||||
end
|
|
||||||
return if @willFail
|
return if @willFail
|
||||||
return if user.item.is_mega_stone?
|
return if user.item.is_mega_stone?
|
||||||
flingableItem = false
|
flingableItem = false
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ class PokeBattle_Battle
|
|||||||
elsif battler.hp<=battler.totalhp/2
|
elsif battler.hp<=battler.totalhp/2
|
||||||
pbDisplayBrief(_INTL("OK, {1}! Come back!",battler.name))
|
pbDisplayBrief(_INTL("OK, {1}! Come back!",battler.name))
|
||||||
elsif battler.turnCount>=5
|
elsif battler.turnCount>=5
|
||||||
pbDisplayBrief(_INTL("{1}, that’s enough! Come back!",battler.name))
|
pbDisplayBrief(_INTL("{1}, that's enough! Come back!",battler.name))
|
||||||
elsif battler.turnCount>=2
|
elsif battler.turnCount>=2
|
||||||
pbDisplayBrief(_INTL("{1}, come back!",battler.name))
|
pbDisplayBrief(_INTL("{1}, come back!",battler.name))
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -491,7 +491,7 @@ FINAL_DMG_MULT = 3
|
|||||||
|
|
||||||
def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
|
def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
|
||||||
return false if !forced && !battler.canHeal?
|
return false if !forced && !battler.canHeal?
|
||||||
return false if !forced && !battler.pbCanConsumeBerry?(item, (MECHANICS_GENERATION >= 7))
|
return false if !forced && !battler.canConsumePinchBerry?(item, (MECHANICS_GENERATION >= 7))
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||||
fraction_to_heal = 8 # Gens 6 and lower
|
fraction_to_heal = 8 # Gens 6 and lower
|
||||||
@@ -517,7 +517,7 @@ def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbBattleStatIncreasingBerry(battler,battle,item,forced,stat,increment=1)
|
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)
|
return false if !battler.pbCanRaiseStatStage?(stat,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
if forced
|
if forced
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ BattleHandlers::HPHealItem.add(:IAPAPABERRY,
|
|||||||
|
|
||||||
BattleHandlers::HPHealItem.add(:LANSATBERRY,
|
BattleHandlers::HPHealItem.add(:LANSATBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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
|
next false if battler.effects[PBEffects::FocusEnergy]>=2
|
||||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||||
battler.effects[PBEffects::FocusEnergy] = 2
|
battler.effects[PBEffects::FocusEnergy] = 2
|
||||||
@@ -126,7 +126,7 @@ BattleHandlers::HPHealItem.add(:MAGOBERRY,
|
|||||||
|
|
||||||
BattleHandlers::HPHealItem.add(:MICLEBERRY,
|
BattleHandlers::HPHealItem.add(:MICLEBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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]
|
next false if !battler.effects[PBEffects::MicleBerry]
|
||||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||||
battler.effects[PBEffects::MicleBerry] = true
|
battler.effects[PBEffects::MicleBerry] = true
|
||||||
@@ -145,7 +145,7 @@ BattleHandlers::HPHealItem.add(:MICLEBERRY,
|
|||||||
BattleHandlers::HPHealItem.add(:ORANBERRY,
|
BattleHandlers::HPHealItem.add(:ORANBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next false if !battler.canHeal?
|
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
|
next false if !forced && battler.hp>battler.totalhp/2
|
||||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||||
battler.pbRecoverHP(10)
|
battler.pbRecoverHP(10)
|
||||||
@@ -175,7 +175,7 @@ BattleHandlers::HPHealItem.add(:SALACBERRY,
|
|||||||
BattleHandlers::HPHealItem.add(:SITRUSBERRY,
|
BattleHandlers::HPHealItem.add(:SITRUSBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next false if !battler.canHeal?
|
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
|
next false if !forced && battler.hp>battler.totalhp/2
|
||||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||||
battler.pbRecoverHP(battler.totalhp/4)
|
battler.pbRecoverHP(battler.totalhp/4)
|
||||||
@@ -213,7 +213,7 @@ BattleHandlers::HPHealItem.add(:WIKIBERRY,
|
|||||||
|
|
||||||
BattleHandlers::StatusCureItem.add(:ASPEARBERRY,
|
BattleHandlers::StatusCureItem.add(:ASPEARBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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
|
next false if battler.status!=PBStatuses::FROZEN
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||||
@@ -226,7 +226,7 @@ BattleHandlers::StatusCureItem.add(:ASPEARBERRY,
|
|||||||
|
|
||||||
BattleHandlers::StatusCureItem.add(:CHERIBERRY,
|
BattleHandlers::StatusCureItem.add(:CHERIBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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
|
next false if battler.status!=PBStatuses::PARALYSIS
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||||
@@ -239,7 +239,7 @@ BattleHandlers::StatusCureItem.add(:CHERIBERRY,
|
|||||||
|
|
||||||
BattleHandlers::StatusCureItem.add(:CHESTOBERRY,
|
BattleHandlers::StatusCureItem.add(:CHESTOBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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
|
next false if battler.status!=PBStatuses::SLEEP
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||||
@@ -252,7 +252,7 @@ BattleHandlers::StatusCureItem.add(:CHESTOBERRY,
|
|||||||
|
|
||||||
BattleHandlers::StatusCureItem.add(:LUMBERRY,
|
BattleHandlers::StatusCureItem.add(:LUMBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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 &&
|
next false if battler.status==PBStatuses::NONE &&
|
||||||
battler.effects[PBEffects::Confusion]==0
|
battler.effects[PBEffects::Confusion]==0
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
@@ -322,7 +322,7 @@ BattleHandlers::StatusCureItem.add(:MENTALHERB,
|
|||||||
|
|
||||||
BattleHandlers::StatusCureItem.add(:PECHABERRY,
|
BattleHandlers::StatusCureItem.add(:PECHABERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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
|
next false if battler.status!=PBStatuses::POISON
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||||
@@ -335,7 +335,7 @@ BattleHandlers::StatusCureItem.add(:PECHABERRY,
|
|||||||
|
|
||||||
BattleHandlers::StatusCureItem.add(:PERSIMBERRY,
|
BattleHandlers::StatusCureItem.add(:PERSIMBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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
|
next false if battler.effects[PBEffects::Confusion]==0
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||||
@@ -353,7 +353,7 @@ BattleHandlers::StatusCureItem.add(:PERSIMBERRY,
|
|||||||
|
|
||||||
BattleHandlers::StatusCureItem.add(:RAWSTBERRY,
|
BattleHandlers::StatusCureItem.add(:RAWSTBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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
|
next false if battler.status!=PBStatuses::BURN
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||||
@@ -370,7 +370,7 @@ BattleHandlers::StatusCureItem.add(:RAWSTBERRY,
|
|||||||
|
|
||||||
BattleHandlers::PriorityBracketChangeItem.add(:CUSTAPBERRY,
|
BattleHandlers::PriorityBracketChangeItem.add(:CUSTAPBERRY,
|
||||||
proc { |item,battler,subPri,battle|
|
proc { |item,battler,subPri,battle|
|
||||||
next if !battler.pbCanConsumeBerry?(item)
|
next if !battler.canConsumePinchBerry?(item)
|
||||||
next 1 if subPri<1
|
next 1 if subPri<1
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -1034,7 +1034,7 @@ BattleHandlers::TargetItemOnHit.add(:ENIGMABERRY,
|
|||||||
|
|
||||||
BattleHandlers::TargetItemOnHit.add(:JABOCABERRY,
|
BattleHandlers::TargetItemOnHit.add(:JABOCABERRY,
|
||||||
proc { |item,user,target,move,battle|
|
proc { |item,user,target,move,battle|
|
||||||
next if battle.pbCheckOpposingAbility(:UNNERVE,target.index)
|
next if !target.canConsumeBerry?
|
||||||
next if !move.physicalMove?
|
next if !move.physicalMove?
|
||||||
next if !user.takesIndirectDamage?
|
next if !user.takesIndirectDamage?
|
||||||
battle.pbCommonAnimation("EatBerry",target)
|
battle.pbCommonAnimation("EatBerry",target)
|
||||||
@@ -1096,7 +1096,7 @@ BattleHandlers::TargetItemOnHit.add(:ROCKYHELMET,
|
|||||||
|
|
||||||
BattleHandlers::TargetItemOnHit.add(:ROWAPBERRY,
|
BattleHandlers::TargetItemOnHit.add(:ROWAPBERRY,
|
||||||
proc { |item,user,target,move,battle|
|
proc { |item,user,target,move,battle|
|
||||||
next if battle.pbCheckOpposingAbility(:UNNERVE,target.index)
|
next if !target.canConsumeBerry?
|
||||||
next if !move.specialMove?
|
next if !move.specialMove?
|
||||||
next if !user.takesIndirectDamage?
|
next if !user.takesIndirectDamage?
|
||||||
battle.pbCommonAnimation("EatBerry",target)
|
battle.pbCommonAnimation("EatBerry",target)
|
||||||
@@ -1164,7 +1164,7 @@ BattleHandlers::TargetItemOnHit.add(:WEAKNESSPOLICY,
|
|||||||
BattleHandlers::TargetItemOnHitPositiveBerry.add(:ENIGMABERRY,
|
BattleHandlers::TargetItemOnHitPositiveBerry.add(:ENIGMABERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next false if !battler.canHeal?
|
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
|
itemName = GameData::Item.get(item).name
|
||||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||||
@@ -1181,7 +1181,7 @@ BattleHandlers::TargetItemOnHitPositiveBerry.add(:ENIGMABERRY,
|
|||||||
|
|
||||||
BattleHandlers::TargetItemOnHitPositiveBerry.add(:KEEBERRY,
|
BattleHandlers::TargetItemOnHitPositiveBerry.add(:KEEBERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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)
|
next false if !battler.pbCanRaiseStatStage?(PBStats::DEFENSE,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
if !forced
|
if !forced
|
||||||
@@ -1195,7 +1195,7 @@ BattleHandlers::TargetItemOnHitPositiveBerry.add(:KEEBERRY,
|
|||||||
|
|
||||||
BattleHandlers::TargetItemOnHitPositiveBerry.add(:MARANGABERRY,
|
BattleHandlers::TargetItemOnHitPositiveBerry.add(:MARANGABERRY,
|
||||||
proc { |item,battler,battle,forced|
|
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)
|
next false if !battler.pbCanRaiseStatStage?(PBStats::SPDEF,battler)
|
||||||
itemName = GameData::Item.get(item).name
|
itemName = GameData::Item.get(item).name
|
||||||
if !forced
|
if !forced
|
||||||
@@ -1282,7 +1282,7 @@ BattleHandlers::UserItemAfterMoveUse.add(:SHELLBELL,
|
|||||||
|
|
||||||
BattleHandlers::EndOfMoveItem.add(:LEPPABERRY,
|
BattleHandlers::EndOfMoveItem.add(:LEPPABERRY,
|
||||||
proc { |item,battler,battle,forced|
|
proc { |item,battler,battle,forced|
|
||||||
next false if !forced && battle.pbCheckOpposingAbility(:UNNERVE,battler.index)
|
next false if !forced && !battler.canConsumeBerry?
|
||||||
found = []
|
found = []
|
||||||
battler.pokemon.moves.each_with_index do |m,i|
|
battler.pokemon.moves.each_with_index do |m,i|
|
||||||
next if m.total_pp<=0 || m.pp==m.total_pp
|
next if m.total_pp<=0 || m.pp==m.total_pp
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ def moveFancy(follower,direction)
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Same map only
|
# Same map only
|
||||||
def jumpFancy(follower,direction)
|
def jumpFancy(follower,direction,leader)
|
||||||
deltaX=(direction == 6 ? 2 : (direction == 4 ? -2 : 0))
|
deltaX=(direction == 6 ? 2 : (direction == 4 ? -2 : 0))
|
||||||
deltaY=(direction == 2 ? 2 : (direction == 8 ? -2 : 0))
|
deltaY=(direction == 2 ? 2 : (direction == 8 ? -2 : 0))
|
||||||
halfDeltaX=(direction == 6 ? 1 : (direction == 4 ? -1 : 0))
|
halfDeltaX=(direction == 6 ? 1 : (direction == 4 ? -1 : 0))
|
||||||
@@ -109,6 +109,11 @@ def jumpFancy(follower,direction)
|
|||||||
moveFancy(follower,direction)
|
moveFancy(follower,direction)
|
||||||
elsif ending
|
elsif ending
|
||||||
if pbTestPass(follower,follower.x,follower.y,0)
|
if pbTestPass(follower,follower.x,follower.y,0)
|
||||||
|
if leader.jumping?
|
||||||
|
follower.jump_speed_real = leader.jump_speed_real * Graphics.frame_rate / 40.0
|
||||||
|
else
|
||||||
|
follower.jump_speed_real = leader.move_speed_real * Graphics.frame_rate / 20.0
|
||||||
|
end
|
||||||
follower.jump(deltaX,deltaY)
|
follower.jump(deltaX,deltaY)
|
||||||
else
|
else
|
||||||
moveThrough(follower,direction)
|
moveThrough(follower,direction)
|
||||||
@@ -117,7 +122,7 @@ def jumpFancy(follower,direction)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbFancyMoveTo(follower,newX,newY)
|
def pbFancyMoveTo(follower,newX,newY,leader)
|
||||||
if follower.x-newX==-1 && follower.y==newY
|
if follower.x-newX==-1 && follower.y==newY
|
||||||
moveFancy(follower,6)
|
moveFancy(follower,6)
|
||||||
elsif follower.x-newX==1 && follower.y==newY
|
elsif follower.x-newX==1 && follower.y==newY
|
||||||
@@ -127,13 +132,13 @@ def pbFancyMoveTo(follower,newX,newY)
|
|||||||
elsif follower.y-newY==1 && follower.x==newX
|
elsif follower.y-newY==1 && follower.x==newX
|
||||||
moveFancy(follower,8)
|
moveFancy(follower,8)
|
||||||
elsif follower.x-newX==-2 && follower.y==newY
|
elsif follower.x-newX==-2 && follower.y==newY
|
||||||
jumpFancy(follower,6)
|
jumpFancy(follower,6,leader)
|
||||||
elsif follower.x-newX==2 && follower.y==newY
|
elsif follower.x-newX==2 && follower.y==newY
|
||||||
jumpFancy(follower,4)
|
jumpFancy(follower,4,leader)
|
||||||
elsif follower.y-newY==-2 && follower.x==newX
|
elsif follower.y-newY==-2 && follower.x==newX
|
||||||
jumpFancy(follower,2)
|
jumpFancy(follower,2,leader)
|
||||||
elsif follower.y-newY==2 && follower.x==newX
|
elsif follower.y-newY==2 && follower.x==newX
|
||||||
jumpFancy(follower,8)
|
jumpFancy(follower,8,leader)
|
||||||
elsif follower.x!=newX || follower.y!=newY
|
elsif follower.x!=newX || follower.y!=newY
|
||||||
follower.moveto(newX,newY)
|
follower.moveto(newX,newY)
|
||||||
end
|
end
|
||||||
@@ -209,8 +214,8 @@ class DependentEvents
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
facings=[facingDirection] # Get facing from behind
|
facings=[facingDirection] # Get facing from behind
|
||||||
facings.push([0,0,4,0,8,0,2,0,6][d]) # Get right facing
|
# facings.push([0,0,4,0,8,0,2,0,6][d]) # Get right facing
|
||||||
facings.push([0,0,6,0,2,0,8,0,4][d]) # Get left facing
|
# facings.push([0,0,6,0,2,0,8,0,4][d]) # Get left facing
|
||||||
if !leaderIsTrueLeader
|
if !leaderIsTrueLeader
|
||||||
facings.push(d) # Get forward facing
|
facings.push(d) # Get forward facing
|
||||||
end
|
end
|
||||||
@@ -265,7 +270,7 @@ class DependentEvents
|
|||||||
if instant
|
if instant
|
||||||
follower.moveto(newX,newY)
|
follower.moveto(newX,newY)
|
||||||
else
|
else
|
||||||
pbFancyMoveTo(follower,newX,newY)
|
pbFancyMoveTo(follower,newX,newY,leader)
|
||||||
end
|
end
|
||||||
elsif (follower.x-newX==-2 && follower.y==newY) ||
|
elsif (follower.x-newX==-2 && follower.y==newY) ||
|
||||||
(follower.x-newX==2 && follower.y==newY) ||
|
(follower.x-newX==2 && follower.y==newY) ||
|
||||||
@@ -274,17 +279,16 @@ class DependentEvents
|
|||||||
if instant
|
if instant
|
||||||
follower.moveto(newX,newY)
|
follower.moveto(newX,newY)
|
||||||
else
|
else
|
||||||
pbFancyMoveTo(follower,newX,newY)
|
pbFancyMoveTo(follower,newX,newY,leader)
|
||||||
end
|
end
|
||||||
elsif follower.x!=posX || follower.y!=posY
|
elsif follower.x!=posX || follower.y!=posY
|
||||||
if instant
|
if instant
|
||||||
follower.moveto(newX,newY)
|
follower.moveto(newX,newY)
|
||||||
else
|
else
|
||||||
pbFancyMoveTo(follower,posX,posY)
|
pbFancyMoveTo(follower,posX,posY,leader)
|
||||||
pbFancyMoveTo(follower,newX,newY)
|
pbFancyMoveTo(follower,newX,newY,leader)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pbTurnTowardEvent(follower,leader)
|
|
||||||
else
|
else
|
||||||
if !mapTile
|
if !mapTile
|
||||||
# Make current position into leader's position
|
# Make current position into leader's position
|
||||||
@@ -293,7 +297,6 @@ class DependentEvents
|
|||||||
if follower.map.map_id==mapTile[0]
|
if follower.map.map_id==mapTile[0]
|
||||||
# Follower is on same map as leader
|
# Follower is on same map as leader
|
||||||
follower.moveto(leader.x,leader.y)
|
follower.moveto(leader.x,leader.y)
|
||||||
pbTurnTowardEvent(follower,leader)
|
|
||||||
else
|
else
|
||||||
# Follower will move to different map
|
# Follower will move to different map
|
||||||
events=$PokemonGlobal.dependentEvents
|
events=$PokemonGlobal.dependentEvents
|
||||||
@@ -305,7 +308,6 @@ class DependentEvents
|
|||||||
newEventData[3]=mapTile[1]
|
newEventData[3]=mapTile[1]
|
||||||
newEventData[4]=mapTile[2]
|
newEventData[4]=mapTile[2]
|
||||||
if mapTile[0]==leader.map.map_id
|
if mapTile[0]==leader.map.map_id
|
||||||
pbTurnTowardEvent(follower,leader)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user