Project1

标题: 菜单栏问题 [打印本页]

作者: joker21    时间: 2014-8-19 09:58
标题: 菜单栏问题
可能是安装了某个大神的脚本,我游戏中的“存档”选项消失了。怎么改回来?

还多了一个”技能升级“选项,怎么删掉?
作者: r403736524    时间: 2014-8-19 09:59
应该是技能升级替换掉存档了吧。。。
作者: joker21    时间: 2014-8-19 13:27
r403736524 发表于 2014-8-19 09:59
应该是技能升级替换掉存档了吧。。。

怎么改回来? 不会是让我删脚本吧?
作者: joker21    时间: 2014-8-19 13:47
本帖最后由 VIPArcher 于 2014-8-19 13:50 编辑
joker21 发表于 2014-8-19 13:27
怎么改回来? 不会是让我删脚本吧?


RUBY 代码复制
  1. # -----------------------------------------------------------------------------
  2. # ◆技能升级(SKILL_UP) By.Clov
  3. # -----------------------------------------------------------------------------
  4. # Ver:1.0.0 Date:2012.06.11
  5. # -1.0.0:完整版
  6. # 界面:SceneManager.call(Scene_SUP)
  7. # 角色切换:技能分类栏 L / R
  8. # -----------------------------------------------------------------------------
  9. module SUP
  10. #—————————————————————————————————————————
  11.   #·升级技能关联
  12.   #  技能ID => 升级后技能ID
  13.   UP = {
  14.   26=>27,    # 治愈 → 治愈Ⅱ
  15.   27=>28,    # 治愈Ⅱ → 治愈Ⅲ
  16.   28=>29,    # 治愈Ⅲ → 回复
  17.   29=>30,    # 回复 → 回复Ⅱ
  18.   30=>116,   # 回复Ⅱ → 精灵的叹息
  19.   80=>81,    # 强击 → 横扫
  20.   81=>82,    # 横扫 → 狂战士咆哮
  21.   82=>83,    # 狂战士咆哮 → 狂战士之舞
  22.   83=>84,    # 狂战士之舞 → 巨人的痛击
  23.   51=>52,
  24.   53=>54,
  25.   55=>56,
  26.   57=>58,
  27.   59=>60,
  28.   51=>62,
  29.   108=>109# 巨人的痛击 → 守护神兽:草泥马降临
  30.   }
  31. #—————————————————————————————————————————
  32.   #·各条件“符号”说明
  33.   #  【物品篇】
  34.   #  条件数组头部 :items  :weapons  :armors 符号分别为判断 道具、武器、防具
  35.   #  再在尾部输入物品ID即可
  36.   #  【变量、开关、对比篇】
  37.   #  条件数组尾部 :bit 符号为要显示图片的名字(尺寸24*24)
  38.   #  若省略的话,将不显示图片
  39.   #———————————————————————————————————————
  40.   #·默认条件
  41.   #  技能ID 0 的条件即为默认升级条件
  42.   #  以下4种条件类型都可以设置默认条件
  43.   #———————————————————————————————————————
  44.   #·升级条件-物品【变量消耗( a -= b)】
  45.   #  技能ID => [[:类别符号, 物品ID(a), 消耗数值(b)],[],[]…更多条件…]
  46.   #  例:1 => [[:items, 10,5], [……]]
  47.   IF_ITE = {
  48. 0 => [[:items, 19, 0]],
  49. #0 => [[:items, 34,3]],
  50. 26 => [[:items, 35, 1]],
  51.   27 => [[:items, 35, 2]],
  52.   28 => [[:items, 35, 3]],
  53.   29 => [[:items, 35, 4]],
  54.   30 => [[:items, 35, 5]],
  55.   80 => [[:items, 35, 0]]
  56.  
  57.  
  58.  
  59. #使用19号道具作为默认升级条件
  60. #升级 回复Ⅱ 需要18号道具1个
  61.    #升级 巨人的痛击
  62.   #需要17号道具1个、62号武器1个、61号防具1个
  63.   }
  64.   #———————————————————————————————————————
  65.   #·升级条件-变量【变量消耗( a -= b)】
  66.   #  技能ID => [["显示文字", "变量连接(a)", 消耗数值(b)],[],[]…更多条件…]
  67.   #  例:1 => [["脚本变量测试","$变量",10], [……]]
  68.   IF_VAR = {
  69. 0 => [["技能点","$game_variables[100]",1]], #使用游戏1号变量作为默认升级条件
  70.   # 恢复技能条件
  71.  
  72.  
  73.   }
  74.   #———————————————————————————————————————
  75.   #·升级条件-开关【开关判断( a == true )】
  76.   #  技能ID => [["显示文字", "开关连接(a)"],[],[]…更多条件…]
  77.   #  例:1 => [["脚本开关测试","$开关"], [……]]
  78.   IF_SWI = {
  79.   0 => [],   #默认升级开关条件
  80.  
  81.   }
  82.   #———————————————————————————————————————
  83.   #·升级条件-比较【比较相等( a == b )】
  84.   #  技能ID => [["显示文字", "比较连接1(a)", "比较连接2(b)"],[],[]…更多条件…]
  85.   #  例:1 => [["脚本比较测试","$比较1","$比较2"], [……]]
  86.   IF_COM = {
  87.   0 => [],   #默认升级对比条件
  88.   }
  89. #—————————————————————————————————————————
  90.   #·积极、消极值槽颜色
  91.   POS_COLOR1 = Color.new(214,233,83,255)
  92.   POS_COLOR2 = Color.new(255,255,255,255)
  93.   NEG_COLOR1 = Color.new(253,80,128,255)
  94.   NEG_COLOR2 = Color.new(255,255,255,255)
  95. #—————————————————————————————————————————
  96.   #·输出评分最大值
  97.   PFX = 9999
  98. #—————————————————————————————————————————
  99.   #·图标存放文件夹
  100.   FILE = "Graphics/Icon/"
  101. #—————————————————————————————————————————
  102.   #·效果范围显示文字
  103.   SCOPE = ["无",
  104.   "单个敌人","全体敌人",
  105.   "一个随机敌人","二个随机敌人","三个随机敌人","四个随机敌人",
  106.   "单个队友","全体队友",
  107.   "单个队友(无法战斗)","全体队友(无法战斗)",
  108.   "使用者"]
  109.   #·使用场合显示文字
  110.   OCCASION = ["随时可用","战斗可用","菜单可用","不可用"]
  111.   #·命中类型显示文字
  112.   HIT_TYPE = ["必定命中","物理攻击","魔法攻击"]
  113.   #·输出类型显示文字
  114.   DAMAGE_TYPE = ["无输出","HP伤害","MP伤害","HP恢复","MP恢复","HP吸收","MP吸收"]
  115. #—————————————————————————————————————————
  116. end
  117.  
  118. #==============================================================================
  119. # ■ SUP_Window_Command
  120. #------------------------------------------------------------------------------
  121. #  技能分类窗口
  122. #==============================================================================
  123.  
  124. class SUP_Window_Command < Window_Command
  125.   #--------------------------------------------------------------------------
  126.   # ● 定义实例变量
  127.   #--------------------------------------------------------------------------
  128.   attr_reader   :skill_window
  129.   #--------------------------------------------------------------------------
  130.   # ● 初始化对象
  131.   #--------------------------------------------------------------------------
  132.   def initialize(x, y)
  133.     super(x, y)
  134.     @actor = nil
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 获取窗口的宽度
  138.   #--------------------------------------------------------------------------
  139.   def window_width
  140.     return 200
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● 设置角色
  144.   #--------------------------------------------------------------------------
  145.   def actor=(actor)
  146.     return if @actor == actor
  147.     @actor = actor
  148.     refresh
  149.     select_last
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 获取显示行数
  153.   #--------------------------------------------------------------------------
  154.   def visible_line_number
  155.     return 4
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● 生成指令列表
  159.   #--------------------------------------------------------------------------
  160.   def make_command_list
  161.     return unless @actor
  162.     @actor.added_skill_types.sort.each do |stype_id|
  163.       name = $data_system.skill_types[stype_id]
  164.       add_command(name, :skill, true, stype_id)
  165.     end
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   # ● 更新画面
  169.   #--------------------------------------------------------------------------
  170.   def update
  171.     super
  172.     @skill_window.stype_id = current_ext if @skill_window
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # ● 设置技能窗口
  176.   #--------------------------------------------------------------------------
  177.   def skill_window=(skill_window)
  178.     @skill_window = skill_window
  179.     update
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # ● 返回上一个选择的位置
  183.   #--------------------------------------------------------------------------
  184.   def select_last
  185.     skill = @actor.last_skill.object
  186.     if skill
  187.       select_ext(skill.stype_id)
  188.     else
  189.       select(0)
  190.     end
  191.   end
  192. end
  193.  
  194. #==============================================================================
  195. # ■ SUP_Window_Index
  196. #------------------------------------------------------------------------------
  197. #  技能列表窗口。
  198. #==============================================================================
  199.  
  200. class SUP_Window_Index < Window_Selectable
  201.   #--------------------------------------------------------------------------
  202.   # ● 初始化对象
  203.   #--------------------------------------------------------------------------
  204.   def initialize(x, y, width, height)
  205.     super
  206.     @actor = nil
  207.     @stype_id = 0
  208.     @data = []
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ● 设置角色
  212.   #--------------------------------------------------------------------------
  213.   def actor=(actor)
  214.     return if @actor == actor
  215.     @actor = actor
  216.     refresh
  217.     self.oy = 0
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● 设置技能类型 ID
  221.   #--------------------------------------------------------------------------
  222.   def stype_id=(stype_id)
  223.     return if @stype_id == stype_id
  224.     @stype_id = stype_id
  225.     refresh
  226.     self.oy = 0
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● 获取列数
  230.   #--------------------------------------------------------------------------
  231.   def col_max
  232.     return 1
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # ● 获取项目数
  236.   #--------------------------------------------------------------------------
  237.   def item_max
  238.     @data ? @data.size : 1
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● 获取技能
  242.   #--------------------------------------------------------------------------
  243.   def item
  244.     @data && index >= 0 ? @data[index] : nil
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 获取选择项目的有效状态
  248.   #--------------------------------------------------------------------------
  249.   def current_item_enabled?
  250.     enable?(@data[index])
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● 查询列表中是否含有此技能
  254.   #--------------------------------------------------------------------------
  255.   def include?(item)
  256.     item && item.stype_id == @stype_id
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● 查询此技能是否可用
  260.   #--------------------------------------------------------------------------
  261.   def enable?(item)
  262.     item && SUP::UP.has_key?(item.id)
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 生成技能列表
  266.   #--------------------------------------------------------------------------
  267.   def make_item_list
  268.     @data = @actor ? @actor.skills.select {|skill| include?(skill) } : []
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● 返回上一个选择的位置
  272.   #--------------------------------------------------------------------------
  273.   def select_last
  274.     select(@data.index(@actor.last_skill.object) || 0)
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ● 绘制项目
  278.   #--------------------------------------------------------------------------
  279.   def draw_item(index)
  280.     skill = @data[index]
  281.     if skill
  282.       rect = item_rect(index)
  283.       rect.width -= 4
  284.       draw_item_name(skill, rect.x, rect.y, enable?(skill))
  285.     end
  286.   end
  287.   #--------------------------------------------------------------------------
  288.   # ● 更新帮助内容
  289.   #--------------------------------------------------------------------------
  290.   def update_help
  291.     @help_window.set_item(item)
  292.   end
  293.   #--------------------------------------------------------------------------
  294.   # ● 刷新
  295.   #--------------------------------------------------------------------------
  296.   def refresh
  297.     make_item_list
  298.     create_contents
  299.     draw_all_items
  300.   end
  301. end
  302.  
  303. #==============================================================================
  304. # ■ SUP_Window_Info
  305. #------------------------------------------------------------------------------
  306. #  技能信息窗口
  307. #==============================================================================
  308.  
  309. class SUP_Window_Info < Window_Base
  310.   #--------------------------------------------------------------------------
  311.   # ● 初始化对象
  312.   #--------------------------------------------------------------------------
  313.   def initialize(x, y,w,h)
  314.     super(x, y, w, h)
  315.     [url=home.php?mod=space&uid=133944]@w[/url] = w ; @h = h
  316.     @yema = 1
  317.     @actor = nil
  318.     [url=home.php?mod=space&uid=260100]@skill[/url] = nil
  319.     @font_size = 20
  320.     @help_fill_color1 = Color.new(255,255,255,255)
  321.     @help_fill_color2 = Color.new(255,255,255,0)
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● 设置角色
  325.   #--------------------------------------------------------------------------
  326.   def actor=(val)
  327.     @actor = val
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● 取得技能
  331.   #--------------------------------------------------------------------------
  332.   def skill
  333.     @skill
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 设置技能
  337.   #--------------------------------------------------------------------------
  338.   def skill=(val)
  339.     [url=home.php?mod=space&uid=260100]@skill[/url] = val
  340.     huanye(@yema)
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ● 技能是否可升级
  344.   #--------------------------------------------------------------------------
  345.   def skill_up?
  346.     SUP::UP.has_key?(@skill.id)
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● 获得行高
  350.   #--------------------------------------------------------------------------
  351.   def line_height
  352.     @font_size
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ● 获得页码
  356.   #--------------------------------------------------------------------------
  357.   def yema
  358.     @yema
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # ● 换页
  362.   #--------------------------------------------------------------------------
  363.   def huanye(y)
  364.     @yema = y
  365.     case @yema
  366.     when 1
  367.     @draw = method(:draw1)
  368.     @help_txt = ["技能状态信息", "升级技能状态信息", "A键换页(1/2)"]
  369.     when 2
  370.     @draw = method(:draw2)
  371.     @help_txt = ["技能数值信息", "升级技能数值信息", "A键换页(2/2)"]
  372.     end
  373.     refresh
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 刷新
  377.   #--------------------------------------------------------------------------
  378.   def refresh
  379.     contents.clear
  380.     return if !@skill
  381.     #描绘帮助信息
  382.     contents.font.size = 16
  383.     help
  384.     #描绘技能信息
  385.     contents.font.size = line_height
  386.     #描绘选中的技能
  387.     @draw.call(@skill, 0, line_height)
  388.     #描绘升级后的技能
  389.     if skill_up?
  390.       @draw.call($data_skills[SUP::UP[@skill.id]], 0, line_height * 9)
  391.     else
  392.       draw_text(70, line_height * 9 + 65, 280, line_height,
  393.     "技能已经无法升级。")
  394.     end
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ● 描绘帮助条
  398.   #--------------------------------------------------------------------------
  399.   def help
  400.     #第一条
  401.     contents.gradient_fill_rect(0, 0, @w, line_height,
  402.     @help_fill_color1, @help_fill_color2)
  403.     draw_text(2, 0, 280, line_height, @help_txt[0])
  404.     #第二条
  405.     contents.gradient_fill_rect(0, line_height * 8, @w, line_height,
  406.     @help_fill_color1, @help_fill_color2)
  407.     draw_text(2, line_height * 8, 280, line_height, @help_txt[1])
  408.     #换页
  409.     draw_text(225, 0, 280, line_height, @help_txt[2])
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● 描绘页1
  413.   #--------------------------------------------------------------------------
  414.   def draw1(skill,x,y)
  415.     #名称---------------------------------------------
  416.     draw_item_name(skill, x, y)
  417.     #属性---------------------------------------------
  418.     sx = $data_system.elements[skill.damage.element_id]
  419.     sx = sx=="" ? "无" : sx
  420.     draw_text(x, y + line_height, 280, line_height,
  421.     "属性:"+sx)
  422.     #使用场合-----------------------------------------
  423.     draw_text(x, y + line_height * 2, 280, line_height,
  424.     "使用场合:"+SUP::OCCASION[skill.occasion ])
  425.     #使用范围-----------------------------------------
  426.     draw_text(x, y + line_height * 3, 280, line_height,
  427.     "使用范围:"+SUP::SCOPE[skill.scope])
  428.     #命中类型-----------------------------------------
  429.     draw_text(x, y + line_height * 4, 280, line_height,
  430.     "命中类型:"+SUP::HIT_TYPE[skill.hit_type])
  431.     #输出类型-----------------------------------------
  432.     draw_text(x, y + line_height * 5, 280, line_height,
  433.     "输出类型:"+SUP::DAMAGE_TYPE[skill.damage.type])
  434.     #武器限制-----------------------------------------
  435.     w1 = $data_system.weapon_types[skill.required_wtype_id1]
  436.     w2 = $data_system.weapon_types[skill.required_wtype_id2]
  437.     w = "无武器限制" ; if w1 !="";w=w1;end ; if w2 != "";w+="与"+w2;end
  438.     draw_text(x, y + line_height * 6, 280, line_height,
  439.     "武器限制:"+w)
  440.   end
  441.   #--------------------------------------------------------------------------
  442.   # ● 描绘页2
  443.   #--------------------------------------------------------------------------
  444.   def draw2(skill,x,y)
  445.     #名称---------------------------------------------
  446.     draw_item_name(skill, x, y)
  447.     #魔力值消耗---------------------------------------
  448.     draw_text(x, y + line_height, 280, line_height,
  449.     "魔力值消耗:")
  450.     w = 200 ; h = 15
  451.     b = skill.mp_cost.to_f / 9999
  452.     c1 = Color.new(128,155,122,255)
  453.     c2 = Color.new(25,55,155,255)
  454.     flii(x+120, y + line_height + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  455.     draw_current_and_max_values(x+40, y + line_height, 280, skill.mp_cost, 9999,
  456.     text_color(0), text_color(0))
  457.     #特技值消耗---------------------------------------
  458.     draw_text(x, y + line_height * 2, 280, line_height,
  459.     "特技值消耗:")
  460.     w = 200 ; h = 15
  461.     b = skill.tp_cost.to_f / 100
  462.     flii(x+120, y + line_height * 2 + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  463.     draw_current_and_max_values(x+40, y + line_height * 2, 280, skill.tp_cost, 100,
  464.     text_color(0), text_color(0))
  465.     #特技值获得---------------------------------------
  466.     draw_text(x, y + line_height * 3, 280, line_height,
  467.     "特技值获得:")
  468.     w = 200 ; h = 15
  469.     b = skill.tp_gain.to_f / 100
  470.     flii(x+120, y + line_height * 3 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  471.     draw_current_and_max_values(x+40, y + line_height * 3, 280, skill.tp_gain, 100,
  472.     text_color(0), text_color(0))
  473.     #攻击次数-----------------------------------------
  474.     draw_text(x, y + line_height * 4, 280, line_height,
  475.     "攻击次数:")
  476.     w = 200 ; h = 15
  477.     b = skill.repeats.to_f / 9
  478.     flii(x+120, y + line_height * 4 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  479.     draw_current_and_max_values(x+40, y + line_height * 4, 280, skill.repeats, 9,
  480.     text_color(0), text_color(0))
  481.     #成功几率-----------------------------------------
  482.     draw_text(x, y + line_height * 5, 280, line_height,
  483.     "成功几率:")
  484.     w = 200 ; h = 15
  485.     b = skill.success_rate.to_f / 100
  486.     flii(x+120, y + line_height * 5 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  487.     draw_current_and_max_values(x+40, y + line_height * 5, 280, skill.success_rate, 100,
  488.     text_color(0), text_color(0))
  489.     #输出评分-----------------------------------------
  490.     draw_text(x, y + line_height * 6, 280, line_height,
  491.     "输出评分:")
  492.     pf = scpf(skill)
  493.     w = 200 ; h = 15
  494.     b = [pf.to_f / SUP::PFX, 1.0].min
  495.     type = skill.damage.type
  496.     case type
  497.     when 0
  498.       draw_text(x+150, y + line_height * 6, 280, line_height,
  499.     "此技能没有输出。")
  500.     when 1, 2, 5, 6
  501.       flii(x+120, y + line_height * 6 + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  502.       draw_current_and_max_values(x+40, y + line_height * 6, 280, pf, SUP::PFX,
  503.       text_color(0), text_color(0))
  504.     when 3, 4
  505.       flii(x+120, y + line_height * 6 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  506.       draw_current_and_max_values(x+40, y + line_height * 6, 280, pf, SUP::PFX,
  507.       text_color(0), text_color(0))
  508.     end
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● 描绘值槽
  512.   #--------------------------------------------------------------------------
  513.   def flii(x, y, w, h, b, color1, color2)
  514.     contents.fill_rect(x, y, w, h, Color.new(0,0,0,64))
  515.     contents.gradient_fill_rect(x, y, w*b, h, color1, color2)
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ● 获得评分
  519.   #--------------------------------------------------------------------------
  520.   def scpf(skill)
  521.     g = skill.damage.formula.to_s
  522.     a = @actor
  523.     v = $game_variables
  524.     g.gsub!(/b/,"a")
  525.     return eval(g)
  526.   end
  527. end
  528.  
  529. #==============================================================================
  530. # ■ SUP_Window_Choice
  531. #------------------------------------------------------------------------------
  532. #  技能升级条件及确认窗口
  533. #==============================================================================
  534.  
  535. class SUP_Window_Choice < Window_Command
  536.   #--------------------------------------------------------------------------
  537.   # ● 初始化对象
  538.   #--------------------------------------------------------------------------
  539.   def initialize(x, y)
  540.     @hx = -1
  541.     super(x, y)
  542.     @skill = nil
  543.     @actor = nil
  544.     @enabled = []
  545.     @txt = []
  546.     @ite = []
  547.     @pic = []
  548.     @xh = []
  549.   end
  550.   #--------------------------------------------------------------------------
  551.   # ● 设置角色
  552.   #--------------------------------------------------------------------------
  553.   def actor=(val)
  554.     @actor = val
  555.   end
  556.   #--------------------------------------------------------------------------
  557.   # ● 取得技能
  558.   #--------------------------------------------------------------------------
  559.   def skill
  560.     @skill
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # ● 设置技能
  564.   #--------------------------------------------------------------------------
  565.   def skill=(val)
  566.     @skill = val
  567.     refresh_draw
  568.   end
  569.   #--------------------------------------------------------------------------
  570.   # ● 取得全部指定条件
  571.   #--------------------------------------------------------------------------
  572.   def all_if(skill_id)
  573.     arr = Array.new
  574.     arr << SUP::IF_ITE[skill_id]
  575.     arr << SUP::IF_VAR[skill_id]
  576.     arr << SUP::IF_SWI[skill_id]
  577.     arr << SUP::IF_COM[skill_id]
  578.   end
  579.   #--------------------------------------------------------------------------
  580.   # ● 获取全部条件有效状态
  581.   #--------------------------------------------------------------------------
  582.   def all_enabled?
  583.     !@enabled.include?(false)
  584.   end
  585.   #--------------------------------------------------------------------------
  586.   # ● 获取物品、变量条件有效状态
  587.   #--------------------------------------------------------------------------
  588.   def ite_var_enabled?(y, s)
  589.     return false if not y
  590.     y >= s
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● 获取开关条件有效状态
  594.   #--------------------------------------------------------------------------
  595.   def swi_enabled?(y)
  596.     y
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # ● 获取对比条件有效状态
  600.   #--------------------------------------------------------------------------
  601.   def com_enabled?(y1, y2)
  602.     y1 == y2
  603.   end
  604.   #--------------------------------------------------------------------------
  605.   # ● 技能升级条件数据
  606.   #--------------------------------------------------------------------------
  607.   def skill_data
  608.     return if !@skill
  609.     @hx = -1 ; @enabled = [] ; @txt = [] ; @pic = [] ; @pid = [] ; @xh = []
  610.     l = all_if(@skill.id) ; n = l.compact
  611.     t = n == [] ? all_if(0) : l
  612.     t1 = t[0] ; t2 = t[1] ; t3 = t[2] ; t4 = t[3]
  613.     if t1
  614.       ite_data(t1)
  615.     end
  616.     if t2
  617.       var_data(t2)
  618.     end
  619.     if t3
  620.       swi_data(t3)
  621.     end
  622.     if t4
  623.       com_data(t4)
  624.     end
  625.   end
  626.   #--------------------------------------------------------------------------
  627.   # ● 技能条件进行描绘
  628.   #--------------------------------------------------------------------------
  629.   def skill_draw
  630.     @txt.each_with_index {|txt,i|
  631.     change_color(normal_color, @enabled[i])
  632.     pic = @pic[i]
  633.     if pic.is_a?(Symbol)
  634.       wx = window_width / 2 - text_size(txt).width / 2 - 24
  635.       if pic == :ite
  636.         draw_item_icon(@ite[i], wx, item_height * i)
  637.       else
  638.         draw_bit(pic.to_s, wx, item_height * i)
  639.       end
  640.     end
  641.     draw_text(0, item_height * i, window_width, item_height, txt, 1)
  642.     }
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # ● 绘制物品图标
  646.   #--------------------------------------------------------------------------
  647.   def draw_item_icon(item, x, y)
  648.     draw_icon(item.icon_index, x, y)
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # ● 绘制图片
  652.   #--------------------------------------------------------------------------
  653.   def draw_bit(name, x, y)
  654.     bitmap = Bitmap.new(SUP::FILE + name)
  655.     rect = Rect.new(0, 0, 24, 24)
  656.     contents.blt(x, y, bitmap, rect)
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # ● 对技能进行升级(变量、物品消耗)
  660.   #--------------------------------------------------------------------------
  661.   def skill_up
  662.     @actor.forget_skill(@skill.id)
  663.     @actor.learn_skill(SUP::UP[@skill.id])
  664.     @xh.each_with_index {|x, i|
  665.     if x.is_a?(String)
  666.       eval(x)
  667.     else
  668.       $game_party.gain_item(@ite[i], -x)
  669.     end}
  670.   end
  671.   #--------------------------------------------------------------------------
  672.   # ● 物品条件 数据
  673.   #--------------------------------------------------------------------------
  674.   def ite_data(si)
  675.     si.each {|i|
  676.     @hx += 1 ; t = i[0] ; b = i[1] ; s = i[2]
  677.     case t
  678.     when :items
  679.       item = $data_items[b]
  680.     when :weapons
  681.       item = $data_weapons[b]
  682.     when :armors
  683.       item = $data_armors[b]
  684.     end
  685.     y = $game_party.item_number(item)
  686.     enabled = ite_var_enabled?(y, s)
  687.     @enabled[@hx] = enabled
  688.     @txt[@hx] = item.name+"*"+ s.to_s
  689.     @ite[@hx] = item
  690.     @pic[@hx] = :ite
  691.     @xh[@hx] = s
  692.     }
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ● 变量条件 数据
  696.   #--------------------------------------------------------------------------
  697.   def var_data(si)
  698.     si.each {|i|
  699.     @hx += 1 ; n = i[0] ; y = eval(i[1]) ; s = i[2]
  700.     enabled = ite_var_enabled?(y, s)
  701.     @enabled[@hx] = enabled
  702.     @txt[@hx] = n+"*"+ s.to_s
  703.     @pic[@hx] = i[-1]
  704.     @xh[@hx] = "#{i[1]} -= #{s.to_s}"
  705.     }
  706.   end
  707.   #--------------------------------------------------------------------------
  708.   # ● 开关条件 数据
  709.   #--------------------------------------------------------------------------
  710.   def swi_data(si)
  711.     si.each {|i|
  712.     @hx += 1 ; n = i[0] ; y = eval(i[1])
  713.     enabled = swi_enabled?(y)
  714.     @enabled[@hx] = enabled
  715.     @txt[@hx] = n
  716.     @pic[@hx] = i[-1]
  717.     }
  718.   end
  719.   #--------------------------------------------------------------------------
  720.   # ● 对比条件 数据
  721.   #--------------------------------------------------------------------------
  722.   def com_data(si)
  723.     si.each {|i|
  724.     @hx += 1 ; n = i[0] ; y1 = eval(i[1]) ; y2 = eval(i[2])
  725.     enabled = com_enabled?(y1,y2)
  726.     @enabled[@hx] = enabled
  727.     @txt[@hx] = n
  728.     @pic[@hx] = i[-1]
  729.     }
  730.   end
  731.   #--------------------------------------------------------------------------
  732.   # ● 获取窗口的宽度
  733.   #--------------------------------------------------------------------------
  734.   def window_width
  735.     return 300
  736.   end
  737.   #--------------------------------------------------------------------------
  738.   # ● 获取项目的高度
  739.   #--------------------------------------------------------------------------
  740.   def item_height
  741.     return 28
  742.   end
  743.   #--------------------------------------------------------------------------
  744.   # ● 获取对齐方向
  745.   #--------------------------------------------------------------------------
  746.   def alignment
  747.     return 1
  748.   end
  749.   #--------------------------------------------------------------------------
  750.   # ● 获取项目的绘制矩形
  751.   #--------------------------------------------------------------------------
  752.   alias x_item_rect item_rect
  753.   def item_rect(index)
  754.     rect = x_item_rect(index)
  755.     rect.y = rect.y + item_height * (@hx+1)
  756.     rect
  757.   end
  758.   #--------------------------------------------------------------------------
  759.   # ● 刷新(清除内容)
  760.   #--------------------------------------------------------------------------
  761.   def refresh
  762.     contents.clear
  763.   end
  764.   #--------------------------------------------------------------------------
  765.   # ● 刷新(取得数据、刷新窗口)
  766.   #--------------------------------------------------------------------------
  767.   def refresh2
  768.     skill_data
  769.     self.height = item_height * (@hx+3)
  770.     self.x = Graphics.width / 2 - window_width / 2
  771.     self.y = Graphics.height / 2 - self.height / 2
  772.     create_contents
  773.   end
  774.   #--------------------------------------------------------------------------
  775.   # ● 刷新(要描绘的内容)
  776.   #--------------------------------------------------------------------------
  777.   def refresh_draw
  778.     refresh
  779.     refresh2
  780.     skill_draw
  781.     clear_command_list
  782.     add_command("确认",   :ok, all_enabled?)
  783.     draw_all_items
  784.   end
  785. end
  786.  
  787. #==============================================================================
  788. # ■ Scene_SUP
  789. #------------------------------------------------------------------------------
  790. #  技能升级画面
  791. #==============================================================================
  792.  
  793. class Scene_SUP < Scene_MenuBase
  794.   #--------------------------------------------------------------------------
  795.   # ● 开始处理
  796.   #--------------------------------------------------------------------------
  797.   def start
  798.     super
  799.     create_help_window
  800.     suv_window_command
  801.     suv_window_info
  802.     suv_window_index
  803.     suv_window_choice
  804.   end
  805.   #--------------------------------------------------------------------------
  806.   # ● 帧更新
  807.   #--------------------------------------------------------------------------
  808.   def update
  809.     super
  810.     if Input.trigger?(:X)
  811.       case @suv_window_info.yema
  812.       when 1
  813.         @suv_window_info.huanye(2)
  814.       when 2
  815.         @suv_window_info.huanye(1)
  816.       end
  817.     end
  818.     if @suv_window_info.skill != @suv_window_index.item
  819.       @suv_window_info.skill = @suv_window_index.item
  820.     end
  821.   end
  822.   #--------------------------------------------------------------------------
  823.   # ● 生成确认窗口
  824.   #--------------------------------------------------------------------------
  825.   def suv_window_choice
  826.     @suv_window_choice = SUP_Window_Choice.new(0, 0)
  827.     @suv_window_choice.viewport = @viewport
  828.     @suv_window_choice.set_handler(:ok,    method(:confirm_ok))
  829.     @suv_window_choice.set_handler(:cancel,   method(:confirm_cancel))
  830.     @suv_window_choice.hide.deactivate
  831.     @suv_window_choice.actor = @actor
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● 生成分类窗口
  835.   #--------------------------------------------------------------------------
  836.   def suv_window_command
  837.     wy = @help_window.height
  838.     @suv_window_command = SUP_Window_Command.new(0, wy)
  839.     @suv_window_command.viewport = @viewport
  840.     @suv_window_command.help_window = @help_window
  841.     @suv_window_command.actor = @actor
  842.     @suv_window_command.set_handler(:skill,    method(:command_skill))
  843.     @suv_window_command.set_handler(:cancel,   method(:return_scene))
  844.     @suv_window_command.set_handler(:pagedown, method(:next_actor))
  845.     @suv_window_command.set_handler(:pageup,   method(:prev_actor))
  846.   end
  847.   #--------------------------------------------------------------------------
  848.   # ● 生成状态窗口
  849.   #--------------------------------------------------------------------------
  850.   def suv_window_info
  851.     y = @help_window.height
  852.     w = Graphics.width - @suv_window_command.width
  853.     h = Graphics.height - @help_window.height
  854.     @suv_window_info = SUP_Window_Info.new(@suv_window_command.width, y, w, h)
  855.     @suv_window_info.viewport = @viewport
  856.     @suv_window_info.actor = @actor
  857.   end
  858.   #--------------------------------------------------------------------------
  859.   # ● 生成列表窗口
  860.   #--------------------------------------------------------------------------
  861.   def suv_window_index
  862.     wx = 0
  863.     wy = @suv_window_command.y + @suv_window_command.height
  864.     ww = Graphics.width - @suv_window_info.width
  865.     wh = Graphics.height - wy
  866.     @suv_window_index = SUP_Window_Index.new(wx, wy, ww, wh)
  867.     @suv_window_index.actor = @actor
  868.     @suv_window_index.viewport = @viewport
  869.     @suv_window_index.help_window = @help_window
  870.     @suv_window_index.set_handler(:ok,     method(:on_item_ok))
  871.     @suv_window_index.set_handler(:cancel, method(:on_item_cancel))
  872.     @suv_window_command.skill_window = @suv_window_index
  873.   end
  874.   #--------------------------------------------------------------------------
  875.   # ● 技能分类里“确定”
  876.   #--------------------------------------------------------------------------
  877.   def command_skill
  878.     @suv_window_index.activate
  879.     @suv_window_index.select_last
  880.   end
  881.   #--------------------------------------------------------------------------
  882.   # ● 技能列表里“确定”
  883.   #--------------------------------------------------------------------------
  884.   def on_item_ok
  885.     skill = @suv_window_index.item
  886.     @suv_window_choice.skill = skill
  887.     @suv_window_choice.show.activate
  888.   end
  889.   #--------------------------------------------------------------------------
  890.   # ● 技能列表里“返回”
  891.   #--------------------------------------------------------------------------
  892.   def on_item_cancel
  893.     @suv_window_index.unselect
  894.     @suv_window_command.activate
  895.   end
  896.   #--------------------------------------------------------------------------
  897.   # ● 确认列表里“确认”
  898.   #--------------------------------------------------------------------------
  899.   def confirm_ok
  900.     @suv_window_choice.skill_up
  901.     @suv_window_index.refresh
  902.     @suv_window_choice.hide.deactivate
  903.     @suv_window_index.activate
  904.   end
  905.   #--------------------------------------------------------------------------
  906.   # ● 确认列表里“返回”
  907.   #--------------------------------------------------------------------------
  908.   def confirm_cancel
  909.     @suv_window_choice.hide.deactivate
  910.     @suv_window_index.activate
  911.   end
  912.   #--------------------------------------------------------------------------
  913.   # ● 切换角色
  914.   #--------------------------------------------------------------------------
  915.   def on_actor_change
  916.     @suv_window_command.actor = @actor
  917.     @suv_window_info.actor = @actor
  918.     @suv_window_index.actor = @actor
  919.     @suv_window_choice.actor = @actor
  920.     @suv_window_command.activate
  921.   end
  922. end



  
作者: joker21    时间: 2014-8-19 13:55
joker21 发表于 2014-8-19 13:47
# -----------------------------------------------------------------------------
# ◆技能升级(SKIL ...

找到原因了
作者: joker21    时间: 2014-8-19 13:56
joker21 发表于 2014-8-19 13:55
找到原因了

#==============================================================================
# ■ Game_Interpreter_Self
#------------------------------------------------------------------------------
# 独立公共事件执行器
#==============================================================================
=begin

独立公共事件执行器用于随时执行公共事件,不受公共事件调用地方的限制。
□使用方法:
1。将脚本插入main前。
2。在需要使用公共事件的地方
插入、
GIS.new(公共事件ID)
□可能的冲突:无
已经被改过兼容VA了。
原制作者为九夜神尊。
=end

class GIS < Game_Interpreter
  def initialize(com_id)
    @com_id = com_id
    common_event = $data_common_events[@com_id]
    setup(common_event.list)
    update
    clear
  end
  def command_117
    if $data_common_events[@params[0]]
      child = Game_Interpreter_Self.new(@params[0])
      child.run
    end
  end
end
class Window_MenuCommand < Window_Command
  def add_save_command
    add_command("任务", :save, true)
    add_command("技能强化", :save2, true)
  end
  def add_game_end_command
    add_command("系统", :game_end)
  end
end
class Scene_Menu < Scene_MenuBase
  alias ccw_zabing create_command_window
  def create_command_window
    ccw_zabing
    @command_window.set_handler(:save2,     method(:command_save2))
  end
  def command_save      
    SceneManager.call(Scene_Task)
  end
  def command_save2
    SceneManager.call(Scene_SUP)
  end
end
class Scene_End < Scene_MenuBase
  alias ccw_zabing create_command_window
  def create_command_window
    ccw_zabing
    @command_window.set_handler(:to_load, method(:command_to_load))
  end
  def command_to_load
    close_command_window
    fadeout_all
    SceneManager.call(Scene_Load)
  end
end
class Window_GameEnd < Window_Command
  alias mcl_zabing make_command_list
  def make_command_list
    mcl_zabing
    add_command("读取档案",      :to_load)
  end
end




是这个脚本把存档替换了,麻烦版主帮看看。
作者: r403736524    时间: 2014-8-19 14:05
joker21 发表于 2014-8-19 13:56
#==============================================================================
# ■ Game_Interpre ...

如果你知道怎么调用"技能强化",或者不需要调用这个窗口的话可以用这个脚本
自定义菜单




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1