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

Project1

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

[已经过期] 一段原创装备类型扩增脚本求修改BUG

[复制链接]

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

跳转到指定楼层
1
发表于 2012-8-5 18:48:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  2. #
  3. #                                发现坑爹问题
  4. #
  5. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  6. module RPG
  7.   class Armor
  8.     def name
  9.       name = @name.split(/,/)[0]
  10.       return name != nil ? name : ''
  11.     end
  12.     def kind
  13.       kind  = @name.split(/,/)[1]
  14.       return kind  != nil ? kind.to_i : @kind
  15.     end
  16.   end
  17. end
  18. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  19. #
  20. #                  C4制作仿LATALE战斗用品装备栏
  21. #
  22. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  23. class Game_Actor < Game_Battler
  24.   attr_reader   :armor5_id                # 项链 ID
  25.   attr_reader   :armor6_id                # 鞋 ID
  26.   attr_reader   :armor7_id                # 项链 ID
  27.   attr_reader   :armor8_id                # 鞋 ID
  28.   attr_reader   :armor9_id                # 项链 ID
  29.   attr_reader   :armor10_id                # 鞋 ID
  30.   attr_reader   :armor11_id                # 项链 ID
  31.   attr_reader   :armor12_id                # 鞋 ID
  32.   #--------------------------------------------------------------------------
  33.   # ● 设置
  34.   #     actor_id : 角色 ID
  35.   #--------------------------------------------------------------------------
  36.   alias old_setup setup
  37.   def setup(actor_id)
  38.     old_setup(actor_id)
  39.     @armor5_id = 0
  40.     @armor6_id = 0
  41.     @armor7_id = 0
  42.     @armor8_id = 0
  43.     @armor9_id = 0
  44.     @armor10_id = 0
  45.     @armor11_id = 0
  46.     @armor12_id = 0
  47.     update_auto_state(nil, $data_armors[@armor5_id])
  48.     update_auto_state(nil, $data_armors[@armor6_id])
  49.     update_auto_state(nil, $data_armors[@armor7_id])
  50.     update_auto_state(nil, $data_armors[@armor8_id])
  51.     update_auto_state(nil, $data_armors[@armor9_id])
  52.     update_auto_state(nil, $data_armors[@armor10_id])
  53.     update_auto_state(nil, $data_armors[@armor11_id])
  54.     update_auto_state(nil, $data_armors[@armor12_id])
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ● 取得属性修正值
  58.   #     element_id : 属性 ID
  59.   #--------------------------------------------------------------------------
  60.   def element_rate(element_id)
  61.     # 获取对应属性有效度的数值
  62.     table = [0,200,150,100,50,0,-100]
  63.     result = table[$data_classes[@class_id].element_ranks[element_id]]
  64.     # 防具能防御本属性的情况下效果减半
  65.     for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id, @armor5_id, @armor6_id, @armor7_id, @armor8_id, @armor9_id, @armor10_id, @armor11_id, @armor12_id]
  66.       armor = $data_armors[i]
  67.       if armor != nil and armor.guard_element_set.include?(element_id)
  68.         result /= 2
  69.       end
  70.     end
  71.     # 状态能防御本属性的情况下效果减半
  72.     for i in @states
  73.       if $data_states[i].guard_element_set.include?(element_id)
  74.         result /= 2
  75.       end
  76.     end
  77.     # 过程结束
  78.     return result
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● 判定防御属性
  82.   #     state_id : 属性 ID
  83.   #--------------------------------------------------------------------------
  84.   def state_guard?(state_id)
  85.     for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id, @armor5_id, @armor6_id, @armor7_id, @armor8_id, @armor9_id, @armor10_id, @armor11_id, @armor12_id]
  86.       armor = $data_armors[i]
  87.       if armor != nil
  88.         if armor.guard_state_set.include?(state_id)
  89.           return true
  90.         end
  91.       end
  92.     end
  93.     return false
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 获取基本力量
  97.   #--------------------------------------------------------------------------
  98.   def base_str
  99.     n = $data_actors[@actor_id].parameters[2, @level]
  100.     weapon = $data_weapons[@weapon_id]
  101.     armor1 = $data_armors[@armor1_id]
  102.     armor2 = $data_armors[@armor2_id]
  103.     armor3 = $data_armors[@armor3_id]
  104.     armor4 = $data_armors[@armor4_id]
  105.     armor5 = $data_armors[@armor5_id]
  106.     armor6 = $data_armors[@armor6_id]
  107.     armor7 = $data_armors[@armor7_id]
  108.     armor8 = $data_armors[@armor8_id]
  109.     armor9 = $data_armors[@armor9_id]
  110.     armor10 = $data_armors[@armor10_id]
  111.     armor11 = $data_armors[@armor11_id]
  112.     armor12 = $data_armors[@armor12_id]
  113.     #armor5 = $data_armors[@armor5_id]
  114.     #armor6 = $data_armors[@armor6_id]
  115.     n += weapon != nil ? weapon.str_plus : 0
  116.     n += armor1 != nil ? armor1.str_plus : 0
  117.     n += armor2 != nil ? armor2.str_plus : 0
  118.     n += armor3 != nil ? armor3.str_plus : 0
  119.     n += armor4 != nil ? armor4.str_plus : 0
  120.     n += armor5 != nil ? armor5.str_plus : 0
  121.     n += armor6 != nil ? armor6.str_plus : 0
  122.     n += armor7 != nil ? armor7.str_plus : 0
  123.     n += armor8 != nil ? armor8.str_plus : 0
  124.     n += armor9 != nil ? armor9.str_plus : 0
  125.     n += armor10 != nil ? armor10.str_plus : 0
  126.     n += armor11 != nil ? armor11.str_plus : 0
  127.     n += armor12 != nil ? armor12.str_plus : 0
  128.    # n += armor5 != nil ? armor5.str_plus : 0
  129.     #n += armor6 != nil ? armor6.str_plus : 0
  130.     return [[n, 1].max, 999].min
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 获取基本灵巧
  134.   #--------------------------------------------------------------------------
  135.   def base_dex
  136.     n = $data_actors[@actor_id].parameters[3, @level]
  137.     weapon = $data_weapons[@weapon_id]
  138.     armor1 = $data_armors[@armor1_id]
  139.     armor2 = $data_armors[@armor2_id]
  140.     armor3 = $data_armors[@armor3_id]
  141.     armor4 = $data_armors[@armor4_id]
  142.     armor5 = $data_armors[@armor5_id]
  143.     armor6 = $data_armors[@armor6_id]
  144.     armor7 = $data_armors[@armor7_id]
  145.     armor8 = $data_armors[@armor8_id]
  146.     armor9 = $data_armors[@armor9_id]
  147.     armor10 = $data_armors[@armor10_id]
  148.     armor11 = $data_armors[@armor11_id]
  149.     armor12 = $data_armors[@armor12_id]
  150.     #armor5 = $data_armors[@armor5_id]
  151.     #armor6 = $data_armors[@armor6_id]
  152.     n += weapon != nil ? weapon.dex_plus : 0
  153.     n += armor1 != nil ? armor1.dex_plus : 0
  154.     n += armor2 != nil ? armor2.dex_plus : 0
  155.     n += armor3 != nil ? armor3.dex_plus : 0
  156.     n += armor4 != nil ? armor4.dex_plus : 0
  157.     n += armor5 != nil ? armor5.dex_plus : 0
  158.     n += armor6 != nil ? armor6.dex_plus : 0
  159.     n += armor7 != nil ? armor7.dex_plus : 0
  160.     n += armor8 != nil ? armor8.dex_plus : 0
  161.     n += armor9 != nil ? armor9.dex_plus : 0
  162.     n += armor10 != nil ? armor10.dex_plus : 0
  163.     n += armor11 != nil ? armor11.dex_plus : 0
  164.     n += armor12 != nil ? armor12.dex_plus : 0
  165.    # n += armor5 != nil ? armor5.str_plus : 0
  166.     #n += armor6 != nil ? armor6.str_plus : 0
  167.     return [[n, 1].max, 999].min
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 获取基本速度
  171.   #--------------------------------------------------------------------------
  172.   def base_agi
  173.     n = $data_actors[@actor_id].parameters[4, @level]
  174.     weapon = $data_weapons[@weapon_id]
  175.     armor1 = $data_armors[@armor1_id]
  176.     armor2 = $data_armors[@armor2_id]
  177.     armor3 = $data_armors[@armor3_id]
  178.     armor4 = $data_armors[@armor4_id]
  179.     armor5 = $data_armors[@armor5_id]
  180.     armor6 = $data_armors[@armor6_id]
  181.     armor7 = $data_armors[@armor7_id]
  182.     armor8 = $data_armors[@armor8_id]
  183.     armor9 = $data_armors[@armor9_id]
  184.     armor10 = $data_armors[@armor10_id]
  185.     armor11 = $data_armors[@armor11_id]
  186.     armor12 = $data_armors[@armor12_id]
  187.     #armor5 = $data_armors[@armor5_id]
  188.     #armor6 = $data_armors[@armor6_id]
  189.     n += weapon != nil ? weapon.agi_plus : 0
  190.     n += armor1 != nil ? armor1.agi_plus : 0
  191.     n += armor2 != nil ? armor2.agi_plus : 0
  192.     n += armor3 != nil ? armor3.agi_plus : 0
  193.     n += armor4 != nil ? armor4.agi_plus : 0
  194.     n += armor5 != nil ? armor5.agi_plus : 0
  195.     n += armor6 != nil ? armor6.agi_plus : 0
  196.     n += armor7 != nil ? armor7.agi_plus : 0
  197.     n += armor8 != nil ? armor8.agi_plus : 0
  198.     n += armor9 != nil ? armor9.agi_plus : 0
  199.     n += armor10 != nil ? armor10.agi_plus : 0
  200.     n += armor11 != nil ? armor11.agi_plus : 0
  201.     n += armor12 != nil ? armor12.agi_plus : 0
  202.    # n += armor5 != nil ? armor5.str_plus : 0
  203.     #n += armor6 != nil ? armor6.str_plus : 0
  204.     return [[n, 1].max, 999].min
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # ● 获取基本魔力
  208.   #--------------------------------------------------------------------------
  209.   def base_int
  210.     n = $data_actors[@actor_id].parameters[5, @level]
  211.     weapon = $data_weapons[@weapon_id]
  212.     armor1 = $data_armors[@armor1_id]
  213.     armor2 = $data_armors[@armor2_id]
  214.     armor3 = $data_armors[@armor3_id]
  215.     armor4 = $data_armors[@armor4_id]
  216.     armor5 = $data_armors[@armor5_id]
  217.     armor6 = $data_armors[@armor6_id]
  218.     armor7 = $data_armors[@armor7_id]
  219.     armor8 = $data_armors[@armor8_id]
  220.     armor9 = $data_armors[@armor9_id]
  221.     armor10 = $data_armors[@armor10_id]
  222.     armor11 = $data_armors[@armor11_id]
  223.     armor12 = $data_armors[@armor12_id]
  224.     #armor5 = $data_armors[@armor5_id]
  225.     #armor6 = $data_armors[@armor6_id]
  226.     n += weapon != nil ? weapon.int_plus : 0
  227.     n += armor1 != nil ? armor1.int_plus : 0
  228.     n += armor2 != nil ? armor2.int_plus : 0
  229.     n += armor3 != nil ? armor3.int_plus : 0
  230.     n += armor4 != nil ? armor4.int_plus : 0
  231.     n += armor5 != nil ? armor5.int_plus : 0
  232.     n += armor6 != nil ? armor6.int_plus : 0
  233.     n += armor7 != nil ? armor7.int_plus : 0
  234.     n += armor8 != nil ? armor8.int_plus : 0
  235.     n += armor9 != nil ? armor9.int_plus : 0
  236.     n += armor10 != nil ? armor10.int_plus : 0
  237.     n += armor11 != nil ? armor11.int_plus : 0
  238.     n += armor12 != nil ? armor12.int_plus : 0
  239.    # n += armor5 != nil ? armor5.str_plus : 0
  240.     #n += armor6 != nil ? armor6.str_plus : 0
  241.     return [[n, 1].max, 999].min
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ● 获取基本物理防御
  245.   #--------------------------------------------------------------------------
  246.   def base_pdef
  247.     weapon = $data_weapons[@weapon_id]
  248.     armor1 = $data_armors[@armor1_id]
  249.     armor2 = $data_armors[@armor2_id]
  250.     armor3 = $data_armors[@armor3_id]
  251.     armor4 = $data_armors[@armor4_id]
  252.     armor5 = $data_armors[@armor5_id]
  253.     armor6 = $data_armors[@armor6_id]
  254.     armor7 = $data_armors[@armor7_id]
  255.     armor8 = $data_armors[@armor8_id]
  256.     armor9 = $data_armors[@armor9_id]
  257.     armor10 = $data_armors[@armor10_id]
  258.     armor11 = $data_armors[@armor11_id]
  259.     armor12 = $data_armors[@armor12_id]
  260.     pdef1 = weapon != nil ? weapon.pdef : 0
  261.     pdef2 = armor1 != nil ? armor1.pdef : 0
  262.     pdef3 = armor2 != nil ? armor2.pdef : 0
  263.     pdef4 = armor3 != nil ? armor3.pdef : 0
  264.     pdef5 = armor4 != nil ? armor4.pdef : 0
  265.     pdef6 = armor5 != nil ? armor5.pdef : 0
  266.     pdef7 = armor6 != nil ? armor6.pdef : 0
  267.     pdef8 = armor7 != nil ? armor7.pdef : 0
  268.     pdef9 = armor8 != nil ? armor8.pdef : 0
  269.     pdef10 = armor9 != nil ? armor9.pdef : 0
  270.     pdef11 = armor10 != nil ? armor10.pdef : 0
  271.     pdef12 = armor11 != nil ? armor11.pdef : 0
  272.     pdef13 = armor12 != nil ? armor12.pdef : 0
  273.     return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + pdef6 + pdef7 + pdef8 + pdef9 + pdef10 + pdef11 + pdef12 + pdef13
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● 获取基本魔法防御
  277.   #--------------------------------------------------------------------------
  278.   def base_mdef
  279.     weapon = $data_weapons[@weapon_id]
  280.     armor1 = $data_armors[@armor1_id]
  281.     armor2 = $data_armors[@armor2_id]
  282.     armor3 = $data_armors[@armor3_id]
  283.     armor4 = $data_armors[@armor4_id]
  284.     armor5 = $data_armors[@armor5_id]
  285.     armor6 = $data_armors[@armor6_id]
  286.     armor7 = $data_armors[@armor7_id]
  287.     armor8 = $data_armors[@armor8_id]
  288.     armor9 = $data_armors[@armor9_id]
  289.     armor10 = $data_armors[@armor10_id]
  290.     armor11 = $data_armors[@armor11_id]
  291.     armor12 = $data_armors[@armor12_id]
  292.     mdef1 = weapon != nil ? weapon.mdef : 0
  293.     mdef2 = armor1 != nil ? armor1.mdef : 0
  294.     mdef3 = armor2 != nil ? armor2.mdef : 0
  295.     mdef4 = armor3 != nil ? armor3.mdef : 0
  296.     mdef5 = armor4 != nil ? armor4.mdef : 0
  297.     mdef6 = armor5 != nil ? armor5.mdef : 0
  298.     mdef7 = armor6 != nil ? armor6.mdef : 0
  299.     mdef8 = armor7 != nil ? armor7.mdef : 0
  300.     mdef9 = armor8 != nil ? armor8.mdef : 0
  301.     mdef10 = armor9 != nil ? armor9.mdef : 0
  302.     mdef11 = armor10 != nil ? armor10.mdef : 0
  303.     mdef12 = armor11 != nil ? armor11.mdef : 0
  304.     mdef13 = armor12 != nil ? armor12.mdef : 0
  305.     return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + mdef6 + mdef7 + mdef8 + mdef9 + mdef10 + mdef11 + mdef12 + mdef13
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # ● 获取基本回避修正
  309.   #--------------------------------------------------------------------------
  310.   def base_eva
  311.     weapon = $data_weapons[@weapon_id]
  312.     armor1 = $data_armors[@armor1_id]
  313.     armor2 = $data_armors[@armor2_id]
  314.     armor3 = $data_armors[@armor3_id]
  315.     armor4 = $data_armors[@armor4_id]
  316.     armor5 = $data_armors[@armor5_id]
  317.     armor6 = $data_armors[@armor6_id]
  318.     armor7 = $data_armors[@armor7_id]
  319.     armor8 = $data_armors[@armor8_id]
  320.     armor9 = $data_armors[@armor9_id]
  321.     armor10 = $data_armors[@armor10_id]
  322.     armor11 = $data_armors[@armor11_id]
  323.     armor12 = $data_armors[@armor12_id]
  324.     eva1 = armor1 != nil ? armor1.eva : 0
  325.     eva2 = armor2 != nil ? armor2.eva : 0
  326.     eva3 = armor3 != nil ? armor3.eva : 0
  327.     eva4 = armor4 != nil ? armor4.eva : 0
  328.     eva5 = armor5 != nil ? armor5.eva : 0
  329.     eva6 = armor6 != nil ? armor6.eva : 0
  330.     eva7 = armor7 != nil ? armor7.eva : 0
  331.     eva8 = armor8 != nil ? armor8.eva : 0
  332.     eva9 = armor9 != nil ? armor9.eva : 0
  333.     eva10 = armor10 != nil ? armor10.eva : 0
  334.     eva11 = armor11 != nil ? armor11.eva : 0
  335.     eva12 = armor12 != nil ? armor12.eva : 0
  336.     return eva1 + eva2 + eva3 + eva4 + eva5 + eva6 + eva7 + eva8 + eva9 + eva10 + eva11 + eva12
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # ● 装备固定判定
  340.   #     equip_type : 装备类型
  341.   #--------------------------------------------------------------------------
  342.   def equip_fix?(equip_type)
  343.     case equip_type
  344.     when 0  # 武器
  345.       return $data_actors[@actor_id].weapon_fix
  346.     when 1  # 盾
  347.       return $data_actors[@actor_id].armor1_fix
  348.     when 2  # 头
  349.       return $data_actors[@actor_id].armor2_fix
  350.     when 3  # 身体
  351.       return $data_actors[@actor_id].armor3_fix
  352.     when 4  # 装饰品
  353.       return $data_actors[@actor_id].armor4_fix
  354.     end
  355.     return false
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # ● 变更装备
  359.   #     equip_type : 装备类型
  360.   #     id    : 武器 or 防具 ID  (0 为解除装备)
  361.   #--------------------------------------------------------------------------
  362.   def equip(equip_type, id)
  363.     case equip_type
  364.     when 0  # 武器
  365.       if id == 0 or $game_party.weapon_number(id) > 0
  366.         $game_party.gain_weapon(@weapon_id, 1)
  367.         @weapon_id = id
  368.         $game_party.lose_weapon(id, 1)
  369.       end
  370.     when 1  # 盾
  371.       if id == 0 or $game_party.armor_number(id) > 0
  372.         update_auto_state($data_armors[@armor1_id], $data_armors[id])
  373.         $game_party.gain_armor(@armor1_id, 1)
  374.         @armor1_id = id
  375.         $game_party.lose_armor(id, 1)
  376.       end
  377.     when 2  # 头
  378.       if id == 0 or $game_party.armor_number(id) > 0
  379.         update_auto_state($data_armors[@armor2_id], $data_armors[id])
  380.         $game_party.gain_armor(@armor2_id, 1)
  381.         @armor2_id = id
  382.         $game_party.lose_armor(id, 1)
  383.       end
  384.     when 3  # 身体
  385.       if id == 0 or $game_party.armor_number(id) > 0
  386.         update_auto_state($data_armors[@armor3_id], $data_armors[id])
  387.         $game_party.gain_armor(@armor3_id, 1)
  388.         @armor3_id = id
  389.         $game_party.lose_armor(id, 1)
  390.       end
  391.     when 4  # 装饰品
  392.       if id == 0 or $game_party.armor_number(id) > 0
  393.         update_auto_state($data_armors[@armor4_id], $data_armors[id])
  394.         $game_party.gain_armor(@armor4_id, 1)
  395.         @armor4_id = id
  396.         $game_party.lose_armor(id, 1)
  397.       end
  398.     when 5  # 项链
  399.       if id == 0 or $game_party.armor_number(id) > 0
  400.         update_auto_state($data_armors[@armor5_id], $data_armors[id])
  401.         $game_party.gain_armor(@armor5_id, 1)
  402.         @armor5_id = id
  403.         $game_party.lose_armor(id, 1)
  404.       end
  405.     when 6  # 鞋
  406.       if id == 0 or $game_party.armor_number(id) > 0
  407.         update_auto_state($data_armors[@armor6_id], $data_armors[id])
  408.         $game_party.gain_armor(@armor6_id, 1)
  409.         @armor6_id = id
  410.         $game_party.lose_armor(id, 1)
  411.       end
  412.     when 7  # 项链
  413.       if id == 0 or $game_party.armor_number(id) > 0
  414.         update_auto_state($data_armors[@armor7_id], $data_armors[id])
  415.         $game_party.gain_armor(@armor7_id, 1)
  416.         @armor7_id = id
  417.         $game_party.lose_armor(id, 1)
  418.       end
  419.     when 8  # 鞋
  420.       if id == 0 or $game_party.armor_number(id) > 0
  421.         update_auto_state($data_armors[@armor8_id], $data_armors[id])
  422.         $game_party.gain_armor(@armor8_id, 1)
  423.         @armor8_id = id
  424.         $game_party.lose_armor(id, 1)
  425.       end
  426.     when 9  # 项链
  427.       if id == 0 or $game_party.armor_number(id) > 0
  428.         update_auto_state($data_armors[@armor9_id], $data_armors[id])
  429.         $game_party.gain_armor(@armor9_id, 1)
  430.         @armor9_id = id
  431.         $game_party.lose_armor(id, 1)
  432.       end
  433.     when 10  # 鞋
  434.       if id == 0 or $game_party.armor_number(id) > 0
  435.         update_auto_state($data_armors[@armor10_id], $data_armors[id])
  436.         $game_party.gain_armor(@armor10_id, 1)
  437.         @armor10_id = id
  438.         $game_party.lose_armor(id, 1)
  439.       end
  440.     when 11  # 项链
  441.       if id == 0 or $game_party.armor_number(id) > 0
  442.         update_auto_state($data_armors[@armor11_id], $data_armors[id])
  443.         $game_party.gain_armor(@armor11_id, 1)
  444.         @armor11_id = id
  445.         $game_party.lose_armor(id, 1)
  446.       end
  447.     when 12  # 鞋
  448.       if id == 0 or $game_party.armor_number(id) > 0
  449.         update_auto_state($data_armors[@armor12_id], $data_armors[id])
  450.         $game_party.gain_armor(@armor12_id, 1)
  451.         @armor12_id = id
  452.         $game_party.lose_armor(id, 1)
  453.       end
  454.     end
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ● 更改职业 ID
  458.   #     class_id : 新的职业 ID
  459.   #--------------------------------------------------------------------------
  460.   def class_id=(class_id)
  461.     if $data_classes[class_id] != nil
  462.       @class_id = class_id
  463.       # 避开无法装备的物品
  464.       unless equippable?($data_weapons[@weapon_id])
  465.         equip(0, 0)
  466.       end
  467.       unless equippable?($data_armors[@armor1_id])
  468.         equip(1, 0)
  469.       end
  470.       unless equippable?($data_armors[@armor2_id])
  471.         equip(2, 0)
  472.       end
  473.       unless equippable?($data_armors[@armor3_id])
  474.         equip(3, 0)
  475.       end
  476.       unless equippable?($data_armors[@armor4_id])
  477.         equip(4, 0)
  478.       end
  479.       unless equippable?($data_armors[@armor5_id])
  480.         equip(5, 0)
  481.       end
  482.       unless equippable?($data_armors[@armor6_id])
  483.         equip(6, 0)
  484.       end
  485.       unless equippable?($data_armors[@armor7_id])
  486.         equip(7, 0)
  487.       end
  488.       unless equippable?($data_armors[@armor8_id])
  489.         equip(8, 0)
  490.       end
  491.       unless equippable?($data_armors[@armor9_id])
  492.         equip(9, 0)
  493.       end
  494.       unless equippable?($data_armors[@armor10_id])
  495.         equip(10, 0)
  496.       end
  497.       unless equippable?($data_armors[@armor11_id])
  498.         equip(11, 0)
  499.       end
  500.       unless equippable?($data_armors[@armor12_id])
  501.         equip(12, 0)
  502.       end
  503.     end
  504.   end
  505. end
  506. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  507. #
  508. #              Window_Base美化,增加属性增减颜色,及全能力值描绘
  509. #
  510. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  511. #==============================================================================
  512. # ■ Window_Base
  513. #------------------------------------------------------------------------------
  514. #  游戏中全部窗口的超级类。
  515. #==============================================================================

  516. class Window_Base < Window
  517.   ################## 属性增减颜色 ##############################
  518.   def up_color
  519.     return Color.new(255, 0, 0)
  520.   end
  521.   def down_color
  522.     return Color.new(0, 255, 0)
  523.   end
  524.   #--------------------------------------------------------------------------
  525.   # ● 描绘能力值
  526.   #     actor : 角色
  527.   #     x     : 描画目标 X 坐标
  528.   #     y     : 描画目标 Y 坐标
  529.   #     type  : 能力值种类 (0~6)
  530.   #--------------------------------------------------------------------------
  531.   def draw_actor_parameter(actor, x, y, type)
  532.     case type
  533.     when 0
  534.       parameter_name = $data_system.words.atk
  535.       parameter_value = actor.atk
  536.     when 1
  537.       parameter_name = $data_system.words.pdef
  538.       parameter_value = actor.pdef
  539.     when 2
  540.       parameter_name = $data_system.words.mdef
  541.       parameter_value = actor.mdef
  542.     when 3
  543.       parameter_name = $data_system.words.str
  544.       parameter_value = actor.str
  545.     when 4
  546.       parameter_name = $data_system.words.dex
  547.       parameter_value = actor.dex
  548.     when 5
  549.       parameter_name = $data_system.words.agi
  550.       parameter_value = actor.agi
  551.     when 6
  552.       parameter_name = $data_system.words.int
  553.       parameter_value = actor.int
  554.     when 7
  555.       parameter_name = "回避"
  556.       parameter_value = actor.eva
  557.     end
  558.     self.contents.font.color = system_color
  559.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  560.     self.contents.font.color = normal_color
  561.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  562.   end
  563. end
  564. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  565. #
  566. #              装备窗口美化,全能力值描绘并追加新的防具装备栏
  567. #
  568. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  569. #==============================================================================
  570. # ■ Window_EquipRight
  571. #------------------------------------------------------------------------------
  572. #  装备画面、显示角色现在装备的物品的窗口。
  573. #==============================================================================

  574. class Window_EquipRight < Window_Selectable
  575.   #--------------------------------------------------------------------------
  576.   # ● 初始化对像
  577.   #     actor : 角色
  578.   #--------------------------------------------------------------------------
  579.   def initialize(actor)
  580.     super(272, 64, 368, 256)
  581.     #super(272, 64, 368, 256)
  582.     self.contents = Bitmap.new(width - 32, height - 32)
  583.     @actor = actor
  584.     refresh
  585.     self.index = 0
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ● 刷新
  589.   #--------------------------------------------------------------------------
  590.   def refresh
  591.     self.contents.clear
  592.     @data = []
  593.     @data.push($data_weapons[@actor.weapon_id])
  594.     @data.push($data_armors[@actor.armor1_id])
  595.     @data.push($data_armors[@actor.armor2_id])
  596.     @data.push($data_armors[@actor.armor3_id])
  597.     @data.push($data_armors[@actor.armor4_id])
  598.     @data.push($data_armors[@actor.armor5_id])
  599.     @data.push($data_armors[@actor.armor6_id])
  600.     @data.push($data_armors[@actor.armor7_id])
  601.     @data.push($data_armors[@actor.armor8_id])
  602.     @data.push($data_armors[@actor.armor9_id])
  603.     @data.push($data_armors[@actor.armor10_id])
  604.     @data.push($data_armors[@actor.armor11_id])
  605.     @data.push($data_armors[@actor.armor12_id])
  606.     @item_max = @data.size
  607.     self.contents.font.color = system_color
  608.     self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
  609.     self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
  610.     self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
  611.     self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
  612.     self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)
  613.     self.contents.draw_text(4, 32 * 5, 92, 32, "上身")
  614.     self.contents.draw_text(4, 32 * 6, 92, 32, "下身")
  615.     self.contents.draw_text(4, 32 * 7, 92, 32, "背部")
  616.     self.contents.draw_text(4, 32 * 8, 92, 32, "手套")
  617.     self.contents.draw_text(4, 32 * 9, 92, 32, "鞋子")
  618.     self.contents.draw_text(4, 32 * 10, 92, 32, "戒指")
  619.     self.contents.draw_text(4, 32 * 11, 92, 32, "勋章")
  620.     self.contents.draw_text(4, 32 * 12, 92, 32, "血统")
  621.     draw_item_name(@data[0], 92, 32 * 0)
  622.     draw_item_name(@data[1], 92, 32 * 1)
  623.     draw_item_name(@data[2], 92, 32 * 2)
  624.     draw_item_name(@data[3], 92, 32 * 3)
  625.     draw_item_name(@data[4], 92, 32 * 4)
  626.     draw_item_name(@data[5], 92, 32 * 5)
  627.     draw_item_name(@data[6], 92, 32 * 6)
  628.     draw_item_name(@data[7], 92, 32 * 7)
  629.     draw_item_name(@data[8], 92, 32 * 8)
  630.     draw_item_name(@data[9], 92, 32 * 9)
  631.     draw_item_name(@data[10], 92, 32 * 10)
  632.     draw_item_name(@data[11], 92, 32 * 11)
  633.     draw_item_name(@data[12], 92, 32 * 12)
  634.   end
  635. end

  636. #==============================================================================
  637. # ■ Window_EquipLeft
  638. #------------------------------------------------------------------------------
  639. #  装备画面的、显示角色能力值变化的窗口。
  640. #==============================================================================

  641. class Window_EquipLeft < Window_Base
  642.   #--------------------------------------------------------------------------
  643.   # ● 初始化对像
  644.   #     actor : 角色
  645.   #--------------------------------------------------------------------------
  646.   def initialize(actor)
  647.     super(0, 64, 272, 416)
  648.     #super(0, 64, 272, 416)
  649.     self.contents = Bitmap.new(width - 32, height - 32)
  650.     @actor = actor
  651.     refresh
  652.   end
  653.   #--------------------------------------------------------------------------
  654.   # ● 刷新
  655.   #--------------------------------------------------------------------------
  656.   def refresh
  657.     self.contents.clear
  658.     draw_actor_name(@actor, 4, 0)
  659.     draw_actor_level(@actor, 4, 32)

  660.     draw_actor_parameter(@actor, 4, 64, 0)
  661.     draw_actor_parameter(@actor, 4, 96, 1)
  662.     draw_actor_parameter(@actor, 4, 128, 2)
  663.     draw_actor_parameter(@actor, 4, 160, 7)
  664.     draw_actor_parameter(@actor, 4, 192, 3)
  665.     draw_actor_parameter(@actor, 4, 224, 4)
  666.     draw_actor_parameter(@actor, 4, 256, 5)
  667.     draw_actor_parameter(@actor, 4, 288, 6)
  668.     if @new_atk != nil
  669.       self.contents.font.color = system_color
  670.       self.contents.draw_text(160, 64, 40, 32, "→", 1)
  671.       self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
  672.       self.contents.font.color = normal_color if @new_atk == @actor.atk
  673.       self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
  674.     end
  675.     if @new_pdef != nil
  676.       self.contents.font.color = system_color
  677.       self.contents.draw_text(160, 96, 40, 32, "→", 1)
  678.       self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
  679.       self.contents.font.color = normal_color if @new_pdef == @actor.pdef
  680.       self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
  681.     end
  682.     if @new_mdef != nil
  683.       self.contents.font.color = system_color
  684.       self.contents.draw_text(160, 128, 40, 32, "→", 1)
  685.       self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
  686.       self.contents.font.color = normal_color if @new_mdef == @actor.mdef
  687.       self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
  688.     end
  689.     if @new_eva != nil
  690.       self.contents.font.color = system_color
  691.       self.contents.draw_text(160, 160, 40, 32, "→", 1)
  692.       self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
  693.       self.contents.font.color = normal_color if @new_eva == @actor.eva
  694.       self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
  695.     end
  696.     if @new_str != nil
  697.       self.contents.font.color = system_color
  698.       self.contents.draw_text(160, 192, 40, 32, "→", 1)
  699.       self.contents.font.color = @new_str>@actor.str ? up_color : down_color
  700.       self.contents.font.color = normal_color if @new_str == @actor.str
  701.       self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
  702.     end
  703.     if @new_dex != nil
  704.       self.contents.font.color = system_color
  705.       self.contents.draw_text(160, 224, 40, 32, "→", 1)
  706.       self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
  707.       self.contents.font.color = normal_color if @new_dex == @actor.dex
  708.       self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
  709.     end
  710.     if @new_agi != nil
  711.       self.contents.font.color = system_color
  712.       self.contents.draw_text(160, 256, 40, 32, "→", 1)
  713.       self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
  714.       self.contents.font.color = normal_color if @new_agi == @actor.agi
  715.       self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
  716.     end
  717.     if @new_int != nil
  718.       self.contents.font.color = system_color
  719.       self.contents.draw_text(160, 288, 40, 32, "→", 1)
  720.       self.contents.font.color = @new_int>@actor.int ? up_color : down_color
  721.       self.contents.font.color = normal_color if @new_int == @actor.int
  722.       self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
  723.     end
  724.   end
  725.   #--------------------------------------------------------------------------
  726.   # ● 变更装备后的能力值设置
  727.   #     new_atk  : 变更装备后的攻击力
  728.   #     new_pdef : 变更装备后的物理防御
  729.   #     new_mdef : 变更装备后的魔法防御
  730.   #--------------------------------------------------------------------------
  731.   def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  732.     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
  733.       @new_atk = new_atk
  734.       @new_pdef = new_pdef
  735.       @new_mdef = new_mdef
  736.       @new_eva = new_eva
  737.       @new_str = new_str
  738.       @new_dex = new_dex
  739.       @new_agi = new_agi
  740.       @new_int = new_int
  741.       refresh
  742.     end
  743.   end
  744. end
  745. #==============================================================================
  746. # ■ Window_EquipItem
  747. #------------------------------------------------------------------------------
  748. #  装备画面、显示浏览变更装备的候补物品的窗口。
  749. #==============================================================================

  750. class Window_EquipItem < Window_Selectable
  751.   #--------------------------------------------------------------------------
  752.   # ● 初始化对像
  753.   #     actor      : 角色
  754.   #     equip_type : 装备部位 (0~3)
  755.   #--------------------------------------------------------------------------
  756.   def initialize(actor, equip_type)
  757.     super(272, 320, 368, 160)
  758.     #super(272, 320, 368, 160)
  759.     @actor = actor
  760.     @equip_type = equip_type
  761.     @column_max = 1
  762.     refresh
  763.     self.active = false
  764.     self.index = -1
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # ● 项目的描绘
  768.   #     index : 项目符号
  769.   #--------------------------------------------------------------------------
  770.   def draw_item(index)
  771.     item = @data[index]
  772.     x = 4
  773.     y = index * 32
  774.     case item
  775.     when RPG::Weapon
  776.       number = $game_party.weapon_number(item.id)
  777.     when RPG::Armor
  778.       number = $game_party.armor_number(item.id)
  779.     end
  780.     bitmap = RPG::Cache.icon(item.icon_name)
  781.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32))
  782.     self.contents.font.color = normal_color
  783.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  784.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  785.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  786.   end
  787. end

  788. class Scene_Equip
  789.   #--------------------------------------------------------------------------
  790.   # ● 主处理
  791.   #--------------------------------------------------------------------------
  792.   def main
  793.     # 获取角色
  794.     @actor = $game_party.actors[@actor_index]
  795.     # 生成窗口
  796.     @help_window = Window_Help.new
  797.     @left_window = Window_EquipLeft.new(@actor)
  798.     @right_window = Window_EquipRight.new(@actor)
  799.     @item_window1 = Window_EquipItem.new(@actor, 0)
  800.     @item_window2 = Window_EquipItem.new(@actor, 1)
  801.     @item_window3 = Window_EquipItem.new(@actor, 2)
  802.     @item_window4 = Window_EquipItem.new(@actor, 3)
  803.     @item_window5 = Window_EquipItem.new(@actor, 4)
  804.     @item_window6 = Window_EquipItem.new(@actor, 5)
  805.     @item_window7 = Window_EquipItem.new(@actor, 6)
  806.     @item_window8 = Window_EquipItem.new(@actor, 7)
  807.     @item_window9 = Window_EquipItem.new(@actor, 8)
  808.     @item_window10 = Window_EquipItem.new(@actor, 9)
  809.     @item_window11 = Window_EquipItem.new(@actor, 10)
  810.     @item_window12 = Window_EquipItem.new(@actor, 11)
  811.     @item_window13 = Window_EquipItem.new(@actor, 12)
  812.     # 关联帮助窗口
  813.     @right_window.help_window = @help_window
  814.     @item_window1.help_window = @help_window
  815.     @item_window2.help_window = @help_window
  816.     @item_window3.help_window = @help_window
  817.     @item_window4.help_window = @help_window
  818.     @item_window5.help_window = @help_window
  819.     @item_window6.help_window = @help_window
  820.     @item_window7.help_window = @help_window
  821.     @item_window8.help_window = @help_window
  822.     @item_window9.help_window = @help_window
  823.     @item_window10.help_window = @help_window
  824.     @item_window11.help_window = @help_window
  825.     @item_window12.help_window = @help_window
  826.     @item_window13.help_window = @help_window
  827.     # 设置光标位置
  828.     @right_window.index = @equip_index
  829.     refresh
  830.     # 执行过渡
  831.     Graphics.transition
  832.     # 主循环
  833.     loop do
  834.       # 刷新游戏画面
  835.       Graphics.update
  836.       # 刷新输入信息
  837.       Input.update
  838.       # 刷新画面
  839.       update
  840.       # 如果画面切换的话的就中断循环
  841.       if $scene != self
  842.         break
  843.       end
  844.     end
  845.     # 准备过渡
  846.     Graphics.freeze
  847.     # 释放窗口
  848.     @help_window.dispose
  849.     @left_window.dispose
  850.     @right_window.dispose
  851.     @item_window1.dispose
  852.     @item_window2.dispose
  853.     @item_window3.dispose
  854.     @item_window4.dispose
  855.     @item_window5.dispose
  856.     @item_window6.dispose
  857.     @item_window7.dispose
  858.     @item_window8.dispose
  859.     @item_window9.dispose
  860.     @item_window10.dispose
  861.     @item_window11.dispose
  862.     @item_window12.dispose
  863.     @item_window13.dispose
  864.   end
  865.   #--------------------------------------------------------------------------
  866.   # ● 刷新
  867.   #--------------------------------------------------------------------------
  868.   def refresh
  869.     # 设置物品窗口的可视状态
  870.     @item_window1.visible = (@right_window.index == 0)
  871.     @item_window2.visible = (@right_window.index == 1)
  872.     @item_window3.visible = (@right_window.index == 2)
  873.     @item_window4.visible = (@right_window.index == 3)
  874.     @item_window5.visible = (@right_window.index == 4)
  875.     @item_window6.visible = (@right_window.index == 5)
  876.     @item_window7.visible = (@right_window.index == 6)
  877.     @item_window8.visible = (@right_window.index == 7)
  878.     @item_window9.visible = (@right_window.index == 8)
  879.     @item_window10.visible = (@right_window.index == 9)
  880.     @item_window11.visible = (@right_window.index == 10)
  881.     @item_window12.visible = (@right_window.index == 11)
  882.     @item_window13.visible = (@right_window.index == 12)
  883.     # 获取当前装备中的物品
  884.     item1 = @right_window.item
  885.     # 设置当前的物品窗口到 @item_window
  886.     case @right_window.index
  887.     when 0
  888.       @item_window = @item_window1
  889.     when 1
  890.       @item_window = @item_window2
  891.     when 2
  892.       @item_window = @item_window3
  893.     when 3
  894.       @item_window = @item_window4
  895.     when 4
  896.       @item_window = @item_window5
  897.     when 5
  898.       @item_window = @item_window6
  899.     when 6
  900.       @item_window = @item_window7
  901.     when 7
  902.       @item_window = @item_window8
  903.     when 8
  904.       @item_window = @item_window9
  905.     when 9
  906.       @item_window = @item_window10
  907.     when 10
  908.       @item_window = @item_window11
  909.     when 11
  910.       @item_window = @item_window12
  911.     when 12
  912.       @item_window = @item_window13
  913.     end
  914.     # 右窗口被激活的情况下
  915.     if @right_window.active
  916.       # 删除变更装备后的能力
  917.     ###############################################################
  918.       @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
  919.     end
  920.     # 物品窗口被激活的情况下
  921.     if @item_window.active
  922.       # 获取现在选中的物品
  923.       item2 = @item_window.item
  924.       # 变更装备
  925.       last_hp = @actor.hp
  926.       last_sp = @actor.sp
  927.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  928.     ###############################################################
  929.       # 获取变更装备后的能力值
  930.       new_atk = @actor.atk
  931.       new_pdef = @actor.pdef
  932.       new_mdef = @actor.mdef
  933.       new_eva = @actor.eva
  934.       new_str = @actor.str
  935.       new_dex = @actor.dex
  936.       new_agi = @actor.agi
  937.       new_int = @actor.int
  938.       # 返回到装备
  939.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  940.       @actor.hp = last_hp
  941.       @actor.sp = last_sp
  942.       # 描画左窗口
  943.     ###############################################################
  944.       @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  945.     ###############################################################
  946.     end
  947.   end
  948. end
  949. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  950. #
  951. #              状态窗口美化,全防具装备栏描绘
  952. #
  953. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  954. #==============================================================================
  955. # ■ Window_Status
  956. #------------------------------------------------------------------------------
  957. #  显示状态画面、完全规格的状态窗口。
  958. #==============================================================================

  959. class Window_Status < Window_Base
  960.   #--------------------------------------------------------------------------
  961.   # ● 刷新
  962.   #--------------------------------------------------------------------------
  963.   def refresh
  964.     self.contents.clear
  965.     draw_actor_graphic(@actor, 40, 112)
  966.     draw_actor_name(@actor, 4, 0)
  967.     draw_actor_class(@actor, 4 + 144, 0)
  968.     draw_actor_level(@actor, 96, 32)
  969.     draw_actor_state(@actor, 96, 64)
  970.     draw_actor_hp(@actor, 96, 112, 172)
  971.     draw_actor_sp(@actor, 96, 144, 172)
  972.     draw_actor_parameter(@actor, 96, 192, 0)
  973.     draw_actor_parameter(@actor, 96, 224, 1)
  974.     draw_actor_parameter(@actor, 96, 256, 2)
  975.     draw_actor_parameter(@actor, 96, 304, 3)
  976.     draw_actor_parameter(@actor, 96, 336, 4)
  977.     draw_actor_parameter(@actor, 96, 368, 5)
  978.     draw_actor_parameter(@actor, 96, 400, 6)
  979.     draw_actor_parameter(@actor, 96, 432, 7)
  980.     draw_actor_parameter(@actor, 96, 464, 8)
  981.     draw_actor_parameter(@actor, 96, 496, 9)
  982.     draw_actor_parameter(@actor, 96, 528, 10)
  983.     draw_actor_parameter(@actor, 96, 560, 11)
  984.     draw_actor_parameter(@actor, 96, 592, 12)
  985.     self.contents.font.color = system_color
  986.     self.contents.draw_text(320, 48, 80, 32, "EXP")
  987.     self.contents.draw_text(320, 80, 80, 32, "NEXT")
  988.     self.contents.font.color = normal_color
  989.     self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  990.     self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  991.     self.contents.font.color = system_color
  992.     self.contents.draw_text(320, 160, 96, 32, "装备")
  993.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
  994.     draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 240)
  995.     draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 272)
  996.     draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 304)
  997.     draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 336)
  998.     draw_item_name($data_armors[@actor.armor5_id], 320 + 16, 368)
  999.     draw_item_name($data_armors[@actor.armor6_id], 320 + 16, 400)
  1000.     draw_item_name($data_armors[@actor.armor7_id], 320 + 16, 432)
  1001.     draw_item_name($data_armors[@actor.armor8_id], 320 + 16, 464)
  1002.     draw_item_name($data_armors[@actor.armor9_id], 320 + 16, 496)
  1003.     draw_item_name($data_armors[@actor.armor10_id], 320 + 16, 528)
  1004.     draw_item_name($data_armors[@actor.armor11_id], 320 + 16, 560)
  1005.     draw_item_name($data_armors[@actor.armor12_id], 320 + 16, 592)
  1006.   end
  1007.   def dummy
  1008.     self.contents.font.color = system_color
  1009.     self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  1010.     self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  1011.     self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  1012.     self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  1013.     self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  1014.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  1015.     draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  1016.     draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  1017.     draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  1018.     draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  1019.   end
  1020. end
  1021. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1022. #
  1023. #              商店购买窗口美化,增加对新装备位置的描述
  1024. #
  1025. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  1026. #==============================================================================
  1027. # ■ Window_ShopStatus
  1028. #------------------------------------------------------------------------------
  1029. #  商店画面、显示物品所持数与角色装备的窗口。
  1030. #==============================================================================

  1031. class Window_ShopStatus < Window_Base
  1032.   #--------------------------------------------------------------------------
  1033.   # ● 刷新
  1034.   #--------------------------------------------------------------------------
  1035.   def refresh
  1036.     self.contents.clear
  1037.     if @item == nil
  1038.       return
  1039.     end
  1040.     case @item
  1041.     when RPG::Item
  1042.       number = $game_party.item_number(@item.id)
  1043.     when RPG::Weapon
  1044.       number = $game_party.weapon_number(@item.id)
  1045.     when RPG::Armor
  1046.       number = $game_party.armor_number(@item.id)
  1047.     end
  1048.     self.contents.font.color = system_color
  1049.     self.contents.draw_text(4, 0, 200, 32, "所持数")
  1050.     self.contents.font.color = normal_color
  1051.     self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
  1052.     if @item.is_a?(RPG::Item)
  1053.       return
  1054.     end
  1055.     # 添加装备品信息
  1056.     for i in 0...$game_party.actors.size
  1057.       # 获取角色
  1058.       actor = $game_party.actors[i]
  1059.       # 可以装备为普通文字颜色、不能装备设置为无效文字颜色
  1060.       if actor.equippable?(@item)
  1061.         self.contents.font.color = normal_color
  1062.       else
  1063.         self.contents.font.color = disabled_color
  1064.       end
  1065.       # 描绘角色名字
  1066.       self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
  1067.       # 获取当前的装备品
  1068.       if @item.is_a?(RPG::Weapon)
  1069.         item1 = $data_weapons[actor.weapon_id]
  1070.       elsif @item.kind == 0
  1071.         item1 = $data_armors[actor.armor1_id]
  1072.       elsif @item.kind == 1
  1073.         item1 = $data_armors[actor.armor2_id]
  1074.       elsif @item.kind == 2
  1075.         item1 = $data_armors[actor.armor3_id]
  1076.       elsif @item.kind == 3
  1077.         item1 = $data_armors[actor.armor4_id]
  1078.       elsif @item.kind == 4
  1079.         item1 = $data_armors[actor.armor5_id]
  1080.       elsif @item.kind == 5
  1081.         item1 = $data_armors[actor.armor6_id]
  1082.       elsif @item.kind == 6
  1083.         item1 = $data_armors[actor.armor7_id]
  1084.       elsif @item.kind == 7
  1085.         item1 = $data_armors[actor.armor8_id]
  1086.       elsif @item.kind == 8
  1087.         item1 = $data_armors[actor.armor9_id]
  1088.       elsif @item.kind == 9
  1089.         item1 = $data_armors[actor.armor10_id]
  1090.       elsif @item.kind == 10
  1091.         item1 = $data_armors[actor.armor11_id]
  1092.       else# if @item.kind == 11
  1093.         item1 = $data_armors[actor.armor12_id]
  1094.       end
  1095.       # 可以装备的情况
  1096.       if actor.equippable?(@item)
  1097.         # 武器的情况
  1098.         if @item.is_a?(RPG::Weapon)
  1099.           atk1 = item1 != nil ? item1.atk : 0
  1100.           atk2 = @item != nil ? @item.atk : 0
  1101.           change = atk2 - atk1
  1102.         end
  1103.         # 防具的情况
  1104.         if @item.is_a?(RPG::Armor)
  1105.           pdef1 = item1 != nil ? item1.pdef : 0
  1106.           mdef1 = item1 != nil ? item1.mdef : 0
  1107.           pdef2 = @item != nil ? @item.pdef : 0
  1108.           mdef2 = @item != nil ? @item.mdef : 0
  1109.           change = pdef2 - pdef1 + mdef2 - mdef1
  1110.         end
  1111.         # 描绘能力值变化
  1112.         self.contents.draw_text(124, 64 + 64 * i, 112, 32,
  1113.           sprintf("%+d", change), 2)
  1114.       end
  1115.       # 描绘物品
  1116.       if item1 != nil
  1117.         x = 4
  1118.         y = 64 + 64 * i + 32
  1119.         bitmap = RPG::Cache.icon(item1.icon_name)
  1120.         opacity = self.contents.font.color == normal_color ? 255 : 128
  1121.         self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 32, 32), opacity)
  1122.         self.contents.draw_text(x + 28, y, 212, 32, item1.name)
  1123.       end
  1124.     end
  1125.   end
  1126. end
复制代码
拿去测试的一定知道BUG就是新增的装备类型看不到名字···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png

Lv5.捕梦者

梦石
0
星屑
39021
在线时间
5719 小时
注册时间
2006-11-10
帖子
6619
2
发表于 2012-8-6 11:16:19 | 只看该作者
  1.   def dummy

  2.     self.contents.font.color = system_color

  3.     self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)

  4.     self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)

  5.     self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)

  6.     self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)

  7.     self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)

  8.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)

  9.     draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)

  10.     draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)

  11.     draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)

  12.     draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)

  13.   end

复制代码
这个dummy是什么意思- -  如果有引用这个方法的话, 显示不出名字主要在这里, 自己添加armor5以后的东东就可以了
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

3
 楼主| 发表于 2012-8-9 14:48:06 | 只看该作者
灯笼菜刀王 发表于 2012-8-6 11:16
这个dummy是什么意思- -  如果有引用这个方法的话, 显示不出名字主要在这里, 自己添加armor5以后的东东就可 ...

重点是我现在的情况是不知道怎样把当前装备栏由一个数列变成2竖列···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-27 06:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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