AlliedG

Untitled

Feb 5th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 51.88 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Equip Engine v1.06
  4. # -- Last Updated: 2012.02.02
  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.02.02 - Bug Fixed: Crash when changing classes to different equip slots.
  17. # 2012.01.22 - Bug Fixed: <equip slot> notetags updated to factor in spaces.
  18. # 2012.01.05 - Compatibility Update: Equip Dynamic Stats
  19. # 2011.12.30 - Bug Fixed: Stats didn't update.
  20. # 2011.12.23 - Script efficiency optimized.
  21. # 2011.12.18 - Script efficiency optimized.
  22. # 2011.12.13 - Started Script and Finished.
  23. #
  24. #==============================================================================
  25. # ▼ Introduction
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # The default equipment system in RPG Maker VX is the standard equipment system
  28. # seen in all of the previous iterations, which consists of weapon, shield,
  29. # headgear, bodygear, and accessory. To break free of that norm, this script
  30. # allows users access to giving actors and/or classes dynamic equipment setups
  31. # (including having multiples of the same categories). In addition to having
  32. # different equip slot setups, newer equipment types can be made to allow for
  33. # more diversity in armour types.
  34. #
  35. #==============================================================================
  36. # ▼ Instructions
  37. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  38. # To install this script, open up your script editor and copy/paste this script
  39. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  40. #
  41. # -----------------------------------------------------------------------------
  42. # Actor Notetags - These notetags go in the actors notebox in the database.
  43. # -----------------------------------------------------------------------------
  44. # <equip slots>
  45. # string
  46. # string
  47. # </equip slots>
  48. # This sets the actor's default slots to whatever is listed in between the two
  49. # notetags. An actor's custom equip slots will take priority over a class's
  50. # custom equip slots, which will take priority over the default equip slots.
  51. # Replace "string" with the proper equipment type name or when in doubt, use
  52. # "equip type: x" with x as the equipment type.
  53. #
  54. # <starting gear: x>
  55. # <starting gear: x, x>
  56. # Adds armour x to the actor's list of starting gear. This is used primarily
  57. # for the newer pieces of gear that can't be added through the starting set of
  58. # equipment through the RPG Maker VX Ace editor by default. Insert multiple of
  59. # these notetags to add more pieces of starting gear if so desired.
  60. #
  61. # <fixed equip: x>
  62. # <fixed equip: x, x>
  63. # This will fix the equip type x. Fixed equip slots mean that the equipment
  64. # already on it are unable to be exchanged in or out by the player. This tag
  65. # has been made so that equip types can be fixed for equip type 5 and above.
  66. # Use multiple of these notetags to add more fixed equipment restrictions.
  67. #
  68. # <sealed equip: x>
  69. # <sealed equip: x, x>
  70. # This will seal the equip type x. Sealed equip slots mean that no equipment
  71. # can be equipped onto that equip type slot. This tag has been made so that
  72. # equip types can be sealed for equip type 5 and above. Use multiple of these
  73. # notetags to add more sealed equipment restrictions.
  74. #
  75. # -----------------------------------------------------------------------------
  76. # Class Notetags - These notetags go in the class notebox in the database.
  77. # -----------------------------------------------------------------------------
  78. # <equip slots>
  79. # string
  80. # string
  81. # </equip slots>
  82. # This sets the class's default slots to whatever is listed in between the two
  83. # notetags. An actor's custom equip slots will take priority over a class's
  84. # custom equip slots, which will take priority over the default equip slots.
  85. # Replace "string" with the proper equipment type name or when in doubt, use
  86. # "equip type: x" with x as the equipment type.
  87. #
  88. # <fixed equip: x>
  89. # <fixed equip: x, x>
  90. # This will fix the equip type x. Fixed equip slots mean that the equipment
  91. # already on it are unable to be exchanged in or out by the player. This tag
  92. # has been made so that equip types can be fixed for equip type 5 and above.
  93. # Use multiple of these notetags to add more fixed equipment restrictions.
  94. #
  95. # <sealed equip: x>
  96. # <sealed equip: x, x>
  97. # This will seal the equip type x. Sealed equip slots mean that no equipment
  98. # can be equipped onto that equip type slot. This tag has been made so that
  99. # equip types can be sealed for equip type 5 and above. Use multiple of these
  100. # notetags to add more sealed equipment restrictions.
  101. #
  102. # -----------------------------------------------------------------------------
  103. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  104. # -----------------------------------------------------------------------------
  105. # <fixed equip: x>
  106. # <fixed equip: x, x>
  107. # This will fix the equip type x. Fixed equip slots mean that the equipment
  108. # already on it are unable to be exchanged in or out by the player. This tag
  109. # has been made so that equip types can be fixed for equip type 5 and above.
  110. # Use multiple of these notetags to add more fixed equipment restrictions.
  111. #
  112. # <sealed equip: x>
  113. # <sealed equip: x, x>
  114. # This will seal the equip type x. Sealed equip slots mean that no equipment
  115. # can be equipped onto that equip type slot. This tag has been made so that
  116. # equip types can be sealed for equip type 5 and above. Use multiple of these
  117. # notetags to add more sealed equipment restrictions.
  118. #
  119. # -----------------------------------------------------------------------------
  120. # Armour Notetags - These notetags go in the armour notebox in the database.
  121. # -----------------------------------------------------------------------------
  122. # <equip type: x>
  123. # <equip type: string>
  124. # For the newer equip types, replace x or string with the equip type ID or the
  125. # name of the equip type respectively. This will set that armour to that
  126. # particular equip type.
  127. #
  128. # <fixed equip: x>
  129. # <fixed equip: x, x>
  130. # This will fix the equip type x. Fixed equip slots mean that the equipment
  131. # already on it are unable to be exchanged in or out by the player. This tag
  132. # has been made so that equip types can be fixed for equip type 5 and above.
  133. # Use multiple of these notetags to add more fixed equipment restrictions.
  134. #
  135. # <sealed equip: x>
  136. # <sealed equip: x, x>
  137. # This will seal the equip type x. Sealed equip slots mean that no equipment
  138. # can be equipped onto that equip type slot. This tag has been made so that
  139. # equip types can be sealed for equip type 5 and above. Use multiple of these
  140. # notetags to add more sealed equipment restrictions.
  141. #
  142. # -----------------------------------------------------------------------------
  143. # State Notetags - These notetags go in the states notebox in the database.
  144. # -----------------------------------------------------------------------------
  145. # <fixed equip: x>
  146. # <fixed equip: x, x>
  147. # This will fix the equip type x. Fixed equip slots mean that the equipment
  148. # already on it are unable to be exchanged in or out by the player. This tag
  149. # has been made so that equip types can be fixed for equip type 5 and above.
  150. # Use multiple of these notetags to add more fixed equipment restrictions.
  151. #
  152. # <sealed equip: x>
  153. # <sealed equip: x, x>
  154. # This will seal the equip type x. Sealed equip slots mean that no equipment
  155. # can be equipped onto that equip type slot. This tag has been made so that
  156. # equip types can be sealed for equip type 5 and above. Use multiple of these
  157. # notetags to add more sealed equipment restrictions.
  158. #
  159. #==============================================================================
  160. # ▼ Compatibility
  161. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  162. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  163. # it will run with RPG Maker VX without adjusting.
  164. #
  165. #==============================================================================
  166.  
  167. module YEA
  168. module EQUIP
  169.  
  170. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  171. # - General Equip Settings -
  172. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  173. # This adjusts the default equip configuration. While actors can have their
  174. # own unique equipment configurations, it's recommended to not change too
  175. # much as things get really hairy when it comes to proper eventing.
  176. #
  177. # ID Equip Type
  178. # --- ------------
  179. # 0 Weapon
  180. # 1 Shield
  181. # 2 Headgear
  182. # 3 Bodygear
  183. # 4 Accessory
  184. #
  185. # Whatever you set the below slots to, the dual wield setup will be exactly
  186. # identical except that the second slot will be changed to a weapon (0).
  187. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  188. # Adjust this array to set the default slots used for all of your actors
  189. # and classes if they do not have a custom equipment slot setup.
  190. DEFAULT_BASE_SLOTS = [ 0, 1, 2, 3, 4]
  191.  
  192. # This hash adjusts the new equip types (past 4+). Adjust them to match
  193. # their names properly. You can choose to allow certain types of equipment
  194. # be removable or not, or whether or not optimize will affect them.
  195. TYPES ={
  196. # TypeID => ["Type Name", Removable?, Optimize?],
  197. 0 => [ "Weapon", false, true],
  198. 1 => [ "Shield", true, true],
  199. 2 => [ "Headgear", true, true],
  200. 3 => [ "Bodygear", false, true],
  201. 4 => ["Accessory", true, false],
  202. 5 => [ "Rune", true, true],
  203. 6 => [ "Necklace", true, true],
  204. } # Do not remove this.
  205.  
  206. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  207. # - Equip Command List -
  208. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  209. # Here, you can adjust the order at which the commands appear (or even
  210. # remove commands as you see fit). Here's a list of which does what:
  211. #
  212. # -------------------------------------------------------------------------
  213. # :command Description
  214. # -------------------------------------------------------------------------
  215. # :equip Activates the manual equip window. Default.
  216. # :optimize Optimizes equipment for the actor. Default.
  217. # :clear Clears all equipment from the actor. Default
  218. #
  219. # And that's all of the currently available commands. This list will be
  220. # updated as more scripts become available.
  221. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  222. # This array arranges the order of which the commands appear in the Equip
  223. # Command window in the Equip Scene.
  224. COMMAND_LIST =[
  225. :equip,
  226. # :optimize,
  227. # :clear,
  228. :custom1,
  229. # :custom2,
  230. ] # Do not remove this.
  231.  
  232. #--------------------------------------------------------------------------
  233. # - Equip Custom Commands -
  234. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  235. # For those who use scripts to that may produce unique effects for
  236. # equipping, use this hash to manage the custom commands for the Equip
  237. # Command Window. You can disable certain commands or prevent them from
  238. # appearing by using switches. If you don't wish to bind them to a switch,
  239. # set the proper switch to 0 for it to have no impact.
  240. #--------------------------------------------------------------------------
  241. CUSTOM_EQUIP_COMMANDS ={
  242. # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  243. :custom1 => [ "Runes", 0, 0, :command_name1],
  244. :custom2 => [ "Custom Text", 13, 0, :command_name2],
  245. } # Do not remove this.
  246.  
  247. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  248. # - Misc Window Settings -
  249. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  250. # This section adjusts the minor visuals that you see inside of the newly
  251. # organized Equip Scene. Adjust the settings as you see fit.
  252. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  253. # This sets the font size used for the status window in the lower right
  254. # corner of the screen (which shows stats and comparisons).
  255. STATUS_FONT_SIZE = 20
  256.  
  257. # This sets the remove equip command in the item window.
  258. REMOVE_EQUIP_ICON = 0
  259. REMOVE_EQUIP_TEXT = "Remove Equip"
  260.  
  261. # This sets the no-equipment text in the slot window.
  262. NOTHING_ICON = 0
  263. NOTHING_TEXT = "Empty"
  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. @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
  627. game_actor_change_equip_aee(slot_id, item)
  628. end
  629.  
  630. #--------------------------------------------------------------------------
  631. # overwrite method: optimize_equipments
  632. #--------------------------------------------------------------------------
  633. def optimize_equipments
  634. $game_temp.eds_actor = self
  635. @optimize_clear = true
  636. clear_equipments
  637. @optimize_clear = false
  638. equip_slots.size.times do |i|
  639. next if !equip_change_ok?(i)
  640. next unless can_optimize?(i)
  641. items = $game_party.equip_items.select do |item|
  642. item.etype_id == equip_slots[i] &&
  643. equippable?(item) && item.performance >= 0
  644. end
  645. change_equip(i, items.max_by {|item| item.performance })
  646. end
  647. $game_temp.eds_actor = nil
  648. end
  649.  
  650. #--------------------------------------------------------------------------
  651. # new method: can_optimize?
  652. #--------------------------------------------------------------------------
  653. def can_optimize?(slot_id)
  654. etype_id = equip_slots[slot_id]
  655. return YEA::EQUIP::TYPES[etype_id][2]
  656. end
  657.  
  658. #--------------------------------------------------------------------------
  659. # alias method: force_change_equip
  660. #--------------------------------------------------------------------------
  661. alias game_actor_force_change_equip_aee force_change_equip
  662. def force_change_equip(slot_id, item)
  663. @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil?
  664. game_actor_force_change_equip_aee(slot_id, item)
  665. end
  666.  
  667. #--------------------------------------------------------------------------
  668. # alias method: weapons
  669. #--------------------------------------------------------------------------
  670. alias game_actor_weapons_aee weapons
  671. def weapons
  672. anti_crash_equips
  673. return game_actor_weapons_aee
  674. end
  675.  
  676. #--------------------------------------------------------------------------
  677. # alias method: armors
  678. #--------------------------------------------------------------------------
  679. alias game_actor_armors_aee armors
  680. def armors
  681. anti_crash_equips
  682. return game_actor_armors_aee
  683. end
  684.  
  685. #--------------------------------------------------------------------------
  686. # alias method: equips
  687. #--------------------------------------------------------------------------
  688. alias game_actor_equips_aee equips
  689. def equips
  690. anti_crash_equips
  691. return game_actor_equips_aee
  692. end
  693.  
  694. #--------------------------------------------------------------------------
  695. # new method: equips
  696. #--------------------------------------------------------------------------
  697. def anti_crash_equips
  698. next unless @equips[i].nil?
  699. @equips[i] = Game_BaseItem.new
  700. end
  701. end
  702.  
  703. end # Game_Actor
  704.  
  705. #==============================================================================
  706. # ■ Game_Interpreter
  707. #==============================================================================
  708.  
  709. class Game_Interpreter
  710.  
  711. #--------------------------------------------------------------------------
  712. # overwrite method: change equip
  713. #--------------------------------------------------------------------------
  714. def command_319
  715. actor = $game_actors[@params[0]]
  716. return if actor.nil?
  717. if @params[1] == 0 && @params[2] != 0
  718. item = $data_weapons[@params[2]]
  719. return unless actor.equip_slots.include?(0)
  720. slot_id = actor.empty_slot(0)
  721. elsif @params[2] != 0
  722. item = $data_armors[@params[2]]
  723. return unless actor.equip_slots.include?(item.etype_id)
  724. slot_id = actor.empty_slot(item.etype_id)
  725. else
  726. slot_id = @params[1]
  727. end
  728. actor.change_equip_by_id(slot_id, @params[2])
  729. end
  730.  
  731. end # Game_Interpreter
  732.  
  733. #==============================================================================
  734. # ■ Window_EquipStatus
  735. #==============================================================================
  736.  
  737. class Window_EquipStatus < Window_Base
  738.  
  739. #--------------------------------------------------------------------------
  740. # overwrite method: initialize
  741. #--------------------------------------------------------------------------
  742. def initialize(dx, dy)
  743. super(dx, dy, window_width, Graphics.height - dy)
  744. @actor = nil
  745. @temp_actor = nil
  746. refresh
  747. end
  748.  
  749. #--------------------------------------------------------------------------
  750. # overwrite method: window_width
  751. #--------------------------------------------------------------------------
  752. def window_width; return Graphics.width * 2 / 5; end
  753.  
  754. #--------------------------------------------------------------------------
  755. # overwrite method: refresh
  756. #--------------------------------------------------------------------------
  757. def refresh
  758. contents.clear
  759. 8.times {|i| draw_item(0, line_height * i, i) }
  760. end
  761.  
  762. #--------------------------------------------------------------------------
  763. # overwrite method: draw_item
  764. #--------------------------------------------------------------------------
  765. def draw_item(dx, dy, param_id)
  766. draw_background_colour(dx, dy)
  767. draw_param_name(dx + 4, dy, param_id)
  768. draw_current_param(dx + 4, dy, param_id) if @actor
  769. drx = (contents.width + 22) / 2
  770. draw_right_arrow(drx, dy)
  771. draw_new_param(drx + 22, dy, param_id) if @temp_actor
  772. reset_font_settings
  773. end
  774.  
  775. #--------------------------------------------------------------------------
  776. # new method: draw_background_colour
  777. #--------------------------------------------------------------------------
  778. def draw_background_colour(dx, dy)
  779. colour = Color.new(0, 0, 0, translucent_alpha/2)
  780. rect = Rect.new(dx+1, dy+1, contents.width - 2, line_height - 2)
  781. contents.fill_rect(rect, colour)
  782. end
  783.  
  784. #--------------------------------------------------------------------------
  785. # overwrite method: draw_param_name
  786. #--------------------------------------------------------------------------
  787. def draw_param_name(dx, dy, param_id)
  788. contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  789. change_color(system_color)
  790. draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  791. end
  792.  
  793. #--------------------------------------------------------------------------
  794. # overwrite method: draw_current_param
  795. #--------------------------------------------------------------------------
  796. def draw_current_param(dx, dy, param_id)
  797. change_color(normal_color)
  798. dw = (contents.width + 22) / 2
  799. draw_text(0, dy, dw, line_height, @actor.param(param_id).group, 2)
  800. reset_font_settings
  801. end
  802.  
  803. #--------------------------------------------------------------------------
  804. # overwrite method: draw_new_param
  805. #--------------------------------------------------------------------------
  806. def draw_new_param(dx, dy, param_id)
  807. contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  808. new_value = @temp_actor.param(param_id)
  809. change_color(param_change_color(new_value - @actor.param(param_id)))
  810. draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  811. reset_font_settings
  812. end
  813.  
  814. end # Window_EquipStatus
  815.  
  816. #==============================================================================
  817. # ■ Window_EquipCommand
  818. #==============================================================================
  819.  
  820. class Window_EquipCommand < Window_HorzCommand
  821.  
  822. #--------------------------------------------------------------------------
  823. # overwrite method: make_command_list
  824. #--------------------------------------------------------------------------
  825. def make_command_list
  826. for command in YEA::EQUIP::COMMAND_LIST
  827. case command
  828. when :equip
  829. add_command(Vocab::equip2, :equip)
  830. when :optimize
  831. add_command(Vocab::optimize, :optimize)
  832. when :clear
  833. add_command(Vocab::clear, :clear)
  834. else
  835. process_custom_command(command)
  836. end
  837. end
  838. end
  839.  
  840. #--------------------------------------------------------------------------
  841. # process_ok
  842. #--------------------------------------------------------------------------
  843. def process_ok
  844. $game_temp.scene_equip_index = index
  845. $game_temp.scene_equip_oy = self.oy
  846. super
  847. end
  848.  
  849. #--------------------------------------------------------------------------
  850. # new method: process_custom_command
  851. #--------------------------------------------------------------------------
  852. def process_custom_command(command)
  853. return unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  854. show = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][2]
  855. continue = show <= 0 ? true : $game_switches[show]
  856. return unless continue
  857. text = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][0]
  858. switch = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][1]
  859. enabled = switch <= 0 ? true : $game_switches[switch]
  860. add_command(text, command, enabled)
  861. end
  862.  
  863. #--------------------------------------------------------------------------
  864. # overwrite method: window_width
  865. #--------------------------------------------------------------------------
  866. def window_width; return 160; end
  867.  
  868. #--------------------------------------------------------------------------
  869. # overwrite method: contents_width
  870. #--------------------------------------------------------------------------
  871. def contents_width; return width - standard_padding * 2; end
  872.  
  873. #--------------------------------------------------------------------------
  874. # overwrite method: contents_height
  875. #--------------------------------------------------------------------------
  876. def contents_height
  877. ch = height - standard_padding * 2
  878. return [ch - ch % item_height, row_max * item_height].max
  879. end
  880.  
  881. #--------------------------------------------------------------------------
  882. # overwrite method: visible_line_number
  883. #--------------------------------------------------------------------------
  884. def visible_line_number; return 4; end
  885.  
  886. #--------------------------------------------------------------------------
  887. # overwrite method: col_max
  888. #--------------------------------------------------------------------------
  889. def col_max; return 1; end
  890.  
  891. #--------------------------------------------------------------------------
  892. # overwrite method: item_rect
  893. #--------------------------------------------------------------------------
  894. def item_rect(index)
  895. rect = Rect.new
  896. rect.width = item_width
  897. rect.height = item_height
  898. rect.x = index % col_max * (item_width + spacing)
  899. rect.y = index / col_max * item_height
  900. rect
  901. end
  902.  
  903. #--------------------------------------------------------------------------
  904. # overwrite method: ensure_cursor_visible
  905. #--------------------------------------------------------------------------
  906. def ensure_cursor_visible
  907. self.top_row = row if row < top_row
  908. self.bottom_row = row if row > bottom_row
  909. end
  910.  
  911. #--------------------------------------------------------------------------
  912. # overwrite method: cursor_down
  913. #--------------------------------------------------------------------------
  914. def cursor_down(wrap = false)
  915. if index < item_max - col_max || (wrap && col_max == 1)
  916. select((index + col_max) % item_max)
  917. end
  918. end
  919.  
  920. #--------------------------------------------------------------------------
  921. # overwrite method: cursor_up
  922. #--------------------------------------------------------------------------
  923. def cursor_up(wrap = false)
  924. if index >= col_max || (wrap && col_max == 1)
  925. select((index - col_max + item_max) % item_max)
  926. end
  927. end
  928.  
  929. #--------------------------------------------------------------------------
  930. # overwrite method: process_pageup
  931. #--------------------------------------------------------------------------
  932. def process_pageup
  933. Sound.play_cursor
  934. Input.update
  935. deactivate
  936. call_handler(:pageup)
  937. end
  938.  
  939. #--------------------------------------------------------------------------
  940. # overwrite method: process_pagedown
  941. #--------------------------------------------------------------------------
  942. def process_pagedown
  943. Sound.play_cursor
  944. Input.update
  945. deactivate
  946. call_handler(:pagedown)
  947. end
  948.  
  949. end # Window_EquipCommand
  950.  
  951. #==============================================================================
  952. # ■ Window_EquipSlot
  953. #==============================================================================
  954.  
  955. class Window_EquipSlot < Window_Selectable
  956.  
  957. #--------------------------------------------------------------------------
  958. # overwrite method: initialize
  959. #--------------------------------------------------------------------------
  960. def initialize(dx, dy, dw)
  961. super(dx, dy, dw, Graphics.height - dy)
  962. @actor = nil
  963. refresh
  964. end
  965.  
  966. #--------------------------------------------------------------------------
  967. # overwrite method: window_height
  968. #--------------------------------------------------------------------------
  969. def window_height; return self.height; end
  970.  
  971. #--------------------------------------------------------------------------
  972. # overwrite method: visible_line_number
  973. #--------------------------------------------------------------------------
  974. def visible_line_number; return item_max; end
  975.  
  976. #--------------------------------------------------------------------------
  977. # overwrite method: refresh
  978. #--------------------------------------------------------------------------
  979. def refresh
  980. create_contents
  981. super
  982. end
  983.  
  984. #--------------------------------------------------------------------------
  985. # overwrite method: draw_item
  986. #--------------------------------------------------------------------------
  987. def draw_item(index)
  988. return unless @actor
  989. rect = item_rect_for_text(index)
  990. change_color(system_color, enable?(index))
  991. draw_text(rect.x, rect.y, 92, line_height, slot_name(index))
  992. item = @actor.equips[index]
  993. dx = rect.x + 92
  994. dw = contents.width - dx - 24
  995. if item.nil?
  996. draw_nothing_equip(dx, rect.y, false, dw)
  997. else
  998. draw_item_name(item, dx, rect.y, enable?(index), dw)
  999. end
  1000. end
  1001.  
  1002. #--------------------------------------------------------------------------
  1003. # new method: draw_nothing_equip
  1004. #--------------------------------------------------------------------------
  1005. def draw_nothing_equip(dx, dy, enabled, dw)
  1006. change_color(normal_color, enabled)
  1007. draw_icon(Icon.nothing_equip, dx, dy, enabled)
  1008. text = YEA::EQUIP::NOTHING_TEXT
  1009. draw_text(dx + 24, dy, dw - 24, line_height, text)
  1010. end
  1011.  
  1012. end # Window_EquipSlot
  1013.  
  1014. #==============================================================================
  1015. # ■ Window_EquipItem
  1016. #==============================================================================
  1017.  
  1018. class Window_EquipItem < Window_ItemList
  1019.  
  1020. #--------------------------------------------------------------------------
  1021. # overwrite method: col_max
  1022. #--------------------------------------------------------------------------
  1023. def col_max; return 1; end
  1024.  
  1025. #--------------------------------------------------------------------------
  1026. # overwrite method: slot_id=
  1027. #--------------------------------------------------------------------------
  1028. def slot_id=(slot_id)
  1029. return if @slot_id == slot_id
  1030. @slot_id = slot_id
  1031. @last_item = nil
  1032. self.oy = 0
  1033. end
  1034.  
  1035. #--------------------------------------------------------------------------
  1036. # overwrite method: draw_item
  1037. #--------------------------------------------------------------------------
  1038. def draw_item(index)
  1039. item = @data[index]
  1040. rect = item_rect(index)
  1041. rect.width -= 4
  1042. if item.nil?
  1043. draw_remove_equip(rect)
  1044. return
  1045. end
  1046. dw = contents.width - rect.x - 24
  1047. draw_item_name(item, rect.x, rect.y, enable?(item), dw)
  1048. #draw_item_number(rect, item)
  1049. end
  1050.  
  1051. #--------------------------------------------------------------------------
  1052. # new method: draw_remove_equip
  1053. #--------------------------------------------------------------------------
  1054. def draw_remove_equip(rect)
  1055. draw_icon(Icon.remove_equip, rect.x, rect.y)
  1056. text = YEA::EQUIP::REMOVE_EQUIP_TEXT
  1057. rect.x += 24
  1058. rect.width -= 24
  1059. draw_text(rect, text)
  1060. end
  1061.  
  1062. #--------------------------------------------------------------------------
  1063. # overwrite method: include?
  1064. #--------------------------------------------------------------------------
  1065. def include?(item)
  1066. if item.nil? && [email protected]?
  1067. etype_id = @actor.equip_slots[@slot_id]
  1068. return YEA::EQUIP::TYPES[etype_id][1]
  1069. end
  1070. return true if item.nil?
  1071. return false unless item.is_a?(RPG::EquipItem)
  1072. return false if @slot_id < 0
  1073. return false if item.etype_id != @actor.equip_slots[@slot_id]
  1074. return @actor.equippable?(item)
  1075. end
  1076.  
  1077. #--------------------------------------------------------------------------
  1078. # overwrite method: enable?
  1079. #--------------------------------------------------------------------------
  1080. def enable?(item)
  1081. if item.nil? && [email protected]?
  1082. etype_id = @actor.equip_slots[@slot_id]
  1083. return YEA::EQUIP::TYPES[etype_id][1]
  1084. end
  1085. return @actor.equippable?(item)
  1086. end
  1087.  
  1088. #--------------------------------------------------------------------------
  1089. # new method: show
  1090. #--------------------------------------------------------------------------
  1091. def show
  1092. @last_item = 0
  1093. update_help
  1094. super
  1095. end
  1096.  
  1097. #--------------------------------------------------------------------------
  1098. # overwrite method: update_help
  1099. #--------------------------------------------------------------------------
  1100. def update_help
  1101. super
  1102. return if @actor.nil?
  1103. return if @status_window.nil?
  1104. return if @last_item == item
  1105. @last_item = item
  1106. temp_actor = Marshal.load(Marshal.dump(@actor))
  1107. temp_actor.force_change_equip(@slot_id, item)
  1108. @status_window.set_temp_actor(temp_actor)
  1109. end
  1110.  
  1111. end # Window_EquipItem
  1112.  
  1113. #==============================================================================
  1114. # ■ Window_EquipActor
  1115. #==============================================================================
  1116.  
  1117. class Window_EquipActor < Window_Base
  1118.  
  1119. #--------------------------------------------------------------------------
  1120. # initialize
  1121. #--------------------------------------------------------------------------
  1122. def initialize(dx, dy)
  1123. super(dx, dy, window_width, fitting_height(4))
  1124. @actor = nil
  1125. end
  1126.  
  1127. #--------------------------------------------------------------------------
  1128. # window_width
  1129. #--------------------------------------------------------------------------
  1130. def window_width; return Graphics.width - 160; end
  1131.  
  1132. #--------------------------------------------------------------------------
  1133. # actor=
  1134. #--------------------------------------------------------------------------
  1135. def actor=(actor)
  1136. return if @actor == actor
  1137. @actor = actor
  1138. refresh
  1139. end
  1140.  
  1141. #--------------------------------------------------------------------------
  1142. # refresh
  1143. #--------------------------------------------------------------------------
  1144. def refresh
  1145. contents.clear
  1146. return unless @actor
  1147. draw_actor_face(@actor, 0, 0)
  1148. draw_actor_simple_status(@actor, 40, line_height / 2)
  1149. end
  1150.  
  1151. end # Window_EquipActor
  1152.  
  1153. #==============================================================================
  1154. # ■ Scene_Equip
  1155. #==============================================================================
  1156.  
  1157. class Scene_Equip < Scene_MenuBase
  1158.  
  1159. #--------------------------------------------------------------------------
  1160. # overwrite method: create_status_window
  1161. #--------------------------------------------------------------------------
  1162. def create_status_window
  1163. wx = Graphics.width - (Graphics.width * 2 / 5)
  1164. wy = @help_window.height + 120
  1165. @status_window = Window_EquipStatus.new(wx, wy)
  1166. @status_window.viewport = @viewport
  1167. @status_window.actor = @actor
  1168. end
  1169.  
  1170. #--------------------------------------------------------------------------
  1171. # overwrite method: create_command_window
  1172. #--------------------------------------------------------------------------
  1173. def create_command_window
  1174. wx = 0
  1175. wy = @help_window.height
  1176. ww = 160
  1177. @command_window = Window_EquipCommand.new(wx, wy, ww)
  1178. @command_window.viewport = @viewport
  1179. @command_window.help_window = @help_window
  1180. if !$game_temp.scene_equip_index.nil?
  1181. @command_window.select($game_temp.scene_equip_index)
  1182. @command_window.oy = $game_temp.scene_equip_oy
  1183. end
  1184. $game_temp.scene_equip_index = nil
  1185. $game_temp.scene_equip_oy = nil
  1186. @command_window.set_handler(:equip, method(:command_equip))
  1187. @command_window.set_handler(:optimize, method(:command_optimize))
  1188. @command_window.set_handler(:clear, method(:command_clear))
  1189. @command_window.set_handler(:cancel, method(:return_scene))
  1190. @command_window.set_handler(:pagedown, method(:next_actor))
  1191. @command_window.set_handler(:pageup, method(:prev_actor))
  1192. process_custom_equip_commands
  1193. create_actor_window
  1194. end
  1195.  
  1196. #--------------------------------------------------------------------------
  1197. # new method: create_actor_window
  1198. #--------------------------------------------------------------------------
  1199. def create_actor_window
  1200. wy = @help_window.height
  1201. @actor_window = Window_EquipActor.new(@command_window.width, wy)
  1202. @actor_window.viewport = @viewport
  1203. @actor_window.actor = @actor
  1204. end
  1205.  
  1206. #--------------------------------------------------------------------------
  1207. # new method: process_custom_equip_commands
  1208. #--------------------------------------------------------------------------
  1209. def process_custom_equip_commands
  1210. for command in YEA::EQUIP::COMMAND_LIST
  1211. next unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command)
  1212. called_method = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][3]
  1213. @command_window.set_handler(command, method(called_method))
  1214. end
  1215. end
  1216.  
  1217. #--------------------------------------------------------------------------
  1218. # overwrite method: create_slot_window
  1219. #--------------------------------------------------------------------------
  1220. def create_slot_window
  1221. wx = 0
  1222. wy = @command_window.y + @command_window.height
  1223. ww = Graphics.width - @status_window.width
  1224. @slot_window = Window_EquipSlot.new(wx, wy, ww)
  1225. @slot_window.viewport = @viewport
  1226. @slot_window.help_window = @help_window
  1227. @slot_window.status_window = @status_window
  1228. @slot_window.actor = @actor
  1229. @slot_window.set_handler(:ok, method(:on_slot_ok))
  1230. @slot_window.set_handler(:cancel, method(:on_slot_cancel))
  1231. end
  1232.  
  1233. #--------------------------------------------------------------------------
  1234. # overwrite method: create_item_window
  1235. #--------------------------------------------------------------------------
  1236. def create_item_window
  1237. wx = @slot_window.x
  1238. wy = @slot_window.y
  1239. ww = @slot_window.width
  1240. wh = @slot_window.height
  1241. @item_window = Window_EquipItem.new(wx, wy, ww, wh)
  1242. @item_window.viewport = @viewport
  1243. @item_window.help_window = @help_window
  1244. @item_window.status_window = @status_window
  1245. @item_window.actor = @actor
  1246. @item_window.set_handler(:ok, method(:on_item_ok))
  1247. @item_window.set_handler(:cancel, method(:on_item_cancel))
  1248. @slot_window.item_window = @item_window
  1249. @item_window.hide
  1250. end
  1251.  
  1252. #--------------------------------------------------------------------------
  1253. # alias method: command_optimize
  1254. #--------------------------------------------------------------------------
  1255. alias scene_equip_command_optimize_aee command_optimize
  1256. def command_optimize
  1257. scene_equip_command_optimize_aee
  1258. @actor_window.refresh
  1259. end
  1260.  
  1261. #--------------------------------------------------------------------------
  1262. # alias method: command_clear
  1263. #--------------------------------------------------------------------------
  1264. alias scene_equip_command_clear_aee command_clear
  1265. def command_clear
  1266. scene_equip_command_clear_aee
  1267. @actor_window.refresh
  1268. end
  1269.  
  1270. #--------------------------------------------------------------------------
  1271. # alias method: on_slot_ok
  1272. #--------------------------------------------------------------------------
  1273. alias scene_equip_on_slot_ok_aee on_slot_ok
  1274. def on_slot_ok
  1275. scene_equip_on_slot_ok_aee
  1276. @slot_window.hide
  1277. @item_window.refresh
  1278. @item_window.show
  1279. end
  1280.  
  1281. #--------------------------------------------------------------------------
  1282. # alias method: on_item_ok
  1283. #--------------------------------------------------------------------------
  1284. alias scene_equip_on_item_ok_aee on_item_ok
  1285. def on_item_ok
  1286. scene_equip_on_item_ok_aee
  1287. @actor_window.refresh
  1288. @slot_window.show
  1289. @item_window.hide
  1290. end
  1291.  
  1292. #--------------------------------------------------------------------------
  1293. # alias method: on_item_cancel
  1294. #--------------------------------------------------------------------------
  1295. alias scene_equip_on_item_cancel_aee on_item_cancel
  1296. def on_item_cancel
  1297. scene_equip_on_item_cancel_aee
  1298. @slot_window.show
  1299. @item_window.hide
  1300. end
  1301.  
  1302. #--------------------------------------------------------------------------
  1303. # alias method: on_actor_change
  1304. #--------------------------------------------------------------------------
  1305. alias scene_equip_on_actor_change_aee on_actor_change
  1306. def on_actor_change
  1307. scene_equip_on_actor_change_aee
  1308. @actor_window.actor = @actor
  1309. end
  1310.  
  1311. #--------------------------------------------------------------------------
  1312. # new method: command_name1
  1313. #--------------------------------------------------------------------------
  1314. def command_name1
  1315. SceneManager.call(Scene_Enchant)
  1316. end
  1317.  
  1318. #--------------------------------------------------------------------------
  1319. # new method: command_name2
  1320. #--------------------------------------------------------------------------
  1321. def command_name2
  1322. # Do nothing.
  1323. end
  1324.  
  1325. end # Scene_Equip
  1326.  
  1327. #==============================================================================
  1328. #
  1329. # ▼ End of File
  1330. #
  1331. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment