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

Project1

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

[已经过期] 装备栏如何随等级提升而开放

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
274 小时
注册时间
2013-12-14
帖子
113
跳转到指定楼层
1
发表于 2015-5-15 14:34:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
因为用了某个脚本,所以装备栏略多(我也需要这么多),因此希望大神帮我设定下或给个思路,
希望某些装备栏需要角色达到指定等级才能开放。比如饰品栏我设置了5个,其中一个默认开启,其余四个需要角色达到15,20,25,30级分别开启一个……

Lv1.梦旅人

梦石
0
星屑
50
在线时间
274 小时
注册时间
2013-12-14
帖子
113
2
 楼主| 发表于 2015-5-15 14:39:14 | 只看该作者
本帖最后由 blueeyescyj 于 2015-5-15 14:53 编辑

话说回来= =脚本很长
RUBY 代码复制
  1. #
  2. # ▼ Yanfly Engine Ace - Ace Equip Engine v1.05
  3. # -- Last Updated: 2012.01.22
  4. # -- Level: Normal, Hard
  5. # -- Requires: n/a
  6. #
  7. #==============================================================================
  8.  
  9. $imported = {} if $imported.nil?
  10. $imported["YEA-AceEquipEngine"] = true
  11.  
  12. #==============================================================================
  13. # ▼ Updates
  14. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  15. # 2012.01.22 - Bug Fixed: <equip slot> notetags updated to factor in spaces.
  16. # 2012.01.05 - Compatibility Update: Equip Dynamic Stats
  17. # 2011.12.30 - Bug Fixed: Stats didn't update.
  18. # 2011.12.23 - Script efficiency optimized.
  19. # 2011.12.18 - Script efficiency optimized.
  20. # 2011.12.13 - Started Script and Finished.
  21. #
  22. #==============================================================================
  23. # ▼ Introduction
  24. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  25. # The default equipment system in RPG Maker VX is the standard equipment system
  26. # seen in all of the previous iterations, which consists of weapon, shield,
  27. # headgear, bodygear, and accessory. To break free of that norm, this script
  28. # allows users access to giving actors and/or classes dynamic equipment setups
  29. # (including having multiples of the same categories). In addition to having
  30. # different equip slot setups, newer equipment types can be made to allow for
  31. # more diversity in armour types.
  32. #
  33. #==============================================================================
  34. # ▼ Instructions
  35. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36. # To install this script, open up your script editor and copy/paste this script
  37. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  38. #
  39. # -----------------------------------------------------------------------------
  40. # Actor Notetags - These notetags go in the actors notebox in the database.
  41. # -----------------------------------------------------------------------------
  42. # <equip slots>
  43. #  string
  44. #  string
  45. # </equip slots>
  46. # This sets the actor's default slots to whatever is listed in between the two
  47. # notetags. An actor's custom equip slots will take priority over a class's
  48. # custom equip slots, which will take priority over the default equip slots.
  49. # Replace "string" with the proper equipment type name or when in doubt, use
  50. # "equip type: x" with x as the equipment type.
  51. #
  52. # <starting gear: x>
  53. # <starting gear: x, x>
  54. # Adds armour x to the actor's list of starting gear. This is used primarily
  55. # for the newer pieces of gear that can't be added through the starting set of
  56. # equipment through the RPG Maker VX Ace editor by default. Insert multiple of
  57. # these notetags to add more pieces of starting gear if so desired.
  58. #
  59. # <fixed equip: x>
  60. # <fixed equip: x, x>
  61. # This will fix the equip type x. Fixed equip slots mean that the equipment
  62. # already on it are unable to be exchanged in or out by the player. This tag
  63. # has been made so that equip types can be fixed for equip type 5 and above.
  64. # Use multiple of these notetags to add more fixed equipment restrictions.
  65. #
  66. # <sealed equip: x>
  67. # <sealed equip: x, x>
  68. # This will seal the equip type x. Sealed equip slots mean that no equipment
  69. # can be equipped onto that equip type slot. This tag has been made so that
  70. # equip types can be sealed for equip type 5 and above. Use multiple of these
  71. # notetags to add more sealed equipment restrictions.
  72. #
  73. # -----------------------------------------------------------------------------
  74. # Class Notetags - These notetags go in the class notebox in the database.
  75. # -----------------------------------------------------------------------------
  76. # <equip slots>
  77. #  string
  78. #  string
  79. # </equip slots>
  80. # This sets the class's default slots to whatever is listed in between the two
  81. # notetags. An actor's custom equip slots will take priority over a class's
  82. # custom equip slots, which will take priority over the default equip slots.
  83. # Replace "string" with the proper equipment type name or when in doubt, use
  84. # "equip type: x" with x as the equipment type.
  85. #
  86. # <fixed equip: x>
  87. # <fixed equip: x, x>
  88. # This will fix the equip type x. Fixed equip slots mean that the equipment
  89. # already on it are unable to be exchanged in or out by the player. This tag
  90. # has been made so that equip types can be fixed for equip type 5 and above.
  91. # Use multiple of these notetags to add more fixed equipment restrictions.
  92. #
  93. # <sealed equip: x>
  94. # <sealed equip: x, x>
  95. # This will seal the equip type x. Sealed equip slots mean that no equipment
  96. # can be equipped onto that equip type slot. This tag has been made so that
  97. # equip types can be sealed for equip type 5 and above. Use multiple of these
  98. # notetags to add more sealed equipment restrictions.
  99. #
  100. # -----------------------------------------------------------------------------
  101. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  102. # -----------------------------------------------------------------------------
  103. # <fixed equip: x>
  104. # <fixed equip: x, x>
  105. # This will fix the equip type x. Fixed equip slots mean that the equipment
  106. # already on it are unable to be exchanged in or out by the player. This tag
  107. # has been made so that equip types can be fixed for equip type 5 and above.
  108. # Use multiple of these notetags to add more fixed equipment restrictions.
  109. #
  110. # <sealed equip: x>
  111. # <sealed equip: x, x>
  112. # This will seal the equip type x. Sealed equip slots mean that no equipment
  113. # can be equipped onto that equip type slot. This tag has been made so that
  114. # equip types can be sealed for equip type 5 and above. Use multiple of these
  115. # notetags to add more sealed equipment restrictions.
  116. #
  117. # -----------------------------------------------------------------------------
  118. # Armour Notetags - These notetags go in the armour notebox in the database.
  119. # -----------------------------------------------------------------------------
  120. # <equip type: x>
  121. # <equip type: string>
  122. # For the newer equip types, replace x or string with the equip type ID or the
  123. # name of the equip type respectively. This will set that armour to that
  124. # particular equip type.
  125. #
  126. # <fixed equip: x>
  127. # <fixed equip: x, x>
  128. # This will fix the equip type x. Fixed equip slots mean that the equipment
  129. # already on it are unable to be exchanged in or out by the player. This tag
  130. # has been made so that equip types can be fixed for equip type 5 and above.
  131. # Use multiple of these notetags to add more fixed equipment restrictions.
  132. #
  133. # <sealed equip: x>
  134. # <sealed equip: x, x>
  135. # This will seal the equip type x. Sealed equip slots mean that no equipment
  136. # can be equipped onto that equip type slot. This tag has been made so that
  137. # equip types can be sealed for equip type 5 and above. Use multiple of these
  138. # notetags to add more sealed equipment restrictions.
  139. #
  140. # -----------------------------------------------------------------------------
  141. # State Notetags - These notetags go in the states notebox in the database.
  142. # -----------------------------------------------------------------------------
  143. # <fixed equip: x>
  144. # <fixed equip: x, x>
  145. # This will fix the equip type x. Fixed equip slots mean that the equipment
  146. # already on it are unable to be exchanged in or out by the player. This tag
  147. # has been made so that equip types can be fixed for equip type 5 and above.
  148. # Use multiple of these notetags to add more fixed equipment restrictions.
  149. #
  150. # <sealed equip: x>
  151. # <sealed equip: x, x>
  152. # This will seal the equip type x. Sealed equip slots mean that no equipment
  153. # can be equipped onto that equip type slot. This tag has been made so that
  154. # equip types can be sealed for equip type 5 and above. Use multiple of these
  155. # notetags to add more sealed equipment restrictions.
  156. #
  157. #==============================================================================
  158. # ▼ Compatibility
  159. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  160. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  161. # it will run with RPG Maker VX without adjusting.
  162. #
  163. #==============================================================================
  164.  
  165. module YEA
  166.   module EQUIP
  167.  
  168.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  169.     # - General Equip Settings -
  170.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  171.     # This adjusts the default equip configuration. While actors can have their
  172.     # own unique equipment configurations, it's recommended to not change too
  173.     # much as things get really hairy when it comes to proper eventing.
  174.     #
  175.     # ID   Equip Type
  176.     # ---  ------------
  177.     #  0   Weapon
  178.     #  1   Shield
  179.     #  2   Headgear
  180.     #  3   Bodygear
  181.     #  4   Accessory
  182.     #
  183.     # Whatever you set the below slots to, the dual wield setup will be exactly
  184.     # identical except that the second slot will be changed to a weapon (0).
  185.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  186.     # Adjust this array to set the default slots used for all of your actors
  187.     # and classes if they do not have a custom equipment slot setup.
  188.     DEFAULT_BASE_SLOTS = [ 0, 3, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
  189.  
  190.     # This hash adjusts the new equip types (past 4+). Adjust them to match
  191.     # their names properly. You can choose to allow certain types of equipment
  192.     # be removable or not, or whether or not optimize will affect them.
  193.     TYPES ={
  194.     # TypeID => ["Type Name", Removable?, Optimize?],
  195.            0 => [   "武器",      true,      true],
  196.            1 => [   "护手",       true,      true],
  197.            2 => [ "魔石",       true,      true],
  198.            3 => [ "防具",       true,      true],
  199.            4 => [   "饰品",       true,      true],
  200.            #5 => [   "魔石",       true,      true],
  201.     } # Do not remove this.
  202.  
  203.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  204.     # - Equip Command List -
  205.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  206.     # Here, you can adjust the order at which the commands appear (or even
  207.     # remove commands as you see fit). Here's a list of which does what:
  208.     #
  209.     # -------------------------------------------------------------------------
  210.     # :command         Description
  211.     # -------------------------------------------------------------------------
  212.     # :equip           Activates the manual equip window. Default.
  213.     # :optimize        Optimizes equipment for the actor. Default.
  214.     # :clear           Clears all equipment from the actor. Default
  215.     #
  216.     # And that's all of the currently available commands. This list will be
  217.     # updated as more scripts become available.
  218.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  219.     # This array arranges the order of which the commands appear in the Equip
  220.     # Command window in the Equip Scene.
  221.     COMMAND_LIST =[
  222.       :equip,
  223.       :optimize,
  224.       :clear,
  225.     # :custom1,
  226.     # :custom2,
  227.     ] # Do not remove this.
  228.  
  229.     #--------------------------------------------------------------------------
  230.     # - Equip Custom Commands -
  231.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  232.     # For those who use scripts to that may produce unique effects for
  233.     # equipping, use this hash to manage the custom commands for the Equip
  234.     # Command Window. You can disable certain commands or prevent them from
  235.     # appearing by using switches. If you don't wish to bind them to a switch,
  236.     # set the proper switch to 0 for it to have no impact.
  237.     #--------------------------------------------------------------------------
  238.     CUSTOM_EQUIP_COMMANDS ={
  239.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  240.       :custom1 => [ "Custom Name",            0,          0, :command_name1],
  241.       :custom2 => [ "Custom Text",           13,          0, :command_name2],
  242.     } # Do not remove this.
  243.  
  244.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  245.     # - Misc Window Settings -
  246.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  247.     # This section adjusts the minor visuals that you see inside of the newly
  248.     # organized Equip Scene. Adjust the settings as you see fit.
  249.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  250.     # This sets the font size used for the status window in the lower right
  251.     # corner of the screen (which shows stats and comparisons).
  252.     STATUS_FONT_SIZE = 20
  253.  
  254.     # This sets the remove equip command in the item window.
  255.     REMOVE_EQUIP_ICON = 61
  256.     REMOVE_EQUIP_TEXT = "<空>"
  257.  
  258.     # This sets the no-equipment text in the slot window.
  259.     NOTHING_ICON = 61
  260.     NOTHING_TEXT = "<空>"
  261.  
  262.  
  263.   end # EQUIP
  264. end # YEA
  265.  
  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.  
  272. module YEA
  273.   module REGEXP
  274.   module BASEITEM
  275.  
  276.     EQUIP_SLOTS_ON  = /<(?:EQUIP_SLOTS|equip slots)>/i
  277.     EQUIP_SLOTS_OFF = /<\/(?:EQUIP_SLOTS|equip slots)>/i
  278.  
  279.     EQUIP_TYPE_INT = /<(?:EQUIP_TYPE|equip type):[ ]*(\d+)>/i
  280.     EQUIP_TYPE_STR = /<(?:EQUIP_TYPE|equip type):[ ]*(.*)>/i
  281.  
  282.     STARTING_GEAR = /<(?:STARTING_GEAR|starting gear):[ ](\d+(?:\s*,\s*\d+)*)>/i
  283.  
  284.     FIXED_EQUIP = /<(?:FIXED_EQUIP|fixed equip):[ ](\d+(?:\s*,\s*\d+)*)>/i
  285.     SEALED_EQUIP = /<(?:SEALED_EQUIP|sealed equip):[ ](\d+(?:\s*,\s*\d+)*)>/i
  286.  
  287.   end # BASEITEM
  288.   end # REGEXP
  289. end # YEA
  290.  
  291. #==============================================================================
  292. # ■ Vocab
  293. #==============================================================================
  294.  
  295. module Vocab
  296.  
  297.   #--------------------------------------------------------------------------
  298.   # overwrite method: self.etype
  299.   #--------------------------------------------------------------------------
  300.   def self.etype(etype)
  301.     return $data_system.terms.etypes[etype] if [0,1,2,3,4].include?(etype)
  302.     return YEA::EQUIP::TYPES[etype][0] if YEA::EQUIP::TYPES.include?(etype)
  303.     return ""
  304.   end
  305.  
  306. end # Vocab
  307.  
  308. #==============================================================================
  309. # ■ Icon
  310. #==============================================================================
  311.  
  312. module Icon
  313.  
  314.   #--------------------------------------------------------------------------
  315.   # self.remove_equip
  316.   #--------------------------------------------------------------------------
  317.   def self.remove_equip; return YEA::EQUIP::REMOVE_EQUIP_ICON; end
  318.  
  319.   #--------------------------------------------------------------------------
  320.   # self.nothing_equip
  321.   #--------------------------------------------------------------------------
  322.   def self.nothing_equip; return YEA::EQUIP::NOTHING_ICON; end
  323.  
  324. end # Icon
  325.  
  326. #==============================================================================
  327. # ■ Numeric
  328. #==============================================================================
  329.  
  330. class Numeric
  331.  
  332.   #--------------------------------------------------------------------------
  333.   # new method: group_digits
  334.   #--------------------------------------------------------------------------
  335.   unless $imported["YEA-CoreEngine"]
  336.   def group; return self.to_s; end
  337.   end # $imported["YEA-CoreEngine"]
  338.  
  339. end # Numeric
  340.  
  341. #==============================================================================
  342. # ■ DataManager
  343. #==============================================================================
  344.  
  345. module DataManager
  346.  
  347.   #--------------------------------------------------------------------------
  348.   # alias method: load_database
  349.   #--------------------------------------------------------------------------
  350.   class <<self; alias load_database_aee load_database; end
  351.   def self.load_database
  352.     load_database_aee
  353.     load_notetags_aee
  354.   end
  355.  
  356.   #--------------------------------------------------------------------------
  357.   # new method: load_notetags_aee
  358.   #--------------------------------------------------------------------------
  359.   def self.load_notetags_aee
  360.     groups = [$data_actors, $data_classes, $data_weapons, $data_armors,
  361.       $data_states]
  362.     for group in groups
  363.       for obj in group
  364.         next if obj.nil?
  365.         obj.load_notetags_aee
  366.       end
  367.     end
  368.   end
  369.  
  370. end # DataManager
  371.  
  372. #==============================================================================
  373. # ■ RPG::BaseItem
  374. #==============================================================================
  375.  
  376. class RPG::BaseItem
  377.  
  378.   #--------------------------------------------------------------------------
  379.   # public instance variables
  380.   #--------------------------------------------------------------------------
  381.   attr_accessor :base_equip_slots
  382.   attr_accessor :fixed_equip_type
  383.   attr_accessor :sealed_equip_type
  384.   attr_accessor :extra_starting_equips
  385.  
  386.   #--------------------------------------------------------------------------
  387.   # common cache: load_notetags_aee
  388.   #--------------------------------------------------------------------------
  389.   def load_notetags_aee
  390.     @base_equip_slots = []
  391.     @equip_slots_on = false
  392.     @fixed_equip_type = []
  393.     @sealed_equip_type = []
  394.     @extra_starting_equips = []
  395.     #---
  396.     self.note.split(/[\r\n]+/).each { |line|
  397.       case line
  398.       #---
  399.       when YEA::REGEXP::BASEITEM::EQUIP_SLOTS_ON
  400.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  401.         @equip_slots_on = true
  402.       when YEA::REGEXP::BASEITEM::EQUIP_SLOTS_OFF
  403.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  404.         @equip_slots_on = false
  405.       #---
  406.       when YEA::REGEXP::BASEITEM::STARTING_GEAR
  407.         next unless self.is_a?(RPG::Actor)
  408.         $1.scan(/\d+/).each { |num|
  409.         @extra_starting_equips.push(num.to_i) if num.to_i > 0 }
  410.       when YEA::REGEXP::BASEITEM::FIXED_EQUIP
  411.         $1.scan(/\d+/).each { |num|
  412.         @fixed_equip_type.push(num.to_i) if num.to_i > 0 }
  413.       when YEA::REGEXP::BASEITEM::SEALED_EQUIP
  414.         $1.scan(/\d+/).each { |num|
  415.         @sealed_equip_type.push(num.to_i) if num.to_i > 0 }
  416.       #---
  417.       when YEA::REGEXP::BASEITEM::EQUIP_TYPE_INT
  418.         next unless self.is_a?(RPG::Armor)
  419.         @etype_id = [1, $1.to_i].max
  420.       when YEA::REGEXP::BASEITEM::EQUIP_TYPE_STR
  421.         next unless self.is_a?(RPG::Armor)
  422.         for key in YEA::EQUIP::TYPES
  423.           id = key[0]
  424.           next if YEA::EQUIP::TYPES[id][0].upcase != $1.to_s.upcase
  425.           @etype_id = [1, id].max
  426.           break
  427.         end
  428.       #---
  429.       else
  430.         if @equip_slots_on
  431.           case line.upcase
  432.           when /EQUIP TYPE[ ](\d+)/i, /EQUIP TYPE:[ ](\d+)/i
  433.             id = $1.to_i
  434.             @base_equip_slots.push(id) if [0,1,2,3,4].include?(id)
  435.             @base_equip_slots.push(id) if YEA::EQUIP::TYPES.include?(id)
  436.           when /WEAPON/i
  437.             @base_equip_slots.push(0)
  438.           when /SHIELD/i
  439.             @base_equip_slots.push(1)
  440.           when /HEAD/i
  441.             @base_equip_slots.push(2)
  442.           when /BODY/i, /ARMOR/i, /ARMOUR/i
  443.             @base_equip_slots.push(3)
  444.           when /ETC/i, /OTHER/i, /ACCESSOR/i
  445.             @base_equip_slots.push(4)
  446.           else
  447.             text = line.upcase.delete(" ")
  448.             for key in YEA::EQUIP::TYPES
  449.               id = key[0]
  450.               next if YEA::EQUIP::TYPES[id][0].upcase.delete(" ")!= text
  451.               @base_equip_slots.push(id)
  452.               break
  453.             end
  454.           end
  455.         end
  456.       end
  457.     } # self.note.split
  458.     #---
  459.     return unless self.is_a?(RPG::Class)
  460.     if @base_equip_slots.empty?
  461.       @base_equip_slots = YEA::EQUIP::DEFAULT_BASE_SLOTS.clone
  462.     end
  463.   end
  464.  
  465. end # RPG::BaseItem
  466.  
  467. #==============================================================================
  468. # ■ Game_Temp
  469. #==============================================================================
  470.  
  471. class Game_Temp
  472.  
  473.   #--------------------------------------------------------------------------
  474.   # public instance variables
  475.   #--------------------------------------------------------------------------
  476.   attr_accessor :eds_actor
  477.   attr_accessor :scene_equip_index
  478.   attr_accessor :scene_equip_oy
  479.  
  480. end # Game_Temp
  481.  
  482. #==============================================================================
  483. # ■ Game_BaseItem
  484. #==============================================================================
  485.  
  486. class Game_BaseItem
  487.  
  488.   #--------------------------------------------------------------------------
  489.   # public instance variables
  490.   #--------------------------------------------------------------------------
  491.   attr_accessor :item_id
  492.  
  493. end # Game_BaseItem
  494.  
  495. #==============================================================================
  496. # ■ Game_BattlerBase
  497. #==============================================================================
  498.  
  499. class Game_BattlerBase
  500.  
  501.   #--------------------------------------------------------------------------
  502.   # alias method: equip_type_fixed?
  503.   #--------------------------------------------------------------------------
  504.   alias game_battlerbase_equip_type_fixed_aee equip_type_fixed?
  505.   def equip_type_fixed?(etype_id)
  506.     return true if fixed_etypes.include?(etype_id) if actor?
  507.     return game_battlerbase_equip_type_fixed_aee(etype_id)
  508.   end
  509.  
  510.   #--------------------------------------------------------------------------
  511.   # alias method: equip_type_sealed?
  512.   #--------------------------------------------------------------------------
  513.   alias game_battlerbase_equip_type_sealed_aee equip_type_sealed?
  514.   def equip_type_sealed?(etype_id)
  515.     return true if sealed_etypes.include?(etype_id) if actor?
  516.     return game_battlerbase_equip_type_sealed_aee(etype_id)
  517.   end
  518.  
  519. end # Game_BattlerBase
  520.  
  521. #==============================================================================
  522. # ■ Game_Actor
  523. #==============================================================================
  524.  
  525. class Game_Actor < Game_Battler
  526.  
  527.   #--------------------------------------------------------------------------
  528.   # alias method: init_equips
  529.   #--------------------------------------------------------------------------
  530.   alias game_actor_init_equips_aee init_equips
  531.   def init_equips(equips)
  532.     game_actor_init_equips_aee(equips)
  533.     equip_extra_starting_equips
  534.   end
  535.  
  536.   #--------------------------------------------------------------------------
  537.   # new method: equip_extra_starting_equips
  538.   #--------------------------------------------------------------------------
  539.   def equip_extra_starting_equips
  540.     for equip_id in actor.extra_starting_equips
  541.       armour = $data_armors[equip_id]
  542.       next if armour.nil?
  543.       etype_id = armour.etype_id
  544.       next unless equip_slots.include?(etype_id)
  545.       slot_id = empty_slot(etype_id)
  546.       @equips[slot_id].set_equip(etype_id == 0, armour.id)
  547.     end
  548.     refresh
  549.   end
  550.  
  551.   #--------------------------------------------------------------------------
  552.   # overwrite method: equip_slots
  553.   #--------------------------------------------------------------------------
  554.   def equip_slots
  555.     return equip_slots_dual if dual_wield?
  556.     return equip_slots_normal
  557.   end
  558.  
  559.   #--------------------------------------------------------------------------
  560.   # new method: equip_slots_normal
  561.   #--------------------------------------------------------------------------
  562.   def equip_slots_normal
  563.     return self.actor.base_equip_slots if self.actor.base_equip_slots != []
  564.     return self.class.base_equip_slots
  565.   end
  566.  
  567.   #--------------------------------------------------------------------------
  568.   # new method: equip_slots_dual
  569.   #--------------------------------------------------------------------------
  570.   def equip_slots_dual
  571.     array = equip_slots_normal.clone
  572.     array[1] = 0 if array.size >= 2
  573.     return array
  574.   end
  575.  
  576.   #--------------------------------------------------------------------------
  577.   # new method: fixed_etypes
  578.   #--------------------------------------------------------------------------
  579.   def fixed_etypes
  580.     array = []
  581.     array |= self.actor.fixed_equip_type
  582.     array |= self.class.fixed_equip_type
  583.     for equip in equips
  584.       next if equip.nil?
  585.       array |= equip.fixed_equip_type
  586.     end
  587.     for state in states
  588.       next if state.nil?
  589.       array |= state.fixed_equip_type
  590.     end
  591.     return array
  592.   end
  593.  
  594.   #--------------------------------------------------------------------------
  595.   # new method: sealed_etypes
  596.   #--------------------------------------------------------------------------
  597.   def sealed_etypes
  598.     array = []
  599.     array |= self.actor.sealed_equip_type
  600.     array |= self.class.sealed_equip_type
  601.     for equip in equips
  602.       next if equip.nil?
  603.       array |= equip.sealed_equip_type
  604.     end
  605.     for state in states
  606.       next if state.nil?
  607.       array |= state.sealed_equip_type
  608.     end
  609.     return array
  610.   end
  611.  
  612.   #--------------------------------------------------------------------------
  613.   # alias method: change_equip
  614.   #--------------------------------------------------------------------------
  615.   alias game_actor_change_equip_aee change_equip
  616.   def change_equip(slot_id, item)
  617.     if item.nil? && !@optimize_clear
  618.       etype_id = equip_slots[slot_id]
  619.       return unless YEA::EQUIP::TYPES[etype_id][1]
  620.     elsif item.nil? && @optimize_clear
  621.       etype_id = equip_slots[slot_id]
  622.       return unless YEA::EQUIP::TYPES[etype_id][2]
  623.     end
  624.     game_actor_change_equip_aee(slot_id, item)
  625.   end
  626.  
  627.   #--------------------------------------------------------------------------
  628.   # overwrite method: optimize_equipments
  629.   #--------------------------------------------------------------------------
  630.   def optimize_equipments
  631.     $game_temp.eds_actor = self
  632.     @optimize_clear = true
  633.     clear_equipments
  634.     @optimize_clear = false
  635.     equip_slots.size.times do |i|
  636.       next if !equip_change_ok?(i)
  637.       next unless can_optimize?(i)
  638.       items = $game_party.equip_items.select do |item|
  639.         item.etype_id == equip_slots[i] &&
  640.         equippable?(item) && item.performance >= 0
  641.       end
  642.       change_equip(i, items.max_by {|item| item.performance })
  643.     end
  644.     $game_temp.eds_actor = nil
  645.   end
  646.  
  647.   #--------------------------------------------------------------------------
  648.   # new method: can_optimize?
  649.   #--------------------------------------------------------------------------
  650.   def can_optimize?(slot_id)
  651.     etype_id = equip_slots[slot_id]
  652.     return YEA::EQUIP::TYPES[etype_id][2]
  653.   end
  654.  
  655. end # Game_Actor
  656.  
  657. #==============================================================================
  658. # ■ Game_Interpreter
  659. #==============================================================================
  660.  
  661. class Game_Interpreter
  662.  
  663.   #--------------------------------------------------------------------------
  664.   # overwrite method: change equip
  665.   #--------------------------------------------------------------------------
  666.   def command_319
  667.     actor = $game_actors[@params[0]]
  668.     return if actor.nil?
  669.     if @params[1] == 0 && @params[2] != 0
  670.       item = $data_weapons[@params[2]]
  671.       return unless actor.equip_slots.include?(0)
  672.       slot_id = actor.empty_slot(0)
  673.     elsif @params[2] != 0
  674.       item = $data_armors[@params[2]]
  675.       return unless actor.equip_slots.include?(item.etype_id)
  676.       slot_id = actor.empty_slot(item.etype_id)
  677.     else
  678.       slot_id = @params[1]
  679.     end
  680.     actor.change_equip_by_id(slot_id, @params[2])
  681.   end
  682.  
  683. end # Game_Interpreter
  684.  
  685. #==============================================================================
  686. # ■ Window_EquipStatus
  687. #==============================================================================
  688.  
  689. class Window_EquipStatus < Window_Base
  690.  
  691.   #--------------------------------------------------------------------------
  692.   # overwrite method: initialize
  693.   #--------------------------------------------------------------------------
  694.   def initialize(dx, dy)
  695.     super(dx, dy, window_width, Graphics.height - dy)
  696.     @actor = nil
  697.     @temp_actor = nil
  698.     refresh
  699.   end
  700.  
  701.   #--------------------------------------------------------------------------
  702.   # overwrite method: window_width
  703.   #--------------------------------------------------------------------------
  704.   def window_width; return Graphics.width * 2 / 5; end
  705.  
  706.   #--------------------------------------------------------------------------
  707.   # overwrite method: refresh
  708.   #--------------------------------------------------------------------------
  709.   def refresh
  710.     contents.clear
  711.     8.times {|i| draw_item(0, line_height * i, i) }
  712.   end
  713.  
  714.   #--------------------------------------------------------------------------
  715.   # overwrite method: draw_item
  716.   #--------------------------------------------------------------------------
  717.   def draw_item(dx, dy, param_id)
  718.     draw_background_colour(dx, dy)
  719.     draw_param_name(dx + 4, dy, param_id)
  720.     draw_current_param(dx + 4, dy, param_id) if @actor
  721.     drx = (contents.width + 22) / 2
  722.     draw_right_arrow(drx, dy)
  723.     draw_new_param(drx + 22, dy, param_id) if @temp_actor
  724.     reset_font_settings
  725.   end
  726.  
  727.   #--------------------------------------------------------------------------
  728.   # new method: draw_background_colour
  729.   #--------------------------------------------------------------------------
  730.   def draw_background_colour(dx, dy)
  731.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  732.     rect = Rect.new(dx+1, dy+1, contents.width - 2, line_height - 2)
  733.     contents.fill_rect(rect, colour)
  734.   end
  735.  
  736.   #--------------------------------------------------------------------------
  737.   # overwrite method: draw_param_name
  738.   #--------------------------------------------------------------------------
  739.   def draw_param_name(dx, dy, param_id)
  740.     contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  741.     change_color(system_color)
  742.     draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  743.   end
  744.  
  745.   #--------------------------------------------------------------------------
  746.   # overwrite method: draw_current_param
  747.   #--------------------------------------------------------------------------
  748.   def draw_current_param(dx, dy, param_id)
  749.     change_color(normal_color)
  750.     dw = (contents.width + 22) / 2
  751.     draw_text(0, dy, dw, line_height, @actor.param(param_id).group, 2)
  752.     reset_font_settings
  753.   end
  754.  
  755.   #--------------------------------------------------------------------------
  756.   # overwrite method: draw_new_param
  757.   #--------------------------------------------------------------------------
  758.   def draw_new_param(dx, dy, param_id)
  759.     contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  760.     new_value = @temp_actor.param(param_id)
  761.     change_color(param_change_color(new_value - @actor.param(param_id)))
  762.     draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  763.     reset_font_settings
  764.   end
  765.  
  766. end # Window_EquipStatus
  767.  
  768. #==============================================================================
  769. # ■ Window_EquipCommand
  770. #==============================================================================
  771.  
  772. class Window_EquipCommand < Window_HorzCommand
  773.  
  774.   #--------------------------------------------------------------------------
  775.   # overwrite method: make_command_list
  776.   #--------------------------------------------------------------------------
  777.   def make_command_list
  778.     for command in YEA::EQUIP::COMMAND_LIST
  779.       case command
  780.       when :equip
  781.         add_command(Vocab::equip2, :equip)
  782.       when :optimize
  783.         add_command(Vocab::optimize, :optimize)
  784.       when :clear
  785.         add_command(Vocab::clear, :clear)
  786.       else
  787.         process_custom_command(command)
  788.       end
  789.     end
  790.   end
  791.  
  792.   #--------------------------------------------------------------------------
  793.   # process_ok
  794.   #--------------------------------------------------------------------------
  795.   def process_ok
  796.     $game_temp.scene_equip_index = index
  797.     $game_temp.scene_equip_oy = self.oy
  798.     super
  799.   end
  800.  
  801.   #--------------------------------------------------------------------------
  802.   # new method: process_custom_command
  803.   #--------------------------------------------------------------------------
  804.   def process_custom_command(command)
  805.     return unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  806.     show = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][2]
  807.     continue = show <= 0 ? true : $game_switches[show]
  808.     return unless continue
  809.     text = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][0]
  810.     switch = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][1]
  811.     enabled = switch <= 0 ? true : $game_switches[switch]
  812.     add_command(text, command, enabled)
  813.   end
  814.  
  815.   #--------------------------------------------------------------------------
  816.   # overwrite method: window_width
  817.   #--------------------------------------------------------------------------
  818.   def window_width; return 160; end
  819.  
  820.   #--------------------------------------------------------------------------
  821.   # overwrite method: contents_width
  822.   #--------------------------------------------------------------------------
  823.   def contents_width; return width - standard_padding * 2; end
  824.  
  825.   #--------------------------------------------------------------------------
  826.   # overwrite method: contents_height
  827.   #--------------------------------------------------------------------------
  828.   def contents_height
  829.     ch = height - standard_padding * 2
  830.     return [ch - ch % item_height, row_max * item_height].max
  831.   end
  832.  
  833.   #--------------------------------------------------------------------------
  834.   # overwrite method: visible_line_number
  835.   #--------------------------------------------------------------------------
  836.   def visible_line_number; return 4; end
  837.  
  838.   #--------------------------------------------------------------------------
  839.   # overwrite method: col_max
  840.   #--------------------------------------------------------------------------
  841.   def col_max; return 1; end
  842.  
  843.   #--------------------------------------------------------------------------
  844.   # overwrite method: item_rect
  845.   #--------------------------------------------------------------------------
  846.   def item_rect(index)
  847.     rect = Rect.new
  848.     rect.width = item_width
  849.     rect.height = item_height
  850.     rect.x = index % col_max * (item_width + spacing)
  851.     rect.y = index / col_max * item_height
  852.     rect
  853.   end
  854.  
  855.   #--------------------------------------------------------------------------
  856.   # overwrite method: ensure_cursor_visible
  857.   #--------------------------------------------------------------------------
  858.   def ensure_cursor_visible
  859.     self.top_row = row if row < top_row
  860.     self.bottom_row = row if row > bottom_row
  861.   end
  862.  
  863.   #--------------------------------------------------------------------------
  864.   # overwrite method: cursor_down
  865.   #--------------------------------------------------------------------------
  866.   def cursor_down(wrap = false)
  867.     if index < item_max - col_max || (wrap && col_max == 1)
  868.       select((index + col_max) % item_max)
  869.     end
  870.   end
  871.  
  872.   #--------------------------------------------------------------------------
  873.   # overwrite method: cursor_up
  874.   #--------------------------------------------------------------------------
  875.   def cursor_up(wrap = false)
  876.     if index >= col_max || (wrap && col_max == 1)
  877.       select((index - col_max + item_max) % item_max)
  878.     end
  879.   end
  880.  
  881.   #--------------------------------------------------------------------------
  882.   # overwrite method: process_pageup
  883.   #--------------------------------------------------------------------------
  884.   def process_pageup
  885.     Sound.play_cursor
  886.     Input.update
  887.     deactivate
  888.     call_handler(:pageup)
  889.   end
  890.  
  891.   #--------------------------------------------------------------------------
  892.   # overwrite method: process_pagedown
  893.   #--------------------------------------------------------------------------
  894.   def process_pagedown
  895.     Sound.play_cursor
  896.     Input.update
  897.     deactivate
  898.     call_handler(:pagedown)
  899.   end
  900.  
  901. end # Window_EquipCommand
  902.  
  903. #==============================================================================
  904. # ■ Window_EquipSlot
  905. #==============================================================================
  906.  
  907. class Window_EquipSlot < Window_Selectable
  908.  
  909.   #--------------------------------------------------------------------------
  910.   # overwrite method: initialize
  911.   #--------------------------------------------------------------------------
  912.   def initialize(dx, dy, dw)
  913.     super(dx, dy, dw, Graphics.height - dy)
  914.     @actor = nil
  915.     refresh
  916.   end
  917.  
  918.   #--------------------------------------------------------------------------
  919.   # overwrite method: window_height
  920.   #--------------------------------------------------------------------------
  921.   def window_height; return self.height; end
  922.  
  923.   #--------------------------------------------------------------------------
  924.   # overwrite method: visible_line_number
  925.   #--------------------------------------------------------------------------
  926.   def visible_line_number; return item_max; end
  927.  
  928.   #--------------------------------------------------------------------------
  929.   # overwrite method: refresh
  930.   #--------------------------------------------------------------------------
  931.   def refresh
  932.     create_contents
  933.     super
  934.   end
  935.  
  936.   #--------------------------------------------------------------------------
  937.   # overwrite method: draw_item
  938.   #--------------------------------------------------------------------------
  939.   def draw_item(index)
  940.     return unless @actor
  941.     rect = item_rect_for_text(index)
  942.     change_color(system_color, enable?(index))
  943.     draw_text(rect.x, rect.y, 96, line_height, slot_name(index))
  944.     item = @actor.equips[index]
  945.     dx = rect.x + 96
  946.     dw = contents.width - dx - 24
  947.     if item.nil?
  948.       draw_nothing_equip(dx, rect.y, false, dw)
  949.     else
  950.       draw_item_name(item, dx, rect.y, enable?(index), dw)
  951.     end
  952.   end
  953.  
  954.   #--------------------------------------------------------------------------
  955.   # new method: draw_nothing_equip
  956.   #--------------------------------------------------------------------------
  957.   def draw_nothing_equip(dx, dy, enabled, dw)
  958.     change_color(normal_color, enabled)
  959.     draw_icon(Icon.nothing_equip, dx, dy, enabled)
  960.     text = YEA::EQUIP::NOTHING_TEXT
  961.     draw_text(dx + 24, dy, dw - 24, line_height, text)
  962.   end
  963.  
  964. end # Window_EquipSlot
  965.  
  966. #==============================================================================
  967. # ■ Window_EquipItem
  968. #==============================================================================
  969.  
  970. class Window_EquipItem < Window_ItemList
  971.  
  972.   #--------------------------------------------------------------------------
  973.   # overwrite method: col_max
  974.   #--------------------------------------------------------------------------
  975.   def col_max; return 1; end
  976.  
  977.   #--------------------------------------------------------------------------
  978.   # overwrite method: slot_id=
  979.   #--------------------------------------------------------------------------
  980.   def slot_id=(slot_id)
  981.     return if @slot_id == slot_id
  982.     @slot_id = slot_id
  983.     @last_item = nil
  984.     self.oy = 0
  985.   end
  986.  
  987.   #--------------------------------------------------------------------------
  988.   # overwrite method: draw_item
  989.   #--------------------------------------------------------------------------
  990.   def draw_item(index)
  991.     item = @data[index]
  992.     rect = item_rect(index)
  993.     rect.width -= 4
  994.     if item.nil?
  995.       draw_remove_equip(rect)
  996.       return
  997.     end
  998.     dw = contents.width - rect.x - 24
  999.     draw_item_name(item, rect.x, rect.y, enable?(item), dw)
  1000.     draw_item_number(rect, item)
  1001.   end
  1002.  
  1003.   #--------------------------------------------------------------------------
  1004.   # new method: draw_remove_equip
  1005.   #--------------------------------------------------------------------------
  1006.   def draw_remove_equip(rect)
  1007.     draw_icon(Icon.remove_equip, rect.x, rect.y)
  1008.     text = YEA::EQUIP::REMOVE_EQUIP_TEXT
  1009.     rect.x += 24
  1010.     rect.width -= 24
  1011.     draw_text(rect, text)
  1012.   end
  1013.  
  1014.   #--------------------------------------------------------------------------
  1015.   # overwrite method: include?
  1016.   #--------------------------------------------------------------------------
  1017.   def include?(item)
  1018.     if item.nil? && !@actor.nil?
  1019.       etype_id = @actor.equip_slots[@slot_id]
  1020.       return YEA::EQUIP::TYPES[etype_id][1]
  1021.     end
  1022.     return true if item.nil?
  1023.     return false unless item.is_a?(RPG::EquipItem)
  1024.     return false if @slot_id < 0
  1025.     return false if item.etype_id != @actor.equip_slots[@slot_id]
  1026.     return @actor.equippable?(item)
  1027.   end
  1028.  
  1029.   #--------------------------------------------------------------------------
  1030.   # overwrite method: enable?
  1031.   #--------------------------------------------------------------------------
  1032.   def enable?(item)
  1033.     if item.nil? && !@actor.nil?
  1034.       etype_id = @actor.equip_slots[@slot_id]
  1035.       return YEA::EQUIP::TYPES[etype_id][1]
  1036.     end
  1037.     return @actor.equippable?(item)
  1038.   end
  1039.  
  1040.   #--------------------------------------------------------------------------
  1041.   # new method: show
  1042.   #--------------------------------------------------------------------------
  1043.   def show
  1044.     @last_item = 0
  1045.     update_help
  1046.     super
  1047.   end
  1048.  
  1049.   #--------------------------------------------------------------------------
  1050.   # overwrite method: update_help
  1051.   #--------------------------------------------------------------------------
  1052.   def update_help
  1053.     super
  1054.     return if @actor.nil?
  1055.     return if @status_window.nil?
  1056.     return if @last_item == item
  1057.     @last_item = item
  1058.     temp_actor = Marshal.load(Marshal.dump(@actor))
  1059.     temp_actor.force_change_equip(@slot_id, item)
  1060.     @status_window.set_temp_actor(temp_actor)
  1061.   end
  1062.  
  1063. end # Window_EquipItem
  1064.  
  1065. #==============================================================================
  1066. # ■ Window_EquipActor
  1067. #==============================================================================
  1068.  
  1069. class Window_EquipActor < Window_Base
  1070.  
  1071.   #--------------------------------------------------------------------------
  1072.   # initialize
  1073.   #--------------------------------------------------------------------------
  1074.   def initialize(dx, dy)
  1075.     super(dx, dy, window_width, fitting_height(4))
  1076.     @actor = nil
  1077.   end
  1078.  
  1079.   #--------------------------------------------------------------------------
  1080.   # window_width
  1081.   #--------------------------------------------------------------------------
  1082.   def window_width; return Graphics.width - 160; end
  1083.  
  1084.   #--------------------------------------------------------------------------
  1085.   # actor=
  1086.   #--------------------------------------------------------------------------
  1087.   def actor=(actor)
  1088.     return if @actor == actor
  1089.     @actor = actor
  1090.     refresh
  1091.   end
  1092.  
  1093.   #--------------------------------------------------------------------------
  1094.   # refresh
  1095.   #--------------------------------------------------------------------------
  1096.   def refresh
  1097.     contents.clear
  1098.     return unless @actor
  1099.     draw_actor_face(@actor, 0, 0)
  1100.     draw_actor_simple_status(@actor, 108, line_height / 2)
  1101.   end
  1102.  
  1103. end # Window_EquipActor
  1104.  
  1105. #==============================================================================
  1106. # ■ Scene_Equip
  1107. #==============================================================================
  1108.  
  1109. class Scene_Equip < Scene_MenuBase
  1110.  
  1111.   #--------------------------------------------------------------------------
  1112.   # overwrite method: create_status_window
  1113.   #--------------------------------------------------------------------------
  1114.   def create_status_window
  1115.     wx = Graphics.width - (Graphics.width * 2 / 5)
  1116.     wy = @help_window.height + 120
  1117.     @status_window = Window_EquipStatus.new(wx, wy)
  1118.     @status_window.viewport = @viewport
  1119.     @status_window.actor = @actor
  1120.   end
  1121.  
  1122.   #--------------------------------------------------------------------------
  1123.   # overwrite method: create_command_window
  1124.   #--------------------------------------------------------------------------
  1125.   def create_command_window
  1126.  
  1127.     wx = 0
  1128.     wy = @help_window.height
  1129.     ww = 160
  1130.     @command_window = Window_EquipCommand.new(wx, wy, ww)
  1131.     @command_window.viewport = @viewport
  1132.     @command_window.help_window = @help_window
  1133.     if !$game_temp.scene_equip_index.nil?
  1134.       @command_window.select($game_temp.scene_equip_index)
  1135.       @command_window.oy = $game_temp.scene_equip_oy
  1136.     end
  1137.     $game_temp.scene_equip_index = nil
  1138.     $game_temp.scene_equip_oy = nil
  1139.     @command_window.set_handler(:equip,    method(:command_equip))
  1140.     @command_window.set_handler(:optimize, method(:command_optimize))
  1141.     @command_window.set_handler(:clear,    method(:command_clear))
  1142.     @command_window.set_handler(:cancel,   method(:return_scene))
  1143.     @command_window.set_handler(:pagedown, method(:next_actor))
  1144.     @command_window.set_handler(:pageup,   method(:prev_actor))
  1145.     process_custom_equip_commands
  1146.     create_actor_window
  1147.   end
  1148.  
  1149.   #--------------------------------------------------------------------------
  1150.   # new method: create_actor_window
  1151.   #--------------------------------------------------------------------------
  1152.   def create_actor_window
  1153.     wy = @help_window.height
  1154.     @actor_window = Window_EquipActor.new(@command_window.width, wy)
  1155.     @actor_window.viewport = @viewport
  1156.     @actor_window.actor = @actor
  1157.   end
  1158.  
  1159.   #--------------------------------------------------------------------------
  1160.   # new method: process_custom_equip_commands
  1161.   #--------------------------------------------------------------------------
  1162.   def process_custom_equip_commands
  1163.     for command in YEA::EQUIP::COMMAND_LIST
  1164.       next unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  1165.       called_method = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][3]
  1166.       @command_window.set_handler(command, method(called_method))
  1167.     end
  1168.   end
  1169.  
  1170.   #--------------------------------------------------------------------------
  1171.   # overwrite method: create_slot_window
  1172.   #--------------------------------------------------------------------------
  1173.   def create_slot_window
  1174.     wx = 0
  1175.     wy = @command_window.y + @command_window.height
  1176.     ww = Graphics.width - @status_window.width
  1177.     @slot_window = Window_EquipSlot.new(wx, wy, ww)
  1178.     @slot_window.viewport = @viewport
  1179.     @slot_window.help_window = @help_window
  1180.     @slot_window.status_window = @status_window
  1181.     @slot_window.actor = @actor
  1182.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  1183.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  1184.   end
  1185.  
  1186.   #--------------------------------------------------------------------------
  1187.   # overwrite method: create_item_window
  1188.   #--------------------------------------------------------------------------
  1189.   def create_item_window
  1190.     wx = @slot_window.x
  1191.     wy = @slot_window.y
  1192.     ww = @slot_window.width
  1193.     wh = @slot_window.height
  1194.     @item_window = Window_EquipItem.new(wx, wy, ww, wh)
  1195.     @item_window.viewport = @viewport
  1196.     @item_window.help_window = @help_window
  1197.     @item_window.status_window = @status_window
  1198.     @item_window.actor = @actor
  1199.     @item_window.set_handler(:ok,     method(:on_item_ok))
  1200.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  1201.     @slot_window.item_window = @item_window
  1202.     @item_window.hide
  1203.   end
  1204.  
  1205.   #--------------------------------------------------------------------------
  1206.   # alias method: command_optimize
  1207.   #--------------------------------------------------------------------------
  1208.   alias scene_equip_command_optimize_aee command_optimize
  1209.   def command_optimize
  1210.     scene_equip_command_optimize_aee
  1211.     @actor_window.refresh
  1212.   end
  1213.  
  1214.   #--------------------------------------------------------------------------
  1215.   # alias method: command_clear
  1216.   #--------------------------------------------------------------------------
  1217.   alias scene_equip_command_clear_aee command_clear
  1218.   def command_clear
  1219.     scene_equip_command_clear_aee
  1220.     @actor_window.refresh
  1221.   end
  1222.  
  1223.   #--------------------------------------------------------------------------
  1224.   # alias method: on_slot_ok
  1225.   #--------------------------------------------------------------------------
  1226.   alias scene_equip_on_slot_ok_aee on_slot_ok
  1227.   def on_slot_ok
  1228.     scene_equip_on_slot_ok_aee
  1229.     @slot_window.hide
  1230.     @item_window.refresh
  1231.     @item_window.show
  1232.   end
  1233.  
  1234.   #--------------------------------------------------------------------------
  1235.   # alias method: on_item_ok
  1236.   #--------------------------------------------------------------------------
  1237.   alias scene_equip_on_item_ok_aee on_item_ok
  1238.   def on_item_ok
  1239.     scene_equip_on_item_ok_aee
  1240.     @actor_window.refresh
  1241.     @slot_window.show
  1242.     @item_window.hide
  1243.   end
  1244.  
  1245.   #--------------------------------------------------------------------------
  1246.   # alias method: on_item_cancel
  1247.   #--------------------------------------------------------------------------
  1248.   alias scene_equip_on_item_cancel_aee on_item_cancel
  1249.   def on_item_cancel
  1250.     scene_equip_on_item_cancel_aee
  1251.     @slot_window.show
  1252.     @item_window.hide
  1253.   end
  1254.  
  1255.   #--------------------------------------------------------------------------
  1256.   # alias method: on_actor_change
  1257.   #--------------------------------------------------------------------------
  1258.   alias scene_equip_on_actor_change_aee on_actor_change
  1259.   def on_actor_change
  1260.     scene_equip_on_actor_change_aee
  1261.     @actor_window.actor = @actor
  1262.   end
  1263.  
  1264.   #--------------------------------------------------------------------------
  1265.   # new method: command_name1
  1266.   #--------------------------------------------------------------------------
  1267.   def command_name1
  1268.     # Do nothing.
  1269.   end
  1270.  
  1271.   #--------------------------------------------------------------------------
  1272.   # new method: command_name2
  1273.   #--------------------------------------------------------------------------
  1274.   def command_name2
  1275.     # Do nothing.
  1276.   end
  1277.  
  1278. end # Scene_Equip
  1279.  
  1280. #==============================================================================
  1281. #
  1282. # ▼ End of File
  1283. #
  1284. #==============================================================================
回复 支持 反对

使用道具 举报

Lv4.逐梦者

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

开拓者

3
发表于 2015-5-15 16:59:28 | 只看该作者
如果只是暂时禁用可以在Game_BattlerBase的def equippable?(item)#判断物品是否可以装备那弄···

点评

判断位置呗···如果你要让界面也跟着变就要动其他地方了···  发表于 2015-5-15 17:22
不是暂时的……而且这样的话感觉要么都可以装备,要么都不能装备了……  发表于 2015-5-15 17:14
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 04:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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