赞 | 13 |
VIP | 118 |
好人卡 | 28 |
积分 | 12 |
经验 | 35779 |
最后登录 | 2017-7-6 |
在线时间 | 1564 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1190
- 在线时间
- 1564 小时
- 注册时间
- 2008-7-30
- 帖子
- 4418
|
早期的翻译:http://myyxs.5d6d.com/thread-529-1-1.html- #===============================================================================
- # * [VX] Waypoints VX
- # Ver. 1.6
- # By Mundane, [email protected]
- # translate by DeathKing
- # 作者:Mundane
- # 汉化:DeathKing
- #-------------------------------------------------------------------------------
- # 鸣谢:
- # · Yeyinde - 帮助我改善脚本。
- #
- # 更新历史:
- # · 2008.08.17 第二弹
- # - 更新脚本至1.6,使得可以自由选择要去的小站
- # · 2008.08.17
- # - 简易化脚本。
- #-------------------------------------------------------------------------------
- module WayVX
- #-------------------------------------------------------------------------------
- # * 概述
- #-------------------------------------------------------------------------------
- #-------------------------------------------------------------------------------
- # 小站建立:
- #-------------------------------------------------------------------------------
- # 通过建立小站需要在下流模板添加:
- # WAYPOINTS = [
- # [C, S, M, X, Y, N],
- # [C, S, M, X, Y, N]
- # ]
- # ·C: 设定项目编号(索引),请递增添加。
- # ·S: 设定对应小站的激活开关。如当1号开关为ON(TRUE)时,“浪人平原”小站
- # 就被激活。0号开关表示默认为激活。
- # ·M: 设定对应小站所在地图的地图ID号。
- # ·X: 设定到达的目的地的X坐标。
- # ·Y: 设定到达的目的地的Y坐标。
- # ·N: 设定小站名称
- #-------------------------------------------------------------------------------
- WAYPOINTS = [ #C S M X Y N
- [0, 0, 1, 8, 6, "格林花园"],
- [1, 1, 2, 8, 6, "浪人平原"],
- [2, 2, 3, 8, 6, "寒冰之地"],
- [3, 3, 4, 8, 6, "萌芽游戏社"]
- ]
- NOSHOW = false # 当值为TRUE时,未激活的小站不会显示
- # 当值为FALSE是,为激活的小站会以灰色的字样显示
-
- # Point System Set-Up:
- ENABLEPTS = false # 消耗次数?(当值为TRUE时,会有值的限定)
- POINTVAR = 1 # (对应*号系统变量)允许传送次数。
-
- # 设定动画与音效
- TELEPORT_SE = "/Audio/SE/Teleport" # 传送音效的名称
- TELEPORT_ANIM = 41 # 传送动画的ID
- #-------------------------------------------------------------------------------
- end
- #-------------------------------END CONFIG--------------------------------------
- #-------------------------------------------------------------------------------
- # * Window_WaypointHelp
- #-------------------------------------------------------------------------------
- class Window_WaypointHelp < Window_Base
- #--------------------------------------------------------------------------
- # * 初始化对象
- # x : 窗口 X 坐标
- # y : 窗口 Y 坐标
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, 258, 60)
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.draw_text(4, 0, 250, 24, '去那个小站?')
- end
- end
- #==============================================================================
- # ** Window_Waypoints
- #------------------------------------------------------------------------------
- # This window deals with Waypoint selection.
- #==============================================================================
- class Window_Waypoints < Window_Selectable
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_reader :commands # command
- #--------------------------------------------------------------------------
- # * Object Initialization
- # width : window width
- # commands : command string array
- # column_max : digit count (if 2 or more, horizontal selection)
- # row_max : row count (0: match command count)
- # spacing : blank space when items are arrange horizontally
- #--------------------------------------------------------------------------
- def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
- if row_max == 0
- row_max = (commands.size + column_max - 1) / column_max
- end
- super(0, 0, width, row_max * WLH + 32, spacing)
- @commands = commands
- @item_max = commands.size
- @column_max = column_max
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- # index : item number
- # enabled : enabled flag. When false, draw semi-transparently.
- #--------------------------------------------------------------------------
- def draw_item(index, enabled = true)
- rect = item_rect(index)
- rect.x += 4
- rect.width -= 8
- self.contents.clear_rect(rect)
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- self.contents.draw_text(rect, @commands[index])
- end
- end
- #-------------------------------------------------------------------------------
- # * Window_WaypointHelp
- #-------------------------------------------------------------------------------
- class Window_Points < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- # x : window X coordinate
- # y : window Y coordinate
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, 160, 60)
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.draw_text(4, 0, 250, 24, '次数:')
- self.contents.draw_text(70, 0, 150, 24, $game_variables[WayVX::POINTVAR].to_s)
- end
- end
- #===============================================================================
- # ** 场景画面
- #===============================================================================
- class Scene_Waypoints < Scene_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- # menu_index : command cursor's initial position
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- #-----------------------------------------------------------------------------
- # * 开始处理
- #-----------------------------------------------------------------------------
- def start
- super
- create_menu_background
- create_command_window
- @wayhelp_window = Window_WaypointHelp.new(0,0)
- if WayVX::ENABLEPTS == true
- @pts_window = Window_Points.new(258,0)
- end
- end
- #--------------------------------------------------------------------------
- # * 结束处理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @command_window.dispose
- @wayhelp_window.dispose
- if WayVX::ENABLEPTS == true
- @pts_window.dispose
- end
- end
- #--------------------------------------------------------------------------
- # * 更新光标矩形
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @command_window.update
- @wayhelp_window.update
- if WayVX::ENABLEPTS == true
- @pts_window.update
- end
- update_command_selection
- end
- #--------------------------------------------------------------------------
- # * 生成命令窗口
- #--------------------------------------------------------------------------
- # * 这里将会添加你的小站
- #--------------------------------------------------------------------------
- def create_command_window
- commands = WayVX::WAYPOINTS.collect{|waypoint| waypoint[5]}
- @command_window = Window_Waypoints.new(258, commands)
- waypoint = WayVX::WAYPOINTS[@command_window.index]
- @command_window.index = @menu_index
- @command_window.y = 60
- WayVX::WAYPOINTS.each do |waypoint|
- if waypoint[1] > 0 && !$game_switches[waypoint[1]]
- @command_window.draw_item(waypoint[0], false)
- end
- end
- #-----------------------------------------------------------------------------
- # * 更行选项
- #-----------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- waypoint = WayVX::WAYPOINTS[@command_window.index]
- if waypoint[1] > 0 && !$game_switches[waypoint[1]]
- Sound.play_buzzer
- elsif WayVX::ENABLEPTS and $game_variables[WayVX::POINTVAR] == 0
- Sound.play_buzzer
- return
- else
- if WayVX::ENABLEPTS == true
- $game_variables[WayVX::POINTVAR] -= 1
- end
- Audio.se_play(WayVX::TELEPORT_SE)
- $game_player.animation_id = WayVX::TELEPORT_ANIM
- $game_map.setup(waypoint[2])
- $game_player.moveto(waypoint[3], waypoint[4])
- $game_player.refresh
- $scene = Scene_Map.new
- RPG::BGM.fade(120)
- RPG::BGS.fade(120)
- Graphics.fadeout(30)
- Graphics.wait(40)
- Graphics.frame_count = 0
- RPG::BGM.stop
- $game_map.autoplay
- end
- end
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|