赞 | 0 |
VIP | 7 |
好人卡 | 0 |
积分 | 1 |
经验 | 3983 |
最后登录 | 2013-2-27 |
在线时间 | 72 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 72 小时
- 注册时间
- 2010-10-18
- 帖子
- 104
|
回复 梦到叶子了 的帖子
自取吧
如果还行的话
就麻烦到认可帖认可一下吧~- #
- # 作者:迷路子
- # 脚本:非常简陋的额外属性窗口
- #
- module Other
- #1 2 3 4分别对应到Other_data2的1 2 3 4
- #後面的5 6 7 8 分别表示那四个数值储存的变数序号
- #以例子来说 就是"饮酒"的数值储存在5号变数中 声望则是6号变数
- #如果要加其他的属性的话 依照同样的格式继续往下加入即可
- Other_data = {
- 1 => 5,
- 2 => 6,
- 3 => 7,
- 4 => 8,
- }
- #该属性的名称
- Other_data2 = {
- 1 => "饮酒",
- 2 => "声望",
- 3 => "轻功",
- 4 => "魅力",
- }
- #窗口的位置
- Other_x = 0
- Other_y = 180
- Color1 = Color.new(120,120,255) #属性名称的颜色
- Color2 = Color.new(255,255,255) #属性能力值的颜色
- Font_Name = "SimHei" #字体的名称
- Font_Size = 18 #字的大小
- end
- #==============================================================================
- # ■ Window_Gold
- #------------------------------------------------------------------------------
- # 显示金钱的窗口。
- #==============================================================================
- class Window_Other < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # x : 窗口 X 座标
- # y : 窗口 Y 座标
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, 160, WLH*Other::Other_data.size + 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_data(4, 0)
- end
-
- def draw_data(x,y)
- self.contents.font.name = Other::Font_Name
- self.contents.font.size = Other::Font_Size
- for i in 1..Other::Other_data2.size
- self.contents.font.color = Other::Color1
- self.contents.draw_text(x,y+WLH*(i-1),Other::Other_data2[i].size*11,WLH,Other::Other_data2[i])
- self.contents.font.color = Other::Color2
- self.contents.draw_text(x+60,y+WLH*(i-1),60,WLH,$game_variables[Other::Other_data[i-1].to_i].to_s,2)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 处理菜单画面的类。
- #==============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # menu_index : 命令窗口光标初始位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- create_command_window
- @gold_window = Window_Gold.new(0, 360)
- @status_window = Window_MenuStatus.new(160, 0)
- @other_window = Window_Other.new(Other::Other_x,Other::Other_y)
- end
- #--------------------------------------------------------------------------
- # ● 结束处理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @command_window.dispose
- @other_window.dispose
- @gold_window.dispose
- @status_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @command_window.update
- @gold_window.update
- @status_window.update
- if @command_window.active
- update_command_selection
- elsif @status_window.active
- update_actor_selection
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成命令窗口
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::item
- s2 = Vocab::skill
- s3 = Vocab::equip
- s4 = Vocab::status
- s5 = Vocab::save
- s6 = Vocab::game_end
- @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
- @command_window.index = @menu_index
- if $game_party.members.size == 0 # 如果队伍为空
- @command_window.draw_item(0, false) # 无效化物品选项
- @command_window.draw_item(1, false) # 无效化技能选项
- @command_window.draw_item(2, false) # 无效化装备选项
- @command_window.draw_item(3, false) # 无效化状态选项
- end
- if $game_system.save_disabled # 如果禁止存档
- @command_window.draw_item(4, false) # 无效化存档选项
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新命令窗口
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0 # 物品
- $scene = Scene_Item.new
- when 1,2,3 # 技能、装备、状态
- start_actor_selection
- when 4 # 存档
- $scene = Scene_File.new(true, false, false)
- when 5 # 结束游戏
- $scene = Scene_End.new
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 角色选择开始
- #--------------------------------------------------------------------------
- def start_actor_selection
- @command_window.active = false
- @status_window.active = true
- if $game_party.last_actor_index < @status_window.item_max
- @status_window.index = $game_party.last_actor_index
- else
- @status_window.index = 0
- end
- end
- #--------------------------------------------------------------------------
- # ● 角色选择结束
- #--------------------------------------------------------------------------
- def end_actor_selection
- @command_window.active = true
- @status_window.active = false
- @status_window.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 角色选择更新
- #--------------------------------------------------------------------------
- def update_actor_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_actor_selection
- elsif Input.trigger?(Input::C)
- $game_party.last_actor_index = @status_window.index
- Sound.play_decision
- case @command_window.index
- when 1 # 技能
- $scene = Scene_Skill.new(@status_window.index)
- when 2 # 装备
- $scene = Scene_Equip.new(@status_window.index)
- when 3 # 状态
- $scene = Scene_Status.new(@status_window.index)
- end
- end
- end
- end
复制代码 |
|