class Window_Teleport < Window_Command def initialize super(0, 0) hide deactivate end end def window_width return 240 end def window_height Graphics.height end TELEPORT_PLACES = [ [2, "草地2", 2, 7, 7], [3, "草地3", 3, 7, 7], [4, "草地4", 4, 7, 7], ] def make_command_list TELEPORT_PLACES.each do |place| if $game_switches[place[0]] add_command(place[1], :teleport, true, place) end end end class Scene_ItemBase alias xxx001_start start def start xxx001_start @teleport_window = Window_Teleport.new @teleport_window.set_handler(:teleport, method(:on_teleport)) @teleport_window.set_handler(:cancel, method(:on_teleport_cancel)) end alias xxx001_determine_item determine_item def determine_item if item.note.include?("<TELEPORT>") show_sub_window(@teleport_window) end else xxx001_determine_item end end def on_teleport place = @teleport_window.current_ext $game_player.reserve_transfer(place[2], place[3], place[4]) SceneManager.goto(Scene_Map) end def on_teleport_cancel hide_sub_window(@teleport_window) end
結果.png (406.66 KB, 下载次数: 35)
失败的结果
1.43 MB, 下载次数: 103
试验范例
喵呜喵5 发表于 2017-4-18 23:01
允许传送的开关打开了吗?
魔法丶小肉包 发表于 2017-4-19 16:01
从上往下数第二个end去掉,然后在
if $game_switches]
add_command(place[1], :teleport, true, pl ...
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |