本帖最后由 345912390 于 2012-7-7 08:54 编辑
{:2_262:}Game_Action脚本里target_index为目标序号
当target_index>=0时为敌人当target_index==-1时为队友
至于怎么用就看你自己了
Game_Action脚本中的 def targets_for_opponents
#-------------------------------------------------------------------------- # ● 目标为敌人 #-------------------------------------------------------------------------- def targets_for_opponents $game_variables[2]=@target_index#新加的一行 if item.for_random? Array.new(item.number_of_targets) { opponents_unit.random_target } elsif item.for_one? num = 1 + (attack? ? subject.atk_times_add.to_i : 0) if @target_index < 0 [opponents_unit.random_target] * num else [opponents_unit.smooth_target(@target_index)] * num end else opponents_unit.alive_members end end
#--------------------------------------------------------------------------
# ● 目标为敌人
#--------------------------------------------------------------------------
def targets_for_opponents
$game_variables[2]=@target_index#新加的一行
if item.for_random?
Array.new(item.number_of_targets) { opponents_unit.random_target }
elsif item.for_one?
num = 1 + (attack? ? subject.atk_times_add.to_i : 0)
if @target_index < 0
[opponents_unit.random_target] * num
else
[opponents_unit.smooth_target(@target_index)] * num
end
else
opponents_unit.alive_members
end
end
��� |