class Interpreter
def replace_this_event(nEventID, nMapID = $game_map.map_id)
return true if $game_temp.in_battle == true
if nMapID != $game_map.map_id
return true if load_data("Data/MapInfos.rxdata")[nMapID] == nil
map = load_data(sprintf("Data/Map%03d.rxdata", nMapID))
event_data = map.events[nEventID]
return true if event_data == nil
else
return true if nEventID == @event_id
that_event = $game_map.events[nEventID]
return true if that_event == nil
event_data = that_event.instance_variable_get("@event").clone
end
this_event = $game_map.events[@event_id]
event_data.x = this_event.x
event_data.y = this_event.y
event_data.id = this_event.id
this_event.instance_variable_set("@event", event_data)
this_event.refresh
return true
end
# 别搞2个都是 类似replace_list 的事件反复套娃 (⊙﹏⊙)
def replace_list(nEventID, nMapID = $game_map.map_id)
return true if $game_temp.in_battle == true
if nMapID == $game_map.map_id
return if @event_id == nEventID
event = $game_map.events[nEventID]
return true if event == nil
the_list = event.list
else
return true if load_data("Data/MapInfos.rxdata")[nMapID] == nil
map = load_data(sprintf("Data/Map%03d.rxdata", nMapID))
event_data = map.events[nEventID]
return true if event_data == nil
pages = event_data.pages
return true if pages.empty?
the_page = nil
pages.reverse.each do |page|
c = page.condition
if c.switch1_valid
next if $game_switched[c.switch1_id] == false
end
if c.switch2_valid
next if $game_switched[c.switch2_id] == false
end
if c.variable_valid
next if $game_variables[c.variable_id] < c.variable_value
end
if c.self_switch_valid
key = [nMapID, nEventID, c.self_switch_ch]
next if $game_self_switches[key] != true
end
the_page = page
break
end
return true if the_page == nil
the_list = the_page.list
end
if the_list != nil
@list = the_list
@index = -1
#@message_waiting = false
#@move_route_waiting = false
#@button_input_variable_id = 0
#@wait_count = 0
#@child_interpreter = nil
#@branch = {}
end
return true
end
end