Advertisement
Dekita

Equipscene 1.2

Mar 29th, 2014
952
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.95 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Equip Scene
  5. # -- Author : Dekita
  6. # -- Version : 1.2
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Equip_Scene]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 29/o3/2o14 - Efficiency update,
  21. # 26/o3/2o14 - Finished,
  22. # ??/??/2o13 - Started,
  23. #
  24. #===============================================================================
  25. # ☆ Introduction
  26. #-------------------------------------------------------------------------------
  27. # Equip Scene For $D13x Engine...
  28. # This only requires my core script.
  29. #
  30. #===============================================================================
  31. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  32. #===============================================================================
  33. # 1. You MUST give credit to "Dekita" !!
  34. # 2. You are NOT allowed to repost this script.(or modified versions)
  35. # 3. You are NOT allowed to convert this script.
  36. # 4. You are NOT allowed to use this script for Commercial games.
  37. # 5. ENJOY!
  38. #
  39. # "FINE PRINT"
  40. # By using this script you hereby agree to the above terms and conditions,
  41. # if any violation of the above terms occurs "legal action" may be taken.
  42. # Not understanding the above terms and conditions does NOT mean that
  43. # they do not apply to you.
  44. # If you wish to discuss the terms and conditions in further detail you can
  45. # contact me at http://dekitarpg.wordpress.com/
  46. #
  47. #===============================================================================
  48. # ☆ Instructions
  49. #-------------------------------------------------------------------------------
  50. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  51. #
  52. #===============================================================================
  53. module Epic_Equip
  54. #===============================================================================
  55. Help_Text={
  56. :equip => "Change equipment.",
  57. :clear => "Clear all equipment.",
  58. :sets => "View detailed equipment set information.",
  59. }
  60. #-----------------------------------------------------------------------------
  61. # Begin Info Hash.
  62. #-----------------------------------------------------------------------------
  63. # [:header, "FOR DISPLAYING TEXT LIKE THIS" , icon, hue],
  64. # [:param, param_id],
  65. # [:x_param, xparam_id],
  66. # [:s_param, sparam_id],
  67. # [:atk_ele, element_id],
  68. # [:def_ele, element_id],
  69. # [:atk_lev],
  70. # [:def_lev],
  71. # [:tp_info],
  72. # [:spds_stat, 0],
  73. #-----------------------------------------------------------------------------
  74. Info={
  75. 0=>[
  76. [:param, 0],
  77. [:param, 1],
  78. [:tp_info],
  79. [:spds_stat, 0],
  80. [:spds_stat, 1],
  81. [:spds_stat, 2],
  82. [:spds_stat, 3],
  83. [:x_param, 7],
  84. [:x_param, 8],
  85. [:atk_lev],
  86. [:def_lev],
  87. ],
  88. 1=>[
  89. [:atk_lev],
  90. [:def_lev],
  91. [:param, 2],
  92. [:param, 3],
  93. [:s_param, 6],
  94. [:param, 4],
  95. [:param, 5],
  96. [:s_param, 7],
  97. [:s_param, 1],
  98. ],
  99. 2=>[
  100. [:x_param, 0],
  101. [:x_param, 2],
  102. [:x_param, 1],
  103. [:x_param, 3],
  104. [:x_param, 4],
  105. [:x_param, 5],
  106. [:x_param, 6],
  107. [:s_param, 2],
  108. [:s_param, 3],
  109. ],
  110. 3=>[
  111. [:atk_ele, 1],
  112. [:atk_ele, 3],
  113. [:atk_ele, 4],
  114. [:atk_ele, 5],
  115. [:atk_ele, 6],
  116. [:atk_ele, 7],
  117. [:atk_ele, 8],
  118. [:atk_ele, 9],
  119. [:atk_ele, 10],
  120. ],
  121. 4=>[
  122. [:def_ele, 1],
  123. [:def_ele, 3],
  124. [:def_ele, 4],
  125. [:def_ele, 5],
  126. [:def_ele, 6],
  127. [:def_ele, 7],
  128. [:def_ele, 8],
  129. [:def_ele, 9],
  130. [:def_ele, 10],
  131. ],
  132. 5=>[
  133. [:header, "Extra Stats", Text_Color::White,0,0,1],
  134. ],
  135. } # << End Page's Settings
  136. #-----------------------------------------------------------------------------
  137. # Max Pages To Show, Never Have Below 1.
  138. Max_Pages = 5 #####################
  139. # CUSTOMISATION END #
  140. end #####################
  141. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  142. # #
  143. # http://dekitarpg.wordpress.com/ #
  144. # #
  145. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  146. #===============================================================================#
  147. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  148. # YES?\.\. #
  149. # OMG, REALLY? \| #
  150. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  151. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  152. #===============================================================================#
  153. class Window_StatusEquip < Window_StatusDekita
  154. #===============================================================================
  155. #--------------------------------------------------------------------------
  156. # Set Windowskin (overwrite from super)
  157. #--------------------------------------------------------------------------
  158. def set_the_skin
  159. @skin = WindowSkins::Skins[:equip_status]
  160. end
  161. end
  162. #===============================================================================
  163. class EquipCommandWindow < Window_Command
  164. #===============================================================================
  165. #-----------------------------------------------------------------------------
  166. #
  167. #-----------------------------------------------------------------------------
  168. def initialize
  169. super(0, 0)
  170. end
  171. #-----------------------------------------------------------------------------
  172. #
  173. #-----------------------------------------------------------------------------
  174. def window_width
  175. return Graphics.width / 4
  176. end
  177. #-----------------------------------------------------------------------------
  178. #
  179. #-----------------------------------------------------------------------------
  180. def visible_line_number
  181. return 2
  182. end
  183. #-----------------------------------------------------------------------------
  184. #
  185. #-----------------------------------------------------------------------------
  186. def make_command_list
  187. add_command(Vocab::equip2, :equip)
  188. add_command(Vocab::clear, :clear)
  189. add_set_command
  190. end
  191. #-----------------------------------------------------------------------------
  192. #
  193. #-----------------------------------------------------------------------------
  194. def set_the_skin
  195. @skin = WindowSkins::Skins[:equip_command]
  196. end
  197. #-----------------------------------------------------------------------------
  198. #
  199. #-----------------------------------------------------------------------------
  200. def add_set_command
  201. end
  202. end
  203. #===============================================================================
  204. class Window_EquipSlot < Window_Selectable
  205. #===============================================================================
  206. #-----------------------------------------------------------------------------
  207. # Draw Box
  208. #-----------------------------------------------------------------------------
  209. def draw_box(x,y,w)
  210. contents.fill_rect(x,y+1,w,line_height-2,General::Box_Color)
  211. end
  212. #--------------------------------------------------------------------------
  213. # * Draw Item
  214. #--------------------------------------------------------------------------
  215. def draw_item(index)
  216. refresh_fonts
  217. return unless @actor
  218. rect = item_rect_for_text(index)
  219. item = @actor.equips[index]
  220. draw_box(rect.x-2,rect.y,42)
  221. draw_box(rect.x+42,rect.y,rect.width-40)
  222. change_color(Text_Color::White, enable?(index))
  223. draw_text(rect.x+2, rect.y, 92, line_height, slot_name(index) + ':')
  224. draw_item_name(item, rect.x + 44, rect.y, enable?(index))
  225. draw_item_number(rect, item)
  226. end
  227. #--------------------------------------------------------------------------
  228. # * Draw Item Name
  229. # enabled : Enabled flag. When false, draw semi-transparently.
  230. #--------------------------------------------------------------------------
  231. def draw_item_name(item, x, y, enabled = true, width = 172)
  232. return unless item
  233. change_color(item.item_disp_color, enabled)
  234. draw_de_icon(item.icon_index, x, y, item.icon_hue, enabled)
  235. draw_text(x + 26, y, width, line_height, item.name)
  236. end
  237. #--------------------------------------------------------------------------
  238. # * Draw Number of Items
  239. #--------------------------------------------------------------------------
  240. def draw_item_number(rect, item)
  241. return unless item
  242. if $D13x[:Equip_Levels]
  243. level = Equip_Exp::Level_Names[item.level]
  244. draw_text(rect, sprintf("%s", level), 2)
  245. end
  246. end
  247. #--------------------------------------------------------------------------
  248. # Set Windowskin (overwrite from super)
  249. #--------------------------------------------------------------------------
  250. def set_the_skin
  251. @skin = WindowSkins::Skins[:equip_slot]
  252. end
  253. end
  254. #===============================================================================
  255. class Window_EquipItem < Window_ItemList
  256. #===============================================================================
  257. #-----------------------------------------------------------------------------
  258. #
  259. #-----------------------------------------------------------------------------
  260. def col_max
  261. return 1
  262. end
  263. #--------------------------------------------------------------------------
  264. # * Draw Item
  265. #--------------------------------------------------------------------------
  266. def draw_item(index)
  267. item = @data[index]
  268. if item
  269. rect = item_rect(index)
  270. rect.width -= 4
  271. draw_item_name(item, rect.x, rect.y, enable?(item))
  272. draw_item_number(rect, item)
  273. end
  274. end
  275. #--------------------------------------------------------------------------
  276. # * Draw Item Name
  277. # enabled : Enabled flag. When false, draw semi-transparently.
  278. #--------------------------------------------------------------------------
  279. def draw_item_name(item, x, y, enabled = true, width = 172)
  280. return unless item
  281. change_color(item.item_disp_color, enabled)
  282. draw_de_icon(item.icon_index, x, y, item.icon_hue, enabled)
  283. draw_text(x + 26, y, width, line_height, item.name)
  284. end
  285. #--------------------------------------------------------------------------
  286. # * Draw Number of Items
  287. #--------------------------------------------------------------------------
  288. def draw_item_number(rect, item)
  289. return unless item
  290. if $D13x[:Equip_Levels]
  291. level = Equip_Exp::Level_Names[item.level]
  292. draw_text(rect, sprintf("%s", level), 2)
  293. else
  294. draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
  295. end
  296. end
  297. #--------------------------------------------------------------------------
  298. # * Update Help Text
  299. #--------------------------------------------------------------------------
  300. def update_help
  301. super
  302. end
  303. #--------------------------------------------------------------------------
  304. # Set Windowskin (overwrite from super)
  305. #--------------------------------------------------------------------------
  306. def set_the_skin
  307. @skin = WindowSkins::Skins[:equip_item]
  308. end
  309. end
  310. #===============================================================================
  311. class Window_Actor_EquipStatus < Dekita_Core_Status
  312. #===============================================================================
  313. #-----------------------------------------------------------------------------
  314. #
  315. #-----------------------------------------------------------------------------
  316. def initialize(actor,y)
  317. x = Graphics.width/2
  318. w = (Graphics.width/2)-(Graphics.width/8)+20
  319. h = Graphics.height-y
  320. super(x, y, w, h, actor)
  321. self.opacity = 0
  322. end
  323. #-----------------------------------------------------------------------------
  324. #
  325. #-----------------------------------------------------------------------------
  326. def setup_info
  327. return Epic_Equip::Info[@page]
  328. end
  329. end
  330. #==============================================================================
  331. class Window_EmptyEquipStatus < Window_Selectable
  332. #==============================================================================
  333. #--------------------------------------------------------------------------
  334. # * Object Initialization
  335. #--------------------------------------------------------------------------
  336. def initialize(y)
  337. x = Graphics.width/2
  338. super(x, y, x, Graphics.height-y)
  339. refresh
  340. end
  341. #--------------------------------------------------------------------------
  342. # * Refresh
  343. #--------------------------------------------------------------------------
  344. def refresh
  345. contents.clear
  346. end
  347. #--------------------------------------------------------------------------
  348. # Set Windowskin (overwrite from super)
  349. #--------------------------------------------------------------------------
  350. def set_the_skin
  351. @skin = WindowSkins::Skins[:equip_status]
  352. end
  353. end
  354. #===============================================================================
  355. class Window_EquipStatusChanges < Dekita_Core_Status_Changes
  356. #===============================================================================
  357. #-----------------------------------------------------------------------------
  358. #
  359. #-----------------------------------------------------------------------------
  360. attr_reader :item
  361. #-----------------------------------------------------------------------------
  362. # Initilize
  363. #-----------------------------------------------------------------------------
  364. def initialize(actor, y)
  365. w = Graphics.width/8
  366. x = Graphics.width-w
  367. h = Graphics.height-y
  368. super(x,y,w,h,actor)
  369. self.opacity = 0
  370. @item = nil
  371. @old_item = @item
  372. end
  373. #-----------------------------------------------------------------------------
  374. #
  375. #-----------------------------------------------------------------------------
  376. def item=(item)
  377. return unless @item != item
  378. @item = item
  379. future_stat
  380. end
  381. #-----------------------------------------------------------------------------
  382. # Get Future Stats
  383. #-----------------------------------------------------------------------------
  384. def future_stat
  385. return unless @dis_window
  386. return unless @item
  387. return unless @item.is_a?(RPG::EquipItem)
  388. return unless @old_item != @item
  389. @old_item = @item
  390. @temp_actor = Marshal.load(Marshal.dump(@actor))
  391. @temp_actor.force_change_equip(@item.etype_id,@item)
  392. refresh
  393. end
  394. #-----------------------------------------------------------------------------
  395. # Get Setup Info
  396. #-----------------------------------------------------------------------------
  397. def setup_info
  398. return Epic_Equip::Info[@page]
  399. end
  400. #-----------------------------------------------------------------------------
  401. # Draw Header
  402. #-----------------------------------------------------------------------------
  403. def draw_header(x,y,text,col,icon,hue,align)
  404. draw_box(x, y)
  405. change_color(col)
  406. draw_text(x, y, wid, line_height, SPDS::Changes_Vocab, align)
  407. return y += line_height
  408. end
  409. end
  410. #===============================================================================
  411. class Dekita_Core_Equip_Status < Dekita_Core_Status
  412. #===============================================================================
  413. #-----------------------------------------------------------------------------
  414. # Initialization
  415. #-----------------------------------------------------------------------------
  416. def initialize(x,y,w,h,actor=nil,page=nil)
  417. @windowidth = w
  418. super(x,y,w,h,actor,page)
  419. @temp_actor = Marshal.load(Marshal.dump(@actor))
  420. @dis_window = nil
  421. refresh
  422. self.z = 201
  423. self.opacity = 0
  424. end
  425. #-----------------------------------------------------------------------------
  426. #
  427. #-----------------------------------------------------------------------------
  428. def window_width
  429. @windowidth
  430. end
  431. #-----------------------------------------------------------------------------
  432. # Refresh
  433. #-----------------------------------------------------------------------------
  434. def refresh
  435. contents.clear
  436. freshen
  437. return unless @page && @item
  438. draw_equip_status
  439. draw_status_inf
  440. end
  441. #-----------------------------------------------------------------------------
  442. #
  443. #-----------------------------------------------------------------------------
  444. def setup_info
  445. return Epic_Equip::Info[@page]
  446. end
  447. #-----------------------------------------------------------------------------
  448. # Set Actor
  449. #-----------------------------------------------------------------------------
  450. def item=(item)
  451. return unless @item != item
  452. @item = item
  453. refresh
  454. end
  455. #-----------------------------------------------------------------------------
  456. # Set Dis Window
  457. #-----------------------------------------------------------------------------
  458. def dis_window=(window)
  459. return if @dis_window == window
  460. @dis_window = window
  461. end
  462. #-----------------------------------------------------------------------------
  463. # Get No Stats
  464. #-----------------------------------------------------------------------------
  465. def show_no_stats
  466. return unless @dis_window && @item == nil
  467. @item = nil
  468. refresh
  469. end
  470. #-----------------------------------------------------------------------------
  471. #
  472. #-----------------------------------------------------------------------------
  473. def draw_equip_status
  474. w = (width-24) - wid - 4
  475. y = 0
  476. y = draw_equip_name(y,w)
  477. y = draw_equip_level(y,w)
  478. y = draw_equip_exp(y,w)
  479. y = draw_equip_durab(y,w)
  480. y = draw_equip_set(y,w)
  481. 5.times do |i|
  482. draw_box_ww(wid+4, y+(24*i), w)
  483. end
  484. draw_item_bonuses(y/24, wid+4, @item.uni_feats)
  485. end
  486. #-----------------------------------------------------------------------------
  487. #
  488. #-----------------------------------------------------------------------------
  489. def draw_equip_name(y,w)
  490. draw_box_ww(wid+4, y, w)
  491. change_color(@item.item_disp_color)
  492. draw_de_icon(@item.icon_index,wid+6,y,0,true)
  493. draw_text(wid+32, y, w-24, line_height, @item.name)
  494. return y if $D13x[:Equip_Levels]
  495. return y += 24
  496. end
  497. #-----------------------------------------------------------------------------
  498. #
  499. #-----------------------------------------------------------------------------
  500. def draw_equip_level(y,w)
  501. change_color(Text_Color::White)
  502. return y unless $D13x[:Equip_Levels]
  503. level = Equip_Exp::Level_Names[@item.level]
  504. draw_text(wid+0+4, y, w-4, line_height, level, 2)
  505. return y += 24
  506. end
  507. #-----------------------------------------------------------------------------
  508. #
  509. #-----------------------------------------------------------------------------
  510. def draw_equip_exp(y,w)
  511. return y unless $D13x[:Equip_Levels]
  512. draw_box_ww(wid+4, y, w)
  513. if @item.at_max_level?
  514. text = "MASTERED"
  515. draw_text(wid+6, y, w, line_height, "#{Equip_Exp::Exp_Vocab}:")
  516. draw_text(wid+0, y, w, line_height, "#{Equip_Exp::Exp_Vocab}: MASTERED",2)
  517. else
  518. next_lv = Equip_Exp::Exp_Required[@item.level+1]
  519. value = @item.exp != 0 ? "#{@item.exp}/#{next_lv}" : "--/#{next_lv}"
  520. draw_text(wid+6, y, w, line_height, "#{Equip_Exp::Exp_Vocab}:")
  521. draw_text(wid+0, y, w, line_height, value, 2)
  522. end
  523. return y += 24
  524. end
  525. #-----------------------------------------------------------------------------
  526. #
  527. #-----------------------------------------------------------------------------
  528. def draw_equip_durab(y,w)
  529. return y unless $D13x[:Equip_Durability]
  530. draw_box_ww(wid+4, y, w)
  531. vocab = "#{Equip_Durability::Durability_V}:"
  532. value = "#{@item.durability.perc_of(@item.max_durability)}%"
  533. if !Equip_Durability::Show_Percent
  534. value = "#{@item.durability.to_flim}/#{@item.max_durability.to_flim}"
  535. end
  536. draw_text(wid+6, y, w-4, line_height, vocab)
  537. draw_text(wid+0, y, w , line_height, value, 2)
  538. return y += 24
  539. end
  540. #-----------------------------------------------------------------------------
  541. #
  542. #-----------------------------------------------------------------------------
  543. def draw_equip_set(y,w)
  544. return y unless $D13x[:Equip_Sets]
  545. draw_box_ww(wid+4, y, w)
  546. gear = "N/A"
  547. Equip_Set::ID.each do |pos_set|
  548. pos_set[1][:pieces].each do |piece|
  549. case piece[0]
  550. when :weapon
  551. next unless @item.is_a?(RPG::Weapon)
  552. next unless @item.database_id == piece[1]
  553. gear = pos_set[1][:set_name]
  554. when :armor
  555. next unless @item.is_a?(RPG::Armor)
  556. next unless @item.database_id == piece[1]
  557. gear = pos_set[1][:set_name]
  558. end
  559. end
  560. end
  561. draw_text(wid+6, y, w-4, line_height, "Equip Set:")
  562. draw_text(wid+0, y, w , line_height, gear, 2)
  563. return y += 24
  564. end
  565. #-----------------------------------------------------------------------------
  566. # Define wid
  567. #-----------------------------------------------------------------------------
  568. def wid
  569. self.width/4-(standard_padding)
  570. end
  571. #-----------------------------------------------------------------------------
  572. # Draw Data
  573. #-----------------------------------------------------------------------------
  574. def draw_data(x,y,text,colo,icon,ihue,valu,alig)
  575. draw_box(x, y)
  576. x = draw_stat_icons(icon, x, y, ihue, all_icons_enable?)
  577. change_color(colo)
  578. change_color(Text_Color::White)
  579. draw_text(0, y, wid, line_height, valu, 2)
  580. return y += line_height
  581. end
  582. #-----------------------------------------------------------------------------
  583. #
  584. #-----------------------------------------------------------------------------
  585. def draw_bonus_data(x,y,text,colo,icon,ihue,valu)
  586. draw_box(x, y)
  587. x = draw_stat_icons(icon, x, y, ihue, all_icons_enable?)
  588. draw_text(x, y, self.width, line_height, text)
  589. draw_text(0, y, self.width-24, line_height, valu, 2)
  590. return y += line_height
  591. end
  592. #-----------------------------------------------------------------------------
  593. # Draw Parameters
  594. #-----------------------------------------------------------------------------
  595. def draw_parameters(x,y,i)
  596. data = Vocanicon.param(i)
  597. text = data[0]
  598. colo = data[1]
  599. icon = data[2]
  600. ihue = data[3]
  601. stat = (@item.params[i] + @item.pars[i]).to_i
  602. valu = General::No_Change_Vocab
  603. valu = sprintf("%s", stat) if stat != 0
  604. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  605. return y
  606. end
  607. #-----------------------------------------------------------------------------
  608. # Draw x Parameters
  609. #-----------------------------------------------------------------------------
  610. def draw_xparameters(x,y,i)
  611. data = Vocanicon.xparam(i)
  612. text = data[0]
  613. colo = data[1]
  614. icon = data[2]
  615. ihue = data[3]
  616. stat = (@item.xpars[i])
  617. valu = General::No_Change_Vocab
  618. valu = sprintf("%1.2f%%", stat) if stat != 0.0
  619. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  620. return y
  621. end
  622. #-----------------------------------------------------------------------------
  623. # Draw sParameters
  624. #-----------------------------------------------------------------------------
  625. def draw_sparameters(x,y,i)
  626. data = Vocanicon.sparam(i)
  627. text = data[0]
  628. colo = data[1]
  629. icon = data[2]
  630. ihue = data[3]
  631. stat = (@item.spars[i])
  632. valu = General::No_Change_Vocab
  633. valu = sprintf("%1.2f%%", stat) if stat != 0.0
  634. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  635. return y
  636. end
  637. #-----------------------------------------------------------------------------
  638. # Draw Attack Elements
  639. #-----------------------------------------------------------------------------
  640. def draw_atk_eles(x,y,i)
  641. return y unless $D13x[:Elems_Control]
  642. data = Vocanicon.atk_element(i)
  643. text = data[0]
  644. colo = data[1]
  645. icon = data[2]
  646. ihue = data[3]
  647. stat = (@item.atk_ele[i])
  648. valu = General::No_Change_Vocab
  649. valu = sprintf("%1.2f%%", stat) if stat != 0.0
  650. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  651. return y
  652. end
  653. #-----------------------------------------------------------------------------
  654. # Draw Defence Elements
  655. #-----------------------------------------------------------------------------
  656. def draw_def_eles(x,y,i)
  657. return y unless $D13x[:Elems_Control]
  658. data = Vocanicon.def_element(i)
  659. text = data[0]
  660. colo = data[1]
  661. icon = data[2]
  662. ihue = data[3]
  663. stat = (@item.def_ele[i])#-@actor.element_rate(i))*100
  664. valu = General::No_Change_Vocab
  665. valu = sprintf("%1.2f%%", stat) if stat != 0.0
  666. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  667. return y
  668. end
  669. #-----------------------------------------------------------------------------
  670. # Draw Attack Level
  671. #-----------------------------------------------------------------------------
  672. def draw_atk_level(x,y)
  673. return y unless $D13x[:Atk_Def_Lvs]
  674. data = Vocanicon::Atk_Level
  675. text = data[0]
  676. colo = data[1]
  677. icon = data[2]
  678. ihue = data[3]
  679. stat = (@item.atk_level).to_i
  680. valu = General::No_Change_Vocab
  681. valu = sprintf("%s", stat) if stat != 0
  682. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  683. return y
  684. end
  685. #-----------------------------------------------------------------------------
  686. # Draw Defence Level
  687. #-----------------------------------------------------------------------------
  688. def draw_def_level(x,y)
  689. return y unless $D13x[:Atk_Def_Lvs]
  690. data = Vocanicon::Def_Level
  691. text = data[0]
  692. colo = data[1]
  693. icon = data[2]
  694. ihue = data[3]
  695. stat = (@item.def_level).to_i
  696. valu = General::No_Change_Vocab
  697. valu = sprintf("%s", stat) if stat != 0
  698. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  699. return y
  700. end
  701. #-----------------------------------------------------------------------------
  702. # Draw TP Info
  703. #-----------------------------------------------------------------------------
  704. def draw_tp_info(x,y)
  705. return y unless $D13x[:TP_Control]
  706. data = Vocanicon::TP
  707. text = data[0]
  708. colo = data[1]
  709. icon = data[2]
  710. ihue = data[3]
  711. stat = (@item.mtp_plus).to_i
  712. valu = General::No_Change_Vocab
  713. valu = sprintf("%s", stat) if stat != 0
  714. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  715. return y
  716. end
  717. #-----------------------------------------------------------------------------
  718. # Draw ISPDS Info
  719. #-----------------------------------------------------------------------------
  720. def draw_spds_info(x,y,i)
  721. return y unless $D13x[:ISPDS]
  722. data = Vocanicon.spds_stat(@actor,i)
  723. text = data[0]
  724. colo = data[1]
  725. icon = data[2]
  726. ihue = data[3]
  727. stat = (@item.spds_stats[i]).to_i
  728. valu = General::No_Change_Vocab
  729. valu = sprintf("%s", stat) if stat != 0
  730. y = draw_data(x,y,text,colo,icon,ihue,valu,1)
  731. return y
  732. end
  733. #-----------------------------------------------------------------------------
  734. #
  735. #-----------------------------------------------------------------------------
  736. def draw_item_bonuses(drew, x = 0, feats = @item.uni_feats)
  737. change_color(Text_Color::Sky_Blue)
  738. y = line_height * (drew)
  739. draw_text(x+4, y, width, line_height, "Bonuses ↓", 0)
  740. drew += 1
  741. feats.each do |f|
  742. next if f == nil
  743. y = line_height * (drew)
  744. case f[0]
  745. when :param
  746. draw_bonus_parz(x, y, f[1], f[2])
  747. drew += 1
  748. when :x_param
  749. draw_bonus_deki_xpars(x, y, f[1], f[2])
  750. drew += 1
  751. when :s_param
  752. draw_bonus_deki_spars(x, y, f[1], f[2])
  753. drew += 1
  754. when :feature
  755. case f[1]
  756. when 22 then draw_bonus_x_parz(x,y,f[2],f[3]) # x~params
  757. when 23 then draw_bonus_s_parz(x,y,f[2],f[3]) # s~params
  758. when 1989 then draw_bonus_DPBz_parz(x,y,f[2],f[3]) # DPBz~pars(PSPDS)
  759. when 1990 then draw_bonus_DPBz_formz(x,y,f[2],f[3]) # ATL/DFL rates
  760. when 2013 then draw_bonus_ispds_parz(x,y,f[2],f[3]) # ISPDS rates
  761. when 11 then draw_bonus_dele(x,y,f[2],f[3]) # defence elements
  762. when 31 then draw_bonus_aele(x,y,f[2],f[3]) # attack elements
  763. when 12 then draw_bonus_Dbuff(x,y,f[2],f[3]) # debuff rates
  764. when 13 then draw_bonus_Def_state(x,y,f[2],f[3]) # def states rates
  765. when 14 then draw_bonus_Res_state(x,y,f[2],f[3]) # resi state rates
  766. when 32 then draw_bonus_Atk_state(x,y,f[2],f[3]) # atk state success %
  767. when 33 then draw_bonus_Atk_speed(x,y,f[2],f[3]) # attack speed
  768. when 34 then draw_bonus_Atk_times(x,y,f[2],f[3]) # attack times
  769. when 41 then draw_bonus_skill_t_add(x,y,f[2],f[3]) # skill type add
  770. when 42 then draw_bonus_skill_t_seal(x,y,f[2],f[3])# skill type seal
  771. when 43 then draw_bonus_skill__add(x,y,f[2],f[3]) # skill add
  772. when 44 then draw_bonus_skill__seal(x,y,f[2],f[3]) # skill seal
  773. when 51 then draw_bonus_equip_w_type(x,y,f[2],f[3])# equip_w_type
  774. when 52 then draw_bonus_equip_a_type(x,y,f[2],f[3])# equip_a_type
  775. when 53 then draw_bonus_fixed_e_type(x,y,f[2],f[3])# fix equip type
  776. when 54 then draw_bonus_seal_e_type(x,y,f[2],f[3]) # seal equip type
  777. when 55 then draw_bonus_slot_type(x,y,f[2],f[3]) # equip slot type
  778. when 61 then draw_bonus_action_times(x,y,f[2],f[3])# Action times
  779. when 62 then draw_bonus_specials(x,y,f[2],f[3]) # Special
  780. when 63 then draw_bonus_collapse_type(x,y,f[2],f[3])# Collapse Type
  781. when 64 then draw_bonus_party_ability(x,y,f[2],f[3])# Party ablity
  782. end
  783. drew += 1
  784. when :exp_rate
  785. draw_bonus_exp_rate(x, y, f[1])
  786. drew += 1
  787. when :durab_rate
  788. draw_bonus_durab_rate(x, y, f[1])
  789. drew += 1
  790. end
  791. end
  792. return drew
  793. end
  794. #-----------------------------------------------------------------------------
  795. #
  796. #-----------------------------------------------------------------------------
  797. def draw_bonus_statistics(x,y,amnt,vocab)
  798. width = window_width-(standard_padding*2)
  799. text = "#{vocab} #{amnt}"
  800. draw_text(x+4, y, width, line_height, text)
  801. end
  802. #-----------------------------------------------------------------------------
  803. #
  804. #-----------------------------------------------------------------------------
  805. def draw_bonus_parz(x, y, par_id, amnt)
  806. data = Vocanicon.param(par_id)
  807. text = data[0]
  808. icon = data[2]
  809. ihue = data[3]
  810. valu = amnt < 0 ? "#{amnt}" : "+#{amnt}"
  811. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  812. end
  813. #-----------------------------------------------------------------------------
  814. #
  815. #-----------------------------------------------------------------------------
  816. def draw_bonus_deki_xpars(x, y, par_id, amnt)
  817. data = Vocanicon.xparam(par_id)
  818. text = data[0]
  819. icon = data[2]
  820. ihue = data[3]
  821. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  822. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  823. end
  824. #-----------------------------------------------------------------------------
  825. #
  826. #-----------------------------------------------------------------------------
  827. def draw_bonus_x_parz(x, y, par_id, amnt)
  828. data = Vocanicon.xparam(par_id)
  829. text = data[0]
  830. icon = data[2]
  831. ihue = data[3]
  832. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  833. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  834. end
  835. #-----------------------------------------------------------------------------
  836. #
  837. #-----------------------------------------------------------------------------
  838. def draw_bonus_s_parz(x, y, par_id, amnt)
  839. data = Vocanicon.sparam(par_id)
  840. text = data[0]
  841. icon = data[2]
  842. ihue = data[3]
  843. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  844. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  845. end
  846. #-----------------------------------------------------------------------------
  847. #
  848. #-----------------------------------------------------------------------------
  849. def draw_bonus_deki_spars(x, y, par_id, amnt)
  850. data = Vocanicon.sparam(par_id)
  851. text = data[0]
  852. icon = data[2]
  853. ihue = data[3]
  854. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  855. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  856. end
  857. #-----------------------------------------------------------------------------
  858. #
  859. #-----------------------------------------------------------------------------
  860. def draw_bonus_DPBz_parz(x, y, par_id, amnt)
  861. return unless $imported[:Dekita__PSPDS]
  862. draw_text(x+4, y, window_width/2-12, line_height, Vocab::dpbz_param(par_id))
  863. value = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  864. draw_text(x, y, window_width/2-12, line_height, value, 2)
  865. end
  866. #-----------------------------------------------------------------------------
  867. #
  868. #-----------------------------------------------------------------------------
  869. def draw_bonus_DPBz_formz(x, y, par_id, amnt)
  870. return unless $imported[:Dekita__ATL_AND_DFL]
  871. draw_text(x+4, y, window_width/2-12, line_height, Vocab::dpbz_formz(par_id))
  872. value = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  873. draw_text(x, y, window_width/2-12, line_height, value, 2)
  874. end
  875. #-----------------------------------------------------------------------------
  876. #
  877. #-----------------------------------------------------------------------------
  878. def draw_bonus_ispds_parz(x, y, par_id, amnt)
  879. return unless $D13x[:ISPDS]
  880. data = Vocanicon.spds_stat(@actor,par_id)
  881. text = data[0]
  882. icon = data[2]
  883. ihue = data[3]
  884. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  885. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  886. end
  887. #-----------------------------------------------------------------------------
  888. #
  889. #-----------------------------------------------------------------------------
  890. def draw_bonus_dele(x, y, par_id, amnt)
  891. return unless $D13x[:Elems_Control]
  892. data = Vocanicon.def_element(par_id)
  893. text = data[0]
  894. icon = data[2]
  895. ihue = data[3]
  896. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  897. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  898. end
  899. #-----------------------------------------------------------------------------
  900. #
  901. #-----------------------------------------------------------------------------
  902. def draw_bonus_aele(x, y, par_id, amnt)
  903. data = Vocanicon.atk_element(par_id)
  904. text = data[0]
  905. icon = data[2]
  906. ihue = data[3]
  907. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  908. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  909. end
  910. #-----------------------------------------------------------------------------
  911. #
  912. #-----------------------------------------------------------------------------
  913. def draw_bonus_Dbuff(x, y, par_id, amnt)
  914. data = Vocanicon.param(par_id)
  915. text = data[0]
  916. icon = data[2]
  917. ihue = data[3]
  918. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  919. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  920. end
  921. #-----------------------------------------------------------------------------
  922. #
  923. #-----------------------------------------------------------------------------
  924. def draw_bonus_Def_state(x, y, par_id, amnt)
  925. data = $data_states[par_id]
  926. text = data.name + ' Def'
  927. icon = data.icon_index
  928. ihue = data.icon_hue
  929. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  930. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  931. end
  932. #-----------------------------------------------------------------------------
  933. #
  934. #-----------------------------------------------------------------------------
  935. def draw_bonus_Res_state(x, y, par_id, amnt)
  936. data = $data_states[par_id]
  937. text = data.name + ' Res'
  938. icon = data.icon_index
  939. ihue = data.icon_hue
  940. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  941. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  942. end
  943. #-----------------------------------------------------------------------------
  944. #
  945. #-----------------------------------------------------------------------------
  946. def draw_bonus_Atk_state(x, y, par_id, amnt)
  947. data = $data_states[par_id]
  948. text = data.name + ' Atk'
  949. icon = data.icon_index
  950. ihue = data.icon_hue
  951. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  952. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  953. end
  954. #-----------------------------------------------------------------------------
  955. #
  956. #-----------------------------------------------------------------------------
  957. def draw_bonus_Atk_speed(x, y, par_id, amnt)
  958. data = Vocanicon::Attack_Speed
  959. text = data[0]
  960. icon = data[2]
  961. ihue = data[3]
  962. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  963. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  964. end
  965. #-----------------------------------------------------------------------------
  966. #
  967. #-----------------------------------------------------------------------------
  968. def draw_bonus_Atk_times(x, y, par_id, amnt)
  969. data = Vocanicon::Attack_Times
  970. text = data[0]
  971. icon = data[2]
  972. ihue = data[3]
  973. valu = amnt < 0 ? "#{amnt}%" : "+#{amnt}%"
  974. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  975. end
  976. #-----------------------------------------------------------------------------
  977. #
  978. #-----------------------------------------------------------------------------
  979. def draw_bonus_skill_t_add(x, y, par_id, amnt)
  980. data = Vocanicon::Skill_Type
  981. text = data[0]
  982. icon = data[2]
  983. ihue = data[3]
  984. valu = "+#{$data_system.skill_types[par_id]}"
  985. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  986. end
  987. #-----------------------------------------------------------------------------
  988. #
  989. #-----------------------------------------------------------------------------
  990. def draw_bonus_skill_t_seal(x, y, par_id, amnt)
  991. data = Vocanicon::Skill_Type
  992. text = data[0]
  993. icon = data[2]
  994. ihue = data[3]
  995. valu = "-#{$data_system.skill_types[par_id]}"
  996. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  997. end
  998. #-----------------------------------------------------------------------------
  999. #
  1000. #-----------------------------------------------------------------------------
  1001. def draw_bonus_skill__add(x, y, par_id, amnt)
  1002. data = $data_skills[par_id]
  1003. text = data.name + ''
  1004. icon = data.icon_index
  1005. ihue = data.icon_hue
  1006. valu = "+#{text}"
  1007. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1008. end
  1009. #-----------------------------------------------------------------------------
  1010. #
  1011. #-----------------------------------------------------------------------------
  1012. def draw_bonus_skill__seal(x, y, par_id, amnt)
  1013. data = $data_skills[par_id]
  1014. text = data.name + ''
  1015. icon = data.icon_index
  1016. ihue = data.icon_hue
  1017. valu = "-#{text}"
  1018. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1019. end
  1020. #-----------------------------------------------------------------------------
  1021. #
  1022. #-----------------------------------------------------------------------------
  1023. def draw_bonus_equip_w_type(x, y, par_id, amnt)
  1024. data = Vocanicon::Equip_Type
  1025. text = data[0]
  1026. icon = data[2]
  1027. ihue = data[3]
  1028. valu = "+#{$data_system.weapon_types[par_id]}"
  1029. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1030. end
  1031. #-----------------------------------------------------------------------------
  1032. #
  1033. #-----------------------------------------------------------------------------
  1034. def draw_bonus_equip_a_type(x, y, par_id, amnt)
  1035. data = Vocanicon::Equip_Type
  1036. text = data[0]
  1037. icon = data[2]
  1038. ihue = data[3]
  1039. valu = "+#{$data_system.armor_types[par_id]}"
  1040. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1041. end
  1042. #-----------------------------------------------------------------------------
  1043. #
  1044. #-----------------------------------------------------------------------------
  1045. def draw_bonus_fixed_e_type(x, y, par_id, amnt)
  1046. data = Vocanicon::Fixed
  1047. text = data[0] + Vocanicon::Equip_Type
  1048. icon = data[2]
  1049. ihue = data[3]
  1050. value = "#{$data_system.terms.etypes[par_id]}"
  1051. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1052. end
  1053. #-----------------------------------------------------------------------------
  1054. #
  1055. #-----------------------------------------------------------------------------
  1056. def draw_bonus_seal_e_type(x, y, par_id, amnt)
  1057. data = Vocanicon::Sealed
  1058. text = data[0] + Vocanicon::Equip_Type
  1059. icon = data[2]
  1060. ihue = data[3]
  1061. value = "#{$data_system.terms.etypes[par_id]}"
  1062. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1063. end
  1064. #-----------------------------------------------------------------------------
  1065. # Draw Bonus Slot Type (for weapons)
  1066. #-----------------------------------------------------------------------------
  1067. def draw_bonus_slot_type(x, y, par_id, amnt)
  1068. case amnt
  1069. when 1
  1070. data = Vocanicon::One__Slot
  1071. else
  1072. data = Vocanicon::Dual_Slot
  1073. end
  1074. text = data[0]
  1075. icon = data[2]
  1076. ihue = data[3]
  1077. value = ""
  1078. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1079. end
  1080. #-----------------------------------------------------------------------------
  1081. # Draw Bonus Action Times
  1082. #-----------------------------------------------------------------------------
  1083. def draw_bonus_action_times(x, y, par_id, amnt)
  1084. data = Vocanicon::Action_Times
  1085. text = data[0]
  1086. icon = data[2]
  1087. ihue = data[3]
  1088. valu = amnt < 0 ? "#{amnt}" : "+#{amnt}"
  1089. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1090. end
  1091. #-----------------------------------------------------------------------------
  1092. # Draw Bonus Special Abilities
  1093. #-----------------------------------------------------------------------------
  1094. def draw_bonus_specials(x, y, par_id, amnt)
  1095. data = Vocanicon.specials(par_id)
  1096. text = data[0]
  1097. icon = data[2]
  1098. ihue = data[3]
  1099. valu = ""
  1100. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1101. end
  1102. #-----------------------------------------------------------------------------
  1103. # Draw Bonus Collapse Type
  1104. #-----------------------------------------------------------------------------
  1105. def draw_bonus_collapse_type(x, y, par_id, amnt)
  1106. data = Vocanicon.collapse_type(par_id)
  1107. text = data[0]
  1108. icon = data[2]
  1109. ihue = data[3]
  1110. valu = ""
  1111. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1112. end
  1113. #-----------------------------------------------------------------------------
  1114. # Draw Bonus Party Abilities
  1115. #-----------------------------------------------------------------------------
  1116. def draw_bonus_party_ability(x, y, par_id, amnt)
  1117. data = Vocanicon.party_ability(par_id)
  1118. text = data[0]
  1119. icon = data[2]
  1120. ihue = data[3]
  1121. valu = ""
  1122. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1123. end
  1124. #-----------------------------------------------------------------------------
  1125. # Draw Bonus Exp Rate
  1126. #-----------------------------------------------------------------------------
  1127. def draw_bonus_exp_rate(x, y, amnt)
  1128. data = Vocanicon::Exp
  1129. text = data[0] + ' Rate'
  1130. icon = data[2]
  1131. ihue = data[3]
  1132. valu = "#{(amnt * 100).to_i}%"
  1133. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1134. end
  1135. #-----------------------------------------------------------------------------
  1136. # Draw Bonus Durability Rate
  1137. #-----------------------------------------------------------------------------
  1138. def draw_bonus_durab_rate(x, y, amnt)
  1139. data = Vocanicon::Exp
  1140. text = 'Endurance'
  1141. icon = 0
  1142. ihue = 0
  1143. valu = amnt < 0.0 ? "#{amnt}%" : "+#{amnt}%"
  1144. draw_bonus_data(x,y,text,nil,icon,ihue,valu)
  1145. end
  1146. end
  1147. #===============================================================================
  1148. class Scene_Equip < Scene_MenuBase
  1149. #===============================================================================
  1150. #-----------------------------------------------------------------------------
  1151. #
  1152. #-----------------------------------------------------------------------------
  1153. def start
  1154. super
  1155. create_command_window
  1156. create_help_window
  1157. create_status_window
  1158. create_slot_window
  1159. create_item_window
  1160. create_fake_status_window
  1161. create_actor_status
  1162. create_actor_changes
  1163. create_item_status
  1164. end
  1165. #-----------------------------------------------------------------------------
  1166. #
  1167. #-----------------------------------------------------------------------------
  1168. def create_command_window
  1169. @command_window = EquipCommandWindow.new
  1170. @command_window.viewport = @viewport
  1171. @command_window.set_handler(:equip, method(:command_equip))
  1172. @command_window.set_handler(:optimize, method(:command_optimize))
  1173. @command_window.set_handler(:clear, method(:command_clear))
  1174. @command_window.set_handler(:cancel, method(:return_scene))
  1175. @command_window.set_handler(:pagedown, method(:next_actor))
  1176. @command_window.set_handler(:pageup, method(:prev_actor))
  1177. end
  1178. #-----------------------------------------------------------------------------
  1179. #
  1180. #-----------------------------------------------------------------------------
  1181. def create_help_window
  1182. @help_window = Deki_Help.new
  1183. @help_window.viewport = @viewport
  1184. @help_window.x = Graphics.width / 4
  1185. end
  1186. #-----------------------------------------------------------------------------
  1187. #
  1188. #-----------------------------------------------------------------------------
  1189. def create_status_window
  1190. @status_window = Window_StatusEquip.new(@actor,@help_window.height)
  1191. @status_window.viewport = @viewport
  1192. end
  1193. #-----------------------------------------------------------------------------
  1194. #
  1195. #-----------------------------------------------------------------------------
  1196. def create_slot_window
  1197. wx = 0
  1198. wy = @status_window.y + @status_window.height
  1199. ww = Graphics.width / 2
  1200. @slot_window = Window_EquipSlot.new(wx, wy, ww)
  1201. @slot_window.viewport = @viewport
  1202. @slot_window.help_window = @help_window
  1203. @slot_window.actor = @actor
  1204. @slot_window.set_handler(:ok, method(:on_slot_ok))
  1205. @slot_window.set_handler(:cancel, method(:on_slot_cancel))
  1206. end
  1207. #-----------------------------------------------------------------------------
  1208. #
  1209. #-----------------------------------------------------------------------------
  1210. def create_item_window
  1211. wx = 0
  1212. wy = @slot_window.y + @slot_window.height
  1213. ww = Graphics.width / 2
  1214. wh = Graphics.height - wy
  1215. @item_window = Window_EquipItem.new(wx, wy, ww, wh)
  1216. @item_window.viewport = @viewport
  1217. @item_window.help_window = @help_window
  1218. @item_window.actor = @actor
  1219. @item_window.set_handler(:ok, method(:on_item_ok))
  1220. @item_window.set_handler(:cancel, method(:on_item_cancel))
  1221. @slot_window.item_window = @item_window
  1222. end
  1223. #-----------------------------------------------------------------------------
  1224. #
  1225. #-----------------------------------------------------------------------------
  1226. def create_fake_status_window
  1227. y = @status_window.y+@status_window.height
  1228. @fake_window = Window_EmptyEquipStatus.new(y)
  1229. @fake_window.viewport = @viewport
  1230. end
  1231. #-----------------------------------------------------------------------------
  1232. #
  1233. #-----------------------------------------------------------------------------
  1234. def create_actor_status
  1235. y = @status_window.y+@status_window.height
  1236. @actor_status = Window_Actor_EquipStatus.new(@actor, y)
  1237. @actor_status.page = 0
  1238. @actor_status.activate
  1239. @actor_status.viewport = @viewport
  1240. end
  1241. #-----------------------------------------------------------------------------
  1242. #
  1243. #-----------------------------------------------------------------------------
  1244. def create_actor_changes
  1245. @actor_changes = Window_EquipStatusChanges.new(@actor,@actor_status.y)
  1246. @actor_changes.dis_window = @item_window
  1247. @actor_changes.page = @actor_status.page
  1248. @actor_changes.activate
  1249. @actor_changes.viewport = @viewport
  1250. end
  1251. #-----------------------------------------------------------------------------
  1252. #
  1253. #-----------------------------------------------------------------------------
  1254. def create_item_status
  1255. x = Graphics.width / 2
  1256. y = @actor_status.y
  1257. w = Graphics.width / 2
  1258. h = Graphics.height-y
  1259. @item_status = Dekita_Core_Equip_Status.new(x,y,w,h,@actor)
  1260. @item_status.dis_window = @item_window
  1261. @item_status.page = @actor_status.page
  1262. @item_status.viewport = @viewport
  1263. @item_status.deactivate
  1264. @item_status.hide
  1265. end
  1266. #-----------------------------------------------------------------------------
  1267. #
  1268. #-----------------------------------------------------------------------------
  1269. def command_equip
  1270. @slot_window.activate
  1271. @slot_window.select(0)
  1272. @actor_changes.item = nil
  1273. @actor_changes.show_no_stats
  1274. end
  1275. #--------------------------------------------------------------------------
  1276. # * [Ultimate Equipment] Command
  1277. #--------------------------------------------------------------------------
  1278. # def command_optimize
  1279. # Sound.play_equip
  1280. # @actor.optimize_equipments
  1281. # @status_window.refresh
  1282. # @slot_window.refresh
  1283. # @command_window.activate
  1284. # end
  1285. #-----------------------------------------------------------------------------
  1286. #
  1287. #-----------------------------------------------------------------------------
  1288. def command_clear
  1289. Sound.play_equip
  1290. @actor.clear_equipments
  1291. refresh_deki_windows
  1292. @actor_changes.item = nil
  1293. @actor_changes.show_no_stats
  1294. @command_window.activate
  1295. end
  1296. #--------------------------------------------------------------------------
  1297. # * Slot [OK]
  1298. #--------------------------------------------------------------------------
  1299. alias :osok_onslotok :on_slot_ok
  1300. def on_slot_ok
  1301. osok_onslotok
  1302. end
  1303. #--------------------------------------------------------------------------
  1304. # * Slot [Cancel]
  1305. #--------------------------------------------------------------------------
  1306. alias :oscn_okslotcancel :on_slot_cancel
  1307. def on_slot_cancel
  1308. oscn_okslotcancel
  1309. if @item_status.active
  1310. @actor_status.activate
  1311. @actor_status.show
  1312. @actor_changes.activate
  1313. @actor_changes.show
  1314. @item_status.deactivate
  1315. @item_status.hide
  1316. end
  1317. # refresh_deki_windows
  1318. # @slot_window.unselect
  1319. # @command_window.activate
  1320. end
  1321. #-----------------------------------------------------------------------------
  1322. #
  1323. #-----------------------------------------------------------------------------
  1324. alias :oiok_onitemok :on_item_ok
  1325. def on_item_ok
  1326. oiok_onitemok
  1327. refresh_deki_windows
  1328. end
  1329. #-----------------------------------------------------------------------------
  1330. #
  1331. #-----------------------------------------------------------------------------
  1332. def on_item_cancel
  1333. @slot_window.activate
  1334. @item_window.unselect
  1335. refresh_deki_windows
  1336. end
  1337. #-----------------------------------------------------------------------------
  1338. #
  1339. #-----------------------------------------------------------------------------
  1340. def on_actor_change
  1341. refresh_deki_windows
  1342. @command_window.activate
  1343. end
  1344. #-----------------------------------------------------------------------------
  1345. #
  1346. #-----------------------------------------------------------------------------
  1347. def refresh_deki_windows
  1348. @status_window.actor = @actor
  1349. @status_window.refresh
  1350. @actor_status.actor = @actor
  1351. @actor_status.refresh
  1352. @actor_changes.actor = @actor
  1353. @actor_changes.refresh
  1354. @slot_window.actor = @actor
  1355. @slot_window.refresh
  1356. @item_status.refresh
  1357. @item_window.actor = @actor
  1358. end
  1359. #-----------------------------------------------------------------------------
  1360. #
  1361. #-----------------------------------------------------------------------------
  1362. def update
  1363. super
  1364. update_command_help
  1365. update_status_shown
  1366. update_actor_status
  1367. update_item_window
  1368. update_item_status
  1369. update_dis_window
  1370. end
  1371. #-----------------------------------------------------------------------------
  1372. #
  1373. #-----------------------------------------------------------------------------
  1374. def update_command_help
  1375. return unless @command_window.active
  1376. text = Epic_Equip::Help_Text[@command_window.current_symbol]
  1377. @help_window.set_text(text)
  1378. end
  1379. #-----------------------------------------------------------------------------
  1380. #
  1381. #-----------------------------------------------------------------------------
  1382. def update_status_shown
  1383. return unless Keys.trigger?(:TAB)
  1384. if @actor_status.active
  1385. @actor_status.deactivate
  1386. @actor_status.hide
  1387. @actor_changes.deactivate
  1388. @actor_changes.hide
  1389. @item_status.activate
  1390. @item_status.show
  1391. else
  1392. @actor_status.activate
  1393. @actor_status.show
  1394. @actor_changes.activate
  1395. @actor_changes.show
  1396. @item_status.deactivate
  1397. @item_status.hide
  1398. end
  1399. end
  1400. #-----------------------------------------------------------------------------
  1401. #
  1402. #-----------------------------------------------------------------------------
  1403. def update_actor_status
  1404. if Keys.trigger?(:RSHIFT)
  1405. change_page(:up)
  1406. end
  1407. if Keys.trigger?(:LSHIFT)
  1408. change_page(:down)
  1409. end
  1410. end
  1411. #-----------------------------------------------------------------------------
  1412. #
  1413. #-----------------------------------------------------------------------------
  1414. def change_page(type)
  1415. page = @actor_status.page
  1416. case type
  1417. when :up
  1418. if @actor_status.page >= (Epic_Equip::Max_Pages-1)
  1419. @actor_status.page = 0
  1420. else
  1421. @actor_status.page += 1
  1422. end
  1423. when :down then
  1424. if @actor_status.page <= 0
  1425. @actor_status.page = Epic_Equip::Max_Pages-1
  1426. else
  1427. @actor_status.page -= 1
  1428. end
  1429. end
  1430. @actor_changes.page = @actor_status.page
  1431. end
  1432. #-----------------------------------------------------------------------------
  1433. #
  1434. #-----------------------------------------------------------------------------
  1435. def update_item_window
  1436. if @item_window.active
  1437. @actor_changes.item = @item_window.item
  1438. elsif @actor_changes.item == nil
  1439. else
  1440. @actor_changes.item = nil
  1441. end
  1442. end
  1443. #-----------------------------------------------------------------------------
  1444. #
  1445. #-----------------------------------------------------------------------------
  1446. def update_item_status
  1447. return unless @item_status.active
  1448. @item_status.page = @actor_status.page
  1449. if @slot_window.active
  1450. @item_status.item = @slot_window.item
  1451. elsif @item_window.active
  1452. @item_status.item = @item_window.item
  1453. end
  1454. end
  1455. #-----------------------------------------------------------------------------
  1456. # Update dis Window
  1457. #-----------------------------------------------------------------------------
  1458. def update_dis_window
  1459. return unless @actor_changes.active
  1460. if @actor_changes.item != nil && @command_window.active
  1461. @actor_changes.item = nil
  1462. @actor_changes.show_no_stats
  1463. end
  1464. if @slot_window.active
  1465. @actor_changes.item = @slot_window.item
  1466. elsif @item_window.active
  1467. @actor_changes.item = @item_window.item
  1468. end
  1469. end
  1470. end
  1471. #==============================================================================#
  1472. # http://dekitarpg.wordpress.com/ #
  1473. #==============================================================================#
  1474. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement