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

Project1

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

[已经解决] 如何去除状态栏里的基本数值?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2009-10-4
帖子
45
跳转到指定楼层
1
发表于 2012-6-16 17:20:43 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 zdb123 于 2012-6-16 18:02 编辑

  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————
  4. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  5. #
  6. #                                防具类追加
  7. #
  8. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  9. module RPG
  10.   class Weapon
  11.     def name
  12.       name = @name.split(/,/)[0]
  13.       return name != nil ? name : ''
  14.     end
  15.     def pic_name
  16.       pic_name = @name.split(/,/)[1]
  17.       return pic_name != nil ? pic_name : ""
  18.     end
  19.   end
  20.   class Armor
  21.     def name
  22.       name = @name.split(/,/)[0]
  23.       return name != nil ? name : ''
  24.     end
  25.     def pic_name
  26.       pic_name = @name.split(/,/)[1]
  27.       return pic_name != nil ? pic_name : ""
  28.     end
  29.     def kind
  30.       kind  = @name.split(/,/)[2]
  31.       return kind  != nil ? kind.to_i : @kind
  32.     end
  33.   end
  34. end
  35. #module RPG
  36. #  class Armor
  37. #    def name
  38. #      name = @name.split(/,/)[0]
  39. #      return name != nil ? name : ''
  40. #    end
  41. #    def kind
  42. #      kind  = @name.split(/,/)[1]
  43. #      return kind  != nil ? kind.to_i : @kind
  44. #    end
  45. #  end
  46. #end
  47. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  48. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  49. #==============================================================================

  50. class Special_Element
  51.   #--------------------------------------------------------------------------
  52.   # ● 特殊な属性を定義する定数
  53.   #--------------------------------------------------------------------------
  54.   TWO_WEAPONS = "二刀流"

  55.   #--------------------------------------------------------------------------
  56.   # ● 特殊な属性をすべて取得
  57.   #--------------------------------------------------------------------------
  58.   def self.special_elements
  59.     # 特殊な属性をすべて列挙
  60.     elements = [
  61.       TWO_WEAPONS
  62.     ]
  63.     return elements
  64.   end

  65.   #--------------------------------------------------------------------------
  66.   # ● 属性名からその属性のIDを得る
  67.   #--------------------------------------------------------------------------
  68.   def self.get_index(name)
  69.     return $data_system.elements.index(name)
  70.   end
  71.   
  72.   #--------------------------------------------------------------------------
  73.   # ● 正規表現にマッチするすべての属性のIDとマッチ情報を得る
  74.   #     戻り値 : 二次元配列 [n][0]にID、[n][1]にマッチ情報(MatchData)
  75.   #--------------------------------------------------------------------------
  76.   def self.get_indices(regexp)
  77.     indices = []
  78.     for i in 1...$data_system.elements.size
  79.       indices.push([i, $~]) if regexp =~ $data_system.elements[i]
  80.     end
  81.   end
  82.   
  83.   #--------------------------------------------------------------------------
  84.   # ● 特殊な属性を取り除く
  85.   #     element_set     : 取り除く前の属性IDの配列
  86.   #     ignore_elements : 取り除きたい属性 ID?名前?正規表現で指定可能
  87.   #     戻り値          : 取り除いた結果の属性IDの配列
  88.   #--------------------------------------------------------------------------
  89.   def self.delete(element_set)
  90.     result = element_set.dup
  91.     for ignore in Special_Element::special_elements
  92.       case ignore
  93.       when Integer
  94.         result.delete(ignore)
  95.       when String
  96.         result.delete(Special_Element::get_index(ignore))
  97.       when Regexp
  98.         for i in result
  99.           result[i] = nil if ignore =~ $data_system.elements[result[i]]
  100.         end
  101.         result.delete(nil)
  102.       end
  103.     end
  104.     return result
  105.   end
  106. end





  107. class Game_Battler
  108.   #--------------------------------------------------------------------------
  109.   # ● 属性修正の計算
  110.   #     element_set : 属性
  111.   #--------------------------------------------------------------------------
  112.   def elements_correct(element_set)
  113.     # --- ここから変更部分 ---
  114.     element_set = Special_Element::delete(element_set)
  115.     # --- 変更部分終わり ---
  116.     # 無属性の場合
  117.     if element_set == []
  118.       # 100 を返す
  119.       return 100
  120.     end
  121.     # 与えられた属性の中で最も弱いものを返す
  122.     # ※メソッド element_rate は、このクラスから継承される Game_Actor
  123.     #   および Game_Enemy クラスで定義される
  124.     weakest = -100
  125.     for i in element_set
  126.       weakest = [weakest, self.element_rate(i)].max
  127.     end
  128.     return weakest
  129.   end
  130. end
  131. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  132. #
  133. #                  Game_Actor添加新的防具ID,并对相关方法修正
  134. #
  135. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  136. class Game_Actor < Game_Battler
  137.   # --- ここから追加部分 ---
  138.   attr_reader   :weapon2_id               # 二刀流武器 ID
  139.   # --- 追加部分終わり ---
  140.   attr_reader   :armor5_id                # 项链 ID
  141.   attr_reader   :armor6_id                # 鞋 ID
  142.   #--------------------------------------------------------------------------
  143.   # ● 设置
  144.   #     actor_id : 角色 ID
  145.   #--------------------------------------------------------------------------
  146.   alias old_setup setup
  147.   def setup(actor_id)
  148.     old_setup(actor_id)
  149.     # --- ここから追加部分 ---
  150.     @weapon2_id = 0
  151.     # --- 追加部分終わり ---
  152.     @armor5_id = 0
  153.     @armor6_id = 0
  154.     update_auto_state(nil, $data_armors[@armor5_id])
  155.     update_auto_state(nil, $data_armors[@armor6_id])
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● 取得属性修正值
  159.   #     element_id : 属性 ID
  160.   #--------------------------------------------------------------------------
  161.   def element_rate(element_id)
  162.     # 获取对应属性有效度的数值
  163.     table = [0,200,150,100,50,0,-100]
  164.     result = table[$data_classes[@class_id].element_ranks[element_id]]
  165.     # 防具能防御本属性的情况下效果减半
  166.     for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id, @armor5_id, @armor6_id]
  167.       armor = $data_armors[i]
  168.       if armor != nil and armor.guard_element_set.include?(element_id)
  169.         result /= 2
  170.       end
  171.     end
  172.     # 状态能防御本属性的情况下效果减半
  173.     for i in @states
  174.       if $data_states[i].guard_element_set.include?(element_id)
  175.         result /= 2
  176.       end
  177.     end
  178.     # 过程结束
  179.     return result
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # ● 判定防御属性
  183.   #     state_id : 属性 ID
  184.   #--------------------------------------------------------------------------
  185.   def state_guard?(state_id)
  186.     for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id, @armor5_id, @armor6_id]
  187.       armor = $data_armors[i]
  188.       if armor != nil
  189.         if armor.guard_state_set.include?(state_id)
  190.           return true
  191.         end
  192.       end
  193.     end
  194.     return false
  195.   end
  196.   #--------------------------------------------------------------------------
  197.   # ● 通常攻撃の属性取得
  198.   #--------------------------------------------------------------------------
  199.   def element_set
  200.     weapon = $data_weapons[@weapon_id]
  201.     # --- ここから変更部分 ---
  202.     weapon2 = $data_weapons[@weapon2_id]
  203.     result = []
  204.     result.concat(weapon.element_set) if weapon != nil
  205.     result.concat(weapon2.element_set) if weapon2 != nil
  206.     return result
  207.     # --- 変更部分終わり ---
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● 通常攻撃のステート変化 (+) 取得
  211.   #--------------------------------------------------------------------------
  212.   def plus_state_set
  213.     weapon = $data_weapons[@weapon_id]
  214.     # --- ここから変更部分 ---
  215.     weapon2 = $data_weapons[@weapon2_id]
  216.     result = []
  217.     result.concat(weapon.plus_state_set) if weapon != nil
  218.     result.concat(weapon2.plus_state_set) if weapon2 != nil
  219.     return result
  220.     # --- 変更部分終わり ---
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # ● 通常攻撃のステート変化 (-) 取得
  224.   #--------------------------------------------------------------------------
  225.   def minus_state_set
  226.     weapon = $data_weapons[@weapon_id]
  227.     # --- ここから変更部分 ---
  228.     weapon2 = $data_weapons[@weapon2_id]
  229.     result = []
  230.     result.concat(weapon.minus_state_set) if weapon != nil
  231.     result.concat(weapon2.minus_state_set) if weapon2 != nil
  232.     return result
  233.     # --- 変更部分終わり ---
  234.   end

  235.   # ● 获取基本力量
  236.   #--------------------------------------------------------------------------
  237.   def base_str
  238.     n = $data_actors[@actor_id].parameters[2, @level]
  239.     weapon = $data_weapons[@weapon_id]
  240.     armor1 = $data_armors[@armor1_id]
  241.     armor2 = $data_armors[@armor2_id]
  242.     armor3 = $data_armors[@armor3_id]
  243.     armor4 = $data_armors[@armor4_id]
  244.     armor5 = $data_armors[@armor5_id]
  245.     armor6 = $data_armors[@armor6_id]
  246.     # --- ここから追加部分 ---
  247.     weapon2 = $data_weapons[@weapon2_id]
  248.     # そのまま加算すると強すぎなので半分にしてみるテスト
  249.     n += weapon2 != nil ? weapon2.str_plus / 2 : 0
  250.     # --- 追加部分終わり ---
  251.     n += weapon != nil ? weapon.str_plus : 0
  252.     n += armor1 != nil ? armor1.str_plus : 0
  253.     n += armor2 != nil ? armor2.str_plus : 0
  254.     n += armor3 != nil ? armor3.str_plus : 0
  255.     n += armor4 != nil ? armor4.str_plus : 0
  256.     n += armor5 != nil ? armor5.str_plus : 0
  257.     n += armor6 != nil ? armor6.str_plus : 0
  258.     return [[n, 1].max, 999].min
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● 获取基本灵巧
  262.   #--------------------------------------------------------------------------
  263.   def base_dex
  264.     n = $data_actors[@actor_id].parameters[3, @level]
  265.     weapon = $data_weapons[@weapon_id]
  266.     armor1 = $data_armors[@armor1_id]
  267.     armor2 = $data_armors[@armor2_id]
  268.     armor3 = $data_armors[@armor3_id]
  269.     armor4 = $data_armors[@armor4_id]
  270.     armor5 = $data_armors[@armor5_id]
  271.     armor6 = $data_armors[@armor6_id]
  272.     # --- ここから追加部分 ---
  273.     weapon2 = $data_weapons[@weapon2_id]
  274.     # そのまま加算すると強すぎなので半分にしてみるテスト
  275.     n += weapon2 != nil ? weapon2.dex_plus / 2 : 0
  276.     # --- 追加部分終わり ---
  277.     n += weapon != nil ? weapon.dex_plus : 0
  278.     n += armor1 != nil ? armor1.dex_plus : 0
  279.     n += armor2 != nil ? armor2.dex_plus : 0
  280.     n += armor3 != nil ? armor3.dex_plus : 0
  281.     n += armor4 != nil ? armor4.dex_plus : 0
  282.     n += armor5 != nil ? armor5.dex_plus : 0
  283.     n += armor6 != nil ? armor6.dex_plus : 0
  284.     return [[n, 1].max, 999].min
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● 获取基本速度
  288.   #--------------------------------------------------------------------------
  289.   def base_agi
  290.     n = $data_actors[@actor_id].parameters[4, @level]
  291.     weapon = $data_weapons[@weapon_id]
  292.     armor1 = $data_armors[@armor1_id]
  293.     armor2 = $data_armors[@armor2_id]
  294.     armor3 = $data_armors[@armor3_id]
  295.     armor4 = $data_armors[@armor4_id]
  296.     armor5 = $data_armors[@armor5_id]
  297.     armor6 = $data_armors[@armor6_id]
  298.     # --- ここから追加部分 ---
  299.     weapon2 = $data_weapons[@weapon2_id]
  300.     # そのまま加算すると強すぎなので半分にしてみるテスト
  301.     n += weapon2 != nil ? weapon2.agi_plus / 2 : 0
  302.     # --- 追加部分終わり ---
  303.     n += weapon != nil ? weapon.agi_plus : 0
  304.     n += armor1 != nil ? armor1.agi_plus : 0
  305.     n += armor2 != nil ? armor2.agi_plus : 0
  306.     n += armor3 != nil ? armor3.agi_plus : 0
  307.     n += armor4 != nil ? armor4.agi_plus : 0
  308.     n += armor5 != nil ? armor5.agi_plus : 0
  309.     n += armor6 != nil ? armor6.agi_plus : 0
  310.     return [[n, 1].max, 999].min
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # ● 获取基本魔力
  314.   #--------------------------------------------------------------------------
  315.   def base_int
  316.     n = $data_actors[@actor_id].parameters[5, @level]
  317.     weapon = $data_weapons[@weapon_id]
  318.     armor1 = $data_armors[@armor1_id]
  319.     armor2 = $data_armors[@armor2_id]
  320.     armor3 = $data_armors[@armor3_id]
  321.     armor4 = $data_armors[@armor4_id]
  322.     armor5 = $data_armors[@armor5_id]
  323.     armor6 = $data_armors[@armor6_id]
  324.     # --- ここから追加部分 ---
  325.     weapon2 = $data_weapons[@weapon2_id]
  326.     # そのまま加算すると強すぎなので半分にしてみるテスト
  327.     n += weapon2 != nil ? weapon2.int_plus / 2 : 0
  328.     # --- 追加部分終わり ---
  329.     n += weapon != nil ? weapon.int_plus : 0
  330.     n += armor1 != nil ? armor1.int_plus : 0
  331.     n += armor2 != nil ? armor2.int_plus : 0
  332.     n += armor3 != nil ? armor3.int_plus : 0
  333.     n += armor4 != nil ? armor4.int_plus : 0
  334.     n += armor5 != nil ? armor5.int_plus : 0
  335.     n += armor6 != nil ? armor6.int_plus : 0
  336.     return [[n, 1].max, 999].min
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # ● 基本攻撃力の取得
  340.   #--------------------------------------------------------------------------
  341.   def base_atk
  342.     weapon = $data_weapons[@weapon_id]
  343.     # --- ここから変更部分 ---
  344.     weapon2 = $data_weapons[@weapon2_id]
  345.     # そのまま加算すると強すぎなので半分にしてみるテスト
  346.     n = weapon2 != nil ? weapon2.atk / 2 : 0
  347.     return weapon != nil ? weapon.atk + n : n
  348.     # --- 変更部分終わり ---
  349.   end

  350.   #--------------------------------------------------------------------------
  351.   # ● 获取基本物理防御
  352.   #--------------------------------------------------------------------------
  353.   def base_pdef
  354.     weapon = $data_weapons[@weapon_id]
  355.     armor1 = $data_armors[@armor1_id]
  356.     armor2 = $data_armors[@armor2_id]
  357.     armor3 = $data_armors[@armor3_id]
  358.     armor4 = $data_armors[@armor4_id]
  359.     armor5 = $data_armors[@armor5_id]
  360.     armor6 = $data_armors[@armor6_id]
  361.     pdef1 = weapon != nil ? weapon.pdef : 0
  362.     pdef2 = armor1 != nil ? armor1.pdef : 0
  363.     pdef3 = armor2 != nil ? armor2.pdef : 0
  364.     pdef4 = armor3 != nil ? armor3.pdef : 0
  365.     pdef5 = armor4 != nil ? armor4.pdef : 0
  366.     pdef6 = armor5 != nil ? armor5.pdef : 0
  367.     pdef7 = armor6 != nil ? armor6.pdef : 0
  368.     # --- ここから追加部分 ---
  369.     weapon2 = $data_weapons[@weapon2_id]
  370.     # そのまま加算すると強すぎなので半分にしてみるテスト
  371.     pdef1 += weapon2 != nil ? weapon2.pdef / 2 : 0
  372.     # --- 追加部分終わり ---
  373.     return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + pdef6 + pdef7
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 获取基本魔法防御
  377.   #--------------------------------------------------------------------------
  378.   def base_mdef
  379.     weapon = $data_weapons[@weapon_id]
  380.     armor1 = $data_armors[@armor1_id]
  381.     armor2 = $data_armors[@armor2_id]
  382.     armor3 = $data_armors[@armor3_id]
  383.     armor4 = $data_armors[@armor4_id]
  384.     armor5 = $data_armors[@armor5_id]
  385.     armor6 = $data_armors[@armor6_id]
  386.     mdef1 = weapon != nil ? weapon.mdef : 0
  387.     mdef2 = armor1 != nil ? armor1.mdef : 0
  388.     mdef3 = armor2 != nil ? armor2.mdef : 0
  389.     mdef4 = armor3 != nil ? armor3.mdef : 0
  390.     mdef5 = armor4 != nil ? armor4.mdef : 0
  391.     mdef6 = armor5 != nil ? armor5.mdef : 0
  392.     mdef7 = armor6 != nil ? armor6.mdef : 0
  393.     # --- ここから追加部分 ---
  394.     weapon2 = $data_weapons[@weapon2_id]
  395.     # そのまま加算すると強すぎなので半分にしてみるテスト
  396.     mdef1 += weapon2 != nil ? weapon2.mdef / 2 : 0
  397.     # --- 追加部分終わり ---
  398.     return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + mdef6 + mdef7
  399.   end
  400.   #--------------------------------------------------------------------------
  401.   # ● 获取基本回避修正
  402.   #--------------------------------------------------------------------------
  403.   def base_eva
  404.     armor1 = $data_armors[@armor1_id]
  405.     armor2 = $data_armors[@armor2_id]
  406.     armor3 = $data_armors[@armor3_id]
  407.     armor4 = $data_armors[@armor4_id]
  408.     armor5 = $data_armors[@armor5_id]
  409.     armor6 = $data_armors[@armor6_id]
  410.     eva1 = armor1 != nil ? armor1.eva : 0
  411.     eva2 = armor2 != nil ? armor2.eva : 0
  412.     eva3 = armor3 != nil ? armor3.eva : 0
  413.     eva4 = armor4 != nil ? armor4.eva : 0
  414.     eva5 = armor5 != nil ? armor5.eva : 0
  415.     eva6 = armor6 != nil ? armor6.eva : 0
  416.     return eva1 + eva2 + eva3 + eva4 + eva5 + eva6
  417.   end

  418.   #--------------------------------------------------------------------------
  419.   # ● 通常攻撃 攻撃側アニメーション ID の取得
  420.   #--------------------------------------------------------------------------
  421. #  def animation1_id
  422. #    weapon = $data_weapons[@weapon_id]
  423. #    # --- ここから変更部分 ---
  424. #    weapon2 = $data_weapons[@weapon2_id]
  425. #    animations = []
  426. #    animations.push(weapon.animation1_id) if weapon != nil
  427. #    animations.push(weapon2.animation1_id) if weapon2 != nil
  428. #    animations.delete(0)
  429. #    return animations.empty? ? 0 : animations
  430. #    # --- 変更部分終わり ---
  431. #  end
  432.   def animation1_id
  433.     if  can_two_weapons?#@active_battler.state_ranks[17] == 1
  434.       weapon = $data_weapons[@weapon_id]
  435.       # --- ここから変更部分 ---
  436.       weapon2 = $data_weapons[@weapon2_id]
  437.       animations = []
  438.       animations.push(weapon.animation1_id) if weapon != nil
  439.       animations.push(weapon2.animation1_id) if weapon2 != nil
  440.       animations.delete(0)
  441.       return animations.empty? ? 0 : animations
  442.       # --- 変更部分終わり ---
  443.     else
  444.       weapon = $data_weapons[@weapon_id]
  445.       return weapon != nil ? weapon.animation1_id : 0
  446.     end
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # ● 通常攻撃 対象側アニメーション ID の取得
  450.   #--------------------------------------------------------------------------
  451. #  def animation2_id
  452. #    weapon = $data_weapons[@weapon_id]
  453. #    # --- ここから変更部分 ---
  454. #    weapon2 = $data_weapons[@weapon2_id]
  455. #    animations = []
  456. #    animations.push(weapon.animation2_id) if weapon != nil
  457. #    animations.push(weapon2.animation2_id) if weapon2 != nil
  458. #    animations.delete(0)
  459. #    return animations.empty? ? 0 : animations
  460. #    # --- 変更部分終わり ---
  461. #  end
  462.     def animation2_id
  463.     if  can_two_weapons?#@active_battler.state_ranks[17] == 1
  464.       weapon = $data_weapons[@weapon_id]
  465.       # --- ここから変更部分 ---
  466.       weapon2 = $data_weapons[@weapon2_id]
  467.       animations = []
  468.       animations.push(weapon.animation2_id) if weapon != nil
  469.       animations.push(weapon2.animation2_id) if weapon2 != nil
  470.       animations.delete(0)
  471.       return animations.empty? ? 0 : animations
  472.       # --- 変更部分終わり ---
  473.     else
  474.       weapon = $data_weapons[@weapon_id]
  475.       return weapon != nil ? weapon.animation2_id : 4
  476.     end
  477.   end
  478. #--------------------------------------------------------------------------
  479.   # ● 更新自动状态
  480.   #     old_armor : 卸下防具
  481.   #     new_armor : 装备防具
  482.   #--------------------------------------------------------------------------
  483.   def update_auto_state(old_armor, new_armor)
  484.     # 强制解除卸下防具的自动状态
  485.     if old_armor != nil and old_armor.auto_state_id != 0
  486.       remove_state(old_armor.auto_state_id, true)
  487.     end
  488.     # 强制附加装备防具的自动状态
  489.     if new_armor != nil and new_armor.auto_state_id != 0
  490.       add_state(new_armor.auto_state_id, true)
  491.     end
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # ● 装备固定判定
  495.   #     equip_type : 装备类型
  496.   #--------------------------------------------------------------------------
  497.   def equip_fix?(equip_type)
  498.     case equip_type
  499.     when 0  # 武器
  500.       return $data_actors[@actor_id].weapon_fix
  501.     when 1  # 盾
  502.       return $data_actors[@actor_id].armor1_fix
  503.     when 2  # 头
  504.       return $data_actors[@actor_id].armor2_fix
  505.     when 3  # 身体
  506.       return $data_actors[@actor_id].armor3_fix
  507.     when 4  # 装饰品
  508.       return $data_actors[@actor_id].armor4_fix
  509.    
  510.    
  511.     end
  512.     return false
  513.   end
  514.   #--------------------------------------------------------------------------
  515.   # ● 变更装备
  516.   #     equip_type : 装备类型
  517.   #     id    : 武器 or 防具 ID  (0 为解除装备)
  518.   #--------------------------------------------------------------------------
  519.   def equip(equip_type, id)
  520.     case equip_type
  521.     when 0  # 武器
  522.       if id == 0 or $game_party.weapon_number(id) > 0
  523.         $game_party.gain_weapon(@weapon_id, 1)
  524.         @weapon_id = id
  525.         $game_party.lose_weapon(id, 1)
  526.         # --- ここから追加部分 ---
  527.         # 二刀武器じゃないものを装備した場合、盾の部分の二刀武器を外す
  528.         if id != 0 and !$data_weapons[id].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  529.           $game_party.gain_weapon(@weapon2_id, 1)
  530.           @weapon2_id = 0
  531.         end
  532.         # --- 追加部分終わり ---
  533.       end
  534.     when 1  # 盾
  535.       if id == 0 or $game_party.armor_number(id) > 0
  536.         update_auto_state($data_armors[@armor1_id], $data_armors[id])
  537.         $game_party.gain_armor(@armor1_id, 1)
  538.         @armor1_id = id
  539.         $game_party.lose_armor(id, 1)
  540.         # --- ここから追加部分 ---
  541.         # 二刀武器を装備していた場合は外す
  542.         if id != 0
  543.           $game_party.gain_weapon(@weapon2_id, 1)
  544.           @weapon2_id = 0
  545.         end
  546.         # --- 追加部分終わり ---
  547.       end
  548.     when 2  # 头
  549.       if id == 0 or $game_party.armor_number(id) > 0
  550.         update_auto_state($data_armors[@armor2_id], $data_armors[id])
  551.         $game_party.gain_armor(@armor2_id, 1)
  552.         @armor2_id = id
  553.         $game_party.lose_armor(id, 1)
  554.       end
  555.     when 3  # 身体
  556.       if id == 0 or $game_party.armor_number(id) > 0
  557.         update_auto_state($data_armors[@armor3_id], $data_armors[id])
  558.         $game_party.gain_armor(@armor3_id, 1)
  559.         @armor3_id = id
  560.         $game_party.lose_armor(id, 1)
  561.       end
  562.     when 4  # 项链
  563.       if id == 0 or $game_party.armor_number(id) > 0
  564.         update_auto_state($data_armors[@armor4_id], $data_armors[id])
  565.         $game_party.gain_armor(@armor4_id, 1)
  566.         @armor4_id = id
  567.         $game_party.lose_armor(id, 1)
  568.       end
  569.     when 5  # 戒指
  570.       if id == 0 or $game_party.armor_number(id) > 0
  571.         update_auto_state($data_armors[@armor5_id], $data_armors[id])
  572.         $game_party.gain_armor(@armor5_id, 1)
  573.         @armor5_id = id
  574.         $game_party.lose_armor(id, 1)
  575.       end
  576.     when 6  # 其余饰品
  577.       if id == 0 or $game_party.armor_number(id) > 0
  578.         update_auto_state($data_armors[@armor6_id], $data_armors[id])
  579.         $game_party.gain_armor(@armor6_id, 1)
  580.         @armor6_id = id
  581.         $game_party.lose_armor(id, 1)
  582.       end
  583.       # --- ここから追加部分 ---
  584.       when -1 # 二刀流の盾部分の武器
  585.       if id == 0 or $game_party.weapon_number(id) > 0
  586.         $game_party.gain_weapon(@weapon2_id, 1)
  587.         @weapon2_id = id
  588.         $game_party.lose_weapon(id, 1)
  589.         # 盾を外す
  590.         $game_party.gain_armor(@armor1_id, 1)
  591.         @armor1_id = 0
  592.         # 既に装備している武器が二刀武器じゃない場合は外す
  593.         if id != 0 and @weapon_id != 0 and !$data_weapons[@weapon_id].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  594.           $game_party.gain_weapon(@weapon_id, 1)
  595.           @weapon_id = 0
  596.         end
  597.       end
  598.       # --- 追加部分終わり ---
  599.     end
  600.   end
  601.   #--------------------------------------------------------------------------
  602.   # ● 二刀流可能なアクターかどうか
  603.   #--------------------------------------------------------------------------
  604.   def can_two_weapons?
  605.     return class_element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  606.   end

  607.   #--------------------------------------------------------------------------
  608.   # ● アクターの所属クラスの属性がAのものを取得
  609.   #--------------------------------------------------------------------------
  610.   def class_element_set
  611.     element_set = []
  612.     for i in 1...$data_classes[@class_id].element_ranks.xsize
  613.       element_set.push(i) if $data_classes[@class_id].element_ranks[i] == 1
  614.     end
  615.     return element_set
  616.   end
  617.    #--------------------------------------------------------------------------
  618.   # ● 可以装备判定
  619.   #     item : 物品
  620.   #--------------------------------------------------------------------------
  621.   def equippable?(item)
  622.     # 武器的情况
  623.     if item.is_a?(RPG::Weapon)
  624.       # 包含当前的职业可以装备武器的场合
  625.       if $data_classes[@class_id].weapon_set.include?(item.id)
  626.         return true
  627.       end
  628.     end
  629.     # 防具的情况
  630.     if item.is_a?(RPG::Armor)
  631.       # 不包含当前的职业可以装备武器的场合
  632.       if $data_classes[@class_id].armor_set.include?(item.id)
  633.         return true
  634.       end
  635.     end
  636.     return false
  637.   end

  638.   #--------------------------------------------------------------------------
  639.   # ● 更改职业 ID
  640.   #     class_id : 新的职业 ID
  641.   #--------------------------------------------------------------------------
  642.   def class_id=(class_id)
  643.     if $data_classes[class_id] != nil
  644.       @class_id = class_id
  645.       # 避开无法装备的物品
  646.       unless equippable?($data_weapons[@weapon_id])
  647.         equip(0, 0)
  648.       end
  649.       unless equippable?($data_armors[@armor1_id])
  650.         equip(1, 0)
  651.       end
  652.       unless equippable?($data_armors[@armor2_id])
  653.         equip(2, 0)
  654.       end
  655.       unless equippable?($data_armors[@armor3_id])
  656.         equip(3, 0)
  657.       end
  658.       unless equippable?($data_armors[@armor4_id])
  659.         equip(4, 0)
  660.       end
  661.       unless equippable?($data_armors[@armor5_id])
  662.         equip(5, 0)
  663.       end
  664.       unless equippable?($data_armors[@armor6_id])
  665.         equip(6, 0)
  666.       end
  667.     end
  668.   end
  669. end
  670. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  671. #
  672. #              Window_Base美化,增加属性增减颜色,及全能力值描绘
  673. #
  674. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  675. #==============================================================================
  676. # ■ Window_Base
  677. #------------------------------------------------------------------------------
  678. #  游戏中全部窗口的超级类。
  679. #==============================================================================

  680. class Window_Base < Window
  681.   ################## 属性增减颜色 ##############################
  682.   def up_color
  683.     return Color.new(255, 0, 0)
  684.   end
  685.   def down_color
  686.     return Color.new(0, 255, 0)
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # ● 描绘能力值
  690.   #     actor : 角色
  691.   #     x     : 描画目标 X 坐标
  692.   #     y     : 描画目标 Y 坐标
  693.   #     type  : 能力值种类 (0~6)
  694.   #--------------------------------------------------------------------------
  695.   def draw_actor_parameter(actor, x, y, type)
  696.     case type
  697.     when 0
  698.       parameter_name = $data_system.words.atk
  699.       parameter_value = actor.atk
  700.     when 1
  701.       parameter_name = $data_system.words.pdef
  702.       parameter_value = actor.pdef
  703.     when 2
  704.       parameter_name = $data_system.words.mdef
  705.       parameter_value = actor.mdef
  706.     when 3
  707.       parameter_name = $data_system.words.str
  708.       parameter_value = actor.str
  709.     when 4
  710.       parameter_name = $data_system.words.dex
  711.       parameter_value = actor.dex
  712.     when 5
  713.       parameter_name = $data_system.words.agi
  714.       parameter_value = actor.agi
  715.     when 6
  716.       parameter_name = $data_system.words.int
  717.       parameter_value = actor.int
  718.     when 7
  719.       parameter_name = "回避"
  720.       parameter_value = actor.eva
  721.     end
  722.     self.contents.font.color = system_color
  723.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  724.     self.contents.font.color = normal_color
  725.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  726.   end
  727. end
  728. #==============================================================================
  729. # ■ Harts_Window_EquipTitle
  730. #==============================================================================
  731. class Harts_Window_EquipTitle < Window_Base
  732.   #--------------------------------------------------------------------------
  733.   # ● 初期化
  734.   #--------------------------------------------------------------------------
  735.   def initialize
  736.     super(0, 0, 160, 64)
  737.     self.contents = Bitmap.new(width - 32, height - 32)
  738.     self.contents.clear
  739.     self.contents.font.color = normal_color
  740.     self.contents.draw_text(4, 0, 120, 32, $data_system.words.equip, 1)
  741.   end
  742. end

  743. #==============================================================================
  744. # ■ Harts_Window_EquipCommand
  745. #==============================================================================

  746. class Harts_Window_EquipCommand < Window_Selectable
  747.   #--------------------------------------------------------------------------
  748.   # ● 初期化
  749.   #--------------------------------------------------------------------------
  750.   def initialize
  751.     super(160, 0, 480, 64)
  752.     self.contents = Bitmap.new(width - 32, height - 32)
  753.     @item_max = 2
  754.     @column_max = 2
  755.     #@commands = ["手动", "自动", "退出"]
  756.     @commands = ["变更装备", "返回"]
  757.     refresh
  758.     self.index = 0
  759.   end
  760.   #--------------------------------------------------------------------------
  761.   # ● 刷新
  762.   #--------------------------------------------------------------------------
  763.   def refresh
  764.     self.contents.clear
  765.     for i in 0...@item_max
  766.     draw_item(i, normal_color)
  767.     end
  768.   end
  769.   #--------------------------------------------------------------------------
  770.   # ● 項目描画
  771.   # index : 項目番号
  772.   # color : 文字色
  773.   #--------------------------------------------------------------------------
  774.   def draw_item(index, color)
  775.     self.contents.font.color = color
  776.     x = index * 240 + 4
  777.     self.contents.draw_text(x, 0, 128, 32, @commands[index], 1)
  778.   end
  779. end

  780. #==============================================================================
  781. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  782. #
  783. #              装备窗口美化,全能力值描绘并追加新的防具装备栏
  784. #
  785. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  786. #==============================================================================
  787. # ■ Window_EquipRight
  788. #------------------------------------------------------------------------------
  789. #  装备画面、显示角色现在装备的物品的窗口。
  790. #==============================================================================

  791. class Window_EquipRight < Window_Selectable
  792.   #--------------------------------------------------------------------------
  793.   # ● 初始化对像
  794.   #     actor : 角色
  795.   #--------------------------------------------------------------------------
  796.   def initialize(actor)
  797.     super(272, 64, 368, 252)
  798.     self.contents = Bitmap.new(width - 32, height - 32)
  799.     @actor = actor
  800.     refresh
  801.     self.index = 0
  802.   end
  803.   #--------------------------------------------------------------------------
  804.   # ● 刷新
  805.   #--------------------------------------------------------------------------
  806.   def refresh
  807.     self.contents.clear
  808.     @data = []
  809.     @data.push($data_weapons[@actor.weapon_id])
  810.     # --- ここから変更部分 ---
  811.     @data.push(@actor.weapon2_id != 0 ? $data_weapons[@actor.weapon2_id] : $data_armors[@actor.armor1_id])
  812.     # --- 変更部分終わり ---
  813.     @data.push($data_armors[@actor.armor2_id])
  814.     @data.push($data_armors[@actor.armor3_id])
  815.     @data.push($data_armors[@actor.armor4_id])
  816.     @data.push($data_armors[@actor.armor5_id])
  817.     @data.push($data_armors[@actor.armor6_id])
  818.     @item_max = @data.size
  819.     self.contents.font.color = system_color
  820.     self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
  821.     self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
  822.     self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
  823.     self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
  824.     self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)
  825.     self.contents.draw_text(4, 32 * 5, 92, 32, "戒指")
  826.     self.contents.draw_text(4, 32 * 6, 92, 32, "饰品")
  827.     draw_item_name(@data[0], 92, 32 * 0)
  828.     draw_item_name(@data[1], 92, 32 * 1)
  829.     draw_item_name(@data[2], 92, 32 * 2)
  830.     draw_item_name(@data[3], 92, 32 * 3)
  831.     draw_item_name(@data[4], 92, 32 * 4)
  832.     draw_item_name(@data[5], 92, 32 * 5)
  833.     draw_item_name(@data[6], 92, 32 * 6)
  834.   end
  835. end
  836. # ■ Harts_Window_EquipItem
  837. #==============================================================================

  838. class Harts_Window_EquipItem < Window_Selectable
  839.   #--------------------------------------------------------------------------
  840.   # ● 初期化
  841.   # actor : 角色
  842.   # equip_type : 装備部位 (0~3)
  843.   #--------------------------------------------------------------------------
  844.   def initialize(actor, equip_type)
  845.     super(272, 314, 368, 102)
  846.     @actor = actor
  847.     @equip_type = equip_type
  848.     @column_max = 1
  849.     refresh
  850.     self.active = false
  851.     self.index = -1
  852.   end
  853.   #--------------------------------------------------------------------------
  854.   # ● 物品取得
  855.   #--------------------------------------------------------------------------
  856.   def item
  857.     return @data[self.index]
  858.   end
  859.   #--------------------------------------------------------------------------
  860.   # ● 最強id取得
  861.   #--------------------------------------------------------------------------
  862.   def max_item_id
  863.     if @equip_type == 0
  864.       if @actor.weapon_id == 0
  865.         max = 0
  866.       else
  867.         max = $data_weapons[@actor.weapon_id].atk
  868.       end
  869.       # --- ここから追加部分 ---
  870.     # 二刀流可能なアクターの場合は、盾に二刀武器も表示
  871.     elsif @equip_type == 1 and @actor.can_two_weapons?
  872.       if @actor.weapon2_id == 0
  873.         max = 0
  874.       else
  875.         max = $data_weapons[@actor.weapon2_id].atk
  876.       end
  877.       #weapon_set = $data_classes[@actor.class_id].weapon_set
  878.       #for i in 1...$data_weapons.size
  879.       #  if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and $data_weapons[i].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  880.       #    @data.push($data_weapons[i])
  881.       #  end
  882.       #end
  883.    
  884.     # --- 追加部分終わり ---
  885.     elsif @equip_type == 1
  886.       if @actor.armor1_id == 0
  887.         max = 0
  888.       else
  889.         max = $data_armors[@actor.armor1_id].pdef
  890.       end
  891.     elsif @equip_type == 2
  892.       if @actor.armor2_id == 0
  893.         max = 0
  894.       else
  895.         max = $data_armors[@actor.armor2_id].pdef
  896.       end
  897.     elsif @equip_type == 3
  898.       if @actor.armor3_id == 0
  899.         max = 0
  900.       else
  901.         max = $data_armors[@actor.armor3_id].pdef
  902.       end
  903.       elsif @equip_type == 4
  904.       if @actor.armor4_id == 0
  905.         max = 0
  906.       else
  907.         max = $data_armors[@actor.armor4_id].pdef
  908.       end
  909.       elsif @equip_type == 5
  910.       if @actor.armor5_id == 0
  911.         max = 0
  912.       else
  913.         max = $data_armors[@actor.armor5_id].pdef
  914.       end
  915.     end
  916.     for i in [email protected]
  917.       if @equip_type <= 1 and @actor.can_two_weapons?
  918.         if max <= $data_weapons[@data[i].id].atk
  919.           max = $data_weapons[@data[i].id].atk
  920.           item_id = @data[i].id
  921.         end
  922.       elsif #@equip_type >= 1
  923.         if max <= $data_armors[@data[i].id].pdef
  924.           max = $data_armors[@data[i].id].pdef
  925.           item_id = @data[i].id
  926.         end
  927.       end
  928.     end
  929.     return item_id
  930.   end
  931.   #--------------------------------------------------------------------------
  932.   # ● 刷新
  933.   #--------------------------------------------------------------------------
  934.   def refresh
  935.     if self.contents != nil
  936.       self.contents.dispose
  937.       self.contents = nil
  938.     end
  939.     @data = []
  940.     # 装備可能的武器追加
  941.     if @equip_type == 0
  942.       weapon_set = $data_classes[@actor.class_id].weapon_set
  943.       for i in 1...$data_weapons.size
  944.         if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  945.           @data.push($data_weapons[i])
  946.         end
  947.       end
  948.     end
  949.     # --- ここから追加部分 ---
  950.     # 二刀流可能なアクターの場合は、盾に二刀武器も表示
  951.     if @equip_type == 1 and @actor.can_two_weapons?
  952.       weapon_set = $data_classes[@actor.class_id].weapon_set
  953.       for i in 1...$data_weapons.size
  954.         if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and $data_weapons[i].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  955.           @data.push($data_weapons[i])
  956.         end
  957.       end
  958.     end
  959.     # --- 追加部分終わり ---
  960.   ###########################################################################
  961. #    if Kboard.keyboard($R_Key_G)
  962. #      # 演奏取消 SE
  963. #      $game_system.se_play($data_system.cancel_se)
  964. #      # 切换到菜单画面
  965. #      $scene = Scene_Map.new
  966. #      return
  967. #    end
  968.   ###########################################################################
  969.   # 装備可能的防具追加
  970.     if @equip_type != 0
  971.       armor_set = $data_classes[@actor.class_id].armor_set
  972.       for i in 1...$data_armors.size
  973.         if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  974.           if $data_armors[i].kind == @equip_type-1
  975.             @data.push($data_armors[i])
  976.           end
  977.         end
  978.       end
  979.     end
  980.     # 空白追加
  981.     @data.push(nil)
  982.     # 全項目描画
  983.     @item_max = @data.size
  984.     self.contents = Bitmap.new(width - 32, row_max * 32)
  985.     for i in 0...@item_max-1
  986.       draw_item(i)
  987.     end
  988.   end
  989.   #--------------------------------------------------------------------------
  990.   # ● 項目描画
  991.   # index : 項目编号
  992.   #--------------------------------------------------------------------------
  993.   def draw_item(index)
  994.     item = @data[index]
  995.     x = 4
  996.     y = index * 32
  997.     case item
  998.     when RPG::Weapon
  999.       number = $game_party.weapon_number(item.id)
  1000.     when RPG::Armor
  1001.       number = $game_party.armor_number(item.id)
  1002.     end
  1003.     bitmap = RPG::Cache.icon(item.icon_name)
  1004.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  1005.     self.contents.font.color = normal_color
  1006.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  1007.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  1008.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  1009.   end
  1010.   #--------------------------------------------------------------------------
  1011.   # ● 帮助更新
  1012.   #--------------------------------------------------------------------------
  1013.   def update_help
  1014.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  1015.   end
  1016. end

  1017. #==============================================================================
  1018. # ■ Harts_Window_EquipLeft
  1019. #==============================================================================

  1020. class Harts_Window_EquipLeft < Window_Base
  1021.   #--------------------------------------------------------------------------
  1022.   # ● 初期化
  1023.   # actor : 角色
  1024.   #--------------------------------------------------------------------------
  1025.   def initialize(actor)
  1026.     super(0, 64, 272, 352)
  1027.     self.contents = Bitmap.new(width - 32, height - 32)
  1028.     @actor = actor
  1029.     refresh
  1030.   end
  1031.   #--------------------------------------------------------------------------
  1032.   # ● リフレッシュ
  1033.   #--------------------------------------------------------------------------
  1034.   def refresh
  1035.     self.contents.clear
  1036.     draw_actor_graphic(@actor, 32, 64)
  1037.     draw_actor_name(@actor, 4 + 96, 0)
  1038.     draw_actor_level(@actor, 4 + 96, 32)
  1039.     draw_actor_parameter(@actor, 4, 100, 0)#80=64
  1040.     draw_actor_parameter(@actor, 4, 127, 1)#112=96
  1041.     draw_actor_parameter(@actor, 4, 154, 2)#144=128
  1042.     draw_actor_parameter(@actor, 4, 181, 7)
  1043.     draw_actor_parameter(@actor, 4, 211, 3)
  1044.     draw_actor_parameter(@actor, 4, 238, 4)
  1045.     draw_actor_parameter(@actor, 4, 265, 5)
  1046.     draw_actor_parameter(@actor, 4, 292, 6)
  1047.     if @new_atk != nil and @new_atk != @actor.atk
  1048.       if @new_atk > @actor.atk
  1049.         self.contents.font.color = system_color
  1050.       else
  1051.         self.contents.font.color = disabled_color
  1052.       end
  1053.       self.contents.draw_text(160, 100, 40, 32, "→", 1)
  1054.       self.contents.draw_text(200, 100, 36, 32, @new_atk.to_s, 2)
  1055.     end
  1056.     if @new_pdef != nil and @new_pdef != @actor.pdef
  1057.       if @new_pdef > @actor.pdef
  1058.         self.contents.font.color = system_color
  1059.       else
  1060.         self.contents.font.color = disabled_color
  1061.       end
  1062.       self.contents.draw_text(160, 127, 40, 32, "→", 1)
  1063.       self.contents.draw_text(200, 127, 36, 32, @new_pdef.to_s, 2)
  1064.     end
  1065.     if @new_mdef != nil and @new_mdef != @actor.mdef
  1066.       if @new_mdef > @actor.mdef
  1067.         self.contents.font.color = system_color
  1068.       else
  1069.         self.contents.font.color = disabled_color
  1070.       end
  1071.       self.contents.draw_text(160, 154, 40, 32, "→", 1)
  1072.       self.contents.draw_text(200, 154, 36, 32, @new_mdef.to_s, 2)
  1073.     end
  1074.     if @new_eva != nil and @new_eva != @actor.eva
  1075.       if @new_eva > @actor.eva
  1076.         self.contents.font.color = system_color
  1077.       else
  1078.         self.contents.font.color = disabled_color
  1079.       end
  1080.       self.contents.draw_text(160, 181, 40, 32, "→", 1)
  1081.       self.contents.draw_text(200, 181, 36, 32, @new_mdef.to_s, 2)
  1082.     end
  1083.     if @new_str != nil and @new_str != @actor.str
  1084.       if @new_str > @actor.str
  1085.         self.contents.font.color = system_color
  1086.       else
  1087.         self.contents.font.color = disabled_color
  1088.       end
  1089.       self.contents.draw_text(160, 211, 40, 32, "→", 1)
  1090.       self.contents.draw_text(200, 211, 36, 32, @new_str.to_s, 2)
  1091.     end
  1092.     if @new_dex != nil and @new_dex != @actor.dex
  1093.       if @new_dex > @actor.dex
  1094.         self.contents.font.color = system_color
  1095.       else
  1096.         self.contents.font.color = disabled_color
  1097.       end
  1098.       self.contents.draw_text(160, 238, 40, 32, "→", 1)
  1099.       self.contents.draw_text(200, 238, 36, 32, @new_dex.to_s, 2)
  1100.     end
  1101.     if @new_agi != nil and @new_agi != @actor.agi
  1102.       if @new_agi > @actor.agi
  1103.         self.contents.font.color = system_color
  1104.       else
  1105.         self.contents.font.color = disabled_color
  1106.       end
  1107.       self.contents.draw_text(160, 265, 40, 32, "→", 1)
  1108.       self.contents.draw_text(200, 265, 36, 32, @new_agi.to_s, 2)
  1109.     end
  1110.     if @new_int != nil and @new_int != @actor.int
  1111.       if @new_int > @actor.int
  1112.         self.contents.font.color = system_color
  1113.       else
  1114.         self.contents.font.color = disabled_color
  1115.       end
  1116.       self.contents.draw_text(160, 292, 40, 32, "→", 1)
  1117.       self.contents.draw_text(200, 292, 36, 32, @new_int.to_s, 2)
  1118.     end
  1119.   end
  1120.   #--------------------------------------------------------------------------
  1121.   # ● 装備変更後設定
  1122.   # new_atk : 装備変更後攻撃力
  1123.   # new_pdef : 装備変更後物理防御
  1124.   # new_mdef : 装備変更後魔法防御
  1125.   #--------------------------------------------------------------------------
  1126.   def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  1127.     if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int
  1128.       @new_atk = new_atk
  1129.       @new_pdef = new_pdef
  1130.       @new_mdef = new_mdef
  1131.       @new_str = new_str
  1132.       @new_dex = new_dex
  1133.       @new_agi = new_agi
  1134.       @new_int = new_int
  1135.       refresh
  1136.     end
  1137.   end
  1138. end

  1139. #==============================================================================
  1140. # ■ Harts_Scene_Equip
  1141. #==============================================================================

  1142. class Scene_Equip
  1143.   include OPACITY_66RPG
  1144.   #--------------------------------------------------------------------------
  1145.   # ● 初期化
  1146.   # actor_index : 角色编号
  1147.   # equip_index : 装備编号
  1148.   #--------------------------------------------------------------------------
  1149.   def initialize(actor_index = 0, equip_index = -1, command_index = 0, equip_active = false, command_active = true)
  1150.     @actor_index = actor_index
  1151.     @equip_index = equip_index
  1152.     @command_index = command_index
  1153.     @equip_active = equip_active
  1154.     @command_active = command_active
  1155.   end
  1156.   #--------------------------------------------------------------------------
  1157.   # ● 主处理
  1158.   #--------------------------------------------------------------------------
  1159.   def main
  1160.     create_screen
  1161.     @actor = $game_party.actors[@actor_index]
  1162.     @title_window = Harts_Window_EquipTitle.new
  1163.     @command_window = Harts_Window_EquipCommand.new
  1164.     @help_window = Window_Help.new
  1165.     @help_window.y = 416
  1166.     @left_window = Harts_Window_EquipLeft.new(@actor)
  1167.     @right_window = Window_EquipRight.new(@actor)
  1168.     @item_window0 = Harts_Window_EquipItem.new(@actor, -1)
  1169.     @item_window1 = Harts_Window_EquipItem.new(@actor, 0)
  1170.     @item_window2 = Harts_Window_EquipItem.new(@actor, 1)
  1171.     @item_window3 = Harts_Window_EquipItem.new(@actor, 2)
  1172.     @item_window4 = Harts_Window_EquipItem.new(@actor, 3)
  1173.     @item_window5 = Harts_Window_EquipItem.new(@actor, 4)
  1174.     @item_window6 = Harts_Window_EquipItem.new(@actor, 5)
  1175.     @item_window7 = Harts_Window_EquipItem.new(@actor, 6)
  1176.     # 关联帮助窗口
  1177.     @right_window.help_window = @help_window
  1178.     @item_window0.help_window = @help_window
  1179.     @item_window1.help_window = @help_window
  1180.     @item_window2.help_window = @help_window
  1181.     @item_window3.help_window = @help_window
  1182.     @item_window4.help_window = @help_window
  1183.     @item_window5.help_window = @help_window


  1184.     @item_window6.help_window = @help_window
  1185.     @item_window7.help_window = @help_window
  1186.     ##############
  1187.     @equip_window = Window_Equip.new
  1188.     ##############
  1189.     # 设置光标位置
  1190.     @command_window.index = @command_index
  1191.     @right_window.index = @equip_index
  1192.     @command_window.active = @command_active
  1193.     @right_window.active = @equip_active
  1194.     testname = @actor.battler_name+"_h.png"
  1195.     if FileTest.exist?("Graphics/battlers/#{testname}")
  1196.       sp = Sprite.new
  1197.       sp.bitmap=Bitmap.new("Graphics/battlers/#{testname}")
  1198.       sp.opacity = 120
  1199.     end   
  1200.     refresh
  1201.     # 执行过渡
  1202.     Graphics.transition
  1203.     # 主循环
  1204.     loop do
  1205.       # 刷新游戏画面
  1206.       Graphics.update
  1207.       # 刷新输入信息
  1208.       Input.update
  1209.       # 刷新画面
  1210.       update
  1211.       # 如果画面切换的话的就中断循环
  1212.       if $scene != self
  1213.         break
  1214.       end
  1215.     end
  1216.     # トランジション準備
  1217.     Graphics.freeze
  1218.     # ウィンドウを解放
  1219.     @title_window.dispose
  1220.     @command_window.dispose
  1221.     @help_window.dispose
  1222.     @left_window.dispose
  1223.     @right_window.dispose
  1224.     @item_window0.dispose
  1225.     @item_window1.dispose
  1226.     @item_window2.dispose
  1227.     @item_window3.dispose
  1228.     @item_window4.dispose
  1229.     @item_window5.dispose
  1230.     @item_window6.dispose
  1231.     @item_window7.dispose
  1232.     ##############
  1233.     @equip_window.dispose
  1234.     ##############
  1235.     dispose_screen
  1236.   end
  1237.   #--------------------------------------------------------------------------
  1238.   # ● 刷新
  1239.   #--------------------------------------------------------------------------
  1240.   def refresh
  1241.     @item_window0.visible = (@right_window.index == -1)
  1242.     @item_window1.visible = (@right_window.index == 0)
  1243.     @item_window2.visible = (@right_window.index == 1)
  1244.     @item_window3.visible = (@right_window.index == 2)
  1245.     @item_window4.visible = (@right_window.index == 3)
  1246.     @item_window5.visible = (@right_window.index == 4)
  1247.     @item_window6.visible = (@right_window.index == 5)
  1248.     @item_window7.visible = (@right_window.index == 6)
  1249.     # 获取当前装备中的物品
  1250.     item1 = @right_window.item
  1251.     ##############
  1252.     @equip_window.set_item(item1)
  1253.     ##############
  1254.     # 设置当前的物品窗口到 @item_window
  1255.     case @right_window.index
  1256.     when -1
  1257.       @item_window = @item_window0
  1258.     when 0
  1259.       @item_window = @item_window1
  1260.     when 1
  1261.       @item_window = @item_window2
  1262.     when 2
  1263.       @item_window = @item_window3
  1264.     when 3
  1265.       @item_window = @item_window4
  1266.     when 4
  1267.       @item_window = @item_window5
  1268.     when 5
  1269.       @item_window = @item_window6
  1270.     when 6
  1271.       @item_window = @item_window7
  1272.     end
  1273.     # 右窗口被激活的情况下
  1274.     if @right_window.active
  1275.       # 删除变更装备后的能力
  1276.     ###############################################################
  1277.       @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
  1278.     end
  1279.     # 物品窗口被激活的情况下
  1280.     if @item_window.active
  1281.       # 获取现在选中的物品
  1282.       item2 = @item_window.item
  1283.       # 变更装备
  1284.       last_hp = @actor.hp
  1285.       last_sp = @actor.sp
  1286.       # --- ここから変更部分 ---
  1287.       # 現在の装備を保存(装備の種類を増やしている場合はここを変更)
  1288.       equipments = [@actor.weapon2_id, @actor.weapon_id, @actor.armor1_id, @actor.armor2_id, @actor.armor3_id, @actor.armor4_id]
  1289.       @actor.equip(equip_type(@right_window.index, item2), item2 == nil ? 0 : item2.id)
  1290.       # --- 変更部分終わり ---
  1291.       # 装備変更後のパラメータを取得
  1292.     ###############################################################
  1293.       # 获取变更装备后的能力值
  1294.       new_atk = @actor.atk
  1295.       new_pdef = @actor.pdef
  1296.       new_mdef = @actor.mdef
  1297.       new_eva = @actor.eva
  1298.       new_str = @actor.str
  1299.       new_dex = @actor.dex
  1300.       new_agi = @actor.agi
  1301.       new_int = @actor.int



  1302.       # --- ここから変更部分 ---
  1303.       # 装備を戻す
  1304.       for i in 0...equipments.size
  1305.         @actor.equip(i - 1, equipments[i])
  1306.       end
  1307.       # --- 変更部分終わり ---
  1308.       # 返回到装备
  1309.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  1310.       @actor.hp = last_hp
  1311.       @actor.sp = last_sp
  1312.       # 描画左窗口
  1313.     ###############################################################
  1314.       @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  1315.     ###############################################################
  1316.       ##################
  1317.       @equip_window.set_item(item2)
  1318.       ##################
  1319.     end
  1320.   end
  1321.   #--------------------------------------------------------------------------
  1322.   # ● 更新
  1323.   #--------------------------------------------------------------------------
  1324.   def update
  1325.     @title_window.update
  1326.     @command_window.update
  1327.     @left_window.update
  1328.     @right_window.update
  1329.     @item_window.update
  1330.     ##############
  1331.     @equip_window.refresh
  1332.     ##############
  1333.     refresh
  1334.     if @command_window.active
  1335.       update_command
  1336.       return
  1337.     end
  1338.     if @right_window.active
  1339.       update_right
  1340.       return
  1341.     end
  1342.     # 物品窗口被激活的情况下: 调用 update_item
  1343.     if @item_window.active
  1344.       update_item
  1345.       return
  1346.     end
  1347.   end
  1348.   #--------------------------------------------------------------------------
  1349.   # ● 更新
  1350.   #--------------------------------------------------------------------------
  1351.   def update_command
  1352.     # 按下B的场合
  1353.     if Input.trigger?(Input::B)
  1354.       # 音效演奏
  1355.       $game_system.se_play($data_system.cancel_se)
  1356.       # 画面切换
  1357.       $scene = Scene_Menu.new(2)
  1358.       return
  1359.     end
  1360.     # 按下C的场合
  1361.     if Input.trigger?(Input::C)
  1362.       case @command_window.index
  1363.       # 装備的場合
  1364.       when 0
  1365.         # 音效演奏
  1366.         $game_system.se_play($data_system.decision_se)
  1367.         @right_window.active = true
  1368.         @command_window.active = false
  1369.         @right_window.index = 0
  1370.         @command_window.index = -1
  1371.         return
  1372.         # 最強装備的場合 
  1373. =begin      
  1374.       when 1
  1375.       
  1376.         # 音效演奏
  1377.         $game_system.se_play($data_system.equip_se)
  1378.         if  @actor.can_two_weapons?
  1379.         # 最強装備的取得
  1380.         max_weapon_id = @item_window1.max_item_id
  1381.         max_weapon2_id = @item_window2.max_item_id
  1382.         max_armor2_id = @item_window3.max_item_id
  1383.         max_armor3_id = @item_window4.max_item_id
  1384.         max_armor4_id = @item_window5.max_item_id
  1385.         max_armor5_id = @item_window6.max_item_id
  1386.         max_armor6_id = @item_window7.max_item_id
  1387.         # 最強装備执行
  1388.         @actor.equip(0, max_weapon_id)
  1389.         @actor.equip(1, max_weapon2_id)
  1390.         @actor.equip(2, max_armor2_id)
  1391.         @actor.equip(3, max_armor3_id)
  1392.         @actor.equip(4, max_armor4_id)
  1393.         @actor.equip(5, max_armor5_id)
  1394.         @actor.equip(6, max_armor6_id)
  1395.         elsif # 最強装備的取得
  1396.         max_weapon_id = @item_window1.max_item_id
  1397.         max_armor1_id = @item_window2.max_item_id
  1398.         max_armor2_id = @item_window3.max_item_id
  1399.         max_armor3_id = @item_window4.max_item_id
  1400.         max_armor4_id = @item_window5.max_item_id
  1401.         max_armor5_id = @item_window6.max_item_id
  1402.         max_armor6_id = @item_window7.max_item_id
  1403.         # 最強装備执行
  1404.         @actor.equip(0, max_weapon_id)
  1405.         @actor.equip(1, max_armor1_id)
  1406.         @actor.equip(2, max_armor2_id)
  1407.         @actor.equip(3, max_armor3_id)
  1408.         @actor.equip(4, max_armor4_id)
  1409.         @actor.equip(5, max_armor5_id)
  1410.         @actor.equip(6, max_armor6_id)
  1411.         end
  1412.         @right_window.refresh
  1413.         @left_window.refresh
  1414.         @item_window1.refresh
  1415.         @item_window2.refresh
  1416.         @item_window3.refresh
  1417.         @item_window4.refresh
  1418.         @item_window5.refresh
  1419.         @item_window6.refresh
  1420.         return
  1421. =end
  1422.       when 1
  1423.         # 音效演奏
  1424.         $game_system.se_play($data_system.cancel_se)
  1425.         # 画面切换
  1426.         $scene = Scene_Menu.new(2)
  1427.         return
  1428.       end
  1429.     end
  1430.     # 按下R的场合
  1431.     if Input.trigger?(Input::R)
  1432.       # 音效演奏
  1433.       $game_system.se_play($data_system.cursor_se)
  1434.       @actor_index += 1
  1435.       @actor_index %= $game_party.actors.size
  1436.       # 画面切换
  1437.       $scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
  1438.       return
  1439.     end
  1440.     # 按下L的场合
  1441.     if Input.trigger?(Input::L)
  1442.       # 音效演奏
  1443.       $game_system.se_play($data_system.cursor_se)
  1444.       @actor_index += $game_party.actors.size - 1
  1445.       @actor_index %= $game_party.actors.size
  1446.         # 画面切换
  1447.       $scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
  1448.       return
  1449.     end
  1450.   end
  1451.   #--------------------------------------------------------------------------
  1452.   # ● 更新右边窗口
  1453.   #--------------------------------------------------------------------------
  1454.   def update_right
  1455.     # 按下B的场合
  1456.     if Input.trigger?(Input::B)
  1457.       # 音效演奏
  1458.       $game_system.se_play($data_system.cancel_se)
  1459.       @right_window.active = false
  1460.       @command_window.active = true
  1461.       @right_window.index = -1
  1462.       @command_window.index = 0
  1463.       return
  1464.     end
  1465.     # 按下C的场合
  1466.     if Input.trigger?(Input::C)
  1467.       # 装備固定时
  1468.       if @actor.equip_fix?(@right_window.index)
  1469.         # 音效演奏
  1470.         $game_system.se_play($data_system.buzzer_se)
  1471.         return
  1472.       end
  1473.       # 音效演奏
  1474.       $game_system.se_play($data_system.decision_se)
  1475.       @right_window.active = false
  1476.       @item_window.active = true
  1477.       @item_window.index = 0
  1478.       return
  1479.     end
  1480.     # 按下R的场合
  1481.     if Input.trigger?(Input::R)
  1482.       # 音效演奏
  1483.       $game_system.se_play($data_system.cursor_se)
  1484.       @actor_index += 1
  1485.       @actor_index %= $game_party.actors.size
  1486.       # 画面切换
  1487.       $scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
  1488.       return
  1489.     end
  1490.     # 按下L的场合
  1491.     if Input.trigger?(Input::L)
  1492.       # 音效演奏
  1493.       $game_system.se_play($data_system.cursor_se)
  1494.       @actor_index += $game_party.actors.size - 1
  1495.       @actor_index %= $game_party.actors.size
  1496.       # 画面切换
  1497.       $scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
  1498.       return
  1499.     end
  1500.   end
  1501.   #--------------------------------------------------------------------------
  1502.   # ● 更新物品
  1503.   #--------------------------------------------------------------------------
  1504.   def update_item
  1505.     # 按下B的场合
  1506.     if Input.trigger?(Input::B)
  1507.       # 音效演奏
  1508.       $game_system.se_play($data_system.cancel_se)
  1509.       @right_window.active = true
  1510.       @item_window.active = false
  1511.       @item_window.index = -1
  1512.       return
  1513.     end
  1514.     # 按下C的场合
  1515.     if Input.trigger?(Input::C)
  1516.       # 音效演奏
  1517.       $game_system.se_play($data_system.equip_se)
  1518.       # アイテムウィンドウで現在選択されているデータを取得
  1519.       item = @item_window.item
  1520.       # --- ここから変更部分 ---
  1521.       # 装備を変更
  1522.       # @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  1523.       @actor.equip(equip_type(@right_window.index, item), item == nil ? 0 : item.id)
  1524.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  1525.       # --- 変更部分終わり ---
  1526.       # ライトウィンドウをアクティブ化
  1527.       @right_window.active = true
  1528.       @item_window.active = false
  1529.       @item_window.index = -1
  1530.       # 刷新
  1531.       @right_window.refresh
  1532.       # --- ここから変更部分 ---
  1533.       # めんどくさいのですべてのウィンドウをリフレッシュ
  1534.       @item_window1.refresh
  1535.       @item_window2.refresh
  1536.       @item_window3.refresh
  1537.       @item_window4.refresh
  1538.       @item_window5.refresh
  1539.       @item_window6.refresh
  1540.       @item_window7.refresh
  1541.       # --- 変更部分終わり ---
  1542.       return
  1543.     end
  1544.    
  1545.   end
  1546.   
  1547.   # --- ここから追加部分 ---
  1548.   #--------------------------------------------------------------------------
  1549.   # ● 二刀流用の装備部位取得
  1550.   #--------------------------------------------------------------------------
  1551.   def equip_type(index, item)
  1552.     return index * (item.is_a?(RPG::Armor) ? 1 : -1)
  1553.   end
  1554.   # --- 追加部分終わり ---
  1555. end
  1556. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1557. #
  1558. #              状态窗口美化,全防具装备栏描绘
  1559. #
  1560. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1561. #==============================================================================
  1562. #---------------------------------------------------
  1563. # 本脚本来自66RPG.com,作者Deathless
  1564. #---------------------------------------------------

  1565. #-----------------------------------------------------
  1566. # 功能设定
  1567. # 当=1和=2,会改变图形的大小
  1568. # =1的时候,图形为每个人自身的能力分配,最大数就是顶点
  1569. # =2的时候,图形为所有人的能力分配,顶点为999
  1570. #
  1571. # 如果不需要999这么大,本脚本中搜索
  1572. # "c[i] = get_position(a[0][0], a[0][1], a[i+1][0], a[i+1][1], b[i] / 999.0)"
  1573. # 把这个999修改了即可。
  1574. #-----------------------------------------------------

  1575. ST_DRAW_SIX_LINES_TYPE = 1

  1576. class Bitmap
  1577.   #--------------------------------------------------------------------------
  1578.   # ● 描绘直线   
  1579.   #     x1,y1,x2,y2:  直线两端的坐标
  1580.   #     width:    宽度   
  1581.   #     color:    颜色
  1582.   #--------------------------------------------------------------------------
  1583.   def drawline(x1, y1, x2, y2, width, color)
  1584.     x1 = x1.to_f
  1585.     y1 = y1.to_f
  1586.     x2 = x2.to_f
  1587.     y2 = y2.to_f
  1588.     width = width.to_f
  1589.     k = (y2 - y1) / (x2 - x1)
  1590.     if k.abs > 1
  1591.       drawline_x(x1, y1, x2, y2, width, color)
  1592.     else
  1593.       drawline_y(x1, y1, x2, y2, width, color)
  1594.     end
  1595.   end
  1596.   def drawline_x(x1, y1, x2, y2, width, color)
  1597.     l = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 * width / (y1 - y2)
  1598.     length = l.abs * 2
  1599.     k = (x2 - x1) / (y2 - y1) #x=ky+b
  1600.     b = x1 - k * y1
  1601.     if l > 0
  1602.       for ty in y2.to_i..y1.to_i
  1603.         tx = ty * k + b
  1604.         fill_rect(tx - l, ty, length, 1, color)
  1605.       end
  1606.     else
  1607.       for ty in y1.to_i..y2.to_i
  1608.         tx = ty * k + b
  1609.         fill_rect(tx + l, ty, length, 1, color)
  1610.       end
  1611.     end
  1612.   end
  1613.   def drawline_y(x1, y1, x2, y2, width, color)
  1614.     l = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 * width / (x1 - x2)
  1615.     height = l.abs * 2
  1616.     k = (y2 - y1) / (x2 - x1) #y=kx+b
  1617.     b = y1 - k * x1
  1618.     if l > 0
  1619.       for tx in x2.to_i..x1.to_i
  1620.         ty = tx * k + b
  1621.         fill_rect(tx, ty - l, 1, height, color)
  1622.       end
  1623.     else
  1624.       for tx in x1.to_i..x2.to_i
  1625.         ty = tx * k + b
  1626.         fill_rect(tx, ty + l, 1, height, color)
  1627.       end
  1628.     end
  1629.   end
  1630. end
  1631. # ■ Window_Status
  1632. #------------------------------------------------------------------------------
  1633. #  显示状态画面、完全规格的状态窗口。
  1634. #==============================================================================

  1635. class Window_Status < Window_Base
  1636.   #--------------------------------------------------------------------------
  1637.   # ● 刷新
  1638.   #--------------------------------------------------------------------------
  1639.   def get_position(x_begin, y_begin, x_end, y_end, percent)
  1640.     a = []
  1641.     a[0] = x_begin + (x_end - x_begin) * percent
  1642.     a[1] = y_begin + (y_end - y_begin) * percent
  1643.     return a
  1644.   end
  1645.   def refresh
  1646.     self.contents.clear
  1647.     x0 = 60 #图表的坐标
  1648.     y0 = 220
  1649.     r = 100.0 #图表的大小,友情提示:浮点数后面的.0不要省略了
  1650.     h = 3 ** 0.5 * r / 2
  1651.     a = [] #六边形的顶点和圆心
  1652.     a[0] = [r, h] #圆心
  1653.     a[1] = [r / 2, 0.0]
  1654.     a[2] = [r * 3 / 2, 0.0]
  1655.     a[6] = [0.0, h]
  1656.     a[3] = [r * 2, h]
  1657.     a[5] = [r / 2, h * 2]
  1658.     a[4] = [r * 3 / 2, h * 2]
  1659.     for i in a
  1660.       i[0] += x0
  1661.       i[1] += y0
  1662.     end
  1663.     self.contents.font.color = Color.new(128, 255, 255, 255)
  1664.     self.contents.draw_text(a[1][0] - 16 , a[1][1] - 32, 80, 32, "攻击")
  1665.     self.contents.draw_text(a[2][0] - 4, a[2][1] - 32, 80, 32, "防御")
  1666.     self.contents.draw_text(a[6][0] - 28, a[6][1] - 16, 80, 32, "力量")
  1667.     self.contents.draw_text(a[5][0] - 16, a[5][1], 80, 32, "敏捷")
  1668.     self.contents.draw_text(a[4][0] - 4, a[4][1], 80, 32, "速度")
  1669.     self.contents.draw_text(a[3][0] + 8, a[3][1] - 16, 80, 32, "魔力")
  1670.     #描绘边框
  1671.     for i in 1...a.size
  1672.       self.contents.drawline(a[0][0], a[0][1], a[i][0], a[i][1], 1, disabled_color)
  1673.     end
  1674.     self.contents.drawline(a[1][0], a[1][1], a[2][0], a[2][1], 1, text_color(6))
  1675.     self.contents.drawline(a[2][0], a[2][1], a[3][0], a[3][1], 1, text_color(6))
  1676.     self.contents.drawline(a[3][0], a[3][1], a[4][0], a[4][1], 1, text_color(6))
  1677.     self.contents.drawline(a[4][0], a[4][1], a[5][0], a[5][1], 1, text_color(6))
  1678.     self.contents.drawline(a[5][0], a[5][1], a[6][0], a[6][1], 1, text_color(6))
  1679.     self.contents.drawline(a[6][0], a[6][1], a[1][0], a[1][1], 1, text_color(6))
  1680.     #描绘能力曲线
  1681.     b = [] #获取能力值
  1682.     b.push(@actor.atk)
  1683.     b.push(@actor.pdef)
  1684.     b.push(@actor.int)
  1685.     b.push(@actor.agi)
  1686.     b.push(@actor.dex)
  1687.     b.push(@actor.str)
  1688. case ST_DRAW_SIX_LINES_TYPE
  1689. when 2
  1690.     #跟999作比较
  1691.     c = []
  1692.     for i in 0...b.size
  1693.       c[i] = get_position(a[0][0], a[0][1], a[i+1][0], a[i+1][1], b[i] / 999.0)
  1694.     end
  1695.     for i in 0...c.size
  1696.       self.contents.drawline(c[i][0], c[i][1], c[i-1][0], c[i-1][1], 1, text_color(3))
  1697.     end   
  1698. when 1
  1699.     #跟最高能力值比较
  1700.     max_abi = 0
  1701.     b.each{|i| max_abi = [max_abi, i].max}
  1702.     max_abi = max_abi.to_f
  1703.     c = [] #获得能力值的坐标
  1704.     for i in 0...b.size
  1705.       c[i] = get_position(a[0][0], a[0][1], a[i+1][0], a[i+1][1], b[i] / max_abi)
  1706.     end
  1707.     for i in 0...c.size
  1708.       self.contents.drawline(c[i][0], c[i][1], c[i-1][0], c[i-1][1], 1, text_color(3))
  1709.     end   
  1710. end
  1711.     #描绘能力数值
  1712.     self.contents.font.color = knockout_color
  1713.     self.contents.font.size = 14
  1714.     for i in 0...b.size
  1715.       self.contents.draw_text(c[i][0], c[i][1], 32, 24, b[i].to_s)
  1716.     end
  1717.     self.contents.font.size = 22
  1718.     #以下未修改   
  1719.     draw_actor_graphic(@actor, 40, 112)
  1720.     draw_actor_name(@actor, 4, 0)
  1721.     draw_actor_class(@actor, 4 + 144, 0)
  1722.     draw_actor_level(@actor, 96, 32)
  1723.     draw_actor_state(@actor, 96, 64)
  1724.     draw_actor_hp(@actor, 96, 112, 172)
  1725.     draw_actor_sp(@actor, 96, 144, 172)
  1726.     draw_actor_parameter(@actor, 96, 192, 0)
  1727.     draw_actor_parameter(@actor, 96, 224, 1)
  1728.     draw_actor_parameter(@actor, 96, 256, 2)
  1729.     draw_actor_parameter(@actor, 96, 304, 3)
  1730.     draw_actor_parameter(@actor, 96, 336, 4)
  1731.     draw_actor_parameter(@actor, 96, 368, 5)
  1732.     draw_actor_parameter(@actor, 96, 400, 6)
  1733.     self.contents.font.color = system_color
  1734.     self.contents.draw_text(320, 48, 80, 32, "EXP")
  1735.     self.contents.draw_text(320, 80, 80, 32, "NEXT")
  1736.     self.contents.font.color = normal_color
  1737.     self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  1738.     self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  1739.     self.contents.font.color = system_color
  1740.     self.contents.draw_text(320, 160, 96, 32, "装备")
  1741.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
  1742.     draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 240)
  1743.     draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 272)
  1744.     draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 304)
  1745.     draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 336)
  1746.     draw_item_name($data_armors[@actor.armor5_id], 320 + 16, 368)
  1747.     draw_item_name($data_armors[@actor.armor6_id], 320 + 16, 400)
  1748.   end
  1749.   def dummy
  1750.     self.contents.font.color = system_color
  1751.     self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  1752.     self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  1753.     self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  1754.     self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  1755.     self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  1756.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  1757.     draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  1758.     draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  1759.     draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  1760.     draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  1761.   end
  1762. end
  1763. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1764. #
  1765. #              商店购买窗口美化,增加对新装备位置的描述
  1766. #
  1767. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1768. #==============================================================================
  1769. # ■ Window_ShopStatus
  1770. #------------------------------------------------------------------------------
  1771. #  商店画面、显示物品所持数与角色装备的窗口。
  1772. #==============================================================================

  1773. class Window_ShopStatus < Window_Base
  1774.   #--------------------------------------------------------------------------
  1775.   # ● 刷新
  1776.   #--------------------------------------------------------------------------
  1777.   def refresh
  1778.     self.contents.clear
  1779.     if @item == nil
  1780.       return
  1781.     end
  1782.     case @item
  1783.     when RPG::Item
  1784.       number = $game_party.item_number(@item.id)
  1785.     when RPG::Weapon
  1786.       number = $game_party.weapon_number(@item.id)
  1787.     when RPG::Armor
  1788.       number = $game_party.armor_number(@item.id)
  1789.     end
  1790.     self.contents.font.color = system_color
  1791.     self.contents.draw_text(4, 0, 200, 32, "所持数")
  1792.     self.contents.font.color = normal_color
  1793.     self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
  1794.     if @item.is_a?(RPG::Item)
  1795.       return
  1796.     end
  1797.     # 添加装备品信息
  1798.     for i in 0...$game_party.actors.size
  1799.       # 获取角色
  1800.       actor = $game_party.actors[i]
  1801.       # 可以装备为普通文字颜色、不能装备设置为无效文字颜色
  1802.       if actor.equippable?(@item)
  1803.         self.contents.font.color = normal_color
  1804.       else
  1805.         self.contents.font.color = disabled_color
  1806.       end
  1807.       # 描绘角色名字
  1808.       self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
  1809.       # 获取当前的装备品
  1810.       if @item.is_a?(RPG::Weapon)
  1811.         item1 = $data_weapons[actor.weapon_id]
  1812.       elsif @item.kind == 0
  1813.         item1 = $data_armors[actor.armor1_id]
  1814.       elsif @item.kind == 1
  1815.         item1 = $data_armors[actor.armor2_id]
  1816.       elsif @item.kind == 2
  1817.         item1 = $data_armors[actor.armor3_id]
  1818.       elsif @item.kind == 3
  1819.         item1 = $data_armors[actor.armor4_id]
  1820.       elsif @item.kind == 4
  1821.         item1 = $data_armors[actor.armor5_id]
  1822.       else# if @item.kind == 5
  1823.         item1 = $data_armors[actor.armor6_id]
  1824.       end
  1825.       # 可以装备的情况
  1826.       if actor.equippable?(@item)
  1827.         # 武器的情况
  1828.         if @item.is_a?(RPG::Weapon)
  1829.           atk1 = item1 != nil ? item1.atk : 0
  1830.           atk2 = @item != nil ? @item.atk : 0
  1831.           change = atk2 - atk1
  1832.         end
  1833.         # 防具的情况
  1834.         if @item.is_a?(RPG::Armor)
  1835.           pdef1 = item1 != nil ? item1.pdef : 0
  1836.           mdef1 = item1 != nil ? item1.mdef : 0
  1837.           pdef2 = @item != nil ? @item.pdef : 0
  1838.           mdef2 = @item != nil ? @item.mdef : 0
  1839.           change = pdef2 - pdef1 + mdef2 - mdef1
  1840.         end
  1841.         # 描绘能力值变化
  1842.         self.contents.draw_text(124, 64 + 64 * i, 112, 32,
  1843.           sprintf("%+d", change), 2)
  1844.       end
  1845.       # 描绘物品
  1846.       if item1 != nil
  1847.         x = 4
  1848.         y = 64 + 64 * i + 32
  1849.         bitmap = RPG::Cache.icon(item1.icon_name)
  1850.         opacity = self.contents.font.color == normal_color ? 255 : 128
  1851.         self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1852.         self.contents.draw_text(x + 28, y, 212, 32, item1.name)
  1853.       end
  1854.     end
  1855.   end
  1856. end
  1857. #==============================================================================
  1858. # ■ Window_Equip
  1859. #------------------------------------------------------------------------------
  1860. #  装备物品大图标显示。
  1861. #==============================================================================

  1862. class Window_Equip < Window_Base
  1863.   #--------------------------------------------------------------------------
  1864.   # ● 初始化对像
  1865.   #--------------------------------------------------------------------------
  1866.   def initialize
  1867.     super(500, 64, 640, 480)
  1868.     @item = nil
  1869.     self.contents = Bitmap.new(width - 32, height - 32)
  1870.     self.opacity = 0
  1871.     refresh
  1872.   end
  1873.   #--------------------------------------------------------------------------
  1874.   # ● 刷新
  1875.   #--------------------------------------------------------------------------
  1876.   def refresh
  1877.     self.contents.clear
  1878.     if @item != nil
  1879.       bitmap = RPG::Cache.picture(@item.pic_name)
  1880.       pic_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  1881.       self.contents.blt(0, 0, bitmap, pic_rect)
  1882.     end
  1883.   end
  1884.   def set_item(item)
  1885.     @item = item
  1886.   end
  1887. end
  1888. class Scene_Battle
  1889.   #--------------------------------------------------------------------------
  1890.   # ● 基本アクション 結果作成
  1891.   #--------------------------------------------------------------------------
  1892.   def dong_make_basic_action_result
  1893.     # 攻撃の場合
  1894.     if @active_battler.current_action.basic == 0
  1895.       # --- ここから変更部分 ---
  1896.       # アニメーション ID を設定
  1897.       @animation1_id = @active_battler.animation1_id.is_a?(Array) ? @active_battler.animation1_id.dup : @active_battler.animation1_id
  1898.       @animation2_id = @active_battler.animation2_id.is_a?(Array) ? @active_battler.animation2_id.dup : @active_battler.animation2_id
  1899.       # --- 変更部分終わり ---
  1900.       # 行動側バトラーがエネミーの場合
  1901.       if @active_battler.is_a?(Game_Enemy)
  1902.         if @active_battler.restriction == 3
  1903.           target = $game_troop.random_target_enemy
  1904.         elsif @active_battler.restriction == 2
  1905.           target = $game_party.random_target_actor
  1906.         else
  1907.           index = @active_battler.current_action.target_index
  1908.           target = $game_party.smooth_target_actor(index)
  1909.         end
  1910.       end
  1911.       # 行動側バトラーがアクターの場合
  1912.       if @active_battler.is_a?(Game_Actor)
  1913.         if @active_battler.restriction == 3
  1914.           target = $game_party.random_target_actor
  1915.         elsif @active_battler.restriction == 2
  1916.           target = $game_troop.random_target_enemy
  1917.         else
  1918.           index = @active_battler.current_action.target_index
  1919.           target = $game_troop.smooth_target_enemy(index)
  1920.         end
  1921.       end
  1922.       # 対象側バトラーの配列を設定
  1923.       @target_battlers = [target]
  1924.       # 通常攻撃の効果を適用
  1925.       for target in @target_battlers
  1926.         target.attack_effect(@active_battler)
  1927.       end
  1928.       return
  1929.     end
  1930.     # 防御の場合
  1931.     if @active_battler.current_action.basic == 1
  1932.       # ヘルプウィンドウに "防御" を表示
  1933.       @help_window.set_text($data_system.words.guard, 1)
  1934.       return
  1935.     end
  1936.     # 逃げるの場合
  1937.     if @active_battler.is_a?(Game_Enemy) and
  1938.        @active_battler.current_action.basic == 2
  1939.       # ヘルプウィンドウに "逃げる" を表示
  1940.       @help_window.set_text("逃げる", 1)
  1941.       # 逃げる
  1942.       @active_battler.escape
  1943.       return
  1944.     end
  1945.     # 何もしないの場合
  1946.     if @active_battler.current_action.basic == 3
  1947.       # アクション強制対象のバトラーをクリア
  1948.       $game_temp.forcing_battler = nil
  1949.       # ステップ 1 に移行
  1950.       @phase4_step = 1
  1951.       return
  1952.     end
  1953.   end

  1954.   #--------------------------------------------------------------------------
  1955.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  1956.   #--------------------------------------------------------------------------
  1957.   def dong_update_phase4_step3
  1958.     # --- ここから変更部分 ---
  1959.     # アニメーションの配列の先頭を取り出す
  1960.     if @animation1_id.is_a?(Integer)
  1961.       @animation1_id = [@animation1_id]
  1962.     end
  1963.     animation = @animation1_id.shift
  1964.     # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
  1965.     if animation == 0
  1966.       @active_battler.white_flash = true
  1967.     else
  1968.       @active_battler.animation_id = animation
  1969.       @active_battler.animation_hit = true
  1970.     end
  1971.     # アニメーションがなくなったらステップ 4 に移行
  1972.     @phase4_step = 4 if @animation1_id.empty?
  1973.     # --- 変更部分終わり ---
  1974.   end

  1975.   #--------------------------------------------------------------------------
  1976.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  1977.   #--------------------------------------------------------------------------
  1978.   def dong_update_phase4_step4
  1979.     # --- ここから変更部分 ---
  1980.     # アニメーションの配列の先頭を取り出す
  1981.     if @animation2_id.is_a?(Integer)
  1982.       @animation2_id = [@animation2_id]
  1983.     end
  1984.     animation = @animation2_id.shift
  1985.     # 対象側アニメーション
  1986.     for target in @target_battlers
  1987.       target.animation_id = animation
  1988.       target.animation_hit = (target.damage != "Miss")
  1989.     end
  1990.     # アニメーションの長さにかかわらず、最低 8 フレーム待つ
  1991.     @wait_count = 8
  1992.     # アニメーションがなくなったらステップ 5 に移行
  1993.     @phase4_step = 5 if @animation2_id.empty?
  1994.     # --- 変更部分終わり ---
  1995.   end
  1996. end




  1997. #==============================================================================
  1998. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  1999. #==============================================================================
