#============================================================================== # 本脚本来自www.66RPG.com,使用和转载请保留此信息 #============================================================================== # 自定义内容解释: # TOWNS[编号]=["地名,可以随便写",开关编号,[传送去的地图id,传送去的地图x, # 传送去的地图y],角色朝向] # # 编号请按照0、1、2、3……顺序往下排布 # 当编号的开关打开的时候,才可以选择这个传送地点 # 角色朝向,2为下,4为左,6为右,8为上,具体可以参考自己数字小键盘的方向和数字关系 # 如果是其他方向请自己改。 # # 需要制作脚本,请点击66rpg.com最底部的QQ交谈 # # 使用方法:在需要传送的传送门、传送石、传送羽毛、传送旅店一类的地方使用公共事件: # 呼叫脚本:$scene = Scene_Teleport.new # # 制作者:柳柳 #============================================================================== TOWNS=[] TOWNS[0]=["馬迪村",1,[5,24,48],8] TOWNS[1]=["港口",2,[1,2,5],8] TOWNS[2]=["大飛燕",3,[3,3,6],8] TOWNS[3]=["神種村",4,[4,2,6],8] TOWNS[4]=["精靈村",5,[5,2,6],8] TOWNS[5]=["富裕村",6,[6,9,6],8] #============================================================================== # ■ Window_Teleport #------------------------------------------------------------------------------ # 处理传送的窗口 #============================================================================== class Window_Teleport < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(640,640,64,64) self.contents = Bitmap.new(width, height) self.opacity = 180 get_towns draw_towns @column_max = 1 end #-------------------------------------------------------------------------- # ● 获取可到达的城镇和窗口大小 #-------------------------------------------------------------------------- def get_towns @carol3_towns = [] @width_temp = 0 @cont_use = false for town in TOWNS if $game_switches[town[1]]==true @carol3_towns.push(town) if contents.text_size(town[0]).width >= @width_temp @width_temp = contents.text_size(town[0]).width end end end @item_max = @carol3_towns.size if @item_max == 0 @carol3_towns[0] = ["没有可以传送的地方",1,[1,1,1]] @width_temp = contents.text_size(@carol3_towns[0][0]).width @item_max = 1 @cont_use = true end self.width = [@width_temp+32,480].min self.height = [(@item_max+1)*32,360].min self.x = (640-self.width)/2 self.y = (480-self.height)/2 self.contents = Bitmap.new(width-32,row_max*32) end #-------------------------------------------------------------------------- # ● 描绘城镇名称 #-------------------------------------------------------------------------- def draw_towns for i in 0...@carol3_towns.size self.contents.draw_text(0,i*32,@width_temp,32,@carol3_towns[0],1) end end #-------------------------------------------------------------------------- # ● 返回的内容 #======================================================================== # ● 地图编号 #-------------------------------------------------------------------------- def map_id return @carol3_towns[self.index][2][0] end #-------------------------------------------------------------------------- # ● 地图x坐标 #-------------------------------------------------------------------------- def map_x return @carol3_towns[self.index][2][1] end #-------------------------------------------------------------------------- # ● 地图y坐标 #-------------------------------------------------------------------------- def map_y return @carol3_towns[self.index][2][2] end #-------------------------------------------------------------------------- # ● 角色朝向 #-------------------------------------------------------------------------- def map_direction return @carol3_towns[self.index][2][3] end #-------------------------------------------------------------------------- # ● 判断是否一个城市都没有 #-------------------------------------------------------------------------- def cant_use? return @cont_use end end #============================================================================== # ■ Scene_Teleport #------------------------------------------------------------------------------ # 处理传送执行的类 #============================================================================== class Scene_Teleport #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main $game_system.se_play($data_system.decision_se) @carol3_trans_white = false @carol3_map_sprite = Spriteset_Map.new @carol3_teleport_window = Window_Teleport.new if @carol3_teleport_window.cant_use? @carol3_teleport_window.index = -1 else @carol3_teleport_window.index = 0 end @carol3_teleport_window.active = true Graphics.transition loop do Graphics.update Input.update carol3_update if $scene != self break end end if @carol3_trans_white==true @carol3_white_sprite = Sprite.new @carol3_white_sprite.bitmap = Bitmap.new(640,480) @carol3_white_sprite.opacity = 0 @carol3_white_sprite.bitmap.fill_rect(0, 0, 640, 480, Color.new(255,255,255,255)) for i in 0..20 @carol3_white_sprite.opacity += 15 @carol3_teleport_window.opacity -= 12 @carol3_teleport_window.contents_opacity -= 12 Graphics.update end Graphics.freeze Graphics.transition(0) Graphics.update @carol3_map_sprite.dispose $game_map.setup($game_temp.player_new_map_id) $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y) $game_player.turn_down $game_player.straighten $game_map.autoplay Graphics.frame_reset for i in 0..20 @carol3_white_sprite.opacity -= 15 Graphics.update end @carol3_white_sprite.dispose @carol3_teleport_window.dispose Graphics.freeze else Graphics.freeze @carol3_teleport_window.dispose @carol3_map_sprite.dispose end end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def carol3_update @carol3_teleport_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) if @carol3_teleport_window.index == -1 $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return else $game_temp.player_new_map_id = @carol3_teleport_window.map_id $game_temp.player_new_x = @carol3_teleport_window.map_x $game_temp.player_new_y = @carol3_teleport_window.map_y $game_temp.player_new_direction = @carol3_teleport_window.map_direction $game_temp.player_transferring = true $game_temp.transition_processing = true $game_temp.transition_name = "" $scene = Scene_Map.new @carol3_trans_white = true Audio.se_play("Audio/SE/" + "018-Teleport01",100,100) return end end end end #============================================================================== # 本脚本来自www.66RPG.com,使用和转载请保留此信息 #============================================================================== |
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |