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

Project1

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

[已经解决] 后知后觉的装备栏拓展脚本出现的一个问题。

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1019 小时
注册时间
2012-4-25
帖子
799
跳转到指定楼层
1
发表于 2013-6-21 09:50:02 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式

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

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

x
  1. #==============================================================================
  2. # 此脚本来自 www.66rpg.com
  3. #------------------------------------------------------------------------------
  4. #  功能:[RMVA]增加装备栏数量
  5. #  作者:后知后觉([email protected]
  6. #  版本:v1.1 2012-02-20
  7. #  使用说明:
  8. #       1.在下面设置需要增加的数量以及增加部位的名字
  9. #       2.在数据库-护甲-备注 里写入 @etype[位置编号]
  10. #         默认系统一共有5个装备位置.占用了0~4号
  11. #         所以扩展出来的装备栏位置编号是从 5 开始.比如 @etype[5]  @etype[6]
  12. #       3.在扩展位置上给角色设置初始装备的方法
  13. #         在 数据库-角色-备注 里写入 @add_equips[装备1ID,装备2ID.....]
  14. #         每个ID中间由半角的 , 分开 比如 @add_equips[61] @add_equips[61,63]
  15. #       4.设置 固定装备 的初始值
  16. #         在 数据库-角色-备注 里写入 @fix_equips[装备位置编号,装备位置编号......]
  17. #         每个编号间由半角的 , 分开 比如 @fix_equips[5] @fix_equips[5,6]
  18. #       5.设置 禁用装备 的初始值
  19. #         在 数据库-角色-备注 里写入 @seal_equips[装备位置编号,装备位置编号......]
  20. #         每个编号间由半角的 , 分开 比如 @seal_equips[5] @seal_equips[5,6]
  21. #       6.游戏运行时可以使用:
  22. #           $game_actors[角色ID].fix_equips  来获取该角色被固定装备位置的数组
  23. #           $game_actors[角色ID].seal_equips 来获取该角色被禁用装备位置的数组
  24. #         然后可以使用数组类的 delete 和 push 方法来删除/增加 etype_id
  25. #         来达到解除与启用 固定、禁用的效果
  26. #         比如 $game_actors[1].fix_equips.delete(5) 解除1号角色5号位置的固定
  27. #              $game_actors[2].seal_equips.push(6) 2号角色禁用6号装备位置
  28. #  注意事项:
  29. #       1.上面说的设置初始装备、固定装备、禁用装备都是只针对新扩展部位的
  30. #         默认的前5个装备位置的固定、禁用、设置初始.还请使用RMVA默认方式设置
  31. #       2.状态画面的描绘装备部分.在默认分辨率下.只能描绘6个装备.
  32. #         我小改了一下.但还是觉得不怎么好看.建议你自己重新描绘那一块...
  33. #==============================================================================
  34. module HzhjEquip
  35.   # 设置要增加的装备部位数量
  36.   ETYPE_ADD_NUM = 3
  37.   # 设置要增加的装备部位的名字
  38.   ETYPE_ADD_NAME = ["帽子", "衣服", "鞋子"]
  39. end
  40. def Vocab.etype(etype_id)
  41.   etypes = $data_system.terms.etypes + HzhjEquip::ETYPE_ADD_NAME
  42.   etypes[etype_id]
  43. end
  44. class RPG::Actor < RPG::BaseItem
  45.   def add_equips
  46.     if /@add_equips\[(.+?)\]/ =~ @note
  47.       result = $1.split(/,/).collect{|str|str.to_i}
  48.       result << 0 while result.size < HzhjEquip::ETYPE_ADD_NUM
  49.     else
  50.       result = Array.new(HzhjEquip::ETYPE_ADD_NUM){0}
  51.     end
  52.     result
  53.   end
  54.   def fix_equips
  55.     if /@fix_equips\[(.+?)\]/ =~ @note
  56.       result = $1.split(/,/).collect{|str|str.to_i}
  57.     else
  58.       result = []
  59.     end
  60.     result
  61.   end
  62.   def seal_equips
  63.     if /@seal_equips\[(.+?)\]/ =~ @note
  64.       result = $1.split(/,/).collect{|str|str.to_i}
  65.     else
  66.       result = []
  67.     end
  68.     result
  69.   end
  70. end
  71. class RPG::Armor < RPG::EquipItem
  72.   def etype_id
  73.     if /@etype\[(.+?)\]/ =~ @note
  74.       return $1.to_i
  75.     else
  76.       return @etype_id
  77.     end
  78.   end
  79. end
  80. class Game_Actor < Game_Battler
  81.   attr_accessor :fix_equips
  82.   attr_accessor :seal_equips
  83.   alias hzhj_old_init_equips_game_actor init_equips
  84.   def init_equips(equips)
  85.     @fix_equips = actor.fix_equips
  86.     @seal_equips = actor.seal_equips
  87.     hzhj_equips = equips.clone
  88.     add_equips = actor.add_equips
  89.     HzhjEquip::ETYPE_ADD_NUM.times{hzhj_equips << add_equips.shift}
  90.     hzhj_old_init_equips_game_actor(hzhj_equips)
  91.   end
  92.   alias hzhj_old_equip_slots_game_actor equip_slots
  93.   def equip_slots
  94.     result = hzhj_old_equip_slots_game_actor
  95.     HzhjEquip::ETYPE_ADD_NUM.times{result << result.size}
  96.     result
  97.   end
  98.   def equip_type_fixed?(etype_id)
  99.     if etype_id > 4
  100.       return @fix_equips.include?(etype_id)
  101.     else
  102.       return super
  103.     end
  104.   end
  105.   def equip_type_sealed?(etype_id)
  106.     if etype_id > 4
  107.       return @seal_equips.include?(etype_id)
  108.     else
  109.       return super
  110.     end
  111.   end
  112. end
  113. class Window_EquipSlot < Window_Selectable
  114.   def actor=(actor)
  115.     return if [url=home.php?mod=space&uid=95897]@actor[/url] == actor
  116.     @actor = actor
  117.     create_contents
  118.     refresh
  119.   end
  120. end
  121. class Window_Status < Window_Selectable
  122.   def draw_equipments(x, y)
  123.     x = 224 if @actor.equips.size > 6
  124.     @actor.equips.each_with_index do |item, i|
  125.       dx = x + 146 * (i / 6)
  126.       dy = y + line_height * (i % 6)
  127.       draw_item_name(item, dx, dy, true, 122)
  128.     end
  129.   end
  130. end
复制代码
上面这个脚本就是后知后觉的装备栏拓展脚本,我在拓展位在游戏开始用@add_equips[装备ID]置添加了装备,然而除了第一个5号位置之外,添加到6,7号位置都会失败,直接出现在物品栏当中。本来是应该问本人,但本人似乎很少出现,所以就到这里问了

Lv1.梦旅人

梦石
0
星屑
50
在线时间
64 小时
注册时间
2013-6-6
帖子
66
6
发表于 2013-6-22 03:21:48 | 只看该作者
  def initialize(dx, dy)
    super(dx, dy, window_width, Graphics.height - dy)
###    @actor = nil  <=700行 直接把它注释掉。
    @temp_actor = nil
    refresh
  end

点评

是将700行整行注射掉?  发表于 2013-6-22 14:41

评分

参与人数 1星屑 +60 收起 理由
Sion + 60 感谢帮忙

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1019 小时
注册时间
2012-4-25
帖子
799
5
 楼主| 发表于 2013-6-22 00:40:39 | 只看该作者
