class Scene_Battle alias cld99_use_item use_item def use_item p "@subject=#{@subject}" p "use_item=#{@subject.current_action.item}" cld99_use_item end end
class Scene_Battle
alias cld99_use_item use_item
def use_item
p "@subject=#{@subject}"
p "use_item=#{@subject.current_action.item}"
cld99_use_item
end
end
基本模式是这样。
不过这样子输出的是16进制object_id,建议换成你需要的参数,比如名字:
class Scene_Battle alias cld99_use_item use_item def use_item p "@subject=#{@subject.name}" #改为输出对象的名字 p "use_item=#{@subject.current_action.item.name}" cld99_use_item end end
class Scene_Battle
alias cld99_use_item use_item
def use_item
p "@subject=#{@subject.name}" #改为输出对象的名字
p "use_item=#{@subject.current_action.item.name}"
cld99_use_item
end
end
|