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

Project1

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

[已经过期] Yanfly的装备拓展系统怎么用

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1150
在线时间
245 小时
注册时间
2016-2-3
帖子
178

开拓者

跳转到指定楼层
1
发表于 2016-3-19 17:40:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我找了一个Yanfly的装备拓展系统,可是我看不懂英文说明(本坑现于初二)....
哪位大神帮我翻译一下?
RUBY 代码复制
  1. #==============================================================================
  2.  
  3. #
  4. # ▼ Yanfly Engine Ace - Ace Equip Engine v1.05
  5.  
  6. # -- Last Updated: 2012.01.22
  7.  
  8. # -- Level: Normal, Hard
  9.  
  10. # -- Requires: n/a
  11.  
  12. #
  13. #==============================================================================
  14.  
  15.  
  16. $imported = {} if $imported.nil?
  17.  
  18. $imported["YEA-AceEquipEngine"] = true
  19.  
  20.  
  21. #==============================================================================
  22.  
  23. # ▼ Updates
  24.  
  25. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26.  
  27. # 2012.01.22 - Bug Fixed: <equip slot> notetags updated to factor in spaces.
  28.  
  29. # 2012.01.05 - Compatibility Update: Equip Dynamic Stats
  30.  
  31. # 2011.12.30 - Bug Fixed: Stats didn't update.
  32.  
  33. # 2011.12.23 - Script efficiency optimized.
  34.  
  35. # 2011.12.18 - Script efficiency optimized.
  36.  
  37. # 2011.12.13 - Started Script and Finished.
  38.  
  39. #
  40. #==============================================================================
  41.  
  42. # ▼ Introduction
  43.  
  44. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  45.  
  46. # The default equipment system in RPG Maker VX is the standard equipment system
  47.  
  48. # seen in all of the previous iterations, which consists of weapon, shield,
  49.  
  50. # headgear, bodygear, and accessory. To break free of that norm, this script
  51.  
  52. # allows users access to giving actors and/or classes dynamic equipment setups
  53.  
  54. # (including having multiples of the same categories). In addition to having
  55.  
  56. # different equip slot setups, newer equipment types can be made to allow for
  57.  
  58. # more diversity in armour types.
  59.  
  60. #
  61. #==============================================================================
  62.  
  63. # ▼ Instructions
  64.  
  65. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  66.  
  67. # To install this script, open up your script editor and copy/paste this script
  68.  
  69. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  70.  
  71. #
  72. # -----------------------------------------------------------------------------
  73.  
  74. # Actor Notetags - These notetags go in the actors notebox in the database.
  75.  
  76. # -----------------------------------------------------------------------------
  77.  
  78. # <equip slots>
  79.  
  80. #  string
  81.  
  82. #  string
  83.  
  84. # </equip slots>
  85.  
  86. # This sets the actor's default slots to whatever is listed in between the two
  87.  
  88. # notetags. An actor's custom equip slots will take priority over a class's
  89.  
  90. # custom equip slots, which will take priority over the default equip slots.
  91.  
  92. # Replace "string" with the proper equipment type name or when in doubt, use
  93.  
  94. # "equip type: x" with x as the equipment type.
  95.  
  96. #
  97. # <starting gear: x>
  98.  
  99. # <starting gear: x, x>
  100.  
  101. # Adds armour x to the actor's list of starting gear. This is used primarily
  102.  
  103. # for the newer pieces of gear that can't be added through the starting set of
  104.  
  105. # equipment through the RPG Maker VX Ace editor by default. Insert multiple of
  106.  
  107. # these notetags to add more pieces of starting gear if so desired.
  108.  
  109. #
  110. # <fixed equip: x>
  111.  
  112. # <fixed equip: x, x>
  113.  
  114. # This will fix the equip type x. Fixed equip slots mean that the equipment
  115.  
  116. # already on it are unable to be exchanged in or out by the player. This tag
  117.  
  118. # has been made so that equip types can be fixed for equip type 5 and above.
  119.  
  120. # Use multiple of these notetags to add more fixed equipment restrictions.
  121.  
  122. #
  123. # <sealed equip: x>
  124.  
  125. # <sealed equip: x, x>
  126.  
  127. # This will seal the equip type x. Sealed equip slots mean that no equipment
  128.  
  129. # can be equipped onto that equip type slot. This tag has been made so that
  130.  
  131. # equip types can be sealed for equip type 5 and above. Use multiple of these
  132.  
  133. # notetags to add more sealed equipment restrictions.
  134.  
  135. #
  136. # -----------------------------------------------------------------------------
  137.  
  138. # Class Notetags - These notetags go in the class notebox in the database.
  139.  
  140. # -----------------------------------------------------------------------------
  141.  
  142. # <equip slots>
  143.  
  144. #  string
  145.  
  146. #  string
  147.  
  148. # </equip slots>
  149.  
  150. # This sets the class's default slots to whatever is listed in between the two
  151.  
  152. # notetags. An actor's custom equip slots will take priority over a class's
  153.  
  154. # custom equip slots, which will take priority over the default equip slots.
  155.  
  156. # Replace "string" with the proper equipment type name or when in doubt, use
  157.  
  158. # "equip type: x" with x as the equipment type.
  159.  
  160. #
  161. # <fixed equip: x>
  162.  
  163. # <fixed equip: x, x>
  164.  
  165. # This will fix the equip type x. Fixed equip slots mean that the equipment
  166.  
  167. # already on it are unable to be exchanged in or out by the player. This tag
  168.  
  169. # has been made so that equip types can be fixed for equip type 5 and above.
  170.  
  171. # Use multiple of these notetags to add more fixed equipment restrictions.
  172.  
  173. #
  174. # <sealed equip: x>
  175.  
  176. # <sealed equip: x, x>
  177.  
  178. # This will seal the equip type x. Sealed equip slots mean that no equipment
  179.  
  180. # can be equipped onto that equip type slot. This tag has been made so that
  181.  
  182. # equip types can be sealed for equip type 5 and above. Use multiple of these
  183.  
  184. # notetags to add more sealed equipment restrictions.
  185.  
  186. #
  187. # -----------------------------------------------------------------------------
  188.  
  189. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  190.  
  191. # -----------------------------------------------------------------------------
  192.  
  193. # <fixed equip: x>
  194.  
  195. # <fixed equip: x, x>
  196.  
  197. # This will fix the equip type x. Fixed equip slots mean that the equipment
  198.  
  199. # already on it are unable to be exchanged in or out by the player. This tag
  200.  
  201. # has been made so that equip types can be fixed for equip type 5 and above.
  202.  
  203. # Use multiple of these notetags to add more fixed equipment restrictions.
  204.  
  205. #
  206. # <sealed equip: x>
  207.  
  208. # <sealed equip: x, x>
  209.  
  210. # This will seal the equip type x. Sealed equip slots mean that no equipment
  211.  
  212. # can be equipped onto that equip type slot. This tag has been made so that
  213.  
  214. # equip types can be sealed for equip type 5 and above. Use multiple of these
  215.  
  216. # notetags to add more sealed equipment restrictions.
  217.  
  218. #
  219. # -----------------------------------------------------------------------------
  220.  
  221. # Armour Notetags - These notetags go in the armour notebox in the database.
  222.  
  223. # -----------------------------------------------------------------------------
  224.  
  225. # <equip type: x>
  226.  
  227. # <equip type: string>
  228.  
  229. # For the newer equip types, replace x or string with the equip type ID or the
  230.  
  231. # name of the equip type respectively. This will set that armour to that
  232.  
  233. # particular equip type.
  234.  
  235. #
  236. # <fixed equip: x>
  237.  
  238. # <fixed equip: x, x>
  239.  
  240. # This will fix the equip type x. Fixed equip slots mean that the equipment
  241.  
  242. # already on it are unable to be exchanged in or out by the player. This tag
  243.  
  244. # has been made so that equip types can be fixed for equip type 5 and above.
  245.  
  246. # Use multiple of these notetags to add more fixed equipment restrictions.
  247.  
  248. #
  249. # <sealed equip: x>
  250.  
  251. # <sealed equip: x, x>
  252.  
  253. # This will seal the equip type x. Sealed equip slots mean that no equipment
  254.  
  255. # can be equipped onto that equip type slot. This tag has been made so that
  256.  
  257. # equip types can be sealed for equip type 5 and above. Use multiple of these
  258.  
  259. # notetags to add more sealed equipment restrictions.
  260.  
  261. #
  262. # -----------------------------------------------------------------------------
  263.  
  264. # State Notetags - These notetags go in the states notebox in the database.
  265.  
  266. # -----------------------------------------------------------------------------
  267.  
  268. # <fixed equip: x>
  269.  
  270. # <fixed equip: x, x>
  271.  
  272. # This will fix the equip type x. Fixed equip slots mean that the equipment
  273.  
  274. # already on it are unable to be exchanged in or out by the player. This tag
  275.  
  276. # has been made so that equip types can be fixed for equip type 5 and above.
  277.  
  278. # Use multiple of these notetags to add more fixed equipment restrictions.
  279.  
  280. #
  281. # <sealed equip: x>
  282.  
  283. # <sealed equip: x, x>
  284.  
  285. # This will seal the equip type x. Sealed equip slots mean that no equipment
  286.  
  287. # can be equipped onto that equip type slot. This tag has been made so that
  288.  
  289. # equip types can be sealed for equip type 5 and above. Use multiple of these
  290.  
  291. # notetags to add more sealed equipment restrictions.
  292.  
  293. #
  294. #==============================================================================
  295.  
  296. # ▼ Compatibility
  297.  
  298. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  299.  
  300. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  301.  
  302. # it will run with RPG Maker VX without adjusting.
  303.  
  304. #
  305. #==============================================================================
  306.  
  307.  
  308. module YEA
  309.  
  310.   module EQUIP
  311.  
  312.  
  313.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  314.  
  315.     # - General Equip Settings -
  316.  
  317.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  318.  
  319.     # This adjusts the default equip configuration. While actors can have their
  320.  
  321.     # own unique equipment configurations, it's recommended to not change too
  322.  
  323.     # much as things get really hairy when it comes to proper eventing.
  324.  
  325.     #
  326.     # ID   Equip Type
  327.  
  328.     # ---  ------------
  329.  
  330.     #  0   Weapon
  331.  
  332.     #  1   Shield
  333.  
  334.     #  2   Headgear
  335.  
  336.     #  3   Bodygear
  337.  
  338.     #  4   Accessory
  339.  
  340.     #
  341.     # Whatever you set the below slots to, the dual wield setup will be exactly
  342.  
  343.     # identical except that the second slot will be changed to a weapon (0).
  344.  
  345.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  346.  
  347.     # Adjust this array to set the default slots used for all of your actors
  348.  
  349.     # and classes if they do not have a custom equipment slot setup.
  350.  
  351.     DEFAULT_BASE_SLOTS = [ 0, 1, 2, 3, 9, 5,7,6,8,4,4]
  352.  
  353.  
  354.     # This hash adjusts the new equip types (past 4+). Adjust them to match
  355.  
  356.     # their names properly. You can choose to allow certain types of equipment
  357.  
  358.     # be removable or not, or whether or not optimize will affect them.
  359.  
  360.     TYPES ={
  361.  
  362.     # TypeID => ["Type Name", Removable?, Optimize?],
  363.  
  364.            0 => [   "武器",      false,      true],
  365.  
  366.            1 => [   "盾",       true,      true],
  367.  
  368.            2 => [ "头盔",       true,      true],
  369.  
  370.            3 => [ "防具",       true,      true],
  371.  
  372.            4 => ["贵重物品",       true,     false],
  373.  
  374.           5 => [ "护腕",       true,      false],
  375.  
  376.            6 => [ "项链",       true,      true],
  377.  
  378.            7 => [ "鞋子",       true,      true],
  379.  
  380.            8 => [ "戒指",       true,      true],
  381.  
  382.            9 => [ "属性",       true,      true],
  383.  
  384.     } # Do not remove this.
  385.  
  386.  
  387.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  388.  
  389.     # - Equip Command List -
  390.  
  391.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  392.  
  393.     # Here, you can adjust the order at which the commands appear (or even
  394.  
  395.     # remove commands as you see fit). Here's a list of which does what:
  396.  
  397.     #
  398.     # -------------------------------------------------------------------------
  399.  
  400.     # :command         Description
  401.  
  402.     # -------------------------------------------------------------------------
  403.  
  404.     # :equip           Activates the manual equip window. Default.
  405.  
  406.     # :optimize        Optimizes equipment for the actor. Default.
  407.  
  408.     # :clear           Clears all equipment from the actor. Default
  409.  
  410.     #
  411.     # And that's all of the currently available commands. This list will be
  412.  
  413.     # updated as more scripts become available.
  414.  
  415.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  416.  
  417.     # This array arranges the order of which the commands appear in the Equip
  418.  
  419.     # Command window in the Equip Scene.
  420.  
  421.     COMMAND_LIST =[
  422.  
  423.       :equip,
  424.  
  425.       :optimize,
  426.  
  427.       :clear,
  428.  
  429.     # :custom1,
  430.  
  431.     # :custom2,
  432.  
  433.     ] # Do not remove this.
  434.  
  435.  
  436.     #--------------------------------------------------------------------------
  437.  
  438.     # - Equip Custom Commands -
  439.  
  440.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  441.  
  442.     # For those who use scripts to that may produce unique effects for
  443.  
  444.     # equipping, use this hash to manage the custom commands for the Equip
  445.  
  446.     # Command Window. You can disable certain commands or prevent them from
  447.  
  448.     # appearing by using switches. If you don't wish to bind them to a switch,
  449.  
  450.     # set the proper switch to 0 for it to have no impact.
  451.  
  452.     #--------------------------------------------------------------------------
  453.  
  454.     CUSTOM_EQUIP_COMMANDS ={
  455.  
  456.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  457.  
  458.       :custom1 => [ "Custom Name",            0,          0, :command_name1],
  459.  
  460.       :custom2 => [ "Custom Text",           13,          0, :command_name2],
  461.  
  462.     } # Do not remove this.
  463.  
  464.  
  465.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  466.  
  467.     # - Misc Window Settings -
  468.  
  469.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  470.  
  471.     # This section adjusts the minor visuals that you see inside of the newly
  472.  
  473.     # organized Equip Scene. Adjust the settings as you see fit.
  474.  
  475.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  476.  
  477.     # This sets the font size used for the status window in the lower right
  478.  
  479.     # corner of the screen (which shows stats and comparisons).
  480.  
  481.     STATUS_FONT_SIZE = 20
  482.  
  483.  
  484.     # This sets the remove equip command in the item window.
  485.  
  486.     REMOVE_EQUIP_ICON = 185
  487.  
  488.     REMOVE_EQUIP_TEXT = "换下"
  489.  
  490.  
  491.     # This sets the no-equipment text in the slot window.
  492.  
  493.     NOTHING_ICON = 185
  494.  
  495.     NOTHING_TEXT = ""
  496.  
  497.  
  498.  
  499.   end # EQUIP
  500.  
  501. end # YEA
  502.  
  503.  
  504. #==============================================================================
  505.  
  506. # ▼ Editting anything past this point may potentially result in causing
  507.  
  508. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  509.  
  510. # halitosis so edit at your own risk.
  511.  
  512. #==============================================================================
  513.  
  514.  
  515. module YEA
  516.  
  517.   module REGEXP
  518.  
  519.   module BASEITEM
  520.  
  521.  
  522.     EQUIP_SLOTS_ON  = /<(?:EQUIP_SLOTS|equip slots)>/i
  523.  
  524.     EQUIP_SLOTS_OFF = /<\/(?:EQUIP_SLOTS|equip slots)>/i
  525.  
  526.  
  527.     EQUIP_TYPE_INT = /<(?:EQUIP_TYPE|equip type):[ ]*(\d+)>/i
  528.  
  529.     EQUIP_TYPE_STR = /<(?:EQUIP_TYPE|equip type):[ ]*(.*)>/i
  530.  
  531.  
  532.     STARTING_GEAR = /<(?:STARTING_GEAR|starting gear):[ ](\d+(?:\s*,\s*\d+)*)>/i
  533.  
  534.  
  535.     FIXED_EQUIP = /<(?:FIXED_EQUIP|fixed equip):[ ](\d+(?:\s*,\s*\d+)*)>/i
  536.  
  537.     SEALED_EQUIP = /<(?:SEALED_EQUIP|sealed equip):[ ](\d+(?:\s*,\s*\d+)*)>/i
  538.  
  539.  
  540.   end # BASEITEM
  541.  
  542.   end # REGEXP
  543.  
  544. end # YEA
  545.  
  546.  
  547. #==============================================================================
  548.  
  549. # ■ Vocab
  550.  
  551. #==============================================================================
  552.  
  553.  
  554. module Vocab
  555.  
  556.  
  557.  
  558.   #--------------------------------------------------------------------------
  559.  
  560.   # overwrite method: self.etype
  561.  
  562.   #--------------------------------------------------------------------------
  563.  
  564.   def self.etype(etype)
  565.  
  566.     return $data_system.terms.etypes[etype] if [0,1,2,3,4].include?(etype)
  567.  
  568.     return YEA::EQUIP::TYPES[etype][0] if YEA::EQUIP::TYPES.include?(etype)
  569.  
  570.     return ""
  571.  
  572.   end
  573.  
  574.  
  575.  
  576. end # Vocab
  577.  
  578.  
  579. #==============================================================================
  580.  
  581. # ■ Icon
  582.  
  583. #==============================================================================
  584.  
  585.  
  586. module Icon
  587.  
  588.  
  589.  
  590.   #--------------------------------------------------------------------------
  591.  
  592.   # self.remove_equip
  593.  
  594.   #--------------------------------------------------------------------------
  595.  
  596.   def self.remove_equip; return YEA::EQUIP::REMOVE_EQUIP_ICON; end
  597.  
  598.  
  599.  
  600.   #--------------------------------------------------------------------------
  601.  
  602.   # self.nothing_equip
  603.  
  604.   #--------------------------------------------------------------------------
  605.  
  606.   def self.nothing_equip; return YEA::EQUIP::NOTHING_ICON; end
  607.  
  608.  
  609. end # Icon
  610.  
  611.  
  612. #==============================================================================
  613.  
  614. # ■ Numeric
  615.  
  616. #==============================================================================
  617.  
  618.  
  619. class Numeric
  620.  
  621.  
  622.  
  623.   #--------------------------------------------------------------------------
  624.  
  625.   # new method: group_digits
  626.  
  627.   #--------------------------------------------------------------------------
  628.  
  629.   unless $imported["YEA-CoreEngine"]
  630.  
  631.   def group; return self.to_s; end
  632.  
  633.   end # $imported["YEA-CoreEngine"]
  634.  
  635.  
  636. end # Numeric
  637.  
  638.  
  639. #==============================================================================
  640.  
  641. # ■ DataManager
  642.  
  643. #==============================================================================
  644.  
  645.  
  646. module DataManager
  647.  
  648.  
  649.  
  650.   #--------------------------------------------------------------------------
  651.  
  652.   # alias method: load_database
  653.  
  654.   #--------------------------------------------------------------------------
  655.  
  656.   class <<self; alias load_database_aee load_database; end
  657.  
  658.   def self.load_database
  659.  
  660.     load_database_aee
  661.  
  662.     load_notetags_aee
  663.  
  664.   end
  665.  
  666.  
  667.  
  668.   #--------------------------------------------------------------------------
  669.  
  670.   # new method: load_notetags_aee
  671.  
  672.   #--------------------------------------------------------------------------
  673.  
  674.   def self.load_notetags_aee
  675.  
  676.     groups = [$data_actors, $data_classes, $data_weapons, $data_armors,
  677.  
  678.       $data_states]
  679.  
  680.     for group in groups
  681.  
  682.       for obj in group
  683.  
  684.         next if obj.nil?
  685.  
  686.         obj.load_notetags_aee
  687.  
  688.       end
  689.  
  690.     end
  691.  
  692.   end
  693.  
  694.  
  695.  
  696. end # DataManager
  697.  
  698.  
  699. #==============================================================================
  700.  
  701. # ■ RPG::BaseItem
  702.  
  703. #==============================================================================
  704.  
  705.  
  706. class RPG::BaseItem
  707.  
  708.  
  709.  
  710.   #--------------------------------------------------------------------------
  711.  
  712.   # public instance variables
  713.  
  714.   #--------------------------------------------------------------------------
  715.  
  716.   attr_accessor :base_equip_slots
  717.  
  718.   attr_accessor :fixed_equip_type
  719.  
  720.   attr_accessor :sealed_equip_type
  721.  
  722.   attr_accessor :extra_starting_equips
  723.  
  724.  
  725.  
  726.   #--------------------------------------------------------------------------
  727.  
  728.   # common cache: load_notetags_aee
  729.  
  730.   #--------------------------------------------------------------------------
  731.  
  732.   def load_notetags_aee
  733.  
  734.     @base_equip_slots = []
  735.  
  736.     @equip_slots_on = false
  737.  
  738.     @fixed_equip_type = []
  739.  
  740.     @sealed_equip_type = []
  741.  
  742.     @extra_starting_equips = []
  743.  
  744.     #---
  745.  
  746.     self.note.split(/[\r\n]+/).each { |line|
  747.  
  748.       case line
  749.  
  750.       #---
  751.  
  752.       when YEA::REGEXP::BASEITEM::EQUIP_SLOTS_ON
  753.  
  754.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  755.  
  756.         @equip_slots_on = true
  757.  
  758.       when YEA::REGEXP::BASEITEM::EQUIP_SLOTS_OFF
  759.  
  760.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  761.  
  762.         @equip_slots_on = false
  763.  
  764.       #---
  765.  
  766.       when YEA::REGEXP::BASEITEM::STARTING_GEAR
  767.  
  768.         next unless self.is_a?(RPG::Actor)
  769.  
  770.         $1.scan(/\d+/).each { |num|
  771.         @extra_starting_equips.push(num.to_i) if num.to_i > 0 }
  772.  
  773.       when YEA::REGEXP::BASEITEM::FIXED_EQUIP
  774.  
  775.         $1.scan(/\d+/).each { |num|
  776.         @fixed_equip_type.push(num.to_i) if num.to_i > 0 }
  777.  
  778.       when YEA::REGEXP::BASEITEM::SEALED_EQUIP
  779.  
  780.         $1.scan(/\d+/).each { |num|
  781.         @sealed_equip_type.push(num.to_i) if num.to_i > 0 }
  782.  
  783.       #---
  784.  
  785.       when YEA::REGEXP::BASEITEM::EQUIP_TYPE_INT
  786.  
  787.         next unless self.is_a?(RPG::Armor)
  788.  
  789.         @etype_id = [1, $1.to_i].max
  790.  
  791.       when YEA::REGEXP::BASEITEM::EQUIP_TYPE_STR
  792.  
  793.         next unless self.is_a?(RPG::Armor)
  794.  
  795.         for key in YEA::EQUIP::TYPES
  796.  
  797.           id = key[0]
  798.  
  799.           next if YEA::EQUIP::TYPES[id][0].upcase != $1.to_s.upcase
  800.  
  801.           @etype_id = [1, id].max
  802.  
  803.           break
  804.  
  805.         end
  806.  
  807.       #---
  808.  
  809.       else
  810.  
  811.         if @equip_slots_on
  812.  
  813.           case line.upcase
  814.  
  815.           when /EQUIP TYPE[ ](\d+)/i, /EQUIP TYPE:[ ](\d+)/i
  816.  
  817.             id = $1.to_i
  818.  
  819.             @base_equip_slots.push(id) if [0,1,2,3,4].include?(id)
  820.  
  821.             @base_equip_slots.push(id) if YEA::EQUIP::TYPES.include?(id)
  822.  
  823.           when /WEAPON/i
  824.  
  825.             @base_equip_slots.push(0)
  826.  
  827.           when /SHIELD/i
  828.  
  829.             @base_equip_slots.push(1)
  830.  
  831.           when /HEAD/i
  832.  
  833.             @base_equip_slots.push(2)
  834.  
  835.           when /BODY/i, /ARMOR/i, /ARMOUR/i
  836.  
  837.             @base_equip_slots.push(3)
  838.  
  839.           when /ETC/i, /OTHER/i, /ACCESSOR/i
  840.  
  841.             @base_equip_slots.push(4)
  842.  
  843.           else
  844.  
  845.             text = line.upcase.delete(" ")
  846.  
  847.             for key in YEA::EQUIP::TYPES
  848.  
  849.               id = key[0]
  850.  
  851.               next if YEA::EQUIP::TYPES[id][0].upcase.delete(" ")!= text
  852.  
  853.               @base_equip_slots.push(id)
  854.  
  855.               break
  856.  
  857.             end
  858.  
  859.           end
  860.  
  861.         end
  862.  
  863.       end
  864.  
  865.     } # self.note.split
  866.  
  867.     #---
  868.  
  869.     return unless self.is_a?(RPG::Class)
  870.  
  871.     if @base_equip_slots.empty?
  872.  
  873.       @base_equip_slots = YEA::EQUIP::DEFAULT_BASE_SLOTS.clone
  874.  
  875.     end
  876.  
  877.   end
  878.  
  879.  
  880.  
  881. end # RPG::BaseItem
  882.  
  883.  
  884. #==============================================================================
  885.  
  886. # ■ Game_Temp
  887.  
  888. #==============================================================================
  889.  
  890.  
  891. class Game_Temp
  892.  
  893.  
  894.  
  895.   #--------------------------------------------------------------------------
  896.  
  897.   # public instance variables
  898.  
  899.   #--------------------------------------------------------------------------
  900.  
  901.   attr_accessor :eds_actor
  902.  
  903.   attr_accessor :scene_equip_index
  904.  
  905.   attr_accessor :scene_equip_oy
  906.  
  907.  
  908.  
  909. end # Game_Temp
  910.  
  911.  
  912. #==============================================================================
  913.  
  914. # ■ Game_BaseItem
  915.  
  916. #==============================================================================
  917.  
  918.  
  919. class Game_BaseItem
  920.  
  921.  
  922.  
  923.   #--------------------------------------------------------------------------
  924.  
  925.   # public instance variables
  926.  
  927.   #--------------------------------------------------------------------------
  928.  
  929.   attr_accessor :item_id
  930.  
  931.  
  932.  
  933. end # Game_BaseItem
  934.  
  935.  
  936. #==============================================================================
  937.  
  938. # ■ Game_BattlerBase
  939.  
  940. #==============================================================================
  941.  
  942.  
  943. class Game_BattlerBase
  944.  
  945.  
  946.  
  947.   #--------------------------------------------------------------------------
  948.  
  949.   # alias method: equip_type_fixed?
  950.  
  951.   #--------------------------------------------------------------------------
  952.  
  953.   alias game_battlerbase_equip_type_fixed_aee equip_type_fixed?
  954.  
  955.   def equip_type_fixed?(etype_id)
  956.  
  957.     return true if fixed_etypes.include?(etype_id) if actor?
  958.  
  959.     return game_battlerbase_equip_type_fixed_aee(etype_id)
  960.  
  961.   end
  962.  
  963.  
  964.  
  965.   #--------------------------------------------------------------------------
  966.  
  967.   # alias method: equip_type_sealed?
  968.  
  969.   #--------------------------------------------------------------------------
  970.  
  971.   alias game_battlerbase_equip_type_sealed_aee equip_type_sealed?
  972.  
  973.   def equip_type_sealed?(etype_id)
  974.  
  975.     return true if sealed_etypes.include?(etype_id) if actor?
  976.  
  977.     return game_battlerbase_equip_type_sealed_aee(etype_id)
  978.  
  979.   end
  980.  
  981.  
  982.  
  983. end # Game_BattlerBase
  984.  
  985.  
  986. #==============================================================================
  987.  
  988. # ■ Game_Actor
  989.  
  990. #==============================================================================
  991.  
  992.  
  993. class Game_Actor < Game_Battler
  994.  
  995.  
  996.  
  997.   #--------------------------------------------------------------------------
  998.  
  999.   # alias method: init_equips
  1000.  
  1001.   #--------------------------------------------------------------------------
  1002.  
  1003.   alias game_actor_init_equips_aee init_equips
  1004.  
  1005.   def init_equips(equips)
  1006.  
  1007.     game_actor_init_equips_aee(equips)
  1008.  
  1009.     equip_extra_starting_equips
  1010.  
  1011.   end
  1012.  
  1013.  
  1014.  
  1015.   #--------------------------------------------------------------------------
  1016.  
  1017.   # new method: equip_extra_starting_equips
  1018.  
  1019.   #--------------------------------------------------------------------------
  1020.  
  1021.   def equip_extra_starting_equips
  1022.  
  1023.     for equip_id in actor.extra_starting_equips
  1024.  
  1025.       armour = $data_armors[equip_id]
  1026.  
  1027.       next if armour.nil?
  1028.  
  1029.       etype_id = armour.etype_id
  1030.  
  1031.       next unless equip_slots.include?(etype_id)
  1032.  
  1033.       slot_id = empty_slot(etype_id)
  1034.  
  1035.       @equips[slot_id].set_equip(etype_id == 0, armour.id)
  1036.  
  1037.     end
  1038.  
  1039.     refresh
  1040.  
  1041.   end
  1042.  
  1043.  
  1044.  
  1045.   #--------------------------------------------------------------------------
  1046.  
  1047.   # overwrite method: equip_slots
  1048.  
  1049.   #--------------------------------------------------------------------------
  1050.  
  1051.   def equip_slots
  1052.  
  1053.     return equip_slots_dual if dual_wield?
  1054.  
  1055.     return equip_slots_normal
  1056.  
  1057.   end
  1058.  
  1059.  
  1060.  
  1061.   #--------------------------------------------------------------------------
  1062.  
  1063.   # new method: equip_slots_normal
  1064.  
  1065.   #--------------------------------------------------------------------------
  1066.  
  1067.   def equip_slots_normal
  1068.  
  1069.     return self.actor.base_equip_slots if self.actor.base_equip_slots != []
  1070.  
  1071.     return self.class.base_equip_slots
  1072.  
  1073.   end
  1074.  
  1075.  
  1076.  
  1077.   #--------------------------------------------------------------------------
  1078.  
  1079.   # new method: equip_slots_dual
  1080.  
  1081.   #--------------------------------------------------------------------------
  1082.  
  1083.   def equip_slots_dual
  1084.  
  1085.     array = equip_slots_normal.clone
  1086.  
  1087.     array[1] = 0 if array.size >= 2
  1088.  
  1089.     return array
  1090.  
  1091.   end
  1092.  
  1093.  
  1094.  
  1095.   #--------------------------------------------------------------------------
  1096.  
  1097.   # new method: fixed_etypes
  1098.  
  1099.   #--------------------------------------------------------------------------
  1100.  
  1101.   def fixed_etypes
  1102.  
  1103.     array = []
  1104.  
  1105.     array |= self.actor.fixed_equip_type
  1106.  
  1107.     array |= self.class.fixed_equip_type
  1108.  
  1109.     for equip in equips
  1110.  
  1111.       next if equip.nil?
  1112.  
  1113.       array |= equip.fixed_equip_type
  1114.  
  1115.     end
  1116.  
  1117.     for state in states
  1118.  
  1119.       next if state.nil?
  1120.  
  1121.       array |= state.fixed_equip_type
  1122.  
  1123.     end
  1124.  
  1125.     return array
  1126.  
  1127.   end
  1128.  
  1129.  
  1130.  
  1131.   #--------------------------------------------------------------------------
  1132.  
  1133.   # new method: sealed_etypes
  1134.  
  1135.   #--------------------------------------------------------------------------
  1136.  
  1137.   def sealed_etypes
  1138.  
  1139.     array = []
  1140.  
  1141.     array |= self.actor.sealed_equip_type
  1142.  
  1143.     array |= self.class.sealed_equip_type
  1144.  
  1145.     for equip in equips
  1146.  
  1147.       next if equip.nil?
  1148.  
  1149.       array |= equip.sealed_equip_type
  1150.  
  1151.     end
  1152.  
  1153.     for state in states
  1154.  
  1155.       next if state.nil?
  1156.  
  1157.       array |= state.sealed_equip_type
  1158.  
  1159.     end
  1160.  
  1161.     return array
  1162.  
  1163.   end
  1164.  
  1165.  
  1166.  
  1167.   #--------------------------------------------------------------------------
  1168.  
  1169.   # alias method: change_equip
  1170.  
  1171.   #--------------------------------------------------------------------------
  1172.  
  1173.   alias game_actor_change_equip_aee change_equip
  1174.  
  1175.   def change_equip(slot_id, item)
  1176.  
  1177.     if item.nil? && !@optimize_clear
  1178.  
  1179.       etype_id = equip_slots[slot_id]
  1180.  
  1181.       return unless YEA::EQUIP::TYPES[etype_id][1]
  1182.  
  1183.     elsif item.nil? && @optimize_clear
  1184.  
  1185.       etype_id = equip_slots[slot_id]
  1186.  
  1187.       return unless YEA::EQUIP::TYPES[etype_id][2]
  1188.  
  1189.     end
  1190.  
  1191.     game_actor_change_equip_aee(slot_id, item)
  1192.  
  1193.   end
  1194.  
  1195.  
  1196.  
  1197.   #--------------------------------------------------------------------------
  1198.  
  1199.   # overwrite method: optimize_equipments
  1200.  
  1201.   #--------------------------------------------------------------------------
  1202.  
  1203.   def optimize_equipments
  1204.  
  1205.     $game_temp.eds_actor = self
  1206.  
  1207.     @optimize_clear = true
  1208.  
  1209.     clear_equipments
  1210.  
  1211.     @optimize_clear = false
  1212.  
  1213.     equip_slots.size.times do |i|
  1214.  
  1215.       next if !equip_change_ok?(i)
  1216.  
  1217.       next unless can_optimize?(i)
  1218.  
  1219.       items = $game_party.equip_items.select do |item|
  1220.  
  1221.         item.etype_id == equip_slots[i] &&
  1222.  
  1223.         equippable?(item) && item.performance >= 0
  1224.  
  1225.       end
  1226.  
  1227.       change_equip(i, items.max_by {|item| item.performance })
  1228.  
  1229.     end
  1230.  
  1231.     $game_temp.eds_actor = nil
  1232.  
  1233.   end
  1234.  
  1235.  
  1236.  
  1237.   #--------------------------------------------------------------------------
  1238.  
  1239.   # new method: can_optimize?
  1240.  
  1241.   #--------------------------------------------------------------------------
  1242.  
  1243.   def can_optimize?(slot_id)
  1244.  
  1245.     etype_id = equip_slots[slot_id]
  1246.  
  1247.     return YEA::EQUIP::TYPES[etype_id][2]
  1248.  
  1249.   end
  1250.  
  1251.  
  1252.  
  1253. end # Game_Actor
  1254.  
  1255.  
  1256. #==============================================================================
  1257.  
  1258. # ■ Game_Interpreter
  1259.  
  1260. #==============================================================================
  1261.  
  1262.  
  1263. class Game_Interpreter
  1264.  
  1265.  
  1266.  
  1267.   #--------------------------------------------------------------------------
  1268.  
  1269.   # overwrite method: change equip
  1270.  
  1271.   #--------------------------------------------------------------------------
  1272.  
  1273.   def command_319
  1274.  
  1275.     actor = $game_actors[@params[0]]
  1276.  
  1277.     return if actor.nil?
  1278.  
  1279.     if @params[1] == 0 && @params[2] != 0
  1280.  
  1281.       item = $data_weapons[@params[2]]
  1282.  
  1283.       return unless actor.equip_slots.include?(0)
  1284.  
  1285.       slot_id = actor.empty_slot(0)
  1286.  
  1287.     elsif @params[2] != 0
  1288.  
  1289.       item = $data_armors[@params[2]]
  1290.  
  1291.       return unless actor.equip_slots.include?(item.etype_id)
  1292.  
  1293.       slot_id = actor.empty_slot(item.etype_id)
  1294.  
  1295.     else
  1296.  
  1297.       slot_id = @params[1]
  1298.  
  1299.     end
  1300.  
  1301.     actor.change_equip_by_id(slot_id, @params[2])
  1302.  
  1303.   end
  1304.  
  1305.  
  1306.  
  1307. end # Game_Interpreter
  1308.  
  1309.  
  1310. #==============================================================================
  1311.  
  1312. # ■ Window_EquipStatus
  1313.  
  1314. #==============================================================================
  1315.  
  1316.  
  1317. class Window_EquipStatus < Window_Base
  1318.  
  1319.  
  1320.  
  1321.   #--------------------------------------------------------------------------
  1322.  
  1323.   # overwrite method: initialize
  1324.  
  1325.   #--------------------------------------------------------------------------
  1326.  
  1327.   def initialize(dx, dy)
  1328.  
  1329.     super(dx, dy, window_width, Graphics.height - dy)
  1330.  
  1331.     @actor = nil
  1332.  
  1333.     @temp_actor = nil
  1334.  
  1335.     refresh
  1336.  
  1337.   end
  1338.  
  1339.  
  1340.  
  1341.   #--------------------------------------------------------------------------
  1342.  
  1343.   # overwrite method: window_width
  1344.  
  1345.   #--------------------------------------------------------------------------
  1346.  
  1347.   def window_width; return Graphics.width * 2 / 5; end
  1348.  
  1349.  
  1350.  
  1351.   #--------------------------------------------------------------------------
  1352.  
  1353.   # overwrite method: refresh
  1354.  
  1355.   #--------------------------------------------------------------------------
  1356.  
  1357.   def refresh
  1358.  
  1359.     contents.clear
  1360.  
  1361.     8.times {|i| draw_item(0, line_height * i, i) }
  1362.  
  1363.   end
  1364.  
  1365.  
  1366.  
  1367.   #--------------------------------------------------------------------------
  1368.  
  1369.   # overwrite method: draw_item
  1370.  
  1371.   #--------------------------------------------------------------------------
  1372.  
  1373.   def draw_item(dx, dy, param_id)
  1374.  
  1375.     draw_background_colour(dx, dy)
  1376.  
  1377.     draw_param_name(dx + 4, dy, param_id)
  1378.  
  1379.     draw_current_param(dx + 4, dy, param_id) if @actor
  1380.  
  1381.     drx = (contents.width + 22) / 2
  1382.  
  1383.     draw_right_arrow(drx, dy)
  1384.  
  1385.     draw_new_param(drx + 22, dy, param_id) if @temp_actor
  1386.  
  1387.     reset_font_settings
  1388.  
  1389.   end
  1390.  
  1391.  
  1392.  
  1393.   #--------------------------------------------------------------------------
  1394.  
  1395.   # new method: draw_background_colour
  1396.  
  1397.   #--------------------------------------------------------------------------
  1398.  
  1399.   def draw_background_colour(dx, dy)
  1400.  
  1401.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1402.  
  1403.     rect = Rect.new(dx+1, dy+1, contents.width - 2, line_height - 2)
  1404.  
  1405.     contents.fill_rect(rect, colour)
  1406.  
  1407.   end
  1408.  
  1409.  
  1410.  
  1411.   #--------------------------------------------------------------------------
  1412.  
  1413.   # overwrite method: draw_param_name
  1414.  
  1415.   #--------------------------------------------------------------------------
  1416.  
  1417.   def draw_param_name(dx, dy, param_id)
  1418.  
  1419.     contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  1420.  
  1421.     change_color(system_color)
  1422.  
  1423.     draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  1424.  
  1425.   end
  1426.  
  1427.  
  1428.  
  1429.   #--------------------------------------------------------------------------
  1430.  
  1431.   # overwrite method: draw_current_param
  1432.  
  1433.   #--------------------------------------------------------------------------
  1434.  
  1435.   def draw_current_param(dx, dy, param_id)
  1436.  
  1437.     change_color(normal_color)
  1438.  
  1439.     dw = (contents.width + 22) / 2
  1440.  
  1441.     draw_text(0, dy, dw, line_height, @actor.param(param_id).group, 2)
  1442.  
  1443.     reset_font_settings
  1444.  
  1445.   end
  1446.  
  1447.  
  1448.  
  1449.   #--------------------------------------------------------------------------
  1450.  
  1451.   # overwrite method: draw_new_param
  1452.  
  1453.   #--------------------------------------------------------------------------
  1454.  
  1455.   def draw_new_param(dx, dy, param_id)
  1456.  
  1457.     contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  1458.  
  1459.     new_value = @temp_actor.param(param_id)
  1460.  
  1461.     change_color(param_change_color(new_value - @actor.param(param_id)))
  1462.  
  1463.     draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  1464.  
  1465.     reset_font_settings
  1466.  
  1467.   end
  1468.  
  1469.  
  1470.  
  1471. end # Window_EquipStatus
  1472.  
  1473.  
  1474. #==============================================================================
  1475.  
  1476. # ■ Window_EquipCommand
  1477.  
  1478. #==============================================================================
  1479.  
  1480.  
  1481. class Window_EquipCommand < Window_HorzCommand
  1482.  
  1483.  
  1484.  
  1485.   #--------------------------------------------------------------------------
  1486.  
  1487.   # overwrite method: make_command_list
  1488.  
  1489.   #--------------------------------------------------------------------------
  1490.  
  1491.   def make_command_list
  1492.  
  1493.     for command in YEA::EQUIP::COMMAND_LIST
  1494.  
  1495.       case command
  1496.  
  1497.       when :equip
  1498.  
  1499.         add_command(Vocab::equip2, :equip)
  1500.  
  1501.       when :optimize
  1502.  
  1503.         add_command(Vocab::optimize, :optimize)
  1504.  
  1505.       when :clear
  1506.  
  1507.         add_command(Vocab::clear, :clear)
  1508.  
  1509.       else
  1510.  
  1511.         process_custom_command(command)
  1512.  
  1513.       end
  1514.  
  1515.     end
  1516.  
  1517.   end
  1518.  
  1519.  
  1520.  
  1521.   #--------------------------------------------------------------------------
  1522.  
  1523.   # process_ok
  1524.  
  1525.   #--------------------------------------------------------------------------
  1526.  
  1527.   def process_ok
  1528.  
  1529.     $game_temp.scene_equip_index = index
  1530.  
  1531.     $game_temp.scene_equip_oy = self.oy
  1532.  
  1533.     super
  1534.  
  1535.   end
  1536.  
  1537.  
  1538.  
  1539.   #--------------------------------------------------------------------------
  1540.  
  1541.   # new method: process_custom_command
  1542.  
  1543.   #--------------------------------------------------------------------------
  1544.  
  1545.   def process_custom_command(command)
  1546.  
  1547.     return unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  1548.  
  1549.     show = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][2]
  1550.  
  1551.     continue = show <= 0 ? true : $game_switches[show]
  1552.  
  1553.     return unless continue
  1554.  
  1555.     text = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][0]
  1556.  
  1557.     switch = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][1]
  1558.  
  1559.     enabled = switch <= 0 ? true : $game_switches[switch]
  1560.  
  1561.     add_command(text, command, enabled)
  1562.  
  1563.   end
  1564.  
  1565.  
  1566.  
  1567.   #--------------------------------------------------------------------------
  1568.  
  1569.   # overwrite method: window_width
  1570.  
  1571.   #--------------------------------------------------------------------------
  1572.  
  1573.   def window_width; return 160; end
  1574.  
  1575.  
  1576.  
  1577.   #--------------------------------------------------------------------------
  1578.  
  1579.   # overwrite method: contents_width
  1580.  
  1581.   #--------------------------------------------------------------------------
  1582.  
  1583.   def contents_width; return width - standard_padding * 2; end
  1584.  
  1585.  
  1586.  
  1587.   #--------------------------------------------------------------------------
  1588.  
  1589.   # overwrite method: contents_height
  1590.  
  1591.   #--------------------------------------------------------------------------
  1592.  
  1593.   def contents_height
  1594.  
  1595.     ch = height - standard_padding * 2
  1596.  
  1597.     return [ch - ch % item_height, row_max * item_height].max
  1598.  
  1599.   end
  1600.  
  1601.  
  1602.  
  1603.   #--------------------------------------------------------------------------
  1604.  
  1605.   # overwrite method: visible_line_number
  1606.  
  1607.   #--------------------------------------------------------------------------
  1608.  
  1609.   def visible_line_number; return 4; end
  1610.  
  1611.  
  1612.  
  1613.   #--------------------------------------------------------------------------
  1614.  
  1615.   # overwrite method: col_max
  1616.  
  1617.   #--------------------------------------------------------------------------
  1618.  
  1619.   def col_max; return 1; end
  1620.  
  1621.  
  1622.   #--------------------------------------------------------------------------
  1623.  
  1624.   # overwrite method: item_rect
  1625.  
  1626.   #--------------------------------------------------------------------------
  1627.  
  1628.   def item_rect(index)
  1629.  
  1630.     rect = Rect.new
  1631.  
  1632.     rect.width = item_width
  1633.  
  1634.     rect.height = item_height
  1635.  
  1636.     rect.x = index % col_max * (item_width + spacing)
  1637.  
  1638.     rect.y = index / col_max * item_height
  1639.  
  1640.     rect
  1641.  
  1642.   end
  1643.  
  1644.  
  1645.  
  1646.   #--------------------------------------------------------------------------
  1647.  
  1648.   # overwrite method: ensure_cursor_visible
  1649.  
  1650.   #--------------------------------------------------------------------------
  1651.  
  1652.   def ensure_cursor_visible
  1653.  
  1654.     self.top_row = row if row < top_row
  1655.  
  1656.     self.bottom_row = row if row > bottom_row
  1657.  
  1658.   end
  1659.  
  1660.  
  1661.   #--------------------------------------------------------------------------
  1662.  
  1663.   # overwrite method: cursor_down
  1664.  
  1665.   #--------------------------------------------------------------------------
  1666.  
  1667.   def cursor_down(wrap = false)
  1668.  
  1669.     if index < item_max - col_max || (wrap && col_max == 1)
  1670.  
  1671.       select((index + col_max) % item_max)
  1672.  
  1673.     end
  1674.  
  1675.   end
  1676.  
  1677.  
  1678.  
  1679.   #--------------------------------------------------------------------------
  1680.  
  1681.   # overwrite method: cursor_up
  1682.  
  1683.   #--------------------------------------------------------------------------
  1684.  
  1685.   def cursor_up(wrap = false)
  1686.  
  1687.     if index >= col_max || (wrap && col_max == 1)
  1688.  
  1689.       select((index - col_max + item_max) % item_max)
  1690.  
  1691.     end
  1692.  
  1693.   end
  1694.  
  1695.  
  1696.  
  1697.   #--------------------------------------------------------------------------
  1698.  
  1699.   # overwrite method: process_pageup
  1700.  
  1701.   #--------------------------------------------------------------------------
  1702.  
  1703.   def process_pageup
  1704.  
  1705.     Sound.play_cursor
  1706.  
  1707.     Input.update
  1708.  
  1709.     deactivate
  1710.  
  1711.     call_handler(:pageup)
  1712.  
  1713.   end
  1714.  
  1715.  
  1716.  
  1717.   #--------------------------------------------------------------------------
  1718.  
  1719.   # overwrite method: process_pagedown
  1720.  
  1721.   #--------------------------------------------------------------------------
  1722.  
  1723.   def process_pagedown
  1724.  
  1725.     Sound.play_cursor
  1726.  
  1727.     Input.update
  1728.  
  1729.     deactivate
  1730.  
  1731.     call_handler(:pagedown)
  1732.  
  1733.   end
  1734.  
  1735.  
  1736.  
  1737. end # Window_EquipCommand
  1738.  
  1739.  
  1740. #==============================================================================
  1741.  
  1742. # ■ Window_EquipSlot
  1743.  
  1744. #==============================================================================
  1745.  
  1746.  
  1747. class Window_EquipSlot < Window_Selectable
  1748.  
  1749.  
  1750.  
  1751.   #--------------------------------------------------------------------------
  1752.  
  1753.   # overwrite method: initialize
  1754.  
  1755.   #--------------------------------------------------------------------------
  1756.  
  1757.   def initialize(dx, dy, dw)
  1758.  
  1759.     super(dx, dy, dw, Graphics.height - dy)
  1760.  
  1761.     @actor = nil
  1762.  
  1763.     refresh
  1764.  
  1765.   end
  1766.  
  1767.  
  1768.  
  1769.   #--------------------------------------------------------------------------
  1770.  
  1771.   # overwrite method: window_height
  1772.  
  1773.   #--------------------------------------------------------------------------
  1774.  
  1775.   def window_height; return self.height; end
  1776.  
  1777.  
  1778.  
  1779.   #--------------------------------------------------------------------------
  1780.  
  1781.   # overwrite method: visible_line_number
  1782.  
  1783.   #--------------------------------------------------------------------------
  1784.  
  1785.   def visible_line_number; return item_max; end
  1786.  
  1787.  
  1788.  
  1789.   #--------------------------------------------------------------------------
  1790.  
  1791.   # overwrite method: refresh
  1792.  
  1793.   #--------------------------------------------------------------------------
  1794.  
  1795.   def refresh
  1796.  
  1797.     create_contents
  1798.  
  1799.     super
  1800.  
  1801.   end
  1802.  
  1803.  
  1804.  
  1805.   #--------------------------------------------------------------------------
  1806.  
  1807.   # overwrite method: draw_item
  1808.  
  1809.   #--------------------------------------------------------------------------
  1810.  
  1811.   def draw_item(index)
  1812.  
  1813.     return unless @actor
  1814.  
  1815.     rect = item_rect_for_text(index)
  1816.  
  1817.     change_color(system_color, enable?(index))
  1818.  
  1819.     draw_text(rect.x, rect.y, 92, line_height, slot_name(index))
  1820.  
  1821.     item = @actor.equips[index]
  1822.  
  1823.     dx = rect.x + 92
  1824.  
  1825.     dw = contents.width - dx - 24
  1826.  
  1827.     if item.nil?
  1828.  
  1829.       draw_nothing_equip(dx, rect.y, false, dw)
  1830.  
  1831.     else
  1832.  
  1833.       draw_item_name(item, dx, rect.y, enable?(index), dw)
  1834.  
  1835.     end
  1836.  
  1837.   end
  1838.  
  1839.  
  1840.  
  1841.   #--------------------------------------------------------------------------
  1842.  
  1843.   # new method: draw_nothing_equip
  1844.  
  1845.   #--------------------------------------------------------------------------
  1846.  
  1847.   def draw_nothing_equip(dx, dy, enabled, dw)
  1848.  
  1849.     change_color(normal_color, enabled)
  1850.  
  1851.     draw_icon(Icon.nothing_equip, dx, dy, enabled)
  1852.  
  1853.     text = YEA::EQUIP::NOTHING_TEXT
  1854.  
  1855.     draw_text(dx + 24, dy, dw - 24, line_height, text)
  1856.  
  1857.   end
  1858.  
  1859.  
  1860.  
  1861. end # Window_EquipSlot
  1862.  
  1863.  
  1864. #==============================================================================
  1865.  
  1866. # ■ Window_EquipItem
  1867.  
  1868. #==============================================================================
  1869.  
  1870.  
  1871. class Window_EquipItem < Window_ItemList
  1872.  
  1873.  
  1874.  
  1875.   #--------------------------------------------------------------------------
  1876.  
  1877.   # overwrite method: col_max
  1878.  
  1879.   #--------------------------------------------------------------------------
  1880.  
  1881.   def col_max; return 1; end
  1882.  
  1883.  
  1884.  
  1885.   #--------------------------------------------------------------------------
  1886.  
  1887.   # overwrite method: slot_id=
  1888.  
  1889.   #--------------------------------------------------------------------------
  1890.  
  1891.   def slot_id=(slot_id)
  1892.  
  1893.     return if @slot_id == slot_id
  1894.  
  1895.     @slot_id = slot_id
  1896.  
  1897.     @last_item = nil
  1898.  
  1899.     self.oy = 0
  1900.  
  1901.   end
  1902.  
  1903.  
  1904.  
  1905.   #--------------------------------------------------------------------------
  1906.  
  1907.   # overwrite method: draw_item
  1908.  
  1909.   #--------------------------------------------------------------------------
  1910.  
  1911.   def draw_item(index)
  1912.  
  1913.     item = @data[index]
  1914.  
  1915.     rect = item_rect(index)
  1916.  
  1917.     rect.width -= 4
  1918.  
  1919.     if item.nil?
  1920.  
  1921.       draw_remove_equip(rect)
  1922.  
  1923.       return
  1924.  
  1925.     end
  1926.  
  1927.     dw = contents.width - rect.x - 24
  1928.  
  1929.     draw_item_name(item, rect.x, rect.y, enable?(item), dw)
  1930.  
  1931.     draw_item_number(rect, item)
  1932.  
  1933.   end
  1934.  
  1935.  
  1936.  
  1937.   #--------------------------------------------------------------------------
  1938.  
  1939.   # new method: draw_remove_equip
  1940.  
  1941.   #--------------------------------------------------------------------------
  1942.  
  1943.   def draw_remove_equip(rect)
  1944.  
  1945.     draw_icon(Icon.remove_equip, rect.x, rect.y)
  1946.  
  1947.     text = YEA::EQUIP::REMOVE_EQUIP_TEXT
  1948.  
  1949.     rect.x += 24
  1950.  
  1951.     rect.width -= 24
  1952.  
  1953.     draw_text(rect, text)
  1954.  
  1955.   end
  1956.  
  1957.  
  1958.  
  1959.   #--------------------------------------------------------------------------
  1960.  
  1961.   # overwrite method: include?
  1962.  
  1963.   #--------------------------------------------------------------------------
  1964.  
  1965.   def include?(item)
  1966.  
  1967.     if item.nil? && !@actor.nil?
  1968.  
  1969.       etype_id = @actor.equip_slots[@slot_id]
  1970.  
  1971.       return YEA::EQUIP::TYPES[etype_id][1]
  1972.  
  1973.     end
  1974.  
  1975.     return true if item.nil?
  1976.  
  1977.     return false unless item.is_a?(RPG::EquipItem)
  1978.  
  1979.     return false if @slot_id < 0
  1980.  
  1981.     return false if item.etype_id != @actor.equip_slots[@slot_id]
  1982.  
  1983.     return @actor.equippable?(item)
  1984.  
  1985.   end
  1986.  
  1987.  
  1988.  
  1989.   #--------------------------------------------------------------------------
  1990.  
  1991.   # overwrite method: enable?
  1992.  
  1993.   #--------------------------------------------------------------------------
  1994.  
  1995.   def enable?(item)
  1996.  
  1997.     if item.nil? && !@actor.nil?
  1998.  
  1999.       etype_id = @actor.equip_slots[@slot_id]
  2000.  
  2001.       return YEA::EQUIP::TYPES[etype_id][1]
  2002.  
  2003.     end
  2004.  
  2005.     return @actor.equippable?(item)
  2006.  
  2007.   end
  2008.  
  2009.  
  2010.  
  2011.   #--------------------------------------------------------------------------
  2012.  
  2013.   # new method: show
  2014.  
  2015.   #--------------------------------------------------------------------------
  2016.  
  2017.   def show
  2018.  
  2019.     @last_item = 0
  2020.  
  2021.     update_help
  2022.  
  2023.     super
  2024.  
  2025.   end
  2026.  
  2027.  
  2028.  
  2029.   #--------------------------------------------------------------------------
  2030.  
  2031.   # overwrite method: update_help
  2032.  
  2033.   #--------------------------------------------------------------------------
  2034.  
  2035.   def update_help
  2036.  
  2037.     super
  2038.  
  2039.     return if @actor.nil?
  2040.  
  2041.     return if @status_window.nil?
  2042.  
  2043.     return if @last_item == item
  2044.  
  2045.     @last_item = item
  2046.  
  2047.     temp_actor = Marshal.load(Marshal.dump(@actor))
  2048.  
  2049.     temp_actor.force_change_equip(@slot_id, item)
  2050.  
  2051.     @status_window.set_temp_actor(temp_actor)
  2052.  
  2053.   end
  2054.  
  2055.  
  2056.  
  2057. end # Window_EquipItem
  2058.  
  2059.  
  2060. #==============================================================================
  2061.  
  2062. # ■ Window_EquipActor
  2063.  
  2064. #==============================================================================
  2065.  
  2066.  
  2067. class Window_EquipActor < Window_Base
  2068.  
  2069.  
  2070.  
  2071.   #--------------------------------------------------------------------------
  2072.  
  2073.   # initialize
  2074.  
  2075.   #--------------------------------------------------------------------------
  2076.  
  2077.   def initialize(dx, dy)
  2078.  
  2079.     super(dx, dy, window_width, fitting_height(4))
  2080.  
  2081.     @actor = nil
  2082.  
  2083.   end
  2084.  
  2085.  
  2086.  
  2087.   #--------------------------------------------------------------------------
  2088.  
  2089.   # window_width
  2090.  
  2091.   #--------------------------------------------------------------------------
  2092.  
  2093.   def window_width; return Graphics.width - 160; end
  2094.  
  2095.  
  2096.  
  2097.   #--------------------------------------------------------------------------
  2098.  
  2099.   # actor=
  2100.  
  2101.   #--------------------------------------------------------------------------
  2102.  
  2103.   def actor=(actor)
  2104.  
  2105.     return if @actor == actor
  2106.  
  2107.     @actor = actor
  2108.  
  2109.     refresh
  2110.  
  2111.   end
  2112.  
  2113.  
  2114.  
  2115.   #--------------------------------------------------------------------------
  2116.  
  2117.   # refresh
  2118.  
  2119.   #--------------------------------------------------------------------------
  2120.  
  2121.   def refresh
  2122.  
  2123.     contents.clear
  2124.  
  2125.     return unless @actor
  2126.  
  2127.     draw_actor_face(@actor, 0, 0)
  2128.  
  2129.     draw_actor_simple_status(@actor, 108, line_height / 2)
  2130.  
  2131.   end
  2132.  
  2133.  
  2134.  
  2135. end # Window_EquipActor
  2136.  
  2137.  
  2138. #==============================================================================
  2139.  
  2140. # ■ Scene_Equip
  2141.  
  2142. #==============================================================================
  2143.  
  2144.  
  2145. class Scene_Equip < Scene_MenuBase
  2146.  
  2147.  
  2148.  
  2149.   #--------------------------------------------------------------------------
  2150.  
  2151.   # overwrite method: create_status_window
  2152.  
  2153.   #--------------------------------------------------------------------------
  2154.  
  2155.   def create_status_window
  2156.  
  2157.     wx = Graphics.width - (Graphics.width * 2 / 5)
  2158.  
  2159.     wy = @help_window.height + 120
  2160.  
  2161.     @status_window = Window_EquipStatus.new(wx, wy)
  2162.  
  2163.     @status_window.viewport = @viewport
  2164.  
  2165.     @status_window.actor = @actor
  2166.  
  2167.   end
  2168.  
  2169.  
  2170.  
  2171.   #--------------------------------------------------------------------------
  2172.  
  2173.   # overwrite method: create_command_window
  2174.  
  2175.   #--------------------------------------------------------------------------
  2176.  
  2177.   def create_command_window
  2178.  
  2179.  
  2180.  
  2181.     wx = 0
  2182.  
  2183.     wy = @help_window.height
  2184.  
  2185.     ww = 160
  2186.  
  2187.     @command_window = Window_EquipCommand.new(wx, wy, ww)
  2188.  
  2189.     @command_window.viewport = @viewport
  2190.  
  2191.     @command_window.help_window = @help_window
  2192.  
  2193.     if !$game_temp.scene_equip_index.nil?
  2194.  
  2195.       @command_window.select($game_temp.scene_equip_index)
  2196.  
  2197.       @command_window.oy = $game_temp.scene_equip_oy
  2198.  
  2199.     end
  2200.  
  2201.     $game_temp.scene_equip_index = nil
  2202.  
  2203.     $game_temp.scene_equip_oy = nil
  2204.  
  2205.     @command_window.set_handler(:equip,    method(:command_equip))
  2206.  
  2207.     @command_window.set_handler(:optimize, method(:command_optimize))
  2208.  
  2209.     @command_window.set_handler(:clear,    method(:command_clear))
  2210.  
  2211.     @command_window.set_handler(:cancel,   method(:return_scene))
  2212.  
  2213.     @command_window.set_handler(:pagedown, method(:next_actor))
  2214.  
  2215.     @command_window.set_handler(:pageup,   method(:prev_actor))
  2216.  
  2217.     process_custom_equip_commands
  2218.  
  2219.     create_actor_window
  2220.  
  2221.   end
  2222.  
  2223.  
  2224.  
  2225.   #--------------------------------------------------------------------------
  2226.  
  2227.   # new method: create_actor_window
  2228.  
  2229.   #--------------------------------------------------------------------------
  2230.  
  2231.   def create_actor_window
  2232.  
  2233.     wy = @help_window.height
  2234.  
  2235.     @actor_window = Window_EquipActor.new(@command_window.width, wy)
  2236.  
  2237.     @actor_window.viewport = @viewport
  2238.  
  2239.     @actor_window.actor = @actor
  2240.  
  2241.   end
  2242.  
  2243.  
  2244.  
  2245.   #--------------------------------------------------------------------------
  2246.  
  2247.   # new method: process_custom_equip_commands
  2248.  
  2249.   #--------------------------------------------------------------------------
  2250.  
  2251.   def process_custom_equip_commands
  2252.  
  2253.     for command in YEA::EQUIP::COMMAND_LIST
  2254.  
  2255.       next unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  2256.  
  2257.       called_method = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][3]
  2258.  
  2259.       @command_window.set_handler(command, method(called_method))
  2260.  
  2261.     end
  2262.  
  2263.   end
  2264.  
  2265.  
  2266.  
  2267.   #--------------------------------------------------------------------------
  2268.  
  2269.   # overwrite method: create_slot_window
  2270.  
  2271.   #--------------------------------------------------------------------------
  2272.  
  2273.   def create_slot_window
  2274.  
  2275.     wx = 0
  2276.  
  2277.     wy = @command_window.y + @command_window.height
  2278.  
  2279.     ww = Graphics.width - @status_window.width
  2280.  
  2281.     @slot_window = Window_EquipSlot.new(wx, wy, ww)
  2282.  
  2283.     @slot_window.viewport = @viewport
  2284.  
  2285.     @slot_window.help_window = @help_window
  2286.  
  2287.     @slot_window.status_window = @status_window
  2288.  
  2289.     @slot_window.actor = @actor
  2290.  
  2291.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  2292.  
  2293.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  2294.  
  2295.   end
  2296.  
  2297.  
  2298.  
  2299.   #--------------------------------------------------------------------------
  2300.  
  2301.   # overwrite method: create_item_window
  2302.  
  2303.   #--------------------------------------------------------------------------
  2304.  
  2305.   def create_item_window
  2306.  
  2307.     wx = @slot_window.x
  2308.  
  2309.     wy = @slot_window.y
  2310.  
  2311.     ww = @slot_window.width
  2312.  
  2313.     wh = @slot_window.height
  2314.  
  2315.     @item_window = Window_EquipItem.new(wx, wy, ww, wh)
  2316.  
  2317.     @item_window.viewport = @viewport
  2318.  
  2319.     @item_window.help_window = @help_window
  2320.  
  2321.     @item_window.status_window = @status_window
  2322.  
  2323.     @item_window.actor = @actor
  2324.  
  2325.     @item_window.set_handler(:ok,     method(:on_item_ok))
  2326.  
  2327.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  2328.  
  2329.     @slot_window.item_window = @item_window
  2330.  
  2331.     @item_window.hide
  2332.  
  2333.   end
  2334.  
  2335.  
  2336.  
  2337.   #--------------------------------------------------------------------------
  2338.  
  2339.   # alias method: command_optimize
  2340.  
  2341.   #--------------------------------------------------------------------------
  2342.  
  2343.   alias scene_equip_command_optimize_aee command_optimize
  2344.  
  2345.   def command_optimize
  2346.  
  2347.     scene_equip_command_optimize_aee
  2348.  
  2349.     @actor_window.refresh
  2350.  
  2351.   end
  2352.  
  2353.  
  2354.  
  2355.   #--------------------------------------------------------------------------
  2356.  
  2357.   # alias method: command_clear
  2358.  
  2359.   #--------------------------------------------------------------------------
  2360.  
  2361.   alias scene_equip_command_clear_aee command_clear
  2362.  
  2363.   def command_clear
  2364.  
  2365.     scene_equip_command_clear_aee
  2366.  
  2367.     @actor_window.refresh
  2368.  
  2369.   end
  2370.  
  2371.  
  2372.  
  2373.   #--------------------------------------------------------------------------
  2374.  
  2375.   # alias method: on_slot_ok
  2376.  
  2377.   #--------------------------------------------------------------------------
  2378.  
  2379.   alias scene_equip_on_slot_ok_aee on_slot_ok
  2380.  
  2381.   def on_slot_ok
  2382.  
  2383.     scene_equip_on_slot_ok_aee
  2384.  
  2385.     @slot_window.hide
  2386.  
  2387.     @item_window.refresh
  2388.  
  2389.     @item_window.show
  2390.  
  2391.   end
  2392.  
  2393.  
  2394.  
  2395.   #--------------------------------------------------------------------------
  2396.  
  2397.   # alias method: on_item_ok
  2398.  
  2399.   #--------------------------------------------------------------------------
  2400.  
  2401.   alias scene_equip_on_item_ok_aee on_item_ok
  2402.  
  2403.   def on_item_ok
  2404.  
  2405.     scene_equip_on_item_ok_aee
  2406.  
  2407.     @actor_window.refresh
  2408.  
  2409.     @slot_window.show
  2410.  
  2411.     @item_window.hide
  2412.  
  2413.   end
  2414.  
  2415.  
  2416.  
  2417.   #--------------------------------------------------------------------------
  2418.  
  2419.   # alias method: on_item_cancel
  2420.  
  2421.   #--------------------------------------------------------------------------
  2422.  
  2423.   alias scene_equip_on_item_cancel_aee on_item_cancel
  2424.  
  2425.   def on_item_cancel
  2426.  
  2427.     scene_equip_on_item_cancel_aee
  2428.  
  2429.     @slot_window.show
  2430.  
  2431.     @item_window.hide
  2432.  
  2433.   end
  2434.  
  2435.  
  2436.  
  2437.   #--------------------------------------------------------------------------
  2438.  
  2439.   # alias method: on_actor_change
  2440.  
  2441.   #--------------------------------------------------------------------------
  2442.  
  2443.   alias scene_equip_on_actor_change_aee on_actor_change
  2444.  
  2445.   def on_actor_change
  2446.  
  2447.     scene_equip_on_actor_change_aee
  2448.  
  2449.     @actor_window.actor = @actor
  2450.  
  2451.   end
  2452.  
  2453.  
  2454.  
  2455.   #--------------------------------------------------------------------------
  2456.  
  2457.   # new method: command_name1
  2458.  
  2459.   #--------------------------------------------------------------------------
  2460.  
  2461.   def command_name1
  2462.  
  2463.     # Do nothing.
  2464.  
  2465.   end
  2466.  
  2467.  
  2468.  
  2469.   #--------------------------------------------------------------------------
  2470.  
  2471.   # new method: command_name2
  2472.  
  2473.   #--------------------------------------------------------------------------
  2474.  
  2475.   def command_name2
  2476.  
  2477.     # Do nothing.
  2478.  
  2479.   end
  2480.  
  2481.  
  2482.  
  2483. end # Scene_Equip
  2484.  
  2485.  
  2486. #==============================================================================
  2487.  
  2488. #
  2489. # ▼ End of File
  2490.  
  2491. #
  2492. #==============================================================================

点评

英文直接机翻不行吗。。。按照格式写在备注里<> バァバァ</>  发表于 2016-3-20 08:57
究极半吊子
《重生学校》同人作:https://rpg.blue/thread-493882-1-1.html

Lv3.寻梦者

梦石
0
星屑
1150
在线时间
245 小时
注册时间
2016-2-3
帖子
178

开拓者

2
 楼主| 发表于 2016-3-20 09:38:24 | 只看该作者
你的回答好高深,听不懂...
究极半吊子
《重生学校》同人作:https://rpg.blue/thread-493882-1-1.html
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 07:11

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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