wuchangdao55 发表于 2013-6-21 17:07
好吧!!贴给你吧!!

英文注释有详细的使用方法!



弄了一会,还是不会解决

点评

這是論壇代碼出錯..... (论譚的問題)  发表于 2013-6-22 06:48
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
150 小时
注册时间
2010-10-22
帖子
58
4
发表于 2013-6-21 17:07:52 | 只看该作者
lirn 发表于 2013-6-21 12:21
如果仅仅是说添加装备栏,我也还有另外一个,但是那个脚本我不知道如何附加初始装备以及固定初始装备。

...

好吧!!贴给你吧!!

英文注释有详细的使用方法!
(看不到就百度或谷歌吧----     你X的,你看的懂为毛不汉化呀- -#)
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Equip Engine v1.05
  4. # -- Last Updated: 2012.01.22
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-AceEquipEngine"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.22 - Bug Fixed: <equip slot> notetags updated to factor in spaces.
  15. # 2012.01.05 - Compatibility Update: Equip Dynamic Stats
  16. # 2011.12.30 - Bug Fixed: Stats didn't update.
  17. # 2011.12.23 - Script efficiency optimized.
  18. # 2011.12.18 - Script efficiency optimized.
  19. # 2011.12.13 - Started Script and Finished.
  20. #
  21. #==============================================================================
  22. # ▼ Introduction
  23. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  24. # The default equipment system in RPG Maker VX is the standard equipment system
  25. # seen in all of the previous iterations, which consists of weapon, shield,
  26. # headgear, bodygear, and accessory. To break free of that norm, this script
  27. # allows users access to giving actors and/or classes dynamic equipment setups
  28. # (including having multiples of the same categories). In addition to having
  29. # different equip slot setups, newer equipment types can be made to allow for
  30. # more diversity in armour types.
  31. #
  32. #==============================================================================
  33. # ▼ Instructions
  34. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  35. # To install this script, open up your script editor and copy/paste this script
  36. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  37. #
  38. # -----------------------------------------------------------------------------
  39. # Actor Notetags - These notetags go in the actors notebox in the database.
  40. # -----------------------------------------------------------------------------
  41. # <equip slots>
  42. #  string
  43. #  string
  44. # </equip slots>
  45. # This sets the actor's default slots to whatever is listed in between the two
  46. # notetags. An actor's custom equip slots will take priority over a class's
  47. # custom equip slots, which will take priority over the default equip slots.
  48. # Replace "string" with the proper equipment type name or when in doubt, use
  49. # "equip type: x" with x as the equipment type.
  50. #
  51. # <starting gear: x>
  52. # <starting gear: x, x>
  53. # Adds armour x to the actor's list of starting gear. This is used primarily
  54. # for the newer pieces of gear that can't be added through the starting set of
  55. # equipment through the RPG Maker VX Ace editor by default. Insert multiple of
  56. # these notetags to add more pieces of starting gear if so desired.
  57. #
  58. # <fixed equip: x>
  59. # <fixed equip: x, x>
  60. # This will fix the equip type x. Fixed equip slots mean that the equipment
  61. # already on it are unable to be exchanged in or out by the player. This tag
  62. # has been made so that equip types can be fixed for equip type 5 and above.
  63. # Use multiple of these notetags to add more fixed equipment restrictions.
  64. #
  65. # <sealed equip: x>
  66. # <sealed equip: x, x>
  67. # This will seal the equip type x. Sealed equip slots mean that no equipment
  68. # can be equipped onto that equip type slot. This tag has been made so that
  69. # equip types can be sealed for equip type 5 and above. Use multiple of these
  70. # notetags to add more sealed equipment restrictions.
  71. #
  72. # -----------------------------------------------------------------------------
  73. # Class Notetags - These notetags go in the class notebox in the database.
  74. # -----------------------------------------------------------------------------
  75. # <equip slots>
  76. #  string
  77. #  string
  78. # </equip slots>
  79. # This sets the class's default slots to whatever is listed in between the two
  80. # notetags. An actor's custom equip slots will take priority over a class's
  81. # custom equip slots, which will take priority over the default equip slots.
  82. # Replace "string" with the proper equipment type name or when in doubt, use
  83. # "equip type: x" with x as the equipment type.
  84. #
  85. # <fixed equip: x>
  86. # <fixed equip: x, x>
  87. # This will fix the equip type x. Fixed equip slots mean that the equipment
  88. # already on it are unable to be exchanged in or out by the player. This tag
  89. # has been made so that equip types can be fixed for equip type 5 and above.
  90. # Use multiple of these notetags to add more fixed equipment restrictions.
  91. #
  92. # <sealed equip: x>
  93. # <sealed equip: x, x>
  94. # This will seal the equip type x. Sealed equip slots mean that no equipment
  95. # can be equipped onto that equip type slot. This tag has been made so that
  96. # equip types can be sealed for equip type 5 and above. Use multiple of these
  97. # notetags to add more sealed equipment restrictions.
  98. #
  99. # -----------------------------------------------------------------------------
  100. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  101. # -----------------------------------------------------------------------------
  102. # <fixed equip: x>
  103. # <fixed equip: x, x>
  104. # This will fix the equip type x. Fixed equip slots mean that the equipment
  105. # already on it are unable to be exchanged in or out by the player. This tag
  106. # has been made so that equip types can be fixed for equip type 5 and above.
  107. # Use multiple of these notetags to add more fixed equipment restrictions.
  108. #
  109. # <sealed equip: x>
  110. # <sealed equip: x, x>
  111. # This will seal the equip type x. Sealed equip slots mean that no equipment
  112. # can be equipped onto that equip type slot. This tag has been made so that
  113. # equip types can be sealed for equip type 5 and above. Use multiple of these
  114. # notetags to add more sealed equipment restrictions.
  115. #
  116. # -----------------------------------------------------------------------------
  117. # Armour Notetags - These notetags go in the armour notebox in the database.
  118. # -----------------------------------------------------------------------------
  119. # <equip type: x>
  120. # <equip type: string>
  121. # For the newer equip types, replace x or string with the equip type ID or the
  122. # name of the equip type respectively. This will set that armour to that
  123. # particular equip type.
  124. #
  125. # <fixed equip: x>
  126. # <fixed equip: x, x>
  127. # This will fix the equip type x. Fixed equip slots mean that the equipment
  128. # already on it are unable to be exchanged in or out by the player. This tag
  129. # has been made so that equip types can be fixed for equip type 5 and above.
  130. # Use multiple of these notetags to add more fixed equipment restrictions.
  131. #
  132. # <sealed equip: x>
  133. # <sealed equip: x, x>
  134. # This will seal the equip type x. Sealed equip slots mean that no equipment
  135. # can be equipped onto that equip type slot. This tag has been made so that
  136. # equip types can be sealed for equip type 5 and above. Use multiple of these
  137. # notetags to add more sealed equipment restrictions.
  138. #
  139. # -----------------------------------------------------------------------------
  140. # State Notetags - These notetags go in the states notebox in the database.
  141. # -----------------------------------------------------------------------------
  142. # <fixed equip: x>
  143. # <fixed equip: x, x>
  144. # This will fix the equip type x. Fixed equip slots mean that the equipment
  145. # already on it are unable to be exchanged in or out by the player. This tag
  146. # has been made so that equip types can be fixed for equip type 5 and above.
  147. # Use multiple of these notetags to add more fixed equipment restrictions.
  148. #
  149. # <sealed equip: x>
  150. # <sealed equip: x, x>
  151. # This will seal the equip type x. Sealed equip slots mean that no equipment
  152. # can be equipped onto that equip type slot. This tag has been made so that
  153. # equip types can be sealed for equip type 5 and above. Use multiple of these
  154. # notetags to add more sealed equipment restrictions.
  155. #
  156. #==============================================================================
  157. # ▼ Compatibility
  158. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  159. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  160. # it will run with RPG Maker VX without adjusting.
  161. #
  162. #==============================================================================

  163. module YEA
  164.   module EQUIP
  165.    
  166.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  167.     # - General Equip Settings -
  168.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  169.     # This adjusts the default equip configuration. While actors can have their
  170.     # own unique equipment configurations, it's recommended to not change too
  171.     # much as things get really hairy when it comes to proper eventing.
  172.     #
  173.     # ID   Equip Type
  174.     # ---  ------------
  175.     #  0   Weapon
  176.     #  1   Shield
  177.     #  2   Headgear
  178.     #  3   Bodygear
  179.     #  4   Accessory
  180.     #
  181.     # Whatever you set the below slots to, the dual wield setup will be exactly
  182.     # identical except that the second slot will be changed to a weapon (0).
  183.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  184.     # Adjust this array to set the default slots used for all of your actors
  185.     # and classes if they do not have a custom equipment slot setup.
  186.     DEFAULT_BASE_SLOTS = [ 0, 1, 2, 3, 5,7,6,8,4,4]
  187.    
  188.     # This hash adjusts the new equip types (past 4+). Adjust them to match
  189.     # their names properly. You can choose to allow certain types of equipment
  190.     # be removable or not, or whether or not optimize will affect them.
  191.     TYPES ={
  192.     # TypeID => ["Type Name", Removable?, Optimize?],
  193.            0 => [   "武器",      false,      true],
  194.            1 => [   "盾",       true,      true],
  195.            2 => [ "头盔",       true,      true],
  196.            3 => [ "防具",       true,      true],
  197.            4 => ["贵重物品",       true,     false],
  198.           5 => [ "护腕",       true,      false],
  199.            6 => [ "项链",       true,      true],
  200.            7 => [ "鞋子",       true,      true],
  201.            8 => [ "戒指",       true,      true],
  202.     } # Do not remove this.
  203.    
  204.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  205.     # - Equip Command List -
  206.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  207.     # Here, you can adjust the order at which the commands appear (or even
  208.     # remove commands as you see fit). Here's a list of which does what:
  209.     #
  210.     # -------------------------------------------------------------------------
  211.     # :command         Description
  212.     # -------------------------------------------------------------------------
  213.     # :equip           Activates the manual equip window. Default.
  214.     # :optimize        Optimizes equipment for the actor. Default.
  215.     # :clear           Clears all equipment from the actor. Default
  216.     #
  217.     # And that's all of the currently available commands. This list will be
  218.     # updated as more scripts become available.
  219.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  220.     # This array arranges the order of which the commands appear in the Equip
  221.     # Command window in the Equip Scene.
  222.     COMMAND_LIST =[
  223.       :equip,
  224.       :optimize,
  225.       :clear,
  226.     # :custom1,
  227.     # :custom2,
  228.     ] # Do not remove this.
  229.    
  230.     #--------------------------------------------------------------------------
  231.     # - Equip Custom Commands -
  232.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  233.     # For those who use scripts to that may produce unique effects for
  234.     # equipping, use this hash to manage the custom commands for the Equip
  235.     # Command Window. You can disable certain commands or prevent them from
  236.     # appearing by using switches. If you don't wish to bind them to a switch,
  237.     # set the proper switch to 0 for it to have no impact.
  238.     #--------------------------------------------------------------------------
  239.     CUSTOM_EQUIP_COMMANDS ={
  240.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  241.       :custom1 => [ "Custom Name",            0,          0, :command_name1],
  242.       :custom2 => [ "Custom Text",           13,          0, :command_name2],
  243.     } # Do not remove this.
  244.    
  245.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  246.     # - Misc Window Settings -
  247.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  248.     # This section adjusts the minor visuals that you see inside of the newly
  249.     # organized Equip Scene. Adjust the settings as you see fit.
  250.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  251.     # This sets the font size used for the status window in the lower right
  252.     # corner of the screen (which shows stats and comparisons).
  253.     STATUS_FONT_SIZE = 20
  254.    
  255.     # This sets the remove equip command in the item window.
  256.     REMOVE_EQUIP_ICON = 185
  257.     REMOVE_EQUIP_TEXT = "<Remove Equip>"
  258.    
  259.     # This sets the no-equipment text in the slot window.
  260.     NOTHING_ICON = 185
  261.     NOTHING_TEXT = "<Empty>"
  262.    
  263.    
  264.   end # EQUIP
  265. end # YEA

  266. #==============================================================================
  267. # ▼ Editting anything past this point may potentially result in causing
  268. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  269. # halitosis so edit at your own risk.
  270. #==============================================================================

  271. module YEA
  272.   module REGEXP
  273.   module BASEITEM
  274.    
  275.     EQUIP_SLOTS_ON  = /<(?:EQUIP_SLOTS|equip slots)>/i
  276.     EQUIP_SLOTS_OFF = /<\/(?:EQUIP_SLOTS|equip slots)>/i
  277.    
  278.     EQUIP_TYPE_INT = /<(?:EQUIP_TYPE|equip type):[ ]*(\d+)>/i
  279.     EQUIP_TYPE_STR = /<(?:EQUIP_TYPE|equip type):[ ]*(.*)>/i
  280.    
  281.     STARTING_GEAR = /<(?:STARTING_GEAR|starting gear):[ ](\d+(?:\s*,\s*\d+)*)>/i
  282.    
  283.     FIXED_EQUIP = /<(?:FIXED_EQUIP|fixed equip):[ ](\d+(?:\s*,\s*\d+)*)>/i
  284.     SEALED_EQUIP = /<(?:SEALED_EQUIP|sealed equip):[ ](\d+(?:\s*,\s*\d+)*)>/i
  285.    
  286.   end # BASEITEM
  287.   end # REGEXP
  288. end # YEA

  289. #==============================================================================
  290. # ■ Vocab
  291. #==============================================================================

  292. module Vocab
  293.   
  294.   #--------------------------------------------------------------------------
  295.   # overwrite method: self.etype
  296.   #--------------------------------------------------------------------------
  297.   def self.etype(etype)
  298.     return $data_system.terms.etypes[etype] if [0,1,2,3,4].include?(etype)
  299.     return YEA::EQUIP::TYPES[etype][0] if YEA::EQUIP::TYPES.include?(etype)
  300.     return ""
  301.   end
  302.   
  303. end # Vocab

  304. #==============================================================================
  305. # ■ Icon
  306. #==============================================================================

  307. module Icon
  308.   
  309.   #--------------------------------------------------------------------------
  310.   # self.remove_equip
  311.   #--------------------------------------------------------------------------
  312.   def self.remove_equip; return YEA::EQUIP::REMOVE_EQUIP_ICON; end
  313.   
  314.   #--------------------------------------------------------------------------
  315.   # self.nothing_equip
  316.   #--------------------------------------------------------------------------
  317.   def self.nothing_equip; return YEA::EQUIP::NOTHING_ICON; end
  318.    
  319. end # Icon

  320. #==============================================================================
  321. # ■ Numeric
  322. #==============================================================================

  323. class Numeric
  324.   
  325.   #--------------------------------------------------------------------------
  326.   # new method: group_digits
  327.   #--------------------------------------------------------------------------
  328.   unless $imported["YEA-CoreEngine"]
  329.   def group; return self.to_s; end
  330.   end # $imported["YEA-CoreEngine"]
  331.    
  332. end # Numeric

  333. #==============================================================================
  334. # ■ DataManager
  335. #==============================================================================

  336. module DataManager
  337.   
  338.   #--------------------------------------------------------------------------
  339.   # alias method: load_database
  340.   #--------------------------------------------------------------------------
  341.   class <<self; alias load_database_aee load_database; end
  342.   def self.load_database
  343.     load_database_aee
  344.     load_notetags_aee
  345.   end
  346.   
  347.   #--------------------------------------------------------------------------
  348.   # new method: load_notetags_aee
  349.   #--------------------------------------------------------------------------
  350.   def self.load_notetags_aee
  351.     groups = [$data_actors, $data_classes, $data_weapons, $data_armors,
  352.       $data_states]
  353.     for group in groups
  354.       for obj in group
  355.         next if obj.nil?
  356.         obj.load_notetags_aee
  357.       end
  358.     end
  359.   end
  360.   
  361. end # DataManager

  362. #==============================================================================
  363. # ■ RPG::BaseItem
  364. #==============================================================================

  365. class RPG::BaseItem
  366.   
  367.   #--------------------------------------------------------------------------
  368.   # public instance variables
  369.   #--------------------------------------------------------------------------
  370.   attr_accessor :base_equip_slots
  371.   attr_accessor :fixed_equip_type
  372.   attr_accessor :sealed_equip_type
  373.   attr_accessor :extra_starting_equips
  374.   
  375.   #--------------------------------------------------------------------------
  376.   # common cache: load_notetags_aee
  377.   #--------------------------------------------------------------------------
  378.   def load_notetags_aee
  379.     @base_equip_slots = []
  380.     @equip_slots_on = false
  381.     @fixed_equip_type = []
  382.     @sealed_equip_type = []
  383.     @extra_starting_equips = []
  384.     #---
  385.     self.note.split(/[\r\n]+/).each { |line|
  386.       case line
  387.       #---
  388.       when YEA::REGEXP::BASEITEM::EQUIP_SLOTS_ON
  389.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  390.         @equip_slots_on = true
  391.       when YEA::REGEXP::BASEITEM::EQUIP_SLOTS_OFF
  392.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  393.         @equip_slots_on = false
  394.       #---
  395.       when YEA::REGEXP::BASEITEM::STARTING_GEAR
  396.         next unless self.is_a?(RPG::Actor)
  397.         $1.scan(/\d+/).each { |num|
  398.         @extra_starting_equips.push(num.to_i) if num.to_i > 0 }
  399.       when YEA::REGEXP::BASEITEM::FIXED_EQUIP
  400.         $1.scan(/\d+/).each { |num|
  401.         @fixed_equip_type.push(num.to_i) if num.to_i > 0 }
  402.       when YEA::REGEXP::BASEITEM::SEALED_EQUIP
  403.         $1.scan(/\d+/).each { |num|
  404.         @sealed_equip_type.push(num.to_i) if num.to_i > 0 }
  405.       #---
  406.       when YEA::REGEXP::BASEITEM::EQUIP_TYPE_INT
  407.         next unless self.is_a?(RPG::Armor)
  408.         @etype_id = [1, $1.to_i].max
  409.       when YEA::REGEXP::BASEITEM::EQUIP_TYPE_STR
  410.         next unless self.is_a?(RPG::Armor)
  411.         for key in YEA::EQUIP::TYPES
  412.           id = key[0]
  413.           next if YEA::EQUIP::TYPES[id][0].upcase != $1.to_s.upcase
  414.           @etype_id = [1, id].max
  415.           break
  416.         end
  417.       #---
  418.       else
  419.         if @equip_slots_on
  420.           case line.upcase
  421.           when /EQUIP TYPE[ ](\d+)/i, /EQUIP TYPE:[ ](\d+)/i
  422.             id = $1.to_i
  423.             @base_equip_slots.push(id) if [0,1,2,3,4].include?(id)
  424.             @base_equip_slots.push(id) if YEA::EQUIP::TYPES.include?(id)
  425.           when /WEAPON/i
  426.             @base_equip_slots.push(0)
  427.           when /SHIELD/i
  428.             @base_equip_slots.push(1)
  429.           when /HEAD/i
  430.             @base_equip_slots.push(2)
  431.           when /BODY/i, /ARMOR/i, /ARMOUR/i
  432.             @base_equip_slots.push(3)
  433.           when /ETC/i, /OTHER/i, /ACCESSOR/i
  434.             @base_equip_slots.push(4)
  435.           else
  436.             text = line.upcase.delete(" ")
  437.             for key in YEA::EQUIP::TYPES
  438.               id = key[0]
  439.               next if YEA::EQUIP::TYPES[id][0].upcase.delete(" ")!= text
  440.               @base_equip_slots.push(id)
  441.               break
  442.             end
  443.           end
  444.         end
  445.       end
  446.     } # self.note.split
  447.     #---
  448.     return unless self.is_a?(RPG::Class)
  449.     if @base_equip_slots.empty?
  450.       @base_equip_slots = YEA::EQUIP::DEFAULT_BASE_SLOTS.clone
  451.     end
  452.   end
  453.   
  454. end # RPG::BaseItem

  455. #==============================================================================
  456. # ■ Game_Temp
  457. #==============================================================================

  458. class Game_Temp
  459.   
  460.   #--------------------------------------------------------------------------
  461.   # public instance variables
  462.   #--------------------------------------------------------------------------
  463.   attr_accessor :eds_actor
  464.   attr_accessor :scene_equip_index
  465.   attr_accessor :scene_equip_oy
  466.   
  467. end # Game_Temp

  468. #==============================================================================
  469. # ■ Game_BaseItem
  470. #==============================================================================

  471. class Game_BaseItem
  472.   
  473.   #--------------------------------------------------------------------------
  474.   # public instance variables
  475.   #--------------------------------------------------------------------------
  476.   attr_accessor :item_id
  477.   
  478. end # Game_BaseItem

  479. #==============================================================================
  480. # ■ Game_BattlerBase
  481. #==============================================================================

  482. class Game_BattlerBase
  483.   
  484.   #--------------------------------------------------------------------------
  485.   # alias method: equip_type_fixed?
  486.   #--------------------------------------------------------------------------
  487.   alias game_battlerbase_equip_type_fixed_aee equip_type_fixed?
  488.   def equip_type_fixed?(etype_id)
  489.     return true if fixed_etypes.include?(etype_id) if actor?
  490.     return game_battlerbase_equip_type_fixed_aee(etype_id)
  491.   end
  492.   
  493.   #--------------------------------------------------------------------------
  494.   # alias method: equip_type_sealed?
  495.   #--------------------------------------------------------------------------
  496.   alias game_battlerbase_equip_type_sealed_aee equip_type_sealed?
  497.   def equip_type_sealed?(etype_id)
  498.     return true if sealed_etypes.include?(etype_id) if actor?
  499.     return game_battlerbase_equip_type_sealed_aee(etype_id)
  500.   end
  501.   
  502. end # Game_BattlerBase

  503. #==============================================================================
  504. # ■ Game_Actor
  505. #==============================================================================

  506. class Game_Actor < Game_Battler
  507.   
  508.   #--------------------------------------------------------------------------
  509.   # alias method: init_equips
  510.   #--------------------------------------------------------------------------
  511.   alias game_actor_init_equips_aee init_equips
  512.   def init_equips(equips)
  513.     game_actor_init_equips_aee(equips)
  514.     equip_extra_starting_equips
  515.   end
  516.   
  517.   #--------------------------------------------------------------------------
  518.   # new method: equip_extra_starting_equips
  519.   #--------------------------------------------------------------------------
  520.   def equip_extra_starting_equips
  521.     for equip_id in actor.extra_starting_equips
  522.       armour = $data_armors[equip_id]
  523.       next if armour.nil?
  524.       etype_id = armour.etype_id
  525.       next unless equip_slots.include?(etype_id)
  526.       slot_id = empty_slot(etype_id)
  527.       @equips[slot_id].set_equip(etype_id == 0, armour.id)
  528.     end
  529.     refresh
  530.   end
  531.   
  532.   #--------------------------------------------------------------------------
  533.   # overwrite method: equip_slots
  534.   #--------------------------------------------------------------------------
  535.   def equip_slots
  536.     return equip_slots_dual if dual_wield?
  537.     return equip_slots_normal
  538.   end
  539.   
  540.   #--------------------------------------------------------------------------
  541.   # new method: equip_slots_normal
  542.   #--------------------------------------------------------------------------
  543.   def equip_slots_normal
  544.     return self.actor.base_equip_slots if self.actor.base_equip_slots != []
  545.     return self.class.base_equip_slots
  546.   end
  547.   
  548.   #--------------------------------------------------------------------------
  549.   # new method: equip_slots_dual
  550.   #--------------------------------------------------------------------------
  551.   def equip_slots_dual
  552.     array = equip_slots_normal.clone
  553.     array[1] = 0 if array.size >= 2
  554.     return array
  555.   end
  556.   
  557.   #--------------------------------------------------------------------------
  558.   # new method: fixed_etypes
  559.   #--------------------------------------------------------------------------
  560.   def fixed_etypes
  561.     array = []
  562.     array |= self.actor.fixed_equip_type
  563.     array |= self.class.fixed_equip_type
  564.     for equip in equips
  565.       next if equip.nil?
  566.       array |= equip.fixed_equip_type
  567.     end
  568.     for state in states
  569.       next if state.nil?
  570.       array |= state.fixed_equip_type
  571.     end
  572.     return array
  573.   end
  574.   
  575.   #--------------------------------------------------------------------------
  576.   # new method: sealed_etypes
  577.   #--------------------------------------------------------------------------
  578.   def sealed_etypes
  579.     array = []
  580.     array |= self.actor.sealed_equip_type
  581.     array |= self.class.sealed_equip_type
  582.     for equip in equips
  583.       next if equip.nil?
  584.       array |= equip.sealed_equip_type
  585.     end
  586.     for state in states
  587.       next if state.nil?
  588.       array |= state.sealed_equip_type
  589.     end
  590.     return array
  591.   end
  592.   
  593.   #--------------------------------------------------------------------------
  594.   # alias method: change_equip
  595.   #--------------------------------------------------------------------------
  596.   alias game_actor_change_equip_aee change_equip
  597.   def change_equip(slot_id, item)
  598.     if item.nil? && !@optimize_clear
  599.       etype_id = equip_slots[slot_id]
  600.       return unless YEA::EQUIP::TYPES[etype_id][1]
  601.     elsif item.nil? && @optimize_clear
  602.       etype_id = equip_slots[slot_id]
  603.       return unless YEA::EQUIP::TYPES[etype_id][2]
  604.     end
  605.     game_actor_change_equip_aee(slot_id, item)
  606.   end
  607.   
  608.   #--------------------------------------------------------------------------
  609.   # overwrite method: optimize_equipments
  610.   #--------------------------------------------------------------------------
  611.   def optimize_equipments
  612.     $game_temp.eds_actor = self
  613.     @optimize_clear = true
  614.     clear_equipments
  615.     @optimize_clear = false
  616.     equip_slots.size.times do |i|
  617.       next if !equip_change_ok?(i)
  618.       next unless can_optimize?(i)
  619.       items = $game_party.equip_items.select do |item|
  620.         item.etype_id == equip_slots[i] &&
  621.         equippable?(item) && item.performance >= 0
  622.       end
  623.       change_equip(i, items.max_by {|item| item.performance })
  624.     end
  625.     $game_temp.eds_actor = nil
  626.   end
  627.   
  628.   #--------------------------------------------------------------------------
  629.   # new method: can_optimize?
  630.   #--------------------------------------------------------------------------
  631.   def can_optimize?(slot_id)
  632.     etype_id = equip_slots[slot_id]
  633.     return YEA::EQUIP::TYPES[etype_id][2]
  634.   end
  635.   
  636. end # Game_Actor

  637. #==============================================================================
  638. # ■ Game_Interpreter
  639. #==============================================================================

  640. class Game_Interpreter
  641.   
  642.   #--------------------------------------------------------------------------
  643.   # overwrite method: change equip
  644.   #--------------------------------------------------------------------------
  645.   def command_319
  646.     actor = $game_actors[@params[0]]
  647.     return if actor.nil?
  648.     if @params[1] == 0 && @params[2] != 0
  649.       item = $data_weapons[@params[2]]
  650.       return unless actor.equip_slots.include?(0)
  651.       slot_id = actor.empty_slot(0)
  652.     elsif @params[2] != 0
  653.       item = $data_armors[@params[2]]
  654.       return unless actor.equip_slots.include?(item.etype_id)
  655.       slot_id = actor.empty_slot(item.etype_id)
  656.     else
  657.       slot_id = @params[1]
  658.     end
  659.     actor.change_equip_by_id(slot_id, @params[2])
  660.   end
  661.   
  662. end # Game_Interpreter

  663. #==============================================================================
  664. # ■ Window_EquipStatus
  665. #==============================================================================

  666. class Window_EquipStatus < Window_Base
  667.   
  668.   #--------------------------------------------------------------------------
  669.   # overwrite method: initialize
  670.   #--------------------------------------------------------------------------
  671.   def initialize(dx, dy)
  672.     super(dx, dy, window_width, Graphics.height - dy)
  673.     [url=home.php?mod=space&uid=95897]@actor[/url] = nil
  674.     @temp_actor = nil
  675.     refresh
  676.   end
  677.   
  678.   #--------------------------------------------------------------------------
  679.   # overwrite method: window_width
  680.   #--------------------------------------------------------------------------
  681.   def window_width; return Graphics.width * 2 / 5; end
  682.   
  683.   #--------------------------------------------------------------------------
  684.   # overwrite method: refresh
  685.   #--------------------------------------------------------------------------
  686.   def refresh
  687.     contents.clear
  688.     8.times {|i| draw_item(0, line_height * i, i) }
  689.   end
  690.   
  691.   #--------------------------------------------------------------------------
  692.   # overwrite method: draw_item
  693.   #--------------------------------------------------------------------------
  694.   def draw_item(dx, dy, param_id)
  695.     draw_background_colour(dx, dy)
  696.     draw_param_name(dx + 4, dy, param_id)
  697.     draw_current_param(dx + 4, dy, param_id) if @actor
  698.     drx = (contents.width + 22) / 2
  699.     draw_right_arrow(drx, dy)
  700.     draw_new_param(drx + 22, dy, param_id) if @temp_actor
  701.     reset_font_settings
  702.   end
  703.   
  704.   #--------------------------------------------------------------------------
  705.   # new method: draw_background_colour
  706.   #--------------------------------------------------------------------------
  707.   def draw_background_colour(dx, dy)
  708.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  709.     rect = Rect.new(dx+1, dy+1, contents.width - 2, line_height - 2)
  710.     contents.fill_rect(rect, colour)
  711.   end
  712.   
  713.   #--------------------------------------------------------------------------
  714.   # overwrite method: draw_param_name
  715.   #--------------------------------------------------------------------------
  716.   def draw_param_name(dx, dy, param_id)
  717.     contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  718.     change_color(system_color)
  719.     draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  720.   end
  721.   
  722.   #--------------------------------------------------------------------------
  723.   # overwrite method: draw_current_param
  724.   #--------------------------------------------------------------------------
  725.   def draw_current_param(dx, dy, param_id)
  726.     change_color(normal_color)
  727.     dw = (contents.width + 22) / 2
  728.     draw_text(0, dy, dw, line_height, @actor.param(param_id).group, 2)
  729.     reset_font_settings
  730.   end
  731.   
  732.   #--------------------------------------------------------------------------
  733.   # overwrite method: draw_new_param
  734.   #--------------------------------------------------------------------------
  735.   def draw_new_param(dx, dy, param_id)
  736.     contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  737.     new_value = @temp_actor.param(param_id)
  738.     change_color(param_change_color(new_value - @actor.param(param_id)))
  739.     draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  740.     reset_font_settings
  741.   end
  742.   
  743. end # Window_EquipStatus

  744. #==============================================================================
  745. # ■ Window_EquipCommand
  746. #==============================================================================

  747. class Window_EquipCommand < Window_HorzCommand
  748.   
  749.   #--------------------------------------------------------------------------
  750.   # overwrite method: make_command_list
  751.   #--------------------------------------------------------------------------
  752.   def make_command_list
  753.     for command in YEA::EQUIP::COMMAND_LIST
  754.       case command
  755.       when :equip
  756.         add_command(Vocab::equip2, :equip)
  757.       when :optimize
  758.         add_command(Vocab::optimize, :optimize)
  759.       when :clear
  760.         add_command(Vocab::clear, :clear)
  761.       else
  762.         process_custom_command(command)
  763.       end
  764.     end
  765.   end
  766.   
  767.   #--------------------------------------------------------------------------
  768.   # process_ok
  769.   #--------------------------------------------------------------------------
  770.   def process_ok
  771.     $game_temp.scene_equip_index = index
  772.     $game_temp.scene_equip_oy = self.oy
  773.     super
  774.   end
  775.   
  776.   #--------------------------------------------------------------------------
  777.   # new method: process_custom_command
  778.   #--------------------------------------------------------------------------
  779.   def process_custom_command(command)
  780.     return unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  781.     show = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][2]
  782.     continue = show <= 0 ? true : $game_switches[show]
  783.     return unless continue
  784.     text = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][0]
  785.     switch = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][1]
  786.     enabled = switch <= 0 ? true : $game_switches[switch]
  787.     add_command(text, command, enabled)
  788.   end
  789.   
  790.   #--------------------------------------------------------------------------
  791.   # overwrite method: window_width
  792.   #--------------------------------------------------------------------------
  793.   def window_width; return 160; end
  794.   
  795.   #--------------------------------------------------------------------------
  796.   # overwrite method: contents_width
  797.   #--------------------------------------------------------------------------
  798.   def contents_width; return width - standard_padding * 2; end
  799.   
  800.   #--------------------------------------------------------------------------
  801.   # overwrite method: contents_height
  802.   #--------------------------------------------------------------------------
  803.   def contents_height
  804.     ch = height - standard_padding * 2
  805.     return [ch - ch % item_height, row_max * item_height].max
  806.   end
  807.   
  808.   #--------------------------------------------------------------------------
  809.   # overwrite method: visible_line_number
  810.   #--------------------------------------------------------------------------
  811.   def visible_line_number; return 4; end
  812.   
  813.   #--------------------------------------------------------------------------
  814.   # overwrite method: col_max
  815.   #--------------------------------------------------------------------------
  816.   def col_max; return 1; end
  817.    
  818.   #--------------------------------------------------------------------------
  819.   # overwrite method: item_rect
  820.   #--------------------------------------------------------------------------
  821.   def item_rect(index)
  822.     rect = Rect.new
  823.     rect.width = item_width
  824.     rect.height = item_height
  825.     rect.x = index % col_max * (item_width + spacing)
  826.     rect.y = index / col_max * item_height
  827.     rect
  828.   end
  829.   
  830.   #--------------------------------------------------------------------------
  831.   # overwrite method: ensure_cursor_visible
  832.   #--------------------------------------------------------------------------
  833.   def ensure_cursor_visible
  834.     self.top_row = row if row < top_row
  835.     self.bottom_row = row if row > bottom_row
  836.   end
  837.    
  838.   #--------------------------------------------------------------------------
  839.   # overwrite method: cursor_down
  840.   #--------------------------------------------------------------------------
  841.   def cursor_down(wrap = false)
  842.     if index < item_max - col_max || (wrap && col_max == 1)
  843.       select((index + col_max) % item_max)
  844.     end
  845.   end
  846.   
  847.   #--------------------------------------------------------------------------
  848.   # overwrite method: cursor_up
  849.   #--------------------------------------------------------------------------
  850.   def cursor_up(wrap = false)
  851.     if index >= col_max || (wrap && col_max == 1)
  852.       select((index - col_max + item_max) % item_max)
  853.     end
  854.   end
  855.   
  856.   #--------------------------------------------------------------------------
  857.   # overwrite method: process_pageup
  858.   #--------------------------------------------------------------------------
  859.   def process_pageup
  860.     Sound.play_cursor
  861.     Input.update
  862.     deactivate
  863.     call_handler(:pageup)
  864.   end
  865.   
  866.   #--------------------------------------------------------------------------
  867.   # overwrite method: process_pagedown
  868.   #--------------------------------------------------------------------------
  869.   def process_pagedown
  870.     Sound.play_cursor
  871.     Input.update
  872.     deactivate
  873.     call_handler(:pagedown)
  874.   end
  875.   
  876. end # Window_EquipCommand

  877. #==============================================================================
  878. # ■ Window_EquipSlot
  879. #==============================================================================

  880. class Window_EquipSlot < Window_Selectable
  881.   
  882.   #--------------------------------------------------------------------------
  883.   # overwrite method: initialize
  884.   #--------------------------------------------------------------------------
  885.   def initialize(dx, dy, dw)
  886.     super(dx, dy, dw, Graphics.height - dy)
  887.     @actor = nil
  888.     refresh
  889.   end
  890.   
  891.   #--------------------------------------------------------------------------
  892.   # overwrite method: window_height
  893.   #--------------------------------------------------------------------------
  894.   def window_height; return self.height; end
  895.   
  896.   #--------------------------------------------------------------------------
  897.   # overwrite method: visible_line_number
  898.   #--------------------------------------------------------------------------
  899.   def visible_line_number; return item_max; end
  900.   
  901.   #--------------------------------------------------------------------------
  902.   # overwrite method: refresh
  903.   #--------------------------------------------------------------------------
  904.   def refresh
  905.     create_contents
  906.     super
  907.   end
  908.   
  909.   #--------------------------------------------------------------------------
  910.   # overwrite method: draw_item
  911.   #--------------------------------------------------------------------------
  912.   def draw_item(index)
  913.     return unless @actor
  914.     rect = item_rect_for_text(index)
  915.     change_color(system_color, enable?(index))
  916.     draw_text(rect.x, rect.y, 92, line_height, slot_name(index))
  917.     item = @actor.equips[index]
  918.     dx = rect.x + 92
  919.     dw = contents.width - dx - 24
  920.     if item.nil?
  921.       draw_nothing_equip(dx, rect.y, false, dw)
  922.     else
  923.       draw_item_name(item, dx, rect.y, enable?(index), dw)
  924.     end
  925.   end
  926.   
  927.   #--------------------------------------------------------------------------
  928.   # new method: draw_nothing_equip
  929.   #--------------------------------------------------------------------------
  930.   def draw_nothing_equip(dx, dy, enabled, dw)
  931.     change_color(normal_color, enabled)
  932.     draw_icon(Icon.nothing_equip, dx, dy, enabled)
  933.     text = YEA::EQUIP::NOTHING_TEXT
  934.     draw_text(dx + 24, dy, dw - 24, line_height, text)
  935.   end
  936.   
  937. end # Window_EquipSlot

  938. #==============================================================================
  939. # ■ Window_EquipItem
  940. #==============================================================================

  941. class Window_EquipItem < Window_ItemList
  942.   
  943.   #--------------------------------------------------------------------------
  944.   # overwrite method: col_max
  945.   #--------------------------------------------------------------------------
  946.   def col_max; return 1; end
  947.   
  948.   #--------------------------------------------------------------------------
  949.   # overwrite method: slot_id=
  950.   #--------------------------------------------------------------------------
  951.   def slot_id=(slot_id)
  952.     return if @slot_id == slot_id
  953.     @slot_id = slot_id
  954.     @last_item = nil
  955.     self.oy = 0
  956.   end
  957.   
  958.   #--------------------------------------------------------------------------
  959.   # overwrite method: draw_item
  960.   #--------------------------------------------------------------------------
  961.   def draw_item(index)
  962.     item = @data[index]
  963.     rect = item_rect(index)
  964.     rect.width -= 4
  965.     if item.nil?
  966.       draw_remove_equip(rect)
  967.       return
  968.     end
  969.     dw = contents.width - rect.x - 24
  970.     draw_item_name(item, rect.x, rect.y, enable?(item), dw)
  971.     draw_item_number(rect, item)
  972.   end
  973.   
  974.   #--------------------------------------------------------------------------
  975.   # new method: draw_remove_equip
  976.   #--------------------------------------------------------------------------
  977.   def draw_remove_equip(rect)
  978.     draw_icon(Icon.remove_equip, rect.x, rect.y)
  979.     text = YEA::EQUIP::REMOVE_EQUIP_TEXT
  980.     rect.x += 24
  981.     rect.width -= 24
  982.     draw_text(rect, text)
  983.   end
  984.   
  985.   #--------------------------------------------------------------------------
  986.   # overwrite method: include?
  987.   #--------------------------------------------------------------------------
  988.   def include?(item)
  989.     if item.nil? && [email protected]?
  990.       etype_id = @actor.equip_slots[@slot_id]
  991.       return YEA::EQUIP::TYPES[etype_id][1]
  992.     end
  993.     return true if item.nil?
  994.     return false unless item.is_a?(RPG::EquipItem)
  995.     return false if @slot_id < 0
  996.     return false if item.etype_id != @actor.equip_slots[@slot_id]
  997.     return @actor.equippable?(item)
  998.   end
  999.   
  1000.   #--------------------------------------------------------------------------
  1001.   # overwrite method: enable?
  1002.   #--------------------------------------------------------------------------
  1003.   def enable?(item)
  1004.     if item.nil? && [email protected]?
  1005.       etype_id = @actor.equip_slots[@slot_id]
  1006.       return YEA::EQUIP::TYPES[etype_id][1]
  1007.     end
  1008.     return @actor.equippable?(item)
  1009.   end
  1010.   
  1011.   #--------------------------------------------------------------------------
  1012.   # new method: show
  1013.   #--------------------------------------------------------------------------
  1014.   def show
  1015.     @last_item = 0
  1016.     update_help
  1017.     super
  1018.   end
  1019.   
  1020.   #--------------------------------------------------------------------------
  1021.   # overwrite method: update_help
  1022.   #--------------------------------------------------------------------------
  1023.   def update_help
  1024.     super
  1025.     return if @actor.nil?
  1026.     return if @status_window.nil?
  1027.     return if @last_item == item
  1028.     @last_item = item
  1029.     temp_actor = Marshal.load(Marshal.dump(@actor))
  1030.     temp_actor.force_change_equip(@slot_id, item)
  1031.     @status_window.set_temp_actor(temp_actor)
  1032.   end
  1033.   
  1034. end # Window_EquipItem

  1035. #==============================================================================
  1036. # ■ Window_EquipActor
  1037. #==============================================================================

  1038. class Window_EquipActor < Window_Base
  1039.   
  1040.   #--------------------------------------------------------------------------
  1041.   # initialize
  1042.   #--------------------------------------------------------------------------
  1043.   def initialize(dx, dy)
  1044.     super(dx, dy, window_width, fitting_height(4))
  1045.     @actor = nil
  1046.   end
  1047.   
  1048.   #--------------------------------------------------------------------------
  1049.   # window_width
  1050.   #--------------------------------------------------------------------------
  1051.   def window_width; return Graphics.width - 160; end
  1052.   
  1053.   #--------------------------------------------------------------------------
  1054.   # actor=
  1055.   #--------------------------------------------------------------------------
  1056.   def actor=(actor)
  1057.     return if @actor == actor
  1058.     @actor = actor
  1059.     refresh
  1060.   end
  1061.   
  1062.   #--------------------------------------------------------------------------
  1063.   # refresh
  1064.   #--------------------------------------------------------------------------
  1065.   def refresh
  1066.     contents.clear
  1067.     return unless @actor
  1068.     draw_actor_face(@actor, 0, 0)
  1069.     draw_actor_simple_status(@actor, 108, line_height / 2)
  1070.   end
  1071.   
  1072. end # Window_EquipActor

  1073. #==============================================================================
  1074. # ■ Scene_Equip
  1075. #==============================================================================

  1076. class Scene_Equip < Scene_MenuBase
  1077.   
  1078.   #--------------------------------------------------------------------------
  1079.   # overwrite method: create_status_window
  1080.   #--------------------------------------------------------------------------
  1081.   def create_status_window
  1082.     wx = Graphics.width - (Graphics.width * 2 / 5)
  1083.     wy = @help_window.height + 120
  1084.     @status_window = Window_EquipStatus.new(wx, wy)
  1085.     @status_window.viewport = @viewport
  1086.     @status_window.actor = @actor
  1087.   end
  1088.   
  1089.   #--------------------------------------------------------------------------
  1090.   # overwrite method: create_command_window
  1091.   #--------------------------------------------------------------------------
  1092.   def create_command_window
  1093.      
  1094.     wx = 0
  1095.     wy = @help_window.height
  1096.     ww = 160
  1097.     @command_window = Window_EquipCommand.new(wx, wy, ww)
  1098.     @command_window.viewport = @viewport
  1099.     @command_window.help_window = @help_window
  1100.     if !$game_temp.scene_equip_index.nil?
  1101.       @command_window.select($game_temp.scene_equip_index)
  1102.       @command_window.oy = $game_temp.scene_equip_oy
  1103.     end
  1104.     $game_temp.scene_equip_index = nil
  1105.     $game_temp.scene_equip_oy = nil
  1106.     @command_window.set_handler(:equip,    method(:command_equip))
  1107.     @command_window.set_handler(:optimize, method(:command_optimize))
  1108.     @command_window.set_handler(:clear,    method(:command_clear))
  1109.     @command_window.set_handler(:cancel,   method(:return_scene))
  1110.     @command_window.set_handler(:pagedown, method(:next_actor))
  1111.     @command_window.set_handler(:pageup,   method(:prev_actor))
  1112.     process_custom_equip_commands
  1113.     create_actor_window
  1114.   end
  1115.   
  1116.   #--------------------------------------------------------------------------
  1117.   # new method: create_actor_window
  1118.   #--------------------------------------------------------------------------
  1119.   def create_actor_window
  1120.     wy = @help_window.height
  1121.     @actor_window = Window_EquipActor.new(@command_window.width, wy)
  1122.     @actor_window.viewport = @viewport
  1123.     @actor_window.actor = @actor
  1124.   end
  1125.   
  1126.   #--------------------------------------------------------------------------
  1127.   # new method: process_custom_equip_commands
  1128.   #--------------------------------------------------------------------------
  1129.   def process_custom_equip_commands
  1130.     for command in YEA::EQUIP::COMMAND_LIST
  1131.       next unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  1132.       called_method = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][3]
  1133.       @command_window.set_handler(command, method(called_method))
  1134.     end
  1135.   end
  1136.   
  1137.   #--------------------------------------------------------------------------
  1138.   # overwrite method: create_slot_window
  1139.   #--------------------------------------------------------------------------
  1140.   def create_slot_window
  1141.     wx = 0
  1142.     wy = @command_window.y + @command_window.height
  1143.     ww = Graphics.width - @status_window.width
  1144.     @slot_window = Window_EquipSlot.new(wx, wy, ww)
  1145.     @slot_window.viewport = @viewport
  1146.     @slot_window.help_window = @help_window
  1147.     @slot_window.status_window = @status_window
  1148.     @slot_window.actor = @actor
  1149.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  1150.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  1151.   end
  1152.   
  1153.   #--------------------------------------------------------------------------
  1154.   # overwrite method: create_item_window
  1155.   #--------------------------------------------------------------------------
  1156.   def create_item_window
  1157.     wx = @slot_window.x
  1158.     wy = @slot_window.y
  1159.     ww = @slot_window.width
  1160.     wh = @slot_window.height
  1161.     @item_window = Window_EquipItem.new(wx, wy, ww, wh)
  1162.     @item_window.viewport = @viewport
  1163.     @item_window.help_window = @help_window
  1164.     @item_window.status_window = @status_window
  1165.     @item_window.actor = @actor
  1166.     @item_window.set_handler(:ok,     method(:on_item_ok))
  1167.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  1168.     @slot_window.item_window = @item_window
  1169.     @item_window.hide
  1170.   end
  1171.   
  1172.   #--------------------------------------------------------------------------
  1173.   # alias method: command_optimize
  1174.   #--------------------------------------------------------------------------
  1175.   alias scene_equip_command_optimize_aee command_optimize
  1176.   def command_optimize
  1177.     scene_equip_command_optimize_aee
  1178.     @actor_window.refresh
  1179.   end
  1180.   
  1181.   #--------------------------------------------------------------------------
  1182.   # alias method: command_clear
  1183.   #--------------------------------------------------------------------------
  1184.   alias scene_equip_command_clear_aee command_clear
  1185.   def command_clear
  1186.     scene_equip_command_clear_aee
  1187.     @actor_window.refresh
  1188.   end
  1189.   
  1190.   #--------------------------------------------------------------------------
  1191.   # alias method: on_slot_ok
  1192.   #--------------------------------------------------------------------------
  1193.   alias scene_equip_on_slot_ok_aee on_slot_ok
  1194.   def on_slot_ok
  1195.     scene_equip_on_slot_ok_aee
  1196.     @slot_window.hide
  1197.     @item_window.refresh
  1198.     @item_window.show
  1199.   end
  1200.   
  1201.   #--------------------------------------------------------------------------
  1202.   # alias method: on_item_ok
  1203.   #--------------------------------------------------------------------------
  1204.   alias scene_equip_on_item_ok_aee on_item_ok
  1205.   def on_item_ok
  1206.     scene_equip_on_item_ok_aee
  1207.     @actor_window.refresh
  1208.     @slot_window.show
  1209.     @item_window.hide
  1210.   end
  1211.   
  1212.   #--------------------------------------------------------------------------
  1213.   # alias method: on_item_cancel
  1214.   #--------------------------------------------------------------------------
  1215.   alias scene_equip_on_item_cancel_aee on_item_cancel
  1216.   def on_item_cancel
  1217.     scene_equip_on_item_cancel_aee
  1218.     @slot_window.show
  1219.     @item_window.hide
  1220.   end
  1221.   
  1222.   #--------------------------------------------------------------------------
  1223.   # alias method: on_actor_change
  1224.   #--------------------------------------------------------------------------
  1225.   alias scene_equip_on_actor_change_aee on_actor_change
  1226.   def on_actor_change
  1227.     scene_equip_on_actor_change_aee
  1228.     @actor_window.actor = @actor
  1229.   end
  1230.   
  1231.   #--------------------------------------------------------------------------
  1232.   # new method: command_name1
  1233.   #--------------------------------------------------------------------------
  1234.   def command_name1
  1235.     # Do nothing.
  1236.   end
  1237.   
  1238.   #--------------------------------------------------------------------------
  1239.   # new method: command_name2
  1240.   #--------------------------------------------------------------------------
  1241.   def command_name2
  1242.     # Do nothing.
  1243.   end
  1244.   
  1245. end # Scene_Equip

  1246. #==============================================================================
  1247. #
  1248. # ▼ End of File
  1249. #
  1250. #==============================================================================
