设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3655|回复: 4
打印 上一主题 下一主题

[已经过期] VA技能强化脚本的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
143
在线时间
347 小时
注册时间
2010-7-7
帖子
128
跳转到指定楼层
1
发表于 2012-8-30 09:26:08 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
使用了技能强化脚本,发现“属性”这一项有点问题。很多技能的属性都是错误的,比如“强击”的属性不是“暗属性”,这个怎么更改?

  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, 5]],
  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.   
  56.    

  57. #使用19号道具作为默认升级条件
  58. #升级 回复Ⅱ 需要18号道具1个
  59.    #升级 巨人的痛击
  60.   #需要17号道具1个、62号武器1个、61号防具1个
  61.   }
  62.   #———————————————————————————————————————
  63.   #·升级条件-变量【变量消耗( a -= b)】
  64.   #  技能ID => [["显示文字", "变量连接(a)", 消耗数值(b)],[],[]…更多条件…]
  65.   #  例:1 => [["脚本变量测试","$变量",10], [……]]
  66.   IF_VAR = {
  67.   0 => [["QP点","$game_variables[100]",5]], #使用游戏1号变量作为默认升级条件
  68.   # 恢复技能条件
  69.   
  70.   
  71.   }
  72.   #———————————————————————————————————————
  73.   #·升级条件-开关【开关判断( a == true )】
  74.   #  技能ID => [["显示文字", "开关连接(a)"],[],[]…更多条件…]
  75.   #  例:1 => [["脚本开关测试","$开关"], [……]]
  76.   IF_SWI = {
  77.   0 => [],   #默认升级开关条件
  78.   
  79.   }
  80.   #———————————————————————————————————————
  81.   #·升级条件-比较【比较相等( a == b )】
  82.   #  技能ID => [["显示文字", "比较连接1(a)", "比较连接2(b)"],[],[]…更多条件…]
  83.   #  例:1 => [["脚本比较测试","$比较1","$比较2"], [……]]
  84.   IF_COM = {
  85.   0 => [],   #默认升级对比条件
  86.   }
  87. #—————————————————————————————————————————
  88.   #·积极、消极值槽颜色
  89.   POS_COLOR1 = Color.new(214,233,83,255)
  90.   POS_COLOR2 = Color.new(255,255,255,255)
  91.   NEG_COLOR1 = Color.new(253,80,128,255)
  92.   NEG_COLOR2 = Color.new(255,255,255,255)
  93. #—————————————————————————————————————————
  94.   #·输出评分最大值
  95.   PFX = 9999
  96. #—————————————————————————————————————————
  97.   #·图标存放文件夹
  98.   FILE = "Graphics/Icon/"
  99. #—————————————————————————————————————————
  100.   #·效果范围显示文字
  101.   SCOPE = ["无",
  102.   "单个敌人","全体敌人",
  103.   "一个随机敌人","二个随机敌人","三个随机敌人","四个随机敌人",
  104.   "单个队友","全体队友",
  105.   "单个队友(无法战斗)","全体队友(无法战斗)",
  106.   "使用者"]
  107.   #·使用场合显示文字
  108.   OCCASION = ["随时可用","战斗可用","菜单可用","不可用"]
  109.   #·命中类型显示文字
  110.   HIT_TYPE = ["必定命中","物理攻击","魔法攻击"]
  111.   #·输出类型显示文字
  112.   DAMAGE_TYPE = ["无输出","HP伤害","MP伤害","HP恢复","MP恢复","HP吸收","MP吸收"]
  113. #—————————————————————————————————————————
  114. end

  115. #==============================================================================
  116. # ■ SUP_Window_Command
  117. #------------------------------------------------------------------------------
  118. #  技能分类窗口
  119. #==============================================================================

  120. class SUP_Window_Command < Window_Command
  121.   #--------------------------------------------------------------------------
  122.   # ● 定义实例变量
  123.   #--------------------------------------------------------------------------
  124.   attr_reader   :skill_window
  125.   #--------------------------------------------------------------------------
  126.   # ● 初始化对象
  127.   #--------------------------------------------------------------------------
  128.   def initialize(x, y)
  129.     super(x, y)
  130.     @actor = nil
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 获取窗口的宽度
  134.   #--------------------------------------------------------------------------
  135.   def window_width
  136.     return 200
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 设置角色
  140.   #--------------------------------------------------------------------------
  141.   def actor=(actor)
  142.     return if @actor == actor
  143.     @actor = actor
  144.     refresh
  145.     select_last
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 获取显示行数
  149.   #--------------------------------------------------------------------------
  150.   def visible_line_number
  151.     return 4
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # ● 生成指令列表
  155.   #--------------------------------------------------------------------------
  156.   def make_command_list
  157.     return unless @actor
  158.     @actor.added_skill_types.sort.each do |stype_id|
  159.       name = $data_system.skill_types[stype_id]
  160.       add_command(name, :skill, true, stype_id)
  161.     end
  162.   end
  163.   #--------------------------------------------------------------------------
  164.   # ● 更新画面
  165.   #--------------------------------------------------------------------------
  166.   def update
  167.     super
  168.     @skill_window.stype_id = current_ext if @skill_window
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● 设置技能窗口
  172.   #--------------------------------------------------------------------------
  173.   def skill_window=(skill_window)
  174.     @skill_window = skill_window
  175.     update
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● 返回上一个选择的位置
  179.   #--------------------------------------------------------------------------
  180.   def select_last
  181.     skill = @actor.last_skill.object
  182.     if skill
  183.       select_ext(skill.stype_id)
  184.     else
  185.       select(0)
  186.     end
  187.   end
  188. end

  189. #==============================================================================
  190. # ■ SUP_Window_Index
  191. #------------------------------------------------------------------------------
  192. #  技能列表窗口。
  193. #==============================================================================

  194. class SUP_Window_Index < Window_Selectable
  195.   #--------------------------------------------------------------------------
  196.   # ● 初始化对象
  197.   #--------------------------------------------------------------------------
  198.   def initialize(x, y, width, height)
  199.     super
  200.     @actor = nil
  201.     @stype_id = 0
  202.     @data = []
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● 设置角色
  206.   #--------------------------------------------------------------------------
  207.   def actor=(actor)
  208.     return if @actor == actor
  209.     @actor = actor
  210.     refresh
  211.     self.oy = 0
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ● 设置技能类型 ID
  215.   #--------------------------------------------------------------------------
  216.   def stype_id=(stype_id)
  217.     return if @stype_id == stype_id
  218.     @stype_id = stype_id
  219.     refresh
  220.     self.oy = 0
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # ● 获取列数
  224.   #--------------------------------------------------------------------------
  225.   def col_max
  226.     return 1
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● 获取项目数
  230.   #--------------------------------------------------------------------------
  231.   def item_max
  232.     @data ? @data.size : 1
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # ● 获取技能
  236.   #--------------------------------------------------------------------------
  237.   def item
  238.     @data && index >= 0 ? @data[index] : nil
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● 获取选择项目的有效状态
  242.   #--------------------------------------------------------------------------
  243.   def current_item_enabled?
  244.     enable?(@data[index])
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 查询列表中是否含有此技能
  248.   #--------------------------------------------------------------------------
  249.   def include?(item)
  250.     item && item.stype_id == @stype_id
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● 查询此技能是否可用
  254.   #--------------------------------------------------------------------------
  255.   def enable?(item)
  256.     item && SUP::UP.has_key?(item.id)
  257.   end
  258.   #--------------------------------------------------------------------------
  259.   # ● 生成技能列表
  260.   #--------------------------------------------------------------------------
  261.   def make_item_list
  262.     @data = @actor ? @actor.skills.select {|skill| include?(skill) } : []
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 返回上一个选择的位置
  266.   #--------------------------------------------------------------------------
  267.   def select_last
  268.     select(@data.index(@actor.last_skill.object) || 0)
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● 绘制项目
  272.   #--------------------------------------------------------------------------
  273.   def draw_item(index)
  274.     skill = @data[index]
  275.     if skill
  276.       rect = item_rect(index)
  277.       rect.width -= 4
  278.       draw_item_name(skill, rect.x, rect.y, enable?(skill))
  279.     end
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● 更新帮助内容
  283.   #--------------------------------------------------------------------------
  284.   def update_help
  285.     @help_window.set_item(item)
  286.   end
  287.   #--------------------------------------------------------------------------
  288.   # ● 刷新
  289.   #--------------------------------------------------------------------------
  290.   def refresh
  291.     make_item_list
  292.     create_contents
  293.     draw_all_items
  294.   end
  295. end

  296. #==============================================================================
  297. # ■ SUP_Window_Info
  298. #------------------------------------------------------------------------------
  299. #  技能信息窗口
  300. #==============================================================================

  301. class SUP_Window_Info < Window_Base
  302.   #--------------------------------------------------------------------------
  303.   # ● 初始化对象
  304.   #--------------------------------------------------------------------------
  305.   def initialize(x, y,w,h)
  306.     super(x, y, w, h)
  307.     @w = w ; @h = h
  308.     @yema = 1
  309.     @actor = nil
  310.     @skill = nil
  311.     @font_size = 20
  312.     @help_fill_color1 = Color.new(255,255,255,255)
  313.     @help_fill_color2 = Color.new(255,255,255,0)
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # ● 设置角色
  317.   #--------------------------------------------------------------------------
  318.   def actor=(val)
  319.     @actor = val
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   # ● 取得技能
  323.   #--------------------------------------------------------------------------
  324.   def skill
  325.     @skill
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ● 设置技能
  329.   #--------------------------------------------------------------------------
  330.   def skill=(val)
  331.     @skill = val
  332.     huanye(@yema)
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 技能是否可升级
  336.   #--------------------------------------------------------------------------
  337.   def skill_up?
  338.     SUP::UP.has_key?(@skill.id)
  339.   end
  340.   #--------------------------------------------------------------------------
  341.   # ● 获得行高
  342.   #--------------------------------------------------------------------------
  343.   def line_height
  344.     @font_size
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● 获得页码
  348.   #--------------------------------------------------------------------------
  349.   def yema
  350.     @yema
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● 换页
  354.   #--------------------------------------------------------------------------
  355.   def huanye(y)
  356.     @yema = y
  357.     case @yema
  358.     when 1
  359.     @draw = method(:draw1)
  360.     @help_txt = ["技能状态信息", "升级技能状态信息", "A键换页(1/2)"]
  361.     when 2
  362.     @draw = method(:draw2)
  363.     @help_txt = ["技能数值信息", "升级技能数值信息", "A键换页(2/2)"]
  364.     end
  365.     refresh
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # ● 刷新
  369.   #--------------------------------------------------------------------------
  370.   def refresh
  371.     contents.clear
  372.     return if !@skill
  373.     #描绘帮助信息
  374.     contents.font.size = 16
  375.     help
  376.     #描绘技能信息
  377.     contents.font.size = line_height
  378.     #描绘选中的技能
  379.     @draw.call(@skill, 0, line_height)
  380.     #描绘升级后的技能
  381.     if skill_up?
  382.       @draw.call($data_skills[SUP::UP[@skill.id]], 0, line_height * 9)
  383.     else
  384.       draw_text(70, line_height * 9 + 65, 280, line_height,
  385.     "技能已经无法升级。")
  386.     end
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # ● 描绘帮助条
  390.   #--------------------------------------------------------------------------
  391.   def help
  392.     #第一条
  393.     contents.gradient_fill_rect(0, 0, @w, line_height,
  394.     @help_fill_color1, @help_fill_color2)
  395.     draw_text(2, 0, 280, line_height, @help_txt[0])
  396.     #第二条
  397.     contents.gradient_fill_rect(0, line_height * 8, @w, line_height,
  398.     @help_fill_color1, @help_fill_color2)
  399.     draw_text(2, line_height * 8, 280, line_height, @help_txt[1])
  400.     #换页
  401.     draw_text(225, 0, 280, line_height, @help_txt[2])
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 描绘页1
  405.   #--------------------------------------------------------------------------
  406.   def draw1(skill,x,y)
  407.     #名称---------------------------------------------
  408.     draw_item_name(skill, x, y)
  409.     #属性---------------------------------------------
  410.     sx = $data_system.elements[skill.damage.element_id]
  411.     sx = sx=="" ? "无" : sx
  412.     draw_text(x, y + line_height, 280, line_height,
  413.     "属性:"+sx)
  414.     #使用场合-----------------------------------------
  415.     draw_text(x, y + line_height * 2, 280, line_height,
  416.     "使用场合:"+SUP::OCCASION[skill.occasion ])
  417.     #使用范围-----------------------------------------
  418.     draw_text(x, y + line_height * 3, 280, line_height,
  419.     "使用范围:"+SUP::SCOPE[skill.scope])
  420.     #命中类型-----------------------------------------
  421.     draw_text(x, y + line_height * 4, 280, line_height,
  422.     "命中类型:"+SUP::HIT_TYPE[skill.hit_type])
  423.     #输出类型-----------------------------------------
  424.     draw_text(x, y + line_height * 5, 280, line_height,
  425.     "输出类型:"+SUP::DAMAGE_TYPE[skill.damage.type])
  426.     #武器限制-----------------------------------------
  427.     w1 = $data_system.weapon_types[skill.required_wtype_id1]
  428.     w2 = $data_system.weapon_types[skill.required_wtype_id2]
  429.     w = "无武器限制" ; if w1 !="";w=w1;end ; if w2 != "";w+="与"+w2;end
  430.     draw_text(x, y + line_height * 6, 280, line_height,
  431.     "武器限制:"+w)
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # ● 描绘页2
  435.   #--------------------------------------------------------------------------
  436.   def draw2(skill,x,y)
  437.     #名称---------------------------------------------
  438.     draw_item_name(skill, x, y)
  439.     #魔力值消耗---------------------------------------
  440.     draw_text(x, y + line_height, 280, line_height,
  441.     "魔力值消耗:")
  442.     w = 200 ; h = 15
  443.     b = skill.mp_cost.to_f / 9999
  444.     c1 = Color.new(128,155,122,255)
  445.     c2 = Color.new(25,55,155,255)
  446.     flii(x+120, y + line_height + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  447.     draw_current_and_max_values(x+40, y + line_height, 280, skill.mp_cost, 9999,
  448.     text_color(0), text_color(0))
  449.     #特技值消耗---------------------------------------
  450.     draw_text(x, y + line_height * 2, 280, line_height,
  451.     "特技值消耗:")
  452.     w = 200 ; h = 15
  453.     b = skill.tp_cost.to_f / 100
  454.     flii(x+120, y + line_height * 2 + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  455.     draw_current_and_max_values(x+40, y + line_height * 2, 280, skill.tp_cost, 100,
  456.     text_color(0), text_color(0))
  457.     #特技值获得---------------------------------------
  458.     draw_text(x, y + line_height * 3, 280, line_height,
  459.     "特技值获得:")
  460.     w = 200 ; h = 15
  461.     b = skill.tp_gain.to_f / 100
  462.     flii(x+120, y + line_height * 3 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  463.     draw_current_and_max_values(x+40, y + line_height * 3, 280, skill.tp_gain, 100,
  464.     text_color(0), text_color(0))
  465.     #攻击次数-----------------------------------------
  466.     draw_text(x, y + line_height * 4, 280, line_height,
  467.     "攻击次数:")
  468.     w = 200 ; h = 15
  469.     b = skill.repeats.to_f / 9
  470.     flii(x+120, y + line_height * 4 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  471.     draw_current_and_max_values(x+40, y + line_height * 4, 280, skill.repeats, 9,
  472.     text_color(0), text_color(0))
  473.     #成功几率-----------------------------------------
  474.     draw_text(x, y + line_height * 5, 280, line_height,
  475.     "成功几率:")
  476.     w = 200 ; h = 15
  477.     b = skill.success_rate.to_f / 100
  478.     flii(x+120, y + line_height * 5 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  479.     draw_current_and_max_values(x+40, y + line_height * 5, 280, skill.success_rate, 100,
  480.     text_color(0), text_color(0))
  481.     #输出评分-----------------------------------------
  482.     draw_text(x, y + line_height * 6, 280, line_height,
  483.     "输出评分:")
  484.     pf = scpf(skill)
  485.     w = 200 ; h = 15
  486.     b = [pf.to_f / SUP::PFX, 1.0].min
  487.     type = skill.damage.type
  488.     case type
  489.     when 0
  490.       draw_text(x+150, y + line_height * 6, 280, line_height,
  491.     "此技能没有输出。")
  492.     when 1, 2, 5, 6
  493.       flii(x+120, y + line_height * 6 + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  494.       draw_current_and_max_values(x+40, y + line_height * 6, 280, pf, SUP::PFX,
  495.       text_color(0), text_color(0))
  496.     when 3, 4
  497.       flii(x+120, y + line_height * 6 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  498.       draw_current_and_max_values(x+40, y + line_height * 6, 280, pf, SUP::PFX,
  499.       text_color(0), text_color(0))
  500.     end
  501.   end
  502.   #--------------------------------------------------------------------------
  503.   # ● 描绘值槽
  504.   #--------------------------------------------------------------------------
  505.   def flii(x, y, w, h, b, color1, color2)
  506.     contents.fill_rect(x, y, w, h, Color.new(0,0,0,64))
  507.     contents.gradient_fill_rect(x, y, w*b, h, color1, color2)
  508.   end
  509.   #--------------------------------------------------------------------------
  510.   # ● 获得评分
  511.   #--------------------------------------------------------------------------
  512.   def scpf(skill)
  513.     g = skill.damage.formula.to_s
  514.     a = @actor
  515.     v = $game_variables
  516.     g.gsub!(/b/,"a")
  517.     return eval(g)
  518.   end
  519. end

  520. #==============================================================================
  521. # ■ SUP_Window_Choice
  522. #------------------------------------------------------------------------------
  523. #  技能升级条件及确认窗口
  524. #==============================================================================

  525. class SUP_Window_Choice < Window_Command
  526.   #--------------------------------------------------------------------------
  527.   # ● 初始化对象
  528.   #--------------------------------------------------------------------------
  529.   def initialize(x, y)
  530.     @hx = -1
  531.     super(x, y)
  532.     @skill = nil
  533.     @actor = nil
  534.     @enabled = []
  535.     @txt = []
  536.     @ite = []
  537.     @pic = []
  538.     @xh = []
  539.   end
  540.   #--------------------------------------------------------------------------
  541.   # ● 设置角色
  542.   #--------------------------------------------------------------------------
  543.   def actor=(val)
  544.     @actor = val
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # ● 取得技能
  548.   #--------------------------------------------------------------------------
  549.   def skill
  550.     @skill
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # ● 设置技能
  554.   #--------------------------------------------------------------------------
  555.   def skill=(val)
  556.     @skill = val
  557.     refresh_draw
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● 取得全部指定条件
  561.   #--------------------------------------------------------------------------
  562.   def all_if(skill_id)
  563.     arr = Array.new
  564.     arr << SUP::IF_ITE[skill_id]
  565.     arr << SUP::IF_VAR[skill_id]
  566.     arr << SUP::IF_SWI[skill_id]
  567.     arr << SUP::IF_COM[skill_id]
  568.   end
  569.   #--------------------------------------------------------------------------
  570.   # ● 获取全部条件有效状态
  571.   #--------------------------------------------------------------------------
  572.   def all_enabled?
  573.     [email protected]?(false)
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ● 获取物品、变量条件有效状态
  577.   #--------------------------------------------------------------------------
  578.   def ite_var_enabled?(y, s)
  579.     return false if not y
  580.     y >= s
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # ● 获取开关条件有效状态
  584.   #--------------------------------------------------------------------------
  585.   def swi_enabled?(y)
  586.     y
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # ● 获取对比条件有效状态
  590.   #--------------------------------------------------------------------------
  591.   def com_enabled?(y1, y2)
  592.     y1 == y2
  593.   end
  594.   #--------------------------------------------------------------------------
  595.   # ● 技能升级条件数据
  596.   #--------------------------------------------------------------------------
  597.   def skill_data
  598.     return if !@skill
  599.     @hx = -1 ; @enabled = [] ; @txt = [] ; @pic = [] ; @pid = [] ; @xh = []
  600.     l = all_if(@skill.id) ; n = l.compact
  601.     t = n == [] ? all_if(0) : l
  602.     t1 = t[0] ; t2 = t[1] ; t3 = t[2] ; t4 = t[3]
  603.     if t1
  604.       ite_data(t1)
  605.     end
  606.     if t2
  607.       var_data(t2)
  608.     end
  609.     if t3
  610.       swi_data(t3)
  611.     end
  612.     if t4
  613.       com_data(t4)
  614.     end
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● 技能条件进行描绘
  618.   #--------------------------------------------------------------------------
  619.   def skill_draw
  620.     @txt.each_with_index {|txt,i|
  621.     change_color(normal_color, @enabled[i])
  622.     pic = @pic[i]
  623.     if pic.is_a?(Symbol)
  624.       wx = window_width / 2 - text_size(txt).width / 2 - 24
  625.       if pic == :ite
  626.         draw_item_icon(@ite[i], wx, item_height * i)
  627.       else
  628.         draw_bit(pic.to_s, wx, item_height * i)
  629.       end
  630.     end
  631.     draw_text(0, item_height * i, window_width, item_height, txt, 1)
  632.     }
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ● 绘制物品图标
  636.   #--------------------------------------------------------------------------
  637.   def draw_item_icon(item, x, y)
  638.     draw_icon(item.icon_index, x, y)
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # ● 绘制图片
  642.   #--------------------------------------------------------------------------
  643.   def draw_bit(name, x, y)
  644.     bitmap = Bitmap.new(SUP::FILE + name)
  645.     rect = Rect.new(0, 0, 24, 24)
  646.     contents.blt(x, y, bitmap, rect)
  647.   end
  648.   #--------------------------------------------------------------------------
  649.   # ● 对技能进行升级(变量、物品消耗)
  650.   #--------------------------------------------------------------------------
  651.   def skill_up
  652.     @actor.forget_skill(@skill.id)
  653.     @actor.learn_skill(SUP::UP[@skill.id])
  654.     @xh.each_with_index {|x, i|
  655.     if x.is_a?(String)
  656.       eval(x)
  657.     else
  658.       $game_party.gain_item(@ite[i], -x)
  659.     end}
  660.   end
  661.   #--------------------------------------------------------------------------
  662.   # ● 物品条件 数据
  663.   #--------------------------------------------------------------------------
  664.   def ite_data(si)
  665.     si.each {|i|
  666.     @hx += 1 ; t = i[0] ; b = i[1] ; s = i[2]
  667.     case t
  668.     when :items
  669.       item = $data_items[b]
  670.     when :weapons
  671.       item = $data_weapons[b]
  672.     when :armors
  673.       item = $data_armors[b]
  674.     end
  675.     y = $game_party.item_number(item)
  676.     enabled = ite_var_enabled?(y, s)
  677.     @enabled[@hx] = enabled
  678.     @txt[@hx] = item.name+"*"+ s.to_s
  679.     @ite[@hx] = item
  680.     @pic[@hx] = :ite
  681.     @xh[@hx] = s
  682.     }
  683.   end
  684.   #--------------------------------------------------------------------------
  685.   # ● 变量条件 数据
  686.   #--------------------------------------------------------------------------
  687.   def var_data(si)
  688.     si.each {|i|
  689.     @hx += 1 ; n = i[0] ; y = eval(i[1]) ; s = i[2]
  690.     enabled = ite_var_enabled?(y, s)
  691.     @enabled[@hx] = enabled
  692.     @txt[@hx] = n+"*"+ s.to_s
  693.     @pic[@hx] = i[-1]
  694.     @xh[@hx] = "#{i[1]} -= #{s.to_s}"
  695.     }
  696.   end
  697.   #--------------------------------------------------------------------------
  698.   # ● 开关条件 数据
  699.   #--------------------------------------------------------------------------
  700.   def swi_data(si)
  701.     si.each {|i|
  702.     @hx += 1 ; n = i[0] ; y = eval(i[1])
  703.     enabled = swi_enabled?(y)
  704.     @enabled[@hx] = enabled
  705.     @txt[@hx] = n
  706.     @pic[@hx] = i[-1]
  707.     }
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● 对比条件 数据
  711.   #--------------------------------------------------------------------------
  712.   def com_data(si)
  713.     si.each {|i|
  714.     @hx += 1 ; n = i[0] ; y1 = eval(i[1]) ; y2 = eval(i[2])
  715.     enabled = com_enabled?(y1,y2)
  716.     @enabled[@hx] = enabled
  717.     @txt[@hx] = n
  718.     @pic[@hx] = i[-1]
  719.     }
  720.   end
  721.   #--------------------------------------------------------------------------
  722.   # ● 获取窗口的宽度
  723.   #--------------------------------------------------------------------------
  724.   def window_width
  725.     return 300
  726.   end
  727.   #--------------------------------------------------------------------------
  728.   # ● 获取项目的高度
  729.   #--------------------------------------------------------------------------
  730.   def item_height
  731.     return 28
  732.   end
  733.   #--------------------------------------------------------------------------
  734.   # ● 获取对齐方向
  735.   #--------------------------------------------------------------------------
  736.   def alignment
  737.     return 1
  738.   end
  739.   #--------------------------------------------------------------------------
  740.   # ● 获取项目的绘制矩形
  741.   #--------------------------------------------------------------------------
  742.   alias x_item_rect item_rect
  743.   def item_rect(index)
  744.     rect = x_item_rect(index)
  745.     rect.y = rect.y + item_height * (@hx+1)
  746.     rect
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # ● 刷新(清除内容)
  750.   #--------------------------------------------------------------------------
  751.   def refresh
  752.     contents.clear
  753.   end
  754.   #--------------------------------------------------------------------------
  755.   # ● 刷新(取得数据、刷新窗口)
  756.   #--------------------------------------------------------------------------
  757.   def refresh2
  758.     skill_data
  759.     self.height = item_height * (@hx+3)
  760.     self.x = Graphics.width / 2 - window_width / 2
  761.     self.y = Graphics.height / 2 - self.height / 2
  762.     create_contents
  763.   end
  764.   #--------------------------------------------------------------------------
  765.   # ● 刷新(要描绘的内容)
  766.   #--------------------------------------------------------------------------
  767.   def refresh_draw
  768.     refresh
  769.     refresh2
  770.     skill_draw
  771.     clear_command_list
  772.     add_command("确认",   :ok, all_enabled?)
  773.     draw_all_items
  774.   end
  775. end

  776. #==============================================================================
  777. # ■ Scene_SUP
  778. #------------------------------------------------------------------------------
  779. #  技能升级画面
  780. #==============================================================================

  781. class Scene_SUP < Scene_MenuBase
  782.   #--------------------------------------------------------------------------
  783.   # ● 开始处理
  784.   #--------------------------------------------------------------------------
  785.   def start
  786.     super
  787.     create_help_window
  788.     suv_window_command
  789.     suv_window_info
  790.     suv_window_index
  791.     suv_window_choice
  792.   end
  793.   #--------------------------------------------------------------------------
  794.   # ● 帧更新
  795.   #--------------------------------------------------------------------------
  796.   def update
  797.     super
  798.     if Input.trigger?(:X)
  799.       case @suv_window_info.yema
  800.       when 1
  801.         @suv_window_info.huanye(2)
  802.       when 2
  803.         @suv_window_info.huanye(1)
  804.       end
  805.     end
  806.     if @suv_window_info.skill != @suv_window_index.item
  807.       @suv_window_info.skill = @suv_window_index.item
  808.     end
  809.   end
  810.   #--------------------------------------------------------------------------
  811.   # ● 生成确认窗口
  812.   #--------------------------------------------------------------------------
  813.   def suv_window_choice
  814.     @suv_window_choice = SUP_Window_Choice.new(0, 0)
  815.     @suv_window_choice.viewport = @viewport
  816.     @suv_window_choice.set_handler(:ok,    method(:confirm_ok))
  817.     @suv_window_choice.set_handler(:cancel,   method(:confirm_cancel))
  818.     @suv_window_choice.hide.deactivate
  819.     @suv_window_choice.actor = @actor
  820.   end
  821.   #--------------------------------------------------------------------------
  822.   # ● 生成分类窗口
  823.   #--------------------------------------------------------------------------
  824.   def suv_window_command
  825.     wy = @help_window.height
  826.     @suv_window_command = SUP_Window_Command.new(0, wy)
  827.     @suv_window_command.viewport = @viewport
  828.     @suv_window_command.help_window = @help_window
  829.     @suv_window_command.actor = @actor
  830.     @suv_window_command.set_handler(:skill,    method(:command_skill))
  831.     @suv_window_command.set_handler(:cancel,   method(:return_scene))
  832.     @suv_window_command.set_handler(:pagedown, method(:next_actor))
  833.     @suv_window_command.set_handler(:pageup,   method(:prev_actor))
  834.   end
  835.   #--------------------------------------------------------------------------
  836.   # ● 生成状态窗口
  837.   #--------------------------------------------------------------------------
  838.   def suv_window_info
  839.     y = @help_window.height
  840.     w = Graphics.width - @suv_window_command.width
  841.     h = Graphics.height - @help_window.height
  842.     @suv_window_info = SUP_Window_Info.new(@suv_window_command.width, y, w, h)
  843.     @suv_window_info.viewport = @viewport
  844.     @suv_window_info.actor = @actor
  845.   end
  846.   #--------------------------------------------------------------------------
  847.   # ● 生成列表窗口
  848.   #--------------------------------------------------------------------------
  849.   def suv_window_index
  850.     wx = 0
  851.     wy = @suv_window_command.y + @suv_window_command.height
  852.     ww = Graphics.width - @suv_window_info.width
  853.     wh = Graphics.height - wy
  854.     @suv_window_index = SUP_Window_Index.new(wx, wy, ww, wh)
  855.     @suv_window_index.actor = @actor
  856.     @suv_window_index.viewport = @viewport
  857.     @suv_window_index.help_window = @help_window
  858.     @suv_window_index.set_handler(:ok,     method(:on_item_ok))
  859.     @suv_window_index.set_handler(:cancel, method(:on_item_cancel))
  860.     @suv_window_command.skill_window = @suv_window_index
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # ● 技能分类里“确定”
  864.   #--------------------------------------------------------------------------
  865.   def command_skill
  866.     @suv_window_index.activate
  867.     @suv_window_index.select_last
  868.   end
  869.   #--------------------------------------------------------------------------
  870.   # ● 技能列表里“确定”
  871.   #--------------------------------------------------------------------------
  872.   def on_item_ok
  873.     skill = @suv_window_index.item
  874.     @suv_window_choice.skill = skill
  875.     @suv_window_choice.show.activate
  876.   end
  877.   #--------------------------------------------------------------------------
  878.   # ● 技能列表里“返回”
  879.   #--------------------------------------------------------------------------
  880.   def on_item_cancel
  881.     @suv_window_index.unselect
  882.     @suv_window_command.activate
  883.   end
  884.   #--------------------------------------------------------------------------
  885.   # ● 确认列表里“确认”
  886.   #--------------------------------------------------------------------------
  887.   def confirm_ok
  888.     @suv_window_choice.skill_up
  889.     @suv_window_index.refresh
  890.     @suv_window_choice.hide.deactivate
  891.     @suv_window_index.activate
  892.   end
  893.   #--------------------------------------------------------------------------
  894.   # ● 确认列表里“返回”
  895.   #--------------------------------------------------------------------------
  896.   def confirm_cancel
  897.     @suv_window_choice.hide.deactivate
  898.     @suv_window_index.activate
  899.   end
  900.   #--------------------------------------------------------------------------
  901.   # ● 切换角色
  902.   #--------------------------------------------------------------------------
  903.   def on_actor_change
  904.     @suv_window_command.actor = @actor
  905.     @suv_window_info.actor = @actor
  906.     @suv_window_index.actor = @actor
  907.     @suv_window_choice.actor = @actor
  908.     @suv_window_command.activate
  909.   end
  910. end




复制代码

Lv1.梦旅人

Mr.Gandum

梦石
0
星屑
226
在线时间
2070 小时
注册时间
2007-1-31
帖子
3039

贵宾

2
发表于 2012-8-30 10:33:45 | 只看该作者
你换个武器试试。
属性里面的物理攻击,指的是你用普通攻击进行攻击的时候的属性。就是你武器·防具·职业·角色·状态里面的特征里有的一项“攻击时树形“里设置的。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
143
在线时间
347 小时
注册时间
2010-7-7
帖子
128
3
 楼主| 发表于 2012-8-30 10:42:58 | 只看该作者
feizhaodan 发表于 2012-8-30 10:33
你换个武器试试。
属性里面的物理攻击,指的是你用普通攻击进行攻击的时候的属性。就是你武器·防具·职业 ...

额,换了别的攻击属性的武器,还是没有变化...
回复 支持 反对

使用道具 举报

Lv1.梦旅人

Mr.Gandum

梦石
0
星屑
226
在线时间
2070 小时
注册时间
2007-1-31
帖子
3039

贵宾

4
发表于 2012-8-30 10:48:03 | 只看该作者
了解了。这是这个系统的BUG。
请找原作者说明一下:当技能的攻击属性设置为物理攻击时,将会显示为属性列表中最后一个属性。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
143
在线时间
347 小时
注册时间
2010-7-7
帖子
128
5
 楼主| 发表于 2012-8-30 10:52:37 | 只看该作者
feizhaodan 发表于 2012-8-30 10:48
了解了。这是这个系统的BUG。
请找原作者说明一下:当技能的攻击属性设置为物理攻击时,将会显示为属性列表 ...

{:2_251:}哦哦 原来是这么回事...
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-17 22:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表