本帖最后由 张咚咚 于 2017-6-30 19:27 编辑
完全即时保存/还原事件
$地图缓存 = [] class Game_Map #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_accessor :events # 事件 end class Game_Map alias new_setup setup def setup(map_id) new_setup(map_id) $game_map.events = $地图缓存[map_id] if $地图缓存[map_id] != nil end end class Interpreter #-------------------------------------------------------------------------- # ● 场所移动 #-------------------------------------------------------------------------- def command_201 # 战斗中的情况 if $game_temp.in_battle # 继续 return true end # 场所移动中、信息显示中、过渡处理中的情况下 if $game_temp.player_transferring or $game_temp.message_window_showing or $game_temp.transition_processing # 结束 return false end $地图缓存[$game_map.map_id] = $game_map.events # 设置场所移动标志 $game_temp.player_transferring = true # 指定方法为 [直接指定] 的情况下 if @parameters[0] == 0 # 设置主角的移动目标 $game_temp.player_new_map_id = @parameters[1] $game_temp.player_new_x = @parameters[2] $game_temp.player_new_y = @parameters[3] $game_temp.player_new_direction = @parameters[4] # 指定方法为 [使用变量指定] 的情况下 else # 设置主角的移动目标 $game_temp.player_new_map_id = $game_variables[@parameters[1]] $game_temp.player_new_x = $game_variables[@parameters[2]] $game_temp.player_new_y = $game_variables[@parameters[3]] $game_temp.player_new_direction = @parameters[4] end # 推进索引 @index += 1 # 有淡入淡出的情况下 if @parameters[5] == 0 # 准备过渡 Graphics.freeze # 设置过渡处理中标志 $game_temp.transition_processing = true $game_temp.transition_name = "" end # 结束 return false end end
$地图缓存 = []
class Game_Map
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :events # 事件
end
class Game_Map
alias new_setup setup
def setup(map_id)
new_setup(map_id)
$game_map.events = $地图缓存[map_id] if $地图缓存[map_id] != nil
end
end
class Interpreter
#--------------------------------------------------------------------------
# ● 场所移动
#--------------------------------------------------------------------------
def command_201
# 战斗中的情况
if $game_temp.in_battle
# 继续
return true
end
# 场所移动中、信息显示中、过渡处理中的情况下
if $game_temp.player_transferring or
$game_temp.message_window_showing or
$game_temp.transition_processing
# 结束
return false
end
$地图缓存[$game_map.map_id] = $game_map.events
# 设置场所移动标志
$game_temp.player_transferring = true
# 指定方法为 [直接指定] 的情况下
if @parameters[0] == 0
# 设置主角的移动目标
$game_temp.player_new_map_id = @parameters[1]
$game_temp.player_new_x = @parameters[2]
$game_temp.player_new_y = @parameters[3]
$game_temp.player_new_direction = @parameters[4]
# 指定方法为 [使用变量指定] 的情况下
else
# 设置主角的移动目标
$game_temp.player_new_map_id = $game_variables[@parameters[1]]
$game_temp.player_new_x = $game_variables[@parameters[2]]
$game_temp.player_new_y = $game_variables[@parameters[3]]
$game_temp.player_new_direction = @parameters[4]
end
# 推进索引
@index += 1
# 有淡入淡出的情况下
if @parameters[5] == 0
# 准备过渡
Graphics.freeze
# 设置过渡处理中标志
$game_temp.transition_processing = true
$game_temp.transition_name = ""
end
# 结束
return false
end
end
|