# ----------------------------------------------------------------------------- # ◆技能升级(SKILL_UP) By.Clov # ----------------------------------------------------------------------------- # Ver:1.0.0 Date:2012.06.11 # -1.0.0:完整版 # 界面:SceneManager.call(Scene_SUP) # 角色切换:技能分类栏 L / R # ----------------------------------------------------------------------------- module SUP #————————————————————————————————————————— #·升级技能关联 # 技能ID => 升级后技能ID UP = { 26=>27, # 治愈 → 治愈Ⅱ 27=>28, # 治愈Ⅱ → 治愈Ⅲ 28=>29, # 治愈Ⅲ → 回复 29=>30, # 回复 → 回复Ⅱ 30=>116, # 回复Ⅱ → 精灵的叹息 80=>81, # 强击 → 横扫 81=>82, # 横扫 → 狂战士咆哮 82=>83, # 狂战士咆哮 → 狂战士之舞 83=>84, # 狂战士之舞 → 巨人的痛击 51=>52, 53=>54, 55=>56, 57=>58, 59=>60, 51=>62, 108=>109# 巨人的痛击 → 守护神兽:草泥马降临 } #————————————————————————————————————————— #·各条件“符号”说明 # 【物品篇】 # 条件数组头部 :items :weapons :armors 符号分别为判断 道具、武器、防具 # 再在尾部输入物品ID即可 # 【变量、开关、对比篇】 # 条件数组尾部 :bit 符号为要显示图片的名字(尺寸24*24) # 若省略的话,将不显示图片 #——————————————————————————————————————— #·默认条件 # 技能ID 0 的条件即为默认升级条件 # 以下4种条件类型都可以设置默认条件 #——————————————————————————————————————— #·升级条件-物品【变量消耗( a -= b)】 # 技能ID => [[:类别符号, 物品ID(a), 消耗数值(b)],[],[]…更多条件…] # 例:1 => [[:items, 10,5], [……]] IF_ITE = { 0 => [[:items, 19, 5]], #0 => [[:items, 34,3]], 26 => [[:items, 35, 1]], 27 => [[:items, 35, 2]], 28 => [[:items, 35, 3]], 29 => [[:items, 35, 4]], 30 => [[:items, 35, 5]] #使用19号道具作为默认升级条件 #升级 回复Ⅱ 需要18号道具1个 #升级 巨人的痛击 #需要17号道具1个、62号武器1个、61号防具1个 } #——————————————————————————————————————— #·升级条件-变量【变量消耗( a -= b)】 # 技能ID => [["显示文字", "变量连接(a)", 消耗数值(b)],[],[]…更多条件…] # 例:1 => [["脚本变量测试","$变量",10], [……]] IF_VAR = { 0 => [["QP点","$game_variables[100]",5]], #使用游戏1号变量作为默认升级条件 # 恢复技能条件 } #——————————————————————————————————————— #·升级条件-开关【开关判断( a == true )】 # 技能ID => [["显示文字", "开关连接(a)"],[],[]…更多条件…] # 例:1 => [["脚本开关测试","$开关"], [……]] IF_SWI = { 0 => [], #默认升级开关条件 } #——————————————————————————————————————— #·升级条件-比较【比较相等( a == b )】 # 技能ID => [["显示文字", "比较连接1(a)", "比较连接2(b)"],[],[]…更多条件…] # 例:1 => [["脚本比较测试","$比较1","$比较2"], [……]] IF_COM = { 0 => [], #默认升级对比条件 } #————————————————————————————————————————— #·积极、消极值槽颜色 POS_COLOR1 = Color.new(214,233,83,255) POS_COLOR2 = Color.new(255,255,255,255) NEG_COLOR1 = Color.new(253,80,128,255) NEG_COLOR2 = Color.new(255,255,255,255) #————————————————————————————————————————— #·输出评分最大值 PFX = 9999 #————————————————————————————————————————— #·图标存放文件夹 FILE = "Graphics/Icon/" #————————————————————————————————————————— #·效果范围显示文字 SCOPE = ["无", "单个敌人","全体敌人", "一个随机敌人","二个随机敌人","三个随机敌人","四个随机敌人", "单个队友","全体队友", "单个队友(无法战斗)","全体队友(无法战斗)", "使用者"] #·使用场合显示文字 OCCASION = ["随时可用","战斗可用","菜单可用","不可用"] #·命中类型显示文字 HIT_TYPE = ["必定命中","物理攻击","魔法攻击"] #·输出类型显示文字 DAMAGE_TYPE = ["无输出","HP伤害","MP伤害","HP恢复","MP恢复","HP吸收","MP吸收"] #————————————————————————————————————————— end #============================================================================== # ■ SUP_Window_Command #------------------------------------------------------------------------------ # 技能分类窗口 #============================================================================== class SUP_Window_Command < Window_Command #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_reader :skill_window #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y) @actor = nil end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 200 end #-------------------------------------------------------------------------- # ● 设置角色 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh select_last end #-------------------------------------------------------------------------- # ● 获取显示行数 #-------------------------------------------------------------------------- def visible_line_number return 4 end #-------------------------------------------------------------------------- # ● 生成指令列表 #-------------------------------------------------------------------------- def make_command_list return unless @actor @actor.added_skill_types.sort.each do |stype_id| name = $data_system.skill_types[stype_id] add_command(name, :skill, true, stype_id) end end #-------------------------------------------------------------------------- # ● 更新画面 #-------------------------------------------------------------------------- def update super @skill_window.stype_id = current_ext if @skill_window end #-------------------------------------------------------------------------- # ● 设置技能窗口 #-------------------------------------------------------------------------- def skill_window=(skill_window) @skill_window = skill_window update end #-------------------------------------------------------------------------- # ● 返回上一个选择的位置 #-------------------------------------------------------------------------- def select_last skill = @actor.last_skill.object if skill select_ext(skill.stype_id) else select(0) end end end #============================================================================== # ■ SUP_Window_Index #------------------------------------------------------------------------------ # 技能列表窗口。 #============================================================================== class SUP_Window_Index < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(x, y, width, height) super @actor = nil @stype_id = 0 @data = [] end #-------------------------------------------------------------------------- # ● 设置角色 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh self.oy = 0 end #-------------------------------------------------------------------------- # ● 设置技能类型 ID #-------------------------------------------------------------------------- def stype_id=(stype_id) return if @stype_id == stype_id @stype_id = stype_id refresh self.oy = 0 end #-------------------------------------------------------------------------- # ● 获取列数 #-------------------------------------------------------------------------- def col_max return 1 end #-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max @data ? @data.size : 1 end #-------------------------------------------------------------------------- # ● 获取技能 #-------------------------------------------------------------------------- def item @data && index >= 0 ? @data[index] : nil end #-------------------------------------------------------------------------- # ● 获取选择项目的有效状态 #-------------------------------------------------------------------------- def current_item_enabled? enable?(@data[index]) end #-------------------------------------------------------------------------- # ● 查询列表中是否含有此技能 #-------------------------------------------------------------------------- def include?(item) item && item.stype_id == @stype_id end #-------------------------------------------------------------------------- # ● 查询此技能是否可用 #-------------------------------------------------------------------------- def enable?(item) item && SUP::UP.has_key?(item.id) end #-------------------------------------------------------------------------- # ● 生成技能列表 #-------------------------------------------------------------------------- def make_item_list @data = @actor ? @actor.skills.select {|skill| include?(skill) } : [] end #-------------------------------------------------------------------------- # ● 返回上一个选择的位置 #-------------------------------------------------------------------------- def select_last select(@data.index(@actor.last_skill.object) || 0) end #-------------------------------------------------------------------------- # ● 绘制项目 #-------------------------------------------------------------------------- def draw_item(index) skill = @data[index] if skill rect = item_rect(index) rect.width -= 4 draw_item_name(skill, rect.x, rect.y, enable?(skill)) end end #-------------------------------------------------------------------------- # ● 更新帮助内容 #-------------------------------------------------------------------------- def update_help @help_window.set_item(item) end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh make_item_list create_contents draw_all_items end end #============================================================================== # ■ SUP_Window_Info #------------------------------------------------------------------------------ # 技能信息窗口 #============================================================================== class SUP_Window_Info < Window_Base #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(x, y,w,h) super(x, y, w, h) [url=home.php?mod=space&uid=133944]@w[/url] = w ; @h = h @yema = 1 @actor = nil [url=home.php?mod=space&uid=260100]@skill[/url] = nil @font_size = 20 @help_fill_color1 = Color.new(255,255,255,255) @help_fill_color2 = Color.new(255,255,255,0) end #-------------------------------------------------------------------------- # ● 设置角色 #-------------------------------------------------------------------------- def actor=(val) @actor = val end #-------------------------------------------------------------------------- # ● 取得技能 #-------------------------------------------------------------------------- def skill @skill end #-------------------------------------------------------------------------- # ● 设置技能 #-------------------------------------------------------------------------- def skill=(val) @skill = val huanye(@yema) end #-------------------------------------------------------------------------- # ● 技能是否可升级 #-------------------------------------------------------------------------- def skill_up? SUP::UP.has_key?(@skill.id) end #-------------------------------------------------------------------------- # ● 获得行高 #-------------------------------------------------------------------------- def line_height @font_size end #-------------------------------------------------------------------------- # ● 获得页码 #-------------------------------------------------------------------------- def yema @yema end #-------------------------------------------------------------------------- # ● 换页 #-------------------------------------------------------------------------- def huanye(y) @yema = y case @yema when 1 @draw = method(:draw1) @help_txt = ["技能状态信息", "升级技能状态信息", "A键换页(1/2)"] when 2 @draw = method(:draw2) @help_txt = ["技能数值信息", "升级技能数值信息", "A键换页(2/2)"] end refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear return if !@skill #描绘帮助信息 contents.font.size = 16 help #描绘技能信息 contents.font.size = line_height #描绘选中的技能 @draw.call(@skill, 0, line_height) #描绘升级后的技能 if skill_up? @draw.call($data_skills[SUP::UP[@skill.id]], 0, line_height * 9) else draw_text(70, line_height * 9 + 65, 280, line_height, "技能已经无法升级。") end end #-------------------------------------------------------------------------- # ● 描绘帮助条 #-------------------------------------------------------------------------- def help #第一条 contents.gradient_fill_rect(0, 0, @w, line_height, @help_fill_color1, @help_fill_color2) draw_text(2, 0, 280, line_height, @help_txt[0]) #第二条 contents.gradient_fill_rect(0, line_height * 8, @w, line_height, @help_fill_color1, @help_fill_color2) draw_text(2, line_height * 8, 280, line_height, @help_txt[1]) #换页 draw_text(225, 0, 280, line_height, @help_txt[2]) end #-------------------------------------------------------------------------- # ● 描绘页1 #-------------------------------------------------------------------------- def draw1(skill,x,y) #名称--------------------------------------------- draw_item_name(skill, x, y) #属性--------------------------------------------- sx = $data_system.elements[skill.damage.element_id] sx = sx=="" ? "无" : sx draw_text(x, y + line_height, 280, line_height, "属性:"+sx) #使用场合----------------------------------------- draw_text(x, y + line_height * 2, 280, line_height, "使用场合:"+SUP::OCCASION[skill.occasion ]) #使用范围----------------------------------------- draw_text(x, y + line_height * 3, 280, line_height, "使用范围:"+SUP::SCOPE[skill.scope]) #命中类型----------------------------------------- draw_text(x, y + line_height * 4, 280, line_height, "命中类型:"+SUP::HIT_TYPE[skill.hit_type]) #输出类型----------------------------------------- draw_text(x, y + line_height * 5, 280, line_height, "输出类型:"+SUP::DAMAGE_TYPE[skill.damage.type]) #武器限制----------------------------------------- w1 = $data_system.weapon_types[skill.required_wtype_id1] w2 = $data_system.weapon_types[skill.required_wtype_id2] w = "无武器限制" ; if w1 !="";w=w1;end ; if w2 != "";w+="与"+w2;end draw_text(x, y + line_height * 6, 280, line_height, "武器限制:"+w) end #-------------------------------------------------------------------------- # ● 描绘页2 #-------------------------------------------------------------------------- def draw2(skill,x,y) #名称--------------------------------------------- draw_item_name(skill, x, y) #魔力值消耗--------------------------------------- draw_text(x, y + line_height, 280, line_height, "魔力值消耗:") w = 200 ; h = 15 b = skill.mp_cost.to_f / 9999 c1 = Color.new(128,155,122,255) c2 = Color.new(25,55,155,255) flii(x+120, y + line_height + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2) draw_current_and_max_values(x+40, y + line_height, 280, skill.mp_cost, 9999, text_color(0), text_color(0)) #特技值消耗--------------------------------------- draw_text(x, y + line_height * 2, 280, line_height, "特技值消耗:") w = 200 ; h = 15 b = skill.tp_cost.to_f / 100 flii(x+120, y + line_height * 2 + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2) draw_current_and_max_values(x+40, y + line_height * 2, 280, skill.tp_cost, 100, text_color(0), text_color(0)) #特技值获得--------------------------------------- draw_text(x, y + line_height * 3, 280, line_height, "特技值获得:") w = 200 ; h = 15 b = skill.tp_gain.to_f / 100 flii(x+120, y + line_height * 3 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2) draw_current_and_max_values(x+40, y + line_height * 3, 280, skill.tp_gain, 100, text_color(0), text_color(0)) #攻击次数----------------------------------------- draw_text(x, y + line_height * 4, 280, line_height, "攻击次数:") w = 200 ; h = 15 b = skill.repeats.to_f / 9 flii(x+120, y + line_height * 4 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2) draw_current_and_max_values(x+40, y + line_height * 4, 280, skill.repeats, 9, text_color(0), text_color(0)) #成功几率----------------------------------------- draw_text(x, y + line_height * 5, 280, line_height, "成功几率:") w = 200 ; h = 15 b = skill.success_rate.to_f / 100 flii(x+120, y + line_height * 5 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2) draw_current_and_max_values(x+40, y + line_height * 5, 280, skill.success_rate, 100, text_color(0), text_color(0)) #输出评分----------------------------------------- draw_text(x, y + line_height * 6, 280, line_height, "输出评分:") pf = scpf(skill) w = 200 ; h = 15 b = [pf.to_f / SUP::PFX, 1.0].min type = skill.damage.type case type when 0 draw_text(x+150, y + line_height * 6, 280, line_height, "此技能没有输出。") when 1, 2, 5, 6 flii(x+120, y + line_height * 6 + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2) draw_current_and_max_values(x+40, y + line_height * 6, 280, pf, SUP::PFX, text_color(0), text_color(0)) when 3, 4 flii(x+120, y + line_height * 6 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2) draw_current_and_max_values(x+40, y + line_height * 6, 280, pf, SUP::PFX, text_color(0), text_color(0)) end end #-------------------------------------------------------------------------- # ● 描绘值槽 #-------------------------------------------------------------------------- def flii(x, y, w, h, b, color1, color2) contents.fill_rect(x, y, w, h, Color.new(0,0,0,64)) contents.gradient_fill_rect(x, y, w*b, h, color1, color2) end #-------------------------------------------------------------------------- # ● 获得评分 #-------------------------------------------------------------------------- def scpf(skill) g = skill.damage.formula.to_s a = @actor v = $game_variables g.gsub!(/b/,"a") return eval(g) end end #============================================================================== # ■ SUP_Window_Choice #------------------------------------------------------------------------------ # 技能升级条件及确认窗口 #============================================================================== class SUP_Window_Choice < Window_Command #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(x, y) @hx = -1 super(x, y) @skill = nil @actor = nil @enabled = [] @txt = [] @ite = [] @pic = [] @xh = [] end #-------------------------------------------------------------------------- # ● 设置角色 #-------------------------------------------------------------------------- def actor=(val) @actor = val end #-------------------------------------------------------------------------- # ● 取得技能 #-------------------------------------------------------------------------- def skill @skill end #-------------------------------------------------------------------------- # ● 设置技能 #-------------------------------------------------------------------------- def skill=(val) @skill = val refresh_draw end #-------------------------------------------------------------------------- # ● 取得全部指定条件 #-------------------------------------------------------------------------- def all_if(skill_id) arr = Array.new arr << SUP::IF_ITE[skill_id] arr << SUP::IF_VAR[skill_id] arr << SUP::IF_SWI[skill_id] arr << SUP::IF_COM[skill_id] end #-------------------------------------------------------------------------- # ● 获取全部条件有效状态 #-------------------------------------------------------------------------- def all_enabled? !@enabled.include?(false) end #-------------------------------------------------------------------------- # ● 获取物品、变量条件有效状态 #-------------------------------------------------------------------------- def ite_var_enabled?(y, s) return false if not y y >= s end #-------------------------------------------------------------------------- # ● 获取开关条件有效状态 #-------------------------------------------------------------------------- def swi_enabled?(y) y end #-------------------------------------------------------------------------- # ● 获取对比条件有效状态 #-------------------------------------------------------------------------- def com_enabled?(y1, y2) y1 == y2 end #-------------------------------------------------------------------------- # ● 技能升级条件数据 #-------------------------------------------------------------------------- def skill_data return if !@skill @hx = -1 ; @enabled = [] ; @txt = [] ; @pic = [] ; @pid = [] ; @xh = [] l = all_if(@skill.id) ; n = l.compact t = n == [] ? all_if(0) : l t1 = t[0] ; t2 = t[1] ; t3 = t[2] ; t4 = t[3] if t1 ite_data(t1) end if t2 var_data(t2) end if t3 swi_data(t3) end if t4 com_data(t4) end end #-------------------------------------------------------------------------- # ● 技能条件进行描绘 #-------------------------------------------------------------------------- def skill_draw @txt.each_with_index {|txt,i| change_color(normal_color, @enabled[i]) pic = @pic[i] if pic.is_a?(Symbol) wx = window_width / 2 - text_size(txt).width / 2 - 24 if pic == :ite draw_item_icon(@ite[i], wx, item_height * i) else draw_bit(pic.to_s, wx, item_height * i) end end draw_text(0, item_height * i, window_width, item_height, txt, 1) } end #-------------------------------------------------------------------------- # ● 绘制物品图标 #-------------------------------------------------------------------------- def draw_item_icon(item, x, y) draw_icon(item.icon_index, x, y) end #-------------------------------------------------------------------------- # ● 绘制图片 #-------------------------------------------------------------------------- def draw_bit(name, x, y) bitmap = Bitmap.new(SUP::FILE + name) rect = Rect.new(0, 0, 24, 24) contents.blt(x, y, bitmap, rect) end #-------------------------------------------------------------------------- # ● 对技能进行升级(变量、物品消耗) #-------------------------------------------------------------------------- def skill_up @actor.forget_skill(@skill.id) @actor.learn_skill(SUP::UP[@skill.id]) @xh.each_with_index {|x, i| if x.is_a?(String) eval(x) else $game_party.gain_item(@ite[i], -x) end} end #-------------------------------------------------------------------------- # ● 物品条件 数据 #-------------------------------------------------------------------------- def ite_data(si) si.each {|i| @hx += 1 ; t = i[0] ; b = i[1] ; s = i[2] case t when :items item = $data_items[b] when :weapons item = $data_weapons[b] when :armors item = $data_armors[b] end y = $game_party.item_number(item) enabled = ite_var_enabled?(y, s) @enabled[@hx] = enabled @txt[@hx] = item.name+"*"+ s.to_s @ite[@hx] = item @pic[@hx] = :ite @xh[@hx] = s } end #-------------------------------------------------------------------------- # ● 变量条件 数据 #-------------------------------------------------------------------------- def var_data(si) si.each {|i| @hx += 1 ; n = i[0] ; y = eval(i[1]) ; s = i[2] enabled = ite_var_enabled?(y, s) @enabled[@hx] = enabled @txt[@hx] = n+"*"+ s.to_s @pic[@hx] = i[-1] @xh[@hx] = "#{i[1]} -= #{s.to_s}" } end #-------------------------------------------------------------------------- # ● 开关条件 数据 #-------------------------------------------------------------------------- def swi_data(si) si.each {|i| @hx += 1 ; n = i[0] ; y = eval(i[1]) enabled = swi_enabled?(y) @enabled[@hx] = enabled @txt[@hx] = n @pic[@hx] = i[-1] } end #-------------------------------------------------------------------------- # ● 对比条件 数据 #-------------------------------------------------------------------------- def com_data(si) si.each {|i| @hx += 1 ; n = i[0] ; y1 = eval(i[1]) ; y2 = eval(i[2]) enabled = com_enabled?(y1,y2) @enabled[@hx] = enabled @txt[@hx] = n @pic[@hx] = i[-1] } end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 300 end #-------------------------------------------------------------------------- # ● 获取项目的高度 #-------------------------------------------------------------------------- def item_height return 28 end #-------------------------------------------------------------------------- # ● 获取对齐方向 #-------------------------------------------------------------------------- def alignment return 1 end #-------------------------------------------------------------------------- # ● 获取项目的绘制矩形 #-------------------------------------------------------------------------- alias x_item_rect item_rect def item_rect(index) rect = x_item_rect(index) rect.y = rect.y + item_height * (@hx+1) rect end #-------------------------------------------------------------------------- # ● 刷新(清除内容) #-------------------------------------------------------------------------- def refresh contents.clear end #-------------------------------------------------------------------------- # ● 刷新(取得数据、刷新窗口) #-------------------------------------------------------------------------- def refresh2 skill_data self.height = item_height * (@hx+3) self.x = Graphics.width / 2 - window_width / 2 self.y = Graphics.height / 2 - self.height / 2 create_contents end #-------------------------------------------------------------------------- # ● 刷新(要描绘的内容) #-------------------------------------------------------------------------- def refresh_draw refresh refresh2 skill_draw clear_command_list add_command("确认", :ok, all_enabled?) draw_all_items end end #============================================================================== # ■ Scene_SUP #------------------------------------------------------------------------------ # 技能升级画面 #============================================================================== class Scene_SUP < Scene_MenuBase #-------------------------------------------------------------------------- # ● 开始处理 #-------------------------------------------------------------------------- def start super create_help_window suv_window_command suv_window_info suv_window_index suv_window_choice end #-------------------------------------------------------------------------- # ● 帧更新 #-------------------------------------------------------------------------- def update super if Input.trigger?(:X) case @suv_window_info.yema when 1 @suv_window_info.huanye(2) when 2 @suv_window_info.huanye(1) end end if @suv_window_info.skill != @suv_window_index.item @suv_window_info.skill = @suv_window_index.item end end #-------------------------------------------------------------------------- # ● 生成确认窗口 #-------------------------------------------------------------------------- def suv_window_choice @suv_window_choice = SUP_Window_Choice.new(0, 0) @suv_window_choice.viewport = @viewport @suv_window_choice.set_handler(:ok, method(:confirm_ok)) @suv_window_choice.set_handler(:cancel, method(:confirm_cancel)) @suv_window_choice.hide.deactivate @suv_window_choice.actor = @actor end #-------------------------------------------------------------------------- # ● 生成分类窗口 #-------------------------------------------------------------------------- def suv_window_command wy = @help_window.height @suv_window_command = SUP_Window_Command.new(0, wy) @suv_window_command.viewport = @viewport @suv_window_command.help_window = @help_window @suv_window_command.actor = @actor @suv_window_command.set_handler(:skill, method(:command_skill)) @suv_window_command.set_handler(:cancel, method(:return_scene)) @suv_window_command.set_handler(:pagedown, method(:next_actor)) @suv_window_command.set_handler(:pageup, method(:prev_actor)) end #-------------------------------------------------------------------------- # ● 生成状态窗口 #-------------------------------------------------------------------------- def suv_window_info y = @help_window.height w = Graphics.width - @suv_window_command.width h = Graphics.height - @help_window.height @suv_window_info = SUP_Window_Info.new(@suv_window_command.width, y, w, h) @suv_window_info.viewport = @viewport @suv_window_info.actor = @actor end #-------------------------------------------------------------------------- # ● 生成列表窗口 #-------------------------------------------------------------------------- def suv_window_index wx = 0 wy = @suv_window_command.y + @suv_window_command.height ww = Graphics.width - @suv_window_info.width wh = Graphics.height - wy @suv_window_index = SUP_Window_Index.new(wx, wy, ww, wh) @suv_window_index.actor = @actor @suv_window_index.viewport = @viewport @suv_window_index.help_window = @help_window @suv_window_index.set_handler(:ok, method(:on_item_ok)) @suv_window_index.set_handler(:cancel, method(:on_item_cancel)) @suv_window_command.skill_window = @suv_window_index end #-------------------------------------------------------------------------- # ● 技能分类里“确定” #-------------------------------------------------------------------------- def command_skill @suv_window_index.activate @suv_window_index.select_last end #-------------------------------------------------------------------------- # ● 技能列表里“确定” #-------------------------------------------------------------------------- def on_item_ok skill = @suv_window_index.item @suv_window_choice.skill = skill @suv_window_choice.show.activate end #-------------------------------------------------------------------------- # ● 技能列表里“返回” #-------------------------------------------------------------------------- def on_item_cancel @suv_window_index.unselect @suv_window_command.activate end #-------------------------------------------------------------------------- # ● 确认列表里“确认” #-------------------------------------------------------------------------- def confirm_ok @suv_window_choice.skill_up @suv_window_index.refresh @suv_window_choice.hide.deactivate @suv_window_index.activate end #-------------------------------------------------------------------------- # ● 确认列表里“返回” #-------------------------------------------------------------------------- def confirm_cancel @suv_window_choice.hide.deactivate @suv_window_index.activate end #-------------------------------------------------------------------------- # ● 切换角色 #-------------------------------------------------------------------------- def on_actor_change @suv_window_command.actor = @actor @suv_window_info.actor = @actor @suv_window_index.actor = @actor @suv_window_choice.actor = @actor @suv_window_command.activate end end
图2.jpg (17.55 KB, 下载次数: 17)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |