def set_target_battlers(scope, battler)
target_battlers = []
battler.set_sxr_add_target(battler.skill_element_set(@skill))
battler.target = []
#====================================================================
#修改的部分总而言之就是加入了一大堆敌我方判断……(只保留了单体)
#====================================================================
#行动方战斗者是敌方的情况
if battler.is_a?(Game_Enemy)
# 效果范围的分歧
case scope
when 1 # 敌单体
battler.target.push(battler) if battler.current_action.self_inclusion
index = battler.current_action.target_index
if battler.current_action.side == 0
main_target = $game_party.actors[index]
for actor in $game_party.actors
if actor.exist? and actor != main_target
target_battlers.push(actor)
end
end
elsif battler.current_action.side == 1
main_target = $game_troop.enemies[index]
for enemy in $game_troop.enemies
if enemy.exist? and enemy != main_target
target_battlers.push(enemy)
end
end
end
battler.target = target_battlers[0, 1] if battler.current_action.add_target == 2
battler.target = target_battlers[0, 2] if battler.current_action.add_target == 3
battler.target = target_battlers[0, 3] if battler.current_action.add_target == 4
battler.target = target_battlers[0, 4] if battler.current_action.add_target == 5
battler.target = target_battlers[0, 5] if battler.current_action.add_target == 6
battler.target = target_battlers[0, 6] if battler.current_action.add_target == 7
battler.target = target_battlers[0, 7] if battler.current_action.add_target == 8
battler.target.push(main_target)
#=============================================================================
when 2 # 敌全体
battler.target.push(battler) if battler.current_action.self_inclusion
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
when 3 # 己方单体
index = battler.current_action.target_index
if battler.current_action.side == 0
main_target = $game_party.actors[index]
for actor in $game_party.actors
if actor.exist? and actor != main_target
target_battlers.push(actor)
end
end
elsif battler.current_action.side == 1
main_target = $game_troop.enemies[index]
for enemy in $game_troop.enemies
if enemy.exist? and enemy != main_target
target_battlers.push(enemy)
end
end
end
battler.target = target_battlers[0, 1] if battler.current_action.add_target == 2
battler.target = target_battlers[0, 2] if battler.current_action.add_target == 3
battler.target = target_battlers[0, 3] if battler.current_action.add_target == 4
battler.target = target_battlers[0, 4] if battler.current_action.add_target == 5
battler.target = target_battlers[0, 5] if battler.current_action.add_target == 6
battler.target = target_battlers[0, 6] if battler.current_action.add_target == 7
battler.target = target_battlers[0, 7] if battler.current_action.add_target == 8
battler.target.push(main_target)
#=============================================================================
when 4 # 己方全体
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 5 # 己方单体 (HP 0)
index = battler.current_action.target_index
enemy = $game_troop.enemies[index]
actor = $game_party.actors[index]
if battler.current_action.side == 0
battler.target.push(actor) if actor != nil
elsif battler.current_action.side == 1
battler.target.push(enemy) if enemy != nil
end
when 6 # 己方全体 (HP 0)
for enemy in $game_troop.enemies
if enemy != nil# and enemy.hp0?# 复活类特技/道具对生存者有效
battler.target.push(enemy)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 7 # 使用者
battler.target.push(battler)
when 8 # 全域化
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 9 # 敌方随机
battler.target.push(battler) if battler.current_action.self_inclusion
for actor in $game_party.actors
if actor.exist?
battler.target = [$game_party.random_target_actor]
end
end
when 10 # 己方随机
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
when 11 #对象随机
battler.target = []
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
end
end
#行动方战斗者是己方的情况
if battler.is_a?(Game_Actor)
# 效果范围的分歧
case scope
when 1 # 敌单体
index = battler.current_action.target_index
if battler.current_action.side == 0
main_target = $game_party.actors[index]
for actor in $game_party.actors
if actor.exist? and actor != main_target
target_battlers.push(actor)
end
end
elsif battler.current_action.side == 1
main_target = $game_troop.enemies[index]
for enemy in $game_troop.enemies
if enemy.exist? and enemy != main_target
target_battlers.push(enemy)
end
end
end
battler.target = target_battlers[0, 1] if battler.current_action.add_target == 2
battler.target = target_battlers[0, 2] if battler.current_action.add_target == 3
battler.target = target_battlers[0, 3] if battler.current_action.add_target == 4
battler.target = target_battlers[0, 4] if battler.current_action.add_target == 5
battler.target = target_battlers[0, 5] if battler.current_action.add_target == 6
battler.target = target_battlers[0, 6] if battler.current_action.add_target == 7
battler.target = target_battlers[0, 7] if battler.current_action.add_target == 8
battler.target.push(main_target)
#=============================================================================
battler.target.push(battler) if battler.current_action.self_inclusion
when 2 # 敌全体
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
battler.target.push(battler) if battler.current_action.self_inclusion
when 3 # 己方单体
index = battler.current_action.target_index
if battler.current_action.side == 0
main_target = $game_party.actors[index]
for actor in $game_party.actors
if actor.exist? and actor != main_target
target_battlers.push(actor)
end
end
elsif battler.current_action.side == 1
main_target = $game_troop.enemies[index]
for enemy in $game_troop.enemies
if enemy.exist? and enemy != main_target
target_battlers.push(enemy)
end
end
end
battler.target = target_battlers[0, 1] if battler.current_action.add_target == 2
battler.target = target_battlers[0, 2] if battler.current_action.add_target == 3
battler.target = target_battlers[0, 3] if battler.current_action.add_target == 4
battler.target = target_battlers[0, 4] if battler.current_action.add_target == 5
battler.target = target_battlers[0, 5] if battler.current_action.add_target == 6
battler.target = target_battlers[0, 6] if battler.current_action.add_target == 7
battler.target = target_battlers[0, 7] if battler.current_action.add_target == 8
battler.target.push(main_target)
#=============================================================================
when 4 # 己方全体
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 5 # 己方单体 (HP 0)
index = battler.current_action.target_index
enemy = $game_troop.enemies[index]
actor = $game_party.actors[index]
if battler.current_action.side == 0
battler.target.push(actor) if actor != nil
elsif battler.current_action.side == 1
battler.target.push(enemy) if enemy != nil
end
when 6 # 己方全体 (HP 0)
for actor in $game_party.actors
if actor != nil# and actor.hp0?# 复活类特技/道具对生存者有效
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 7 # 使用者
battler.target.push(battler)
when 8 # 全域化
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
when 9 # 敌方随机
for enemy in $game_troop.enemies
if enemy.exist?
battler.target = [$game_troop.random_target_enemy]
end
end
battler.target.push(battler) if battler.current_action.self_inclusion
when 10 # 己方随机
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
when 11 #对象随机
battler.target = []
for enemy in $game_troop.enemies
if enemy.exist?
battler.target.push(enemy)
end
end
for actor in $game_party.actors
if actor.exist?
battler.target.push(actor)
end
end
battler.target -=[battler] if battler.current_action.self_exclusion
battler.target = [battler.target[rand(battler.target.size)]]
end
end
battler.target.compact!
end