复制代码

点评

谢谢分享,贫道早就想找这类脚本。赞一个,好人一生平安~  发表于 2013-6-22 03:25

评分

参与人数 1星屑 +90 收起 理由
Sion + 90 感谢帮忙

查看全部评分

XAS GYRO努力制造中
代码什么的最讨厌了!去改别人的才最好玩
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1019 小时
注册时间
2012-4-25
帖子
799
3
 楼主| 发表于 2013-6-21 12:21:17 | 只看该作者
本帖最后由 lirn 于 2013-6-21 12:23 编辑
wuchangdao55 发表于 2013-6-21 10:54
用Yanfly Engine的装备系统吧!!这个脚本冲突很多!


如果仅仅是说添加装备栏,我也还有另外一个,但是那个脚本我不知道如何附加初始装备以及固定初始装备。


YEA系统似乎会跟后知后觉的横版冲突,而这个目前没有任何冲突。如果能单独使用的话,或许可以,但我不懂英文。

能把脚本全称给我看看吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
150 小时
注册时间
2010-10-22
帖子
58
2
发表于 2013-6-21 10:54:18 | 只看该作者
用Yanfly Engine的装备系统吧!!这个脚本冲突很多!

XAS GYRO努力制造中
代码什么的最讨厌了!去改别人的才最好玩
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-15 05:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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