42 lines
1.5 KiB
Ruby
42 lines
1.5 KiB
Ruby
# PreActionCommonEvent
|
|
#「行動前コモン実行」 (作成日……2012/ 1/ 1)
|
|
#______________________________________________________________________________
|
|
|
|
|
|
class RPG::UsableItem < RPG::BaseItem
|
|
def pre_common_events
|
|
if @__pre_common_events == nil
|
|
data = note.scan(/<pre_common:(\d+)>/i).collect{|match| match[0].to_i }
|
|
@__pre_common_events = data
|
|
end
|
|
return @__pre_common_events
|
|
end
|
|
end
|
|
#______________________________________________________________________________
|
|
|
|
|
|
class Scene_Battle < Scene_Base
|
|
alias pre_action_common_event__execute_action execute_action
|
|
def execute_action
|
|
process_local_event(@subject.current_action.item.pre_common_events)
|
|
|
|
pre_action_common_event__execute_action
|
|
end
|
|
#--------------------------------------------------------------------------
|
|
def process_local_event(common_events)
|
|
#if @subject.actor?#紅茶走
|
|
#return Sound.play_equip#紅茶走 ここにステート付与と分岐は可能か試作
|
|
# else #紅茶走
|
|
# return Sound.play_cursor#紅茶走
|
|
# end#紅茶走
|
|
common_events.each do |common_event_id|
|
|
next if $data_common_events[common_event_id] == nil
|
|
next if $data_common_events[common_event_id].name.empty?
|
|
$game_temp.reserve_common_event(common_event_id)
|
|
process_event
|
|
next if @status_window.open?
|
|
@status_window.open
|
|
update_for_wait until @status_window.open?
|
|
end
|
|
end
|
|
end
|