Advertisement
Dekita

ses1.4

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