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

Project1

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

[已经过期] 此装备脚本如何把Max.hp和Max.mp改成命中率和回避率?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
70
在线时间
1083 小时
注册时间
2013-3-29
帖子
2394
跳转到指定楼层
1
发表于 2015-7-12 21:41:41 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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

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

  288. #==============================================================================
  289. # ■ Vocab
  290. #==============================================================================

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

  303. #==============================================================================
  304. # ■ Icon
  305. #==============================================================================

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

  319. #==============================================================================
  320. # ■ Numeric
  321. #==============================================================================

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

  332. #==============================================================================
  333. # ■ DataManager
  334. #==============================================================================

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

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

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

  454. #==============================================================================
  455. # ■ Game_Temp
  456. #==============================================================================

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

  467. #==============================================================================
  468. # ■ Game_BaseItem
  469. #==============================================================================

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

  478. #==============================================================================
  479. # ■ Game_BattlerBase
  480. #==============================================================================

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

  502. #==============================================================================
  503. # ■ Game_Actor
  504. #==============================================================================

  505. class Game_Actor < Game_Battler
  506.   
  507.   #--------------------------------------------------------------------------
  508.   # alias method: init_equips
  509.   #--------------------------------------------------------------------------
  510.   alias game_actor_init_equips_aee init_equips
  511.   def init_equips(equips)
  512.     game_actor_init_equips_aee(equips)
  513.     equip_extra_starting_equips
  514.   end
  515.   
  516.   #--------------------------------------------------------------------------
  517.   # new method: equip_extra_starting_equips
  518.   #--------------------------------------------------------------------------
  519.   def equip_extra_starting_equips
  520.     for equip_id in actor.extra_starting_equips
  521.       armour = $data_armors[equip_id]
  522.       next if armour.nil?
  523.       etype_id = armour.etype_id
  524.       next unless equip_slots.include?(etype_id)
  525.       slot_id = empty_slot(etype_id)
  526.       @equips[slot_id].set_equip(etype_id == 0, armour.id)
  527.     end
  528.     refresh
  529.   end
  530.   
  531.   #--------------------------------------------------------------------------
  532.   # overwrite method: equip_slots
  533.   #--------------------------------------------------------------------------
  534.   def equip_slots
  535.     return equip_slots_dual if dual_wield?
  536.     return equip_slots_normal
  537.   end
  538.   
  539.   #--------------------------------------------------------------------------
  540.   # new method: equip_slots_normal
  541.   #--------------------------------------------------------------------------
  542.   def equip_slots_normal
  543.     return self.actor.base_equip_slots if self.actor.base_equip_slots != []
  544.     return self.class.base_equip_slots
  545.   end
  546.   
  547.   #--------------------------------------------------------------------------
  548.   # new method: equip_slots_dual
  549.   #--------------------------------------------------------------------------
  550.   def equip_slots_dual
  551.     array = equip_slots_normal.clone
  552.     array[1] = 0 if array.size >= 2
  553.     return array
  554.   end
  555.   
  556.   #--------------------------------------------------------------------------
  557.   # new method: fixed_etypes
  558.   #--------------------------------------------------------------------------
  559.   def fixed_etypes
  560.     array = []
  561.     array |= self.actor.fixed_equip_type
  562.     array |= self.class.fixed_equip_type
  563.     for equip in equips
  564.       next if equip.nil?
  565.       array |= equip.fixed_equip_type
  566.     end
  567.     for state in states
  568.       next if state.nil?
  569.       array |= state.fixed_equip_type
  570.     end
  571.     return array
  572.   end
  573.   
  574.   #--------------------------------------------------------------------------
  575.   # new method: sealed_etypes
  576.   #--------------------------------------------------------------------------
  577.   def sealed_etypes
  578.     array = []
  579.     array |= self.actor.sealed_equip_type
  580.     array |= self.class.sealed_equip_type
  581.     for equip in equips
  582.       next if equip.nil?
  583.       array |= equip.sealed_equip_type
  584.     end
  585.     for state in states
  586.       next if state.nil?
  587.       array |= state.sealed_equip_type
  588.     end
  589.     return array
  590.   end
  591.   
  592.   #--------------------------------------------------------------------------
  593.   # alias method: change_equip
  594.   #--------------------------------------------------------------------------
  595.   alias game_actor_change_equip_aee change_equip
  596.   def change_equip(slot_id, item)
  597.     if item.nil? && !@optimize_clear
  598.       etype_id = equip_slots[slot_id]
  599.       return unless YEA::EQUIP::TYPES[etype_id][1]
  600.     elsif item.nil? && @optimize_clear
  601.       etype_id = equip_slots[slot_id]
  602.       return unless YEA::EQUIP::TYPES[etype_id][2]
  603.     end
  604.     @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
  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.   #--------------------------------------------------------------------------
  637.   # alias method: force_change_equip
  638.   #--------------------------------------------------------------------------
  639.   alias game_actor_force_change_equip_aee force_change_equip
  640.   def force_change_equip(slot_id, item)
  641.     @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
  642.     game_actor_force_change_equip_aee(slot_id, item)
  643.   end
  644.   
  645.   #--------------------------------------------------------------------------
  646.   # alias method: weapons
  647.   #--------------------------------------------------------------------------
  648.   alias game_actor_weapons_aee weapons
  649.   def weapons
  650.     anti_crash_equips
  651.     return game_actor_weapons_aee
  652.   end
  653.   
  654.   #--------------------------------------------------------------------------
  655.   # alias method: armors
  656.   #--------------------------------------------------------------------------
  657.   alias game_actor_armors_aee armors
  658.   def armors
  659.     anti_crash_equips
  660.     return game_actor_armors_aee
  661.   end
  662.   
  663.   #--------------------------------------------------------------------------
  664.   # alias method: equips
  665.   #--------------------------------------------------------------------------
  666.   alias game_actor_equips_aee equips
  667.   def equips
  668.     anti_crash_equips
  669.     return game_actor_equips_aee
  670.   end
  671.   
  672.   #--------------------------------------------------------------------------
  673.   # new method: equips
  674.   #--------------------------------------------------------------------------
  675.   def anti_crash_equips
  676.     for i in [email protected]
  677.       next unless @equips[i].nil?
  678.       @equips[i] = Game_BaseItem.new
  679.     end
  680.   end
  681.   
  682. end # Game_Actor

  683. #==============================================================================
  684. # ■ Game_Interpreter
  685. #==============================================================================

  686. class Game_Interpreter
  687.   
  688.   #--------------------------------------------------------------------------
  689.   # overwrite method: change equip
  690.   #--------------------------------------------------------------------------
  691.   def command_319
  692.     actor = $game_actors[@params[0]]
  693.     return if actor.nil?
  694.     if @params[1] == 0 && @params[2] != 0
  695.       item = $data_weapons[@params[2]]
  696.       return unless actor.equip_slots.include?(0)
  697.       slot_id = actor.empty_slot(0)
  698.     elsif @params[2] != 0
  699.       item = $data_armors[@params[2]]
  700.       return unless actor.equip_slots.include?(item.etype_id)
  701.       slot_id = actor.empty_slot(item.etype_id)
  702.     else
  703.       slot_id = @params[1]
  704.     end
  705.     actor.change_equip_by_id(slot_id, @params[2])
  706.   end
  707.   
  708. end # Game_Interpreter

  709. #==============================================================================
  710. # ■ Window_EquipStatus
  711. #==============================================================================

  712. class Window_EquipStatus < Window_Base
  713.   
  714.   #--------------------------------------------------------------------------
  715.   # overwrite method: initialize
  716.   #--------------------------------------------------------------------------
  717.   def initialize(dx, dy)
  718.     super(dx, dy, window_width, Graphics.height - dy)
  719.     @actor = nil
  720.     @temp_actor = nil
  721.     refresh
  722.   end
  723.   
  724.   #--------------------------------------------------------------------------
  725.   # overwrite method: window_width
  726.   #--------------------------------------------------------------------------
  727.   def window_width; return Graphics.width * 2 / 5; end
  728.   
  729.   #--------------------------------------------------------------------------
  730.   # overwrite method: refresh
  731.   #--------------------------------------------------------------------------
  732.   def refresh
  733.     contents.clear
  734.     8.times {|i| draw_item(0, line_height * i, i) }
  735.   end
  736.   
  737.   #--------------------------------------------------------------------------
  738.   # overwrite method: draw_item
  739.   #--------------------------------------------------------------------------
  740.   def draw_item(dx, dy, param_id)
  741.     draw_background_colour(dx, dy)
  742.     draw_param_name(dx + 4, dy, param_id)
  743.     draw_current_param(dx + 4, dy, param_id) if @actor
  744.     drx = (contents.width + 22) / 2
  745.     draw_right_arrow(drx, dy)
  746.     draw_new_param(drx + 22, dy, param_id) if @temp_actor
  747.     reset_font_settings
  748.   end
  749.   
  750.   #--------------------------------------------------------------------------
  751.   # new method: draw_background_colour
  752.   #--------------------------------------------------------------------------
  753.   def draw_background_colour(dx, dy)
  754.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  755.     rect = Rect.new(dx+1, dy+1, contents.width - 2, line_height - 2)
  756.     contents.fill_rect(rect, colour)
  757.   end
  758.   
  759.   #--------------------------------------------------------------------------
  760.   # overwrite method: draw_param_name
  761.   #--------------------------------------------------------------------------
  762.   def draw_param_name(dx, dy, param_id)
  763.     contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  764.     change_color(system_color)
  765.     draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  766.   end
  767.   
  768.   #--------------------------------------------------------------------------
  769.   # overwrite method: draw_current_param
  770.   #--------------------------------------------------------------------------
  771.   def draw_current_param(dx, dy, param_id)
  772.     change_color(normal_color)
  773.     dw = (contents.width + 22) / 2
  774.     draw_text(0, dy, dw, line_height, @actor.param(param_id).group, 2)
  775.     reset_font_settings
  776.   end
  777.   
  778.   #--------------------------------------------------------------------------
  779.   # overwrite method: draw_new_param
  780.   #--------------------------------------------------------------------------
  781.   def draw_new_param(dx, dy, param_id)
  782.     contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  783.     new_value = @temp_actor.param(param_id)
  784.     change_color(param_change_color(new_value - @actor.param(param_id)))
  785.     draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  786.     reset_font_settings
  787.   end
  788.   
  789. end # Window_EquipStatus

  790. #==============================================================================
  791. # ■ Window_EquipCommand
  792. #==============================================================================

  793. class Window_EquipCommand < Window_HorzCommand
  794.   
  795.   #--------------------------------------------------------------------------
  796.   # overwrite method: make_command_list
  797.   #--------------------------------------------------------------------------
  798.   def make_command_list
  799.     for command in YEA::EQUIP::COMMAND_LIST
  800.       case command
  801.       when :equip
  802.         add_command(Vocab::equip2, :equip)
  803.       when :optimize
  804.         add_command(Vocab::optimize, :optimize)
  805.       when :clear
  806.         add_command(Vocab::clear, :clear)
  807.       else
  808.         process_custom_command(command)
  809.       end
  810.     end
  811.   end
  812.   
  813.   #--------------------------------------------------------------------------
  814.   # process_ok
  815.   #--------------------------------------------------------------------------
  816.   def process_ok
  817.     $game_temp.scene_equip_index = index
  818.     $game_temp.scene_equip_oy = self.oy
  819.     super
  820.   end
  821.   
  822.   #--------------------------------------------------------------------------
  823.   # new method: process_custom_command
  824.   #--------------------------------------------------------------------------
  825.   def process_custom_command(command)
  826.     return unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  827.     show = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][2]
  828.     continue = show <= 0 ? true : $game_switches[show]
  829.     return unless continue
  830.     text = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][0]
  831.     switch = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][1]
  832.     enabled = switch <= 0 ? true : $game_switches[switch]
  833.     add_command(text, command, enabled)
  834.   end
  835.   
  836.   #--------------------------------------------------------------------------
  837.   # overwrite method: window_width
  838.   #--------------------------------------------------------------------------
  839.   def window_width; return 160; end
  840.   
  841.   #--------------------------------------------------------------------------
  842.   # overwrite method: contents_width
  843.   #--------------------------------------------------------------------------
  844.   def contents_width; return width - standard_padding * 2; end
  845.   
  846.   #--------------------------------------------------------------------------
  847.   # overwrite method: contents_height
  848.   #--------------------------------------------------------------------------
  849.   def contents_height
  850.     ch = height - standard_padding * 2
  851.     return [ch - ch % item_height, row_max * item_height].max
  852.   end
  853.   
  854.   #--------------------------------------------------------------------------
  855.   # overwrite method: visible_line_number
  856.   #--------------------------------------------------------------------------
  857.   def visible_line_number; return 4; end
  858.   
  859.   #--------------------------------------------------------------------------
  860.   # overwrite method: col_max
  861.   #--------------------------------------------------------------------------
  862.   def col_max; return 1; end
  863.    
  864.   #--------------------------------------------------------------------------
  865.   # overwrite method: item_rect
  866.   #--------------------------------------------------------------------------
  867.   def item_rect(index)
  868.     rect = Rect.new
  869.     rect.width = item_width
  870.     rect.height = item_height
  871.     rect.x = index % col_max * (item_width + spacing)
  872.     rect.y = index / col_max * item_height
  873.     rect
  874.   end
  875.   
  876.   #--------------------------------------------------------------------------
  877.   # overwrite method: ensure_cursor_visible
  878.   #--------------------------------------------------------------------------
  879.   def ensure_cursor_visible
  880.     self.top_row = row if row < top_row
  881.     self.bottom_row = row if row > bottom_row
  882.   end
  883.    
  884.   #--------------------------------------------------------------------------
  885.   # overwrite method: cursor_down
  886.   #--------------------------------------------------------------------------
  887.   def cursor_down(wrap = false)
  888.     if index < item_max - col_max || (wrap && col_max == 1)
  889.       select((index + col_max) % item_max)
  890.     end
  891.   end
  892.   
  893.   #--------------------------------------------------------------------------
  894.   # overwrite method: cursor_up
  895.   #--------------------------------------------------------------------------
  896.   def cursor_up(wrap = false)
  897.     if index >= col_max || (wrap && col_max == 1)
  898.       select((index - col_max + item_max) % item_max)
  899.     end
  900.   end
  901.   
  902.   #--------------------------------------------------------------------------
  903.   # overwrite method: process_pageup
  904.   #--------------------------------------------------------------------------
  905.   def process_pageup
  906.     Sound.play_cursor
  907.     Input.update
  908.     deactivate
  909.     call_handler(:pageup)
  910.   end
  911.   
  912.   #--------------------------------------------------------------------------
  913.   # overwrite method: process_pagedown
  914.   #--------------------------------------------------------------------------
  915.   def process_pagedown
  916.     Sound.play_cursor
  917.     Input.update
  918.     deactivate
  919.     call_handler(:pagedown)
  920.   end
  921.   
  922. end # Window_EquipCommand

  923. #==============================================================================
  924. # ■ Window_EquipSlot
  925. #==============================================================================

  926. class Window_EquipSlot < Window_Selectable
  927.   
  928.   #--------------------------------------------------------------------------
  929.   # overwrite method: initialize
  930.   #--------------------------------------------------------------------------
  931.   def initialize(dx, dy, dw)
  932.     super(dx, dy, dw, Graphics.height - dy)
  933.     @actor = nil
  934.     refresh
  935.   end
  936.   
  937.   #--------------------------------------------------------------------------
  938.   # overwrite method: window_height
  939.   #--------------------------------------------------------------------------
  940.   def window_height; return self.height; end
  941.   
  942.   #--------------------------------------------------------------------------
  943.   # overwrite method: visible_line_number
  944.   #--------------------------------------------------------------------------
  945.   def visible_line_number; return item_max; end
  946.   
  947.   #--------------------------------------------------------------------------
  948.   # overwrite method: refresh
  949.   #--------------------------------------------------------------------------
  950.   def refresh
  951.     create_contents
  952.     super
  953.   end
  954.   
  955.   #--------------------------------------------------------------------------
  956.   # overwrite method: draw_item
  957.   #--------------------------------------------------------------------------
  958.   def draw_item(index)
  959.     return unless @actor
  960.     rect = item_rect_for_text(index)
  961.     change_color(system_color, enable?(index))
  962.     draw_text(rect.x, rect.y, 92, line_height, slot_name(index))
  963.     item = @actor.equips[index]
  964.     dx = rect.x + 92
  965.     dw = contents.width - dx - 24
  966.     if item.nil?
  967.       draw_nothing_equip(dx, rect.y, false, dw)
  968.     else
  969.       draw_item_name(item, dx, rect.y, enable?(index), dw)
  970.     end
  971.   end
  972.   
  973.   #--------------------------------------------------------------------------
  974.   # new method: draw_nothing_equip
  975.   #--------------------------------------------------------------------------
  976.   def draw_nothing_equip(dx, dy, enabled, dw)
  977.     change_color(normal_color, enabled)
  978.     draw_icon(Icon.nothing_equip, dx, dy, enabled)
  979.     text = YEA::EQUIP::NOTHING_TEXT
  980.     draw_text(dx + 24, dy, dw - 24, line_height, text)
  981.   end
  982.   
  983. end # Window_EquipSlot

  984. #==============================================================================
  985. # ■ Window_EquipItem
  986. #==============================================================================

  987. class Window_EquipItem < Window_ItemList
  988.   
  989.   #--------------------------------------------------------------------------
  990.   # overwrite method: col_max
  991.   #--------------------------------------------------------------------------
  992.   def col_max; return 1; end
  993.   
  994.   #--------------------------------------------------------------------------
  995.   # overwrite method: slot_id=
  996.   #--------------------------------------------------------------------------
  997.   def slot_id=(slot_id)
  998.     return if @slot_id == slot_id
  999.     @slot_id = slot_id
  1000.     @last_item = nil
  1001.     self.oy = 0
  1002.     refresh
  1003.   end
  1004.   
  1005.   #--------------------------------------------------------------------------
  1006.   # overwrite method: draw_item
  1007.   #--------------------------------------------------------------------------
  1008.   def draw_item(index)
  1009.     item = @data[index]
  1010.     rect = item_rect(index)
  1011.     rect.width -= 4
  1012.     if item.nil?
  1013.       draw_remove_equip(rect)
  1014.       return
  1015.     end
  1016.     dw = contents.width - rect.x - 24
  1017.     draw_item_name(item, rect.x, rect.y, enable?(item), dw)
  1018.     draw_item_number(rect, item)
  1019.   end
  1020.   
  1021.   #--------------------------------------------------------------------------
  1022.   # new method: draw_remove_equip
  1023.   #--------------------------------------------------------------------------
  1024.   def draw_remove_equip(rect)
  1025.     draw_icon(Icon.remove_equip, rect.x, rect.y)
  1026.     text = YEA::EQUIP::REMOVE_EQUIP_TEXT
  1027.     rect.x += 24
  1028.     rect.width -= 24
  1029.     draw_text(rect, text)
  1030.   end
  1031.   
  1032.   #--------------------------------------------------------------------------
  1033.   # overwrite method: include?
  1034.   #--------------------------------------------------------------------------
  1035.   def include?(item)
  1036.     if item.nil? && [email protected]?
  1037.       etype_id = @actor.equip_slots[@slot_id]
  1038.       return YEA::EQUIP::TYPES[etype_id][1]
  1039.     end
  1040.     return true if item.nil?
  1041.     return false unless item.is_a?(RPG::EquipItem)
  1042.     return false if @slot_id < 0
  1043.     return false if item.etype_id != @actor.equip_slots[@slot_id]
  1044.     return @actor.equippable?(item)
  1045.   end
  1046.   
  1047.   #--------------------------------------------------------------------------
  1048.   # overwrite method: enable?
  1049.   #--------------------------------------------------------------------------
  1050.   def enable?(item)
  1051.     if item.nil? && [email protected]?
  1052.       etype_id = @actor.equip_slots[@slot_id]
  1053.       return YEA::EQUIP::TYPES[etype_id][1]
  1054.     end
  1055.     return @actor.equippable?(item)
  1056.   end
  1057.   
  1058.   #--------------------------------------------------------------------------
  1059.   # new method: show
  1060.   #--------------------------------------------------------------------------
  1061.   def show
  1062.     @last_item = 0
  1063.     update_help
  1064.     super
  1065.   end
  1066.   
  1067.   #--------------------------------------------------------------------------
  1068.   # overwrite method: update_help
  1069.   #--------------------------------------------------------------------------
  1070.   def update_help
  1071.     super
  1072.     return if @actor.nil?
  1073.     return if @status_window.nil?
  1074.     return if @last_item == item
  1075.     @last_item = item
  1076.     temp_actor = Marshal.load(Marshal.dump(@actor))
  1077.     temp_actor.force_change_equip(@slot_id, item)
  1078.     @status_window.set_temp_actor(temp_actor)
  1079.   end
  1080.   
  1081. end # Window_EquipItem

  1082. #==============================================================================
  1083. # ■ Window_EquipActor
  1084. #==============================================================================

  1085. class Window_EquipActor < Window_Base
  1086.   
  1087.   #--------------------------------------------------------------------------
  1088.   # initialize
  1089.   #--------------------------------------------------------------------------
  1090.   def initialize(dx, dy)
  1091.     super(dx, dy, window_width, fitting_height(4))
  1092.     @actor = nil
  1093.   end
  1094.   
  1095.   #--------------------------------------------------------------------------
  1096.   # window_width
  1097.   #--------------------------------------------------------------------------
  1098.   def window_width; return Graphics.width - 160; end
  1099.   
  1100.   #--------------------------------------------------------------------------
  1101.   # actor=
  1102.   #--------------------------------------------------------------------------
  1103.   def actor=(actor)
  1104.     return if @actor == actor
  1105.     @actor = actor
  1106.     refresh
  1107.   end
  1108.   
  1109.   #--------------------------------------------------------------------------
  1110.   # refresh
  1111.   #--------------------------------------------------------------------------
  1112.   def refresh
  1113.     contents.clear
  1114.     return unless @actor
  1115.     draw_actor_face(@actor, 0, 0)
  1116.     draw_actor_simple_status(@actor, 108, line_height / 2)
  1117.   end
  1118.   
  1119. end # Window_EquipActor

  1120. #==============================================================================
  1121. # ■ Scene_Equip
  1122. #==============================================================================

  1123. class Scene_Equip < Scene_MenuBase
  1124.   
  1125.   #--------------------------------------------------------------------------
  1126.   # overwrite method: create_status_window
  1127.   #--------------------------------------------------------------------------
  1128.   def create_status_window
  1129.     wx = Graphics.width - (Graphics.width * 2 / 5)
  1130.     wy = @help_window.height + 120
  1131.     @status_window = Window_EquipStatus.new(wx, wy)
  1132.     @status_window.viewport = @viewport
  1133.     @status_window.actor = @actor
  1134.   end
  1135.   
  1136.   #--------------------------------------------------------------------------
  1137.   # overwrite method: create_command_window
  1138.   #--------------------------------------------------------------------------
  1139.   def create_command_window
  1140.     wx = 0
  1141.     wy = @help_window.height
  1142.     ww = 160
  1143.     @command_window = Window_EquipCommand.new(wx, wy, ww)
  1144.     @command_window.viewport = @viewport
  1145.     @command_window.help_window = @help_window
  1146.     if !$game_temp.scene_equip_index.nil?
  1147.       @command_window.select($game_temp.scene_equip_index)
  1148.       @command_window.oy = $game_temp.scene_equip_oy
  1149.     end
  1150.     $game_temp.scene_equip_index = nil
  1151.     $game_temp.scene_equip_oy = nil
  1152.     @command_window.set_handler(:equip,    method(:command_equip))
  1153.     @command_window.set_handler(:optimize, method(:command_optimize))
  1154.     @command_window.set_handler(:clear,    method(:command_clear))
  1155.     @command_window.set_handler(:cancel,   method(:return_scene))
  1156.     @command_window.set_handler(:pagedown, method(:next_actor))
  1157.     @command_window.set_handler(:pageup,   method(:prev_actor))
  1158.     process_custom_equip_commands
  1159.     create_actor_window
  1160.   end
  1161.   
  1162.   #--------------------------------------------------------------------------
  1163.   # new method: create_actor_window
  1164.   #--------------------------------------------------------------------------
  1165.   def create_actor_window
  1166.     wy = @help_window.height
  1167.     @actor_window = Window_EquipActor.new(@command_window.width, wy)
  1168.     @actor_window.viewport = @viewport
  1169.     @actor_window.actor = @actor
  1170.   end
  1171.   
  1172.   #--------------------------------------------------------------------------
  1173.   # new method: process_custom_equip_commands
  1174.   #--------------------------------------------------------------------------
  1175.   def process_custom_equip_commands
  1176.     for command in YEA::EQUIP::COMMAND_LIST
  1177.       next unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  1178.       called_method = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][3]
  1179.       @command_window.set_handler(command, method(called_method))
  1180.     end
  1181.   end
  1182.   
  1183.   #--------------------------------------------------------------------------
  1184.   # overwrite method: create_slot_window
  1185.   #--------------------------------------------------------------------------
  1186.   def create_slot_window
  1187.     wx = 0
  1188.     wy = @command_window.y + @command_window.height
  1189.     ww = Graphics.width - @status_window.width
  1190.     @slot_window = Window_EquipSlot.new(wx, wy, ww)
  1191.     @slot_window.viewport = @viewport
  1192.     @slot_window.help_window = @help_window
  1193.     @slot_window.status_window = @status_window
  1194.     @slot_window.actor = @actor
  1195.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  1196.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  1197.   end
  1198.   
  1199.   #--------------------------------------------------------------------------
  1200.   # overwrite method: create_item_window
  1201.   #--------------------------------------------------------------------------
  1202.   def create_item_window
  1203.     wx = @slot_window.x
  1204.     wy = @slot_window.y
  1205.     ww = @slot_window.width
  1206.     wh = @slot_window.height
  1207.     @item_window = Window_EquipItem.new(wx, wy, ww, wh)
  1208.     @item_window.viewport = @viewport
  1209.     @item_window.help_window = @help_window
  1210.     @item_window.status_window = @status_window
  1211.     @item_window.actor = @actor
  1212.     @item_window.set_handler(:ok,     method(:on_item_ok))
  1213.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  1214.     @slot_window.item_window = @item_window
  1215.     @item_window.hide
  1216.   end
  1217.   
  1218.   #--------------------------------------------------------------------------
  1219.   # alias method: command_optimize
  1220.   #--------------------------------------------------------------------------
  1221.   alias scene_equip_command_optimize_aee command_optimize
  1222.   def command_optimize
  1223.     scene_equip_command_optimize_aee
  1224.     @actor_window.refresh
  1225.   end
  1226.   
  1227.   #--------------------------------------------------------------------------
  1228.   # alias method: command_clear
  1229.   #--------------------------------------------------------------------------
  1230.   alias scene_equip_command_clear_aee command_clear
  1231.   def command_clear
  1232.     scene_equip_command_clear_aee
  1233.     @actor_window.refresh
  1234.   end
  1235.   
  1236.   #--------------------------------------------------------------------------
  1237.   # alias method: on_slot_ok
  1238.   #--------------------------------------------------------------------------
  1239.   alias scene_equip_on_slot_ok_aee on_slot_ok
  1240.   def on_slot_ok
  1241.     scene_equip_on_slot_ok_aee
  1242.     @slot_window.hide
  1243.     @item_window.refresh
  1244.     @item_window.show
  1245.   end
  1246.   
  1247.   #--------------------------------------------------------------------------
  1248.   # alias method: on_item_ok
  1249.   #--------------------------------------------------------------------------
  1250.   alias scene_equip_on_item_ok_aee on_item_ok
  1251.   def on_item_ok
  1252.     scene_equip_on_item_ok_aee
  1253.     @actor_window.refresh
  1254.     @slot_window.show
  1255.     @item_window.hide
  1256.   end
  1257.   
  1258.   #--------------------------------------------------------------------------
  1259.   # alias method: on_item_cancel
  1260.   #--------------------------------------------------------------------------
  1261.   alias scene_equip_on_item_cancel_aee on_item_cancel
  1262.   def on_item_cancel
  1263.     scene_equip_on_item_cancel_aee
  1264.     @slot_window.show
  1265.     @item_window.hide
  1266.   end
  1267.   
  1268.   #--------------------------------------------------------------------------
  1269.   # alias method: on_actor_change
  1270.   #--------------------------------------------------------------------------
  1271.   alias scene_equip_on_actor_change_aee on_actor_change
  1272.   def on_actor_change
  1273.     scene_equip_on_actor_change_aee
  1274.     @actor_window.actor = @actor
  1275.   end
  1276.   
  1277.   #--------------------------------------------------------------------------
  1278.   # new method: command_name1
  1279.   #--------------------------------------------------------------------------
  1280.   def command_name1
  1281.     # Do nothing.
  1282.   end
  1283.   
  1284.   #--------------------------------------------------------------------------
  1285.   # new method: command_name2
  1286.   #--------------------------------------------------------------------------
  1287.   def command_name2
  1288.     # Do nothing.
  1289.   end
  1290.   
  1291. end # Scene_Equip

  1292. #==============================================================================
  1293. #
  1294. # ▼ End of File
  1295. #
  1296. #==============================================================================
复制代码

坑的进度如上                                                                                                        点击↑
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2025-2-22 15:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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