复制代码
rt 我想用六围描绘的脚本 但和原本的图像重叠了 我想知道如何去除状态栏里的基本数值?

点评

截图,脚本....  发表于 2012-6-16 17:28

Lv1.梦旅人

梦石
0
星屑
55
在线时间
85 小时
注册时间
2012-4-25
帖子
192
2
发表于 2012-6-16 19:41:26 | 只看该作者
本帖最后由 woyaozhuce 于 2012-6-16 19:45 编辑



这样的么,我看你的也是装备追加

把描绘能力值的那一段注释掉就行了
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2009-10-4
帖子
45
3
 楼主| 发表于 2012-6-16 19:45:51 | 只看该作者
woyaozhuce 发表于 2012-6-16 19:41
这样的么,我看你的也是装备追加

不 就是想把攻防属性什么的去掉 只剩六围图
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
85 小时
注册时间
2012-4-25
帖子
192
4
发表于 2012-6-16 19:53:17 | 只看该作者
那我就不太会了。 要改动Game_Actor的类

等待高人出现吧。
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
47
在线时间
412 小时
注册时间
2012-6-1
帖子
1021
5
发表于 2012-6-16 20:08:43 | 只看该作者
本帖最后由 明特·布兰马修 于 2012-6-16 20:29 编辑

在楼主的脚本里的1758-1764行的脚本前加个#号
既是注释该功能即可

点评

哦哦!谢谢!!  发表于 2012-6-16 20:47
这里是新人 明特·布兰马修
脚本盲 事件盲 美工盲
还是色盲ORZ
XP\VX略懂VA无助很抱歉
所以问题什么如果答不好就不要提醒我了
短篇7已经放弃,但是坑在继续补上。所以回答和现身次数少之。
有事烧纸或者留言即可。

还有我不是正太啊ORZ
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2009-10-4
帖子
45
6
 楼主| 发表于 2012-6-16 20:27:25 | 只看该作者
明特·布兰马修 发表于 2012-6-16 20:08
在Window_Status脚本里的37-43行的脚本前加个#号
既是注释该功能即可

额 没用啊…… 一样重叠

点评

已经修改了,请查看5楼原帖  发表于 2012-6-16 20:30
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-4 19:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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