赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 21341 |
最后登录 | 2023-11-29 |
在线时间 | 784 小时 |
Lv1.梦旅人 超级囧神 无尽的灌水
- 梦石
- 0
- 星屑
- 144
- 在线时间
- 784 小时
- 注册时间
- 2010-6-27
- 帖子
- 2065
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
当有2个传送项目时,要很多次才能移动光标,而3个传送项目的时候,就没有问题了,但是第四个又出现问题- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # 自定义内容解释:
- # TOWNS[编号]=["地名,可以随便写",开关编号,[传送去的地图id,传送去的地图x,
- # 传送去的地图y],角色朝向]
- #
- # 编号请按照0、1、2、3……顺序往下排布
- # 当编号的开关打开的时候,才可以选择这个传送地点
- # 角色朝向,2为下,4为左,6为右,8为上,具体可以参考自己数字小键盘的方向和数字关系
- # 如果是其他方向请自己改。
- #
- # 需要制作脚本,请联系superufo
- #
- # 使用方法:在需要传送的传送门、传送石、传送羽毛、传送旅店一类的地方使用公共事件:
- # 呼叫脚本:$scene = Scene_Teleport.new
- #
- # 制作者:柳柳
- #==============================================================================
- TOWNS=[]
- TOWNS[0]=["隆兴镇",91,[4,0,5],2]
- TOWNS[1]=["回村子",92,[2,29,2],2]
- TOWNS[2]=["贾拉山脉",93,[34,9,10],8]
- TOWNS[3]=["苏泊尔湖",94,[52,15,38],8]
- TOWNS[4]=["宝石平原",95,[40,6,23],8]
- TOWNS[5]=["梦幻之地",96,[46,9,16],8]
- TOWNS[6]=["乌卡雪山",97,[46,9,16],8]
- TOWNS[7]=["拉苏河",98,[46,9,16],8]
- TOWNS[8]=["奇遇之海",99,[46,9,16],8]
- TOWNS[9]=["纳奥湖",100,[46,9,16],8]
- TOWNS[10]=["克莫伐木场",101,[46,9,16],8]
- TOWNS[11]=["阿罗工房",102,[46,9,16],8]
- TOWNS[12]=["黎明皇家港",103,[46,9,16],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]]
- $game_player.move_up
- @width_temp = contents.text_size(@carol3_towns[0][0]).width
- @item_max = 1
- @cont_use = true
- end
- self.width = [@width_temp+32,416].min
- self.height = [(@item_max+1)*32,360].min
- self.x = (544-self.width)/2
- self.y = (416-self.height)/2
- self.contents = Bitmap.new(width-32,row_max*WLH)
- end
- #--------------------------------------------------------------------------
- # ● 描绘城镇名称
- #--------------------------------------------------------------------------
- def draw_towns
- for i in 0...@carol3_towns.size
- self.contents.draw_text(0,i*WLH,@width_temp,WLH,@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][3]
- end
- #--------------------------------------------------------------------------
- # ● 判断是否一个城市都没有
- #--------------------------------------------------------------------------
- def cant_use?
- return @cont_use
- end
- end
- #==============================================================================
- # ■ Scene_Teleport
- #------------------------------------------------------------------------------
- # 处理传送执行的类
- #==============================================================================
- class Scene_Teleport < Scene_Base
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def start
- Sound.play_decision
- @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
- end
-
- def terminate
- super
- @carol3_teleport_window.dispose
- end
-
- def update
- super
- @carol3_teleport_window.update
- carol3_update
- end
-
- def update_scene
- @carol3_teleport_window.active = true
- $game_player.reserve_transfer(@carol3_teleport_window.map_id, @carol3_teleport_window.map_x, @carol3_teleport_window.map_y, @carol3_teleport_window.map_direction)
- $game_map.autoplay
- $scene = Scene_Map.new
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def carol3_update
- @carol3_teleport_window.update
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- $game_player.move_up
- return
- end
- if Input.trigger?(Input::C)
- if @carol3_teleport_window.index == -1
- Sound.play_cancel
- $scene = Scene_Map.new
- return
- else
- Audio.se_play("Audio/SE/" + "Teleport",100,100)
- update_scene
- return
- end
- end
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 |
|