#--------------------------------------------------------------------------
# ● 生成技能或物品目标
# obj : 技能或物品
#--------------------------------------------------------------------------
def make_obj_targets(obj)
targets = []
if obj.for_opponent?
if obj.for_random?
if obj.for_one? # 敌随机单体
number_of_targets = 1
elsif obj.for_two? # 敌随机二体
number_of_targets = 2
else # 敌随机三体
number_of_targets = 3
end
number_of_targets.times do
targets.push(opponents_unit.random_target)
end
elsif obj.dual? # 敌单体连续
if obj.is_a?(RPG::Skill) and obj.id == 1 #1号技能时
targets.push(opponents_unit.smooth_target(@target_index))
targets += targets
targets += targets
elsif obj.is_a?(RPG::Skill) and obj.id == 2 #2号技能时
targets.push(opponents_unit.smooth_target(@target_index))
targets += targets
targets += targets
targets += targets
else
targets.push(opponents_unit.smooth_target(@target_index))
targets += targets
end
elsif obj.for_one? # 敌单体
targets.push(opponents_unit.smooth_target(@target_index))
else # 敌全体
targets += opponents_unit.existing_members
end
elsif obj.for_user? # 使用者
targets.push(battler)
elsif obj.for_dead_friend?
if obj.for_one? # 我方单体(无法行动)
targets.push(friends_unit.smooth_dead_target(@target_index))
else # 我方全体(无法行动)
targets += friends_unit.dead_members
end
elsif obj.for_friend?
if obj.for_one? # 我方单体
targets.push(friends_unit.smooth_target(@target_index))
else # 我方全体
targets += friends_unit.existing_members
end
end
return targets.compact
end