Advertisement
Dekita

$D13x Equip Sets 1.3

May 21st, 2013
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.25 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Equipment Sets
  5. # -- Author : Dekita
  6. # -- Version : 1.3
  7. # -- Level : Easy / Normal
  8. # -- Requires : $D13x Core 1.8+
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Equip_Sets]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 21/o5/2o13 - Compatability, ($D13x ISPDS)
  21. # 2o/o5/2o13 - Compatability, ($D13x Atk & Def Lvs)
  22. # 16/o5/2o13 - Bugfix, (Skill Icon Being Overwritten)
  23. # o5/o5/2o13 - Finished,
  24. # o4/o5/2o13 - Started
  25. #
  26. #===============================================================================
  27. # ☆ Introduction
  28. #-------------------------------------------------------------------------------
  29. # This script creates equipment sets.
  30. # if an actor is equipped with enough items from the set, they will get a bonus
  31. # to a statistic, such as parameters, xparams, sparams, atk element rate,
  32. # defence element rate, skills.
  33. #
  34. # This script also adds an information window into the status screen,
  35. # accessed by pressing :S (default), this shows the current set items and
  36. # all bonuses currently obtained.
  37. #
  38. #===============================================================================
  39. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  40. #===============================================================================
  41. # 1. You MUST give credit to "Dekita" !!
  42. # 2. You are NOT allowed to repost this script.(or modified versions)
  43. # 3. You are NOT allowed to convert this script.
  44. # 4. You are NOT allowed to use this script for Commercial games.
  45. # 5. ENJOY!
  46. #
  47. # "FINE PRINT"
  48. # By using this script you hereby agree to the above terms and conditions,
  49. # if any violation of the above terms occurs "legal action" may be taken.
  50. # Not understanding the above terms and conditions does NOT mean that
  51. # they do not apply to you.
  52. # If you wish to discuss the terms and conditions in further detail you can
  53. # contact me at http://dekitarpg.wordpress.com/
  54. #
  55. #===============================================================================
  56. # ☆ Instructions
  57. #-------------------------------------------------------------------------------
  58. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  59. # Place Below Both, " $D13x Statistic Control " && " $D13x Elements Control ".
  60. # Place Above " $D13x Status Scene ".
  61. #
  62. #===============================================================================
  63. # ☆ Script Calls
  64. #-------------------------------------------------------------------------------
  65. # $game_actors[actor_id].has_full_set?(set_id)
  66. # or
  67. # $game_party.members[member_id].has_full_set?(set_id)
  68. # or
  69. # $game_party.leader.has_full_set?(set_id)
  70. #
  71. # These script calls all check if an actor has a complete set equipped.
  72. # will return true if the set is complete, false otherwise.
  73. #
  74. # Use for conditional branches and things of that nature :)
  75. #
  76. #===============================================================================
  77. # ☆ HELP
  78. #-------------------------------------------------------------------------------
  79. # PARAMS : # XPARAMS : # SPARAMS : #
  80. # stat = id # stat = id # stat = id #
  81. # mhp = 0 # hit = 0 # tgr = 0 #
  82. # mmp = 1 # eva = 1 # grd = 1 #
  83. # atk = 2 # cri = 2 # rec = 2 #
  84. # def = 3 # cev = 3 # pha = 3 #
  85. # mat = 4 # mev = 4 # mcr = 4 #
  86. # mdf = 5 # mrf = 5 # tcr = 5 #
  87. # agi = 6 # cnt = 6 # pdr = 6 #
  88. # luk = 7 # hrg = 7 # mdr = 7 #
  89. # # mrg = 8 # fdr = 8 #
  90. # # trg = 9 # exr = 9 #
  91. #-------------------------------------------------------------------------------
  92. # Remember :
  93. # All Params work with integer values, eg. 1, 5, 123, 653, 198123
  94. # All x/s-Params work with float values, eg. 1.0, 0.5, 0.1, 0.05, 0.01
  95. # 1.0 = 100%, 0.01 = 1%,
  96. #
  97. #===============================================================================
  98. module Equip_Set
  99. #===============================================================================
  100. ID={} # << Keep
  101. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  102. # ☆ Key Settings
  103. #-----------------------------------------------------------------------------
  104. # :show_sets = Key to press to show set info screen (Status Screen).
  105. # :scroll_up = Key to press to scroll up the info screen.
  106. # :scroll_dn = Key to press to scroll down the info screen.
  107. #-----------------------------------------------------------------------------
  108. Keys = {
  109. :show_sets => :S,
  110. :scroll_up => :UP,
  111. :scroll_dn => :DOWN,
  112. }
  113. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  114. # ☆ Equipment Set, Settings
  115. #-----------------------------------------------------------------------------
  116. # :set_name = The set name displayed on info screen
  117. # :set_icon = The set icon shown in info screen
  118. # :set_info = The set information shown.
  119. # :pieces = The items included in the set.
  120. # ^- [:weapon, id] For a weapon item
  121. # ^- [:armor, id] For an Armor item
  122. # :bonuses = The set bonuses for pieces equipped.
  123. # ^- pieces => [:param, id, value]
  124. # ^- pieces => [:x_param, id, value]
  125. # ^- pieces => [:s_param, id, value]
  126. # ^- pieces => [:atk_ele, id, value]
  127. # ^- pieces => [:def_ele, id, value]
  128. # ^- pieces => [:atk_lvl, value]
  129. # ^- pieces => [:def_lvl, value]
  130. # ^- pieces => [:skill, id]
  131. # ^- pieces => [:spds_stat, id, value]
  132. #-----------------------------------------------------------------------------
  133. ID[1]={
  134. :set_name => "Shita Gear",
  135. :set_icon => [5, 0, true], # id, hue, enable
  136. :set_info => "Epicly Bad Equipment Set!! Forged By An Unknown Traveller.",
  137. :pieces => [
  138. [:weapon, 1],
  139. [:armor , 1],
  140. [:armor , 2],
  141. [:armor , 3],
  142. [:armor , 4],
  143. [:armor , 5],
  144. [:armor , 6],
  145. ],
  146. :bonuses => {
  147. 1 => [:atk_lvl, 50],
  148. 2 => [:spds_stat, 0, 50],
  149. # 2 => [:param, 0, 50],
  150. 3 => [:x_param, 0, 0.5],
  151. 4 => [:s_param, 0, -0.05],
  152. 5 => [:def_ele, 3, -0.1],
  153. 6 => [:atk_ele, 3, 0.1],
  154. 7 => [:skill, 12],
  155. },
  156. }# << end set ID[1]
  157. #-----------------------------------------------------------------------------
  158. ID[2]={
  159. :set_name => "Bettera Gear",
  160. :set_icon => [15, 0, true], # id, hue, enable
  161. :set_info => "Average Equipment Set!! Forged By The Warrior Goshiki.",
  162. :pieces => [
  163. [:weapon, 2],
  164. [:armor , 7],
  165. [:armor , 8],
  166. [:armor , 9],
  167. [:armor , 10],
  168. [:armor , 11],
  169. [:armor , 12],
  170. ],
  171. :bonuses => {
  172. 2 => [:param, 0, 50],
  173. 4 => [:x_param, 0, 0.5],
  174. 5 => [:s_param, 0, 0.5],
  175. 6 => [:def_ele, 3, 0.1],
  176. 7 => [:atk_ele, 3, 0.1],
  177. },
  178. }# << end set ID[2]
  179. #-----------------------------------------------------------------------------
  180. ID[3]={
  181. :set_name => "Epicaga Gear",
  182. :set_icon => [25, 0, true], # id, hue, enable
  183. :set_info => "Epic Equipment Set!! Forged By The Legendary Cleric Dekita.",
  184. :pieces => [
  185. [:weapon, 3],
  186. [:armor , 13],
  187. [:armor , 14],
  188. [:armor , 15],
  189. [:armor , 16],
  190. [:armor , 17],
  191. [:armor , 18],
  192. ],
  193. :bonuses => {
  194. 2 => [:param, 0, 50],
  195. 3 => [:x_param, 0, 0.5],
  196. 4 => [:s_param, 0, 0.5],
  197. 5 => [:atk_ele, 3, 0.1],
  198. 6 => [:def_ele, 3, 0.1],
  199. },
  200. }# << end set ID[3]
  201. #-----------------------------------------------------------------------------
  202. ID[4]={
  203. :set_name => "Yin Yang Rings",
  204. :set_icon => [25, 180, true], # id, hue, enable
  205. :set_info => "Powerfull Ornament Set!! Said To Be Both Good And Evil...",
  206. :pieces => [
  207. [:armor , 19],
  208. [:armor , 20],
  209. ],
  210. :bonuses => {
  211. 2 => [:param, 0, 50],
  212. },
  213. }# << end set ID[4]
  214. #-----------------------------------------------------------------------------
  215. # << Add more lines in here, follow the same format as above.
  216. # ie.
  217. # ID[id_number]={
  218. # :set_name => "Set Name",
  219. # :set_icon => [icon index, hue, enabled],
  220. # :set_info => "Equipment Set Information.",
  221. # :pieces => [
  222. # [:weapon, id],
  223. # [:armor , id],
  224. # [:armor , id],
  225. # [:armor , id],
  226. # [:armor , id],
  227. # ],
  228. # :bonuses => {
  229. # 2 => [:param, id, val],
  230. # 3 => [:x_param, id, val],
  231. # 4 => [:s_param, id, val],
  232. # 5 => [:atk_ele, id, val],
  233. # 6 => [:def_ele, id, val],
  234. # },
  235. # }# << end ID[id_number]
  236. #####################
  237. # CUSTOMISATION END #
  238. end #####################
  239. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  240. # #
  241. # http://dekitarpg.wordpress.com/ #
  242. # #
  243. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  244. #===============================================================================#
  245. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  246. # YES?\.\. #
  247. # OMG, REALLY? \| #
  248. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  249. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  250. #===============================================================================#
  251. class Game_Actor < Game_Battler
  252. #===============================================================================
  253. #-----------------------------------------------------------------------------
  254. # Alias List
  255. #-----------------------------------------------------------------------------
  256. alias :setup_eqp_set :setup
  257. alias :ref_eqp_sets :refresh
  258. alias :parpl_eqp_set :param_plus
  259. alias :xparpl_eqp_set :xparam_plus if $D13x[:Stats_Control]
  260. alias :sparpl_eqp_set :sparam_plus if $D13x[:Stats_Control]
  261. alias :atkele_eqp_set :atk_ele_plus if $D13x[:Elems_Control]
  262. alias :defele_eqp_set :def_ele_plus if $D13x[:Elems_Control]
  263. alias :atl_dfl_sets_plus :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
  264. alias :spds_sets_plus :spds_plus if $D13x[:ISPDS]
  265. alias :skills_eqp_set :skills
  266. #-----------------------------------------------------------------------------
  267. # Setup
  268. #-----------------------------------------------------------------------------
  269. def setup(actor_id)
  270. reset_set_params
  271. setup_eqp_set(actor_id)
  272. end
  273. #-----------------------------------------------------------------------------
  274. # Refresh
  275. #-----------------------------------------------------------------------------
  276. def refresh
  277. reset_set_params
  278. check_equip_set
  279. ref_eqp_sets
  280. end
  281. #-----------------------------------------------------------------------------
  282. # Reset Set Params
  283. #-----------------------------------------------------------------------------
  284. def reset_set_params
  285. @set_atl_dfl = [0] * 2
  286. @set_param = [0] * 8
  287. @set_xparam = [0] * 10
  288. @set_sparam = [0] * 10
  289. @set_atk_ele = [0] * $data_system.elements.size
  290. @set_def_ele = [0] * $data_system.elements.size
  291. @set_spds_stats = [0] * 8
  292. @set_spds_stats = [0] * SPDS::Commands.size if $D13x[:ISPDS]
  293. @eqp_set_skills = Array.new
  294. end
  295. #-----------------------------------------------------------------------------
  296. # Get Added Value of Parameter
  297. #-----------------------------------------------------------------------------
  298. def param_plus(param_id)
  299. parpl_eqp_set(param_id) + @set_param[param_id]
  300. end
  301. if $D13x[:Stats_Control]
  302. #---------------------------------------------------------------------------
  303. # Get Added Value of x-Parameter
  304. #---------------------------------------------------------------------------
  305. def xparam_plus(xparam_id)
  306. xparpl_eqp_set(xparam_id) + @set_xparam[xparam_id]
  307. end
  308. #---------------------------------------------------------------------------
  309. # Get Added Value of s-Parameter
  310. #---------------------------------------------------------------------------
  311. def sparam_plus(sparam_id)
  312. sparpl_eqp_set(sparam_id) + @set_sparam[sparam_id]
  313. end
  314. end # if $D13x[:Stats_Control]
  315. if $D13x[:Elems_Control]
  316. #---------------------------------------------------------------------------
  317. # Get Added Value of def-Element
  318. #---------------------------------------------------------------------------
  319. def def_ele_plus(element_id)
  320. defele_eqp_set(element_id) + @set_def_ele[element_id]
  321. end
  322. #---------------------------------------------------------------------------
  323. # Get Added Value of atk-Element
  324. #---------------------------------------------------------------------------
  325. def atk_ele_plus(element_id)
  326. atkele_eqp_set(element_id) + @set_atk_ele[element_id]
  327. end
  328. end # if $D13x[:Elems_Control]
  329. if $D13x[:Atk_Def_Lvs]
  330. #---------------------------------------------------------------------------
  331. # Atk Lv | Def Lv ++
  332. #---------------------------------------------------------------------------
  333. def atl_dfl_plus(id)
  334. atl_dfl_sets_plus(id) + @set_atl_dfl[id]
  335. end
  336. end # if $D13x[:Atk_Def_Lvs]
  337. if $D13x[:ISPDS]
  338. #---------------------------------------------------------------------------
  339. # Get SPDS Stats Plus
  340. #---------------------------------------------------------------------------
  341. def spds_plus(id)
  342. spds_sets_plus(id) + @set_spds_stats[id]
  343. end
  344. end # if $D13x[:ISPDS]
  345. #-----------------------------------------------------------------------------
  346. # Get Skill Object Array
  347. #-----------------------------------------------------------------------------
  348. def skills
  349. skills_eqp_set + @eqp_set_skills.sort.collect { |id| $data_skills[id] }
  350. end
  351. #-----------------------------------------------------------------------------
  352. # Check Equip Set Data
  353. #-----------------------------------------------------------------------------
  354. def check_equip_set
  355. Equip_Set::ID.each do |pos_set|
  356. set_items = 0
  357. equips.each do |curr_eqp|
  358. next if curr_eqp == nil
  359. pos_set[1][:pieces].each do |piece|
  360. case piece[0]
  361. when :weapon
  362. next unless curr_eqp.is_a?(RPG::Weapon)
  363. next unless curr_eqp.database_id == piece[1]
  364. set_items += 1
  365. when :armor
  366. next unless curr_eqp.is_a?(RPG::Armor)
  367. next unless curr_eqp.database_id == piece[1]
  368. set_items += 1
  369. end
  370. end
  371. end
  372. pos_set[1][:bonuses].each do |k,i|
  373. check_set_bonuses(k,i,set_items)
  374. end
  375. end
  376. end
  377. #-----------------------------------------------------------------------------
  378. # Check Equip Set Bonuses
  379. #-----------------------------------------------------------------------------
  380. def check_set_bonuses(val,i,pieces)
  381. if val <= pieces
  382. case i[0]
  383. when :param then @set_param [i[1]] += i[2] if $D13x[:Stats_Control]
  384. when :x_param then @set_xparam [i[1]] += i[2] if $D13x[:Stats_Control]
  385. when :s_param then @set_sparam [i[1]] += i[2] if $D13x[:Stats_Control]
  386. when :atk_ele then @set_atk_ele[i[1]] += i[2] if $D13x[:Elems_Control]
  387. when :def_ele then @set_def_ele[i[1]] += i[2] if $D13x[:Elems_Control]
  388. when :atk_lvl then @set_atl_dfl[0] += i[1] if $D13x[:Atk_Def_Lvs]
  389. when :def_lvl then @set_atl_dfl[1] += i[1] if $D13x[:Atk_Def_Lvs]
  390. when :spds_stat then @set_spds_stats[i[1]] += i[2] if $D13x[:ISPDS]
  391. when :skill then @eqp_set_skills << i[1]
  392. end
  393. end
  394. end
  395. #-----------------------------------------------------------------------------
  396. # Has Full Equip Set On ?
  397. #-----------------------------------------------------------------------------
  398. def has_full_set?(set_id)
  399. pos_set = Equip_Set::ID[set_id]
  400. set_items = 0
  401. equips.each do |curr_eqp|
  402. next if curr_eqp == nil
  403. pos_set[:pieces].each do |piece|
  404. case piece[0]
  405. when :weapon
  406. next unless curr_eqp.is_a?(RPG::Weapon)
  407. next unless curr_eqp.database_id == piece[1]
  408. set_items += 1
  409. when :armor
  410. next unless curr_eqp.is_a?(RPG::Armor)
  411. next unless curr_eqp.database_id == piece[1]
  412. set_items += 1
  413. end
  414. end
  415. end
  416. return true if set_items == pos_set[:pieces].size
  417. return false
  418. end
  419.  
  420. end
  421.  
  422. #===============================================================================
  423. class Window_EquipSet < Window_Selectable
  424. #===============================================================================
  425. #--------------------------------------------------------------------------
  426. # Object Initialization
  427. #--------------------------------------------------------------------------
  428. def initialize(actor)
  429. super(0, Graphics.height/2-32, Graphics.width, Graphics.height/2+32)
  430. @actor = actor
  431. @drew = 0
  432. refresh
  433. end
  434. #--------------------------------------------------------------------------
  435. # Do Refresh
  436. #--------------------------------------------------------------------------
  437. def refresh
  438. contents.clear
  439. self.opacity = 0 if $D13x[:Status_Scene]
  440. return unless @actor
  441. if !General::Fonts.include?(self.contents.font.name)
  442. self.contents.font.name = General::Fonts
  443. end
  444. if self.contents.font.size != General::Font_Size
  445. self.contents.font.size = General::Font_Size
  446. end
  447. if self.contents.font.bold != General::Font_Bold
  448. self.contents.font.bold = General::Font_Bold
  449. end
  450. get_max_lines
  451. draw_set_info
  452. end
  453. #--------------------------------------------------------------------------
  454. # Draw Set Information
  455. #--------------------------------------------------------------------------
  456. def scroll_up
  457. return if @drew >= 0
  458. @drew += 1
  459. refresh
  460. end
  461. #--------------------------------------------------------------------------
  462. # Draw Set Information
  463. #--------------------------------------------------------------------------
  464. def scroll_down
  465. return if @drew <= -(@lines)
  466. @drew -= 1
  467. refresh
  468. end
  469. #-----------------------------------------------------------------------------
  470. # Get Max Lines ( to show )
  471. #-----------------------------------------------------------------------------
  472. def get_max_lines
  473. @lines = 0
  474. lines = 0
  475. @sets = []
  476. Equip_Set::ID.each do |pos_set|
  477. @actor.equips.each do |curr_eqp|
  478. next if curr_eqp == nil
  479. pos_set[1][:pieces].each do |piece|
  480. case piece[0]
  481. when :weapon
  482. next unless curr_eqp.is_a?(RPG::Weapon)
  483. next unless curr_eqp.database_id == piece[1]
  484. lines += 1
  485. @sets << pos_set unless @sets.include?(pos_set)
  486. when :armor
  487. next unless curr_eqp.is_a?(RPG::Armor)
  488. next unless curr_eqp.database_id == piece[1]
  489. lines += 1
  490. @sets << pos_set unless @sets.include?(pos_set)
  491. end
  492. end
  493. end
  494. end
  495. @lines = lines
  496. end
  497. #--------------------------------------------------------------------------
  498. # Draw Set Information
  499. #--------------------------------------------------------------------------
  500. def draw_set_info
  501. drew = @drew
  502. Equip_Set::ID.each do |pos_set|
  503. set_items = 0
  504. @actor.equips.each do |curr_eqp|
  505. next if curr_eqp == nil
  506. pos_set[1][:pieces].each do |piece|
  507. case piece[0]
  508. when :weapon
  509. next unless curr_eqp.is_a?(RPG::Weapon)
  510. next unless curr_eqp.database_id == piece[1]
  511. set_items += 1
  512. when :armor
  513. next unless curr_eqp.is_a?(RPG::Armor)
  514. next unless curr_eqp.database_id == piece[1]
  515. set_items += 1
  516. end
  517. end
  518. end
  519. if set_items > 0
  520. drew = (draw_set_name(pos_set[1],drew))
  521. draw_set_items(pos_set,drew)
  522. end
  523. drew = draw_set_dataa(drew, set_items)
  524. pos_set[1][:bonuses].each do |k,i|
  525. drew = draw_set_bonuses(k,i,set_items,drew)
  526. end
  527. drew += 2 if set_items > 1
  528. end
  529. end
  530. #-----------------------------------------------------------------------------
  531. # Draw Equip Set Data
  532. #-----------------------------------------------------------------------------
  533. def draw_set_dataa(drew, pieces)
  534. return drew if pieces < 2
  535. wid = Graphics.width/2-(standard_padding)
  536. txt = ""
  537. draw_text(wid, 0+(line_height*drew), wid, line_height, "Bonuses :")
  538. return drew
  539. end
  540. #--------------------------------------------------------------------------
  541. # Draw Set Name
  542. #--------------------------------------------------------------------------
  543. def draw_set_name(set,drew)
  544. draw_text(4, 0+(line_height*drew), 240, line_height, "Set Name :")
  545. icon = set[:set_icon]
  546. draw_de_icon(icon[0], 84, 0+(line_height*drew), icon[1], icon[2])
  547. text = set[:set_name]
  548. draw_text(108, 0+(line_height*drew), 240, line_height, text)
  549. wid = (Graphics.width)-(standard_padding)
  550. drew += 1
  551. draw_text(4, 0+(line_height*drew), 240, line_height, "Set Info :")
  552. text = set[:set_info]
  553. draw_text(84, 0+(line_height*drew), wid-84, line_height, text)
  554. return drew += 1
  555. end
  556. #-----------------------------------------------------------------------------
  557. # Draw Equip Set Items
  558. #-----------------------------------------------------------------------------
  559. def draw_set_items(pos_set, drew)
  560. change_color(Text_Color::White)
  561. draw_text(4, 0+(line_height*drew), 240, line_height, "Pieces :")
  562. @actor.equips.each do |curr_eqp|
  563. next if curr_eqp == nil
  564. pos_set[1][:pieces].each do |piece|
  565. case piece[0]
  566. when :weapon
  567. next unless curr_eqp.is_a?(RPG::Weapon)
  568. next unless curr_eqp.database_id == piece[1]
  569. wid = Graphics.width/2
  570. draw_de_icon(curr_eqp.icon_index, 84, 0+(line_height*drew), 0, true)
  571. change_color(curr_eqp.item_disp_color)
  572. draw_text(84+25, 0+(line_height*drew), wid, line_height, curr_eqp.name)
  573. drew += 1
  574. when :armor
  575. next unless curr_eqp.is_a?(RPG::Armor)
  576. next unless curr_eqp.database_id == piece[1]
  577. wid = Graphics.width/2
  578. draw_de_icon(curr_eqp.icon_index, 84, 0+(line_height*drew), 0, true)
  579. change_color(curr_eqp.item_disp_color)
  580. draw_text(25+84, 0+(line_height*drew), wid, line_height, curr_eqp.name)
  581. drew += 1
  582. end
  583. end
  584. end
  585. change_color(Text_Color::White)
  586. return drew
  587. end
  588. #-----------------------------------------------------------------------------
  589. # Draw Equip Set Bonuses
  590. #-----------------------------------------------------------------------------
  591. def draw_set_bonuses(val,i,pieces,drew)
  592. wid = Graphics.width/2-(standard_padding)
  593. if val <= pieces
  594. case i[0]
  595. when :param
  596. txt = "#{Vocab::param(i[1])}"
  597. num = i[2] > 0 ? "+#{i[2]}" : "#{i[2]}"
  598. when :x_param
  599. txt = "#{Vocab::x_param(i[1])}" if $D13x[:Stats_Control]
  600. num = i[2]>0.0 ?sprintf("+%1.2f%%",i[2]*100): sprintf("%1.2f%%",i[2]*100)
  601. when :s_param
  602. txt = "#{Vocab::s_param(i[1])}" if $D13x[:Stats_Control]
  603. num = i[2]>0.0 ?sprintf("+%1.2f%%",i[2]*100): sprintf("%1.2f%%",i[2]*100)
  604. when :atk_ele
  605. txt = "#{$data_system.elements[i[1]]} Dmg Deal" if $D13x[:Elems_Control]
  606. num = i[2]>0.0 ?sprintf("+%1.2f%%",i[2]*100): sprintf("%1.2f%%",i[2]*100)
  607. when :def_ele
  608. txt = "#{$data_system.elements[i[1]]} Dmg Took" if $D13x[:Elems_Control]
  609. num = i[2]>0.0 ?sprintf("+%1.2f%%",i[2]*100): sprintf("%1.2f%%",i[2]*100)
  610. when :atk_lev
  611. txt = Atl_Dfl::Atl_Name if $D13x[:Atk_Def_Lvs]
  612. num = i[1]>0 ?sprintf("+%s",i[1].to_i): sprintf("%s",i[1],to_i)
  613. when :def_lev
  614. txt = Atl_Dfl::Dfl_Name if $D13x[:Atk_Def_Lvs]
  615. num = i[1]>0 ?sprintf("+%s",i[1].to_i): sprintf("%s",i[1],to_i)
  616. when :spds_stat
  617. txt = @actor.spds_set[i[1]][:name] if $D13x[:ISPDS]
  618. num = i[2]>0 ?sprintf("+%s",i[2].to_i): sprintf("%s",i[2].to_i)
  619. when :skill
  620. txt = "Skill : #{$data_skills[i[1]].name}"
  621. num = ""
  622. icon = [$data_skills[i[1]].icon_index, 0, true]
  623. end
  624. if $D13x[:Status_Scene]
  625. Status_Scene::Info.each do |page|
  626. page.each do |info|
  627. info.each do |this|
  628. if (i[0] == this[0]) && (i[1] == this[1])
  629. icon = [this[3], this[4], true] unless icon
  630. end
  631. end rescue nil
  632. end
  633. end
  634. draw_de_icon(icon[0],wid+78,0+(line_height*drew),icon[1],icon[2]) if icon
  635. draw_text(wid+25+78, 0+(line_height*drew), wid, line_height, txt)
  636. draw_text(wid, 0+(line_height*drew), wid-12, line_height, num, 2)
  637. else
  638. draw_text(wid+78, 0+(line_height*drew), wid, line_height, txt)
  639. draw_text(wid, 0+(line_height*drew), wid-12, line_height, num, 2)
  640. end
  641. return drew += 1
  642. end
  643. return drew
  644. end
  645.  
  646. end
  647.  
  648. #===============================================================================
  649. class Scene_Status < Scene_MenuBase
  650. #===============================================================================
  651. #-----------------------------------------------------------------------------
  652. # Start Processing
  653. #-----------------------------------------------------------------------------
  654. alias :start_equip_set_status :start
  655. alias :oac_equip_set_status :on_actor_change
  656. alias :update_equip_set_status :update
  657. #-----------------------------------------------------------------------------
  658. # Start Processing
  659. #-----------------------------------------------------------------------------
  660. def start
  661. start_equip_set_status
  662. make_eqp_set_wind
  663. end
  664. #-----------------------------------------------------------------------------
  665. # Make Equip Set Window
  666. #-----------------------------------------------------------------------------
  667. def make_eqp_set_wind
  668. @eqp_set_window = Window_EquipSet.new(@actor)
  669. @eqp_set_window.set_handler(:cancel, method(:return_scene))
  670. @eqp_set_window.set_handler(:pagedown, method(:next_actor))
  671. @eqp_set_window.set_handler(:pageup, method(:prev_actor))
  672. @eqp_set_window.visible = false
  673. @eqp_set_window.close
  674. end
  675. #-----------------------------------------------------------------------------
  676. # Update
  677. #-----------------------------------------------------------------------------
  678. def update
  679. update_equip_set_status
  680. update_eqp_set
  681. end
  682. #-----------------------------------------------------------------------------
  683. # Update Equip Set
  684. #-----------------------------------------------------------------------------
  685. def update_eqp_set
  686. if Keys.trigger?(Keys::Key[Equip_Set::Keys[:show_sets]])
  687. if @eqp_set_window.active
  688. @eqp_set_window.deactivate
  689. @eqp_set_window.close
  690. @status_window.activate
  691. if @command_window
  692. @command_window.activate
  693. end
  694. if @status_window_II
  695. @status_window_II.open
  696. end
  697. else
  698. @status_window.deactivate
  699. @eqp_set_window.visible = true if @eqp_set_window.visible == false
  700. @eqp_set_window.activate
  701. @eqp_set_window.open
  702. if @command_window
  703. @command_window.deactivate
  704. end
  705. if @status_window_II
  706. @status_window_II.close
  707. end
  708. end
  709. end
  710. if @eqp_set_window.active
  711. if Keys.trigger?(Keys::Key[Equip_Set::Keys[:scroll_dn]])
  712. @eqp_set_window.scroll_down
  713. end
  714. if Keys.trigger?(Keys::Key[Equip_Set::Keys[:scroll_up]])
  715. @eqp_set_window.scroll_up
  716. end
  717. end
  718. end
  719. #--------------------------------------------------------------------------
  720. # Change Actors
  721. #--------------------------------------------------------------------------
  722. def on_actor_change
  723. oac_equip_set_status
  724. change_equip_wind_actor
  725. end
  726. #--------------------------------------------------------------------------
  727. # Change Actors ( Equip Window )
  728. #--------------------------------------------------------------------------
  729. def change_equip_wind_actor
  730. if @eqp_set_window.active
  731. @eqp_set_window.actor = @actor
  732. @eqp_set_window.refresh
  733. end
  734. end
  735.  
  736. end
  737.  
  738. #==============================================================================#
  739. # http://dekitarpg.wordpress.com/ #
  740. #==============================================================================#
  741. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement