赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 8559 |
最后登录 | 2015-8-26 |
在线时间 | 439 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 439 小时
- 注册时间
- 2013-3-2
- 帖子
- 710
|
- #==============================================================================
- # 本脚本来自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]=["测试点",101,[1,9,3],2]
- TOWNS[1]=["",0,[1,2,5],4]
- TOWNS[2]=["",0,[3,3,6],4]
- TOWNS[3]=["",0,[4,2,6],4]
- TOWNS[4]=["",0,[5,2,6],4]
- TOWNS[5]=["",0,[6,9,6],4]
- TOWNS[6]=["",0,[1,2,3],2]
- TOWNS[7]=["",0,[1,2,5],4]
- TOWNS[8]=["",0,[3,3,6],4]
- TOWNS[9]=["",0,[4,2,6],4]
- TOWNS[10]=["",0,[5,2,6],4]
- TOWNS[11]=["",0,[6,9,6],4]
- TOWNS[12]=["",0,[1,2,3],2]
- TOWNS[13]=["",0,[1,2,5],4]
- TOWNS[14]=["",3,[3,3,6],4]
- TOWNS[15]=["",4,[4,2,6],4]
- TOWNS[16]=["",5,[5,2,6],4]
- TOWNS[17]=["",6,[6,9,6],4]
- TOWNS[18]=["",1,[1,2,3],2]
- TOWNS[19]=["",2,[1,2,5],4]
- TOWNS[20]=["",3,[3,3,6],4]
- TOWNS[21]=["",4,[4,2,6],4]
- TOWNS[22]=["",5,[5,2,6],4]
- TOWNS[23]=["",6,[6,9,6],4]
- TOWNS[24]=["",1,[1,2,3],2]
- TOWNS[25]=["",2,[1,2,5],4]
- TOWNS[26]=["",3,[3,3,6],4]
- TOWNS[27]=["",4,[4,2,6],4]
- TOWNS[28]=["",5,[5,2,6],4]
- TOWNS[29]=["",6,[6,9,6],4]
- TOWNS[30]=["",1,[1,2,3],2]
- TOWNS[31]=["",2,[1,2,5],4]
- TOWNS[32]=["",3,[3,3,6],4]
- TOWNS[33]=["",4,[4,2,6],4]
- TOWNS[34]=["",5,[5,2,6],4]
- TOWNS[35]=["",6,[6,9,6],4]
- TOWNS[36]=["",1,[1,2,3],2]
- TOWNS[37]=["",2,[1,2,5],4]
- TOWNS[38]=["",3,[3,3,6],4]
- TOWNS[39]=["",4,[4,2,6],4]
- TOWNS[40]=["",5,[5,2,6],4]
- TOWNS[41]=["",6,[6,9,6],4]
- TOWNS[42]=["",1,[1,2,3],2]
- TOWNS[43]=["",2,[1,2,5],4]
- TOWNS[44]=["",3,[3,3,6],4]
- TOWNS[45]=["",4,[4,2,6],4]
- TOWNS[46]=["",5,[5,2,6],4]
- TOWNS[47]=["",6,[6,9,6],4]
- #==============================================================================
- # ■ 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[i][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,使用和转载请保留此信息
- #==============================================================================
复制代码 |
评分
-
查看全部评分
|