Project1

标题: 裝備腳本用法 [打印本页]

作者: 29162535ck    时间: 2013-8-9 19:50
标题: 裝備腳本用法
本帖最后由 29162535ck 于 2013-8-9 23:40 编辑

誰可以教我一下這個腳本怎麼用,要怎麼樣才能在TypeID4、5、6 裝備

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





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1