Advertisement
Dekita

Perfect Status Screen v1.4

Sep 21st, 2012
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.45 KB | None | 0 0
  1. =begin =========================================================================
  2. Dekita's v1.4
  3. ★ Perfect Status Screen™ ★
  4.  
  5. ===============================================================================
  6. ☆ Script Information:
  7. =======================
  8. This script will Display necessary information regarding an actors stats,
  9. parameters, "Vitality", "Strength", "Dexterity" and "Magic".
  10. Also displays elemental/state resistances and attack values.
  11.  
  12. NOTE: PAGEFOUR reffers to the fourth page of information i added, i have set it
  13. to display "PAGEFOUR" first, therefor PAGEFOUR = the first page you see on
  14. opening the status screen.
  15.  
  16. NOTE: THIS SCRIPT REQUIRES "Dekita's - Perfect Stat Point Distribution System"
  17.  
  18. ================================================================================
  19. ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  20. ================================================================================
  21. 1. You must give credit to "Dekita"
  22. 2. You are NOT allowed to repost this script.(or modified versions)
  23. 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
  24. 4. You are NOT allowed to use this script for Commercial games.
  25. 5. ENJOY!
  26.  
  27. "FINE PRINT"
  28. By using this script you hereby agree to the above terms and conditions,
  29. if any violation of the above terms occurs "legal action" may be taken.
  30. Not understanding the above terms and conditions does NOT mean that
  31. they do not apply to you.
  32. If you wish to discuss the terms and conditions in further detail you can
  33. contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
  34.  
  35. ===============================================================================
  36. ☆ History:
  37. ============
  38. D - M - Y
  39. 20/09/2o12 - Updated script,(v1.4)
  40. Optimized coding,
  41. fixed pvari script calls,
  42. 27/08/2o12 - Added controlable variable info.v1.3
  43. 21/08/2o12 - Finished.(v1.2)
  44. 14/08/2o12 - Started modification for Dekita - Elements and states distribution.
  45. 11/08/2o12 - released Script. (v1.01)
  46. - Spiced up some shit
  47. - Added "Page Three" (outbound element and status info)
  48. 08/08/2o12 - Released Script. (v1.0)
  49. 07/08/2o12 - started script.
  50.  
  51. ================================================================================
  52. ☆ INSTRUCTIONS:
  53. =================
  54. Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
  55. Place this script UNDER "Dekita - Perfect Stat Point Distribution System".
  56.  
  57. ===============================================================================
  58. ☆ Script Calls:
  59. =================
  60. Dont see why you would want to but you can use this script call to
  61. call the status screen.
  62.  
  63. SceneManager.call(Scene_Status)
  64.  
  65.  
  66. Use the script call below to change an actors "Perfect information"
  67. change[x] for the information number, actor_id to actors database number
  68. and inset your text between the inverted comma's > " "
  69.  
  70. pinfo[x](actor_id, " Text goes here ")
  71.  
  72. e.g
  73. pinfo1(1, "This is an example")
  74. pinfo2(1, "This is an example")
  75. pinfo3(1, "This is an example")
  76. pinfo4(1, "This is an example")
  77. pinfo5(1, "This is an example")
  78.  
  79.  
  80. use this script call to change an actors perfect variable, use these as you see
  81. fit, youcould do all sorts of things with them, e.g set a common event to run on
  82. an actors death, and use it as a death counter. whatever you want ^_^
  83.  
  84. pvari[x](actor_id, value)
  85.  
  86. e.g
  87. pvari1(1, 50)
  88. pvari2(1, 50)
  89. pvari3(1, 50)
  90. pvari4(1, 50)
  91.  
  92. ================================================================================
  93. =end
  94. $imported = {} if $imported.nil?
  95. $imported["DPB-PSS"] = true
  96. #===============================================================================
  97. # ☆ Perfect Status Screen Begin:
  98. #================================
  99. module DPB ; module PSS
  100.  
  101. COMMANDS =[
  102. [:pagefour, "IIII"],
  103. [:pageone, "I"],
  104. [:pagetwo, "II"],
  105. [:pagethree, "III"],
  106. ]#DO NOT REMOVE #######################
  107. # CUSTOMISATION BEGIN #
  108. #######################
  109. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  110. # ☆ Elements Row 1
  111. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  112. # You can control from here which elements are viewable in row 1
  113. # along with their icons.
  114. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  115.  
  116. ELEMENT_VOCAB = "Elements: (Inbound DMG)" # for incomming elemental damage
  117.  
  118. ATK_ELE_VOCAB = "(Attack DMG)" # for outgoing elemental damage
  119.  
  120. ELEMENTS_ROW1 = [3..10] # Elements shown. Maximum of 8 can be shown per row.
  121.  
  122. ELEMENT_ICONS_ROW1 ={ # Contains element icon information.
  123.  
  124. # Element ID => Icon,
  125. 3 => 96, # Fire
  126. 4 => 97, # Ice
  127. 5 => 98, # Thunder
  128. 6 => 99, # Water
  129. 7 => 100, # Earth
  130. 8 => 101, # Wind
  131. 9 => 102, # Holy
  132. 10 => 103, # Dark
  133.  
  134. } # Do not remove this.
  135.  
  136. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  137. # ☆ Elements Row 2
  138. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  139. # You can control from here whether you want to display a second row of
  140. # elemental data along with their icons.
  141. # Just set "SHOW_ELE_ROW_2" to "true" and change the Element ID and Icon
  142. # to suit your needs.
  143. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  144.  
  145. SHOW_ELE_ROW_2 = false # made for those who want more elements in their game :D
  146.  
  147. ELEMENTS_ROW2 = [10, 9, 8, 7, 6, 5, 4, 3] # Elements shown. Maximum of 8 can be shown per row.
  148.  
  149. ELEMENT_ICONS_ROW2 ={ # Contains element icon information.
  150. # Element ID => Icon,
  151.  
  152. 3 => 96, # Fire
  153. 4 => 97, # Ice
  154. 5 => 98, # Thunder
  155. 6 => 99, # Water
  156. 7 => 100, # Earth
  157. 8 => 101, # Wind
  158. 9 => 102, # Holy
  159. 10 => 103, # Dark
  160.  
  161. } # Do not remove this.
  162.  
  163.  
  164. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  165. # ☆ States Row 1
  166. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  167. # You can control from here what states are shown in row 1.
  168. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  169.  
  170. STATUS_VOCAB = "Status: (Inbound hit rate)" # for imcomming status effects
  171.  
  172. ATK_STATUS_VOCAB = "(Attack hit rate)" # for outgoing status effects
  173.  
  174. STATES_ROW_1 = [1..8] # States shown. Maximum of 8 can be shown.
  175.  
  176. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  177. # ☆ States Row 2
  178. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  179. # You can control from here what states are shown in row 2.
  180. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  181.  
  182. STATES_ROW_2 = [12..19] # States shown. Maximum of 8 can be shown.
  183.  
  184. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  185. # ☆ Main Actor Info
  186. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  187. # You can control from here what info is shown on the main page.
  188. # You can rearrange these in any order you like :D
  189. # as well as rename them to anything you want
  190. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  191.  
  192. INFO1and2LH = 5.5 # line height for PAGEFOUR_INFO 1 and 2
  193.  
  194. PAGEFOUR_INFO1 =[
  195.  
  196. [:pname, "Name:"],
  197. [:pnickname,"Nickname:"],
  198. [:plvlupexp,"Next Lv Exp:"],
  199. #[:pvari1, "variable1:"],
  200. #[:pvari3, "variable3:"],
  201.  
  202. ] # Do not remove this.
  203.  
  204. PAGEFOUR_INFO2 =[
  205.  
  206. [:plevel, "Level:"],
  207. [:pclass, "Class:"],
  208. [:pexp, "Total Exp:"],
  209. #[:pvari2, "variable2:"],
  210. #[:pvari4, "variable4:"],
  211.  
  212. ] # Do not remove this.
  213.  
  214. INFO3LH = 8.5 # line height for PAGEFOUR_INFO 3
  215.  
  216. PAGEFOUR_INFO3 =[
  217.  
  218. [:pinfo1, "Hometown:"],
  219. [:pinfo2, "Personality:"],
  220. [:pinfo3, "Favourate Food:"],
  221. [:pinfo4, "Favourate Quote"],
  222. [:pinfo5, "Relationship Status:"],
  223.  
  224. ] # Do not remove this. #####################
  225. # CUSTOMISATION END #
  226. #####################
  227. #===============================================================================#
  228. # http://dekitarpg.wordpress.com/ #
  229. #===============================================================================#
  230. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  231. # YES?\.\. #
  232. # OMG, REALLY? #
  233. # WELL SLAP MY FACE AND CALL ME A DRAGON.\..\.. #
  234. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  235. #===============================================================================#
  236. # - SCRIPT BEGIN - #
  237. #===============================================================================#
  238.  
  239. unless $imported["DPB-PSPDS"]
  240. msg = "The script ''%s'' requires ''Dekita - Perfect Stat Point Distribution System'' in order to function properly. It must also be placed below it!"
  241. script = "Dekita - Perfect Status Screen"
  242. msgbox(sprintf(msg, script))
  243. exit
  244. end
  245.  
  246. module_function
  247. def convert_integer_array(array)
  248. result = []
  249. array.each { |i|
  250. case i
  251. when Range; result |= i.to_a
  252. when Integer; result |= [i]
  253. end }
  254. return result
  255. end
  256.  
  257. ELEMENTS_ROW1 = convert_integer_array(ELEMENTS_ROW1)
  258. ELEMENTS_ROW2 = convert_integer_array(ELEMENTS_ROW2)
  259. STATES_ROW_1 = convert_integer_array(STATES_ROW_1)
  260. STATES_ROW_2 = convert_integer_array(STATES_ROW_2)
  261.  
  262. end # PSS
  263. end #DPB
  264.  
  265. #==============================================================================
  266. module Icon
  267. #==============================================================================
  268.  
  269. def self.element(id)
  270. return 0 unless DPB::PSS::ELEMENT_ICONS_ROW1.include?(id)
  271. return DPB::PSS::ELEMENT_ICONS_ROW1[id]
  272. end
  273.  
  274. end # Icon
  275.  
  276. #==============================================================================
  277. class Game_BattlerBase
  278. #==============================================================================
  279.  
  280. def atk_element_rate(element_id)
  281. features_sum(FEATURE_ATK_ELEMENT, element_id)
  282. end
  283.  
  284. end # Game_BattlerBase
  285.  
  286. #==============================================================================
  287. class Game_Actor < Game_Battler
  288. #==============================================================================
  289.  
  290. attr_reader :perfectinfo1
  291. attr_reader :perfectinfo2
  292. attr_reader :perfectinfo3
  293. attr_reader :perfectinfo4
  294. attr_reader :perfectinfo5
  295. attr_reader :perfectvari1
  296. attr_reader :perfectvari2
  297. attr_reader :perfectvari3
  298. attr_reader :perfectvari4
  299.  
  300. alias change_pinfo initialize
  301. def initialize(actor_id)
  302. change_pinfo(actor_id)
  303. @perfectinfo1 = "pinfo1"
  304. @perfectinfo2 = "pinfo2"
  305. @perfectinfo3 = "pinfo3"
  306. @perfectinfo4 = "pinfo4"
  307. @perfectinfo5 = "pinfo5"
  308. @perfectvari1 = 0
  309. @perfectvari2 = 0
  310. @perfectvari3 = 0
  311. @perfectvari4 = 0
  312. end
  313.  
  314. def change_pinfo1(text)
  315. @perfectinfo1 = text
  316. end
  317.  
  318. def change_pinfo2(text)
  319. @perfectinfo2 = text
  320. end
  321.  
  322. def change_pinfo3(text)
  323. @perfectinfo3 = text
  324. end
  325.  
  326. def change_pinfo4(text)
  327. @perfectinfo4 = text
  328. end
  329.  
  330. def change_pinfo5(text)
  331. @perfectinfo5 = text
  332. end
  333.  
  334. def change_pvari1(value)
  335. @perfectvari1 = value
  336. end
  337.  
  338. def change_pvari2(value)
  339. @perfectvari2 = value
  340. end
  341.  
  342. def change_pvari3(value)
  343. @perfectvari3 = value
  344. end
  345.  
  346. def change_pvari4(value)
  347. @perfectvari4 = value
  348. end
  349.  
  350. end # Game_Actor
  351.  
  352. #==============================================================================
  353. class Game_Interpreter
  354. #==============================================================================
  355.  
  356. def pinfo1(actor_id, text)
  357. actor = $game_actors[actor_id]
  358. return if actor == nil
  359. actor.change_pinfo1(text)
  360. end
  361.  
  362. def pinfo2(actor_id, text)
  363. actor = $game_actors[actor_id]
  364. return if actor == nil
  365. actor.change_pinfo2(text)
  366. end
  367.  
  368. def pinfo3(actor_id, text)
  369. actor = $game_actors[actor_id]
  370. return if actor == nil
  371. actor.change_pinfo3(text)
  372. end
  373.  
  374. def pinfo4(actor_id, text)
  375. actor = $game_actors[actor_id]
  376. return if actor == nil
  377. actor.change_pinfo4(text)
  378. end
  379.  
  380. def pinfo5(actor_id, text)
  381. actor = $game_actors[actor_id]
  382. return if actor == nil
  383. actor.change_pinfo5(text)
  384. end
  385.  
  386. def pvari1(actor_id, value)
  387. actor = $game_actors[actor_id]
  388. return if actor == nil
  389. actor.change_pvari1(value)
  390. end
  391.  
  392. def pvari2(actor_id, value)
  393. actor = $game_actors[actor_id]
  394. return if actor == nil
  395. actor.change_pvari2(value)
  396. end
  397.  
  398. def pvari3(actor_id, value)
  399. actor = $game_actors[actor_id]
  400. return if actor == nil
  401. actor.change_pvari3(value)
  402. end
  403.  
  404. def pvari4(actor_id, value)
  405. actor = $game_actors[actor_id]
  406. return if actor == nil
  407. actor.change_pvari4(value)
  408. end
  409.  
  410. end # class Game_Inperpreter
  411.  
  412. #==============================================================================
  413. class Game_Temp
  414. #==============================================================================
  415.  
  416. attr_accessor :scene_status_index
  417. attr_accessor :scene_status_oy
  418.  
  419. end # Game_Temp
  420.  
  421. #==============================================================================
  422. class Window_StatusCommand < Window_Command
  423. #==============================================================================
  424.  
  425. attr_accessor :item_window
  426.  
  427. def initialize(dx, dy)
  428. super(dx, dy)
  429. @actor = nil
  430. self.opacity = 0
  431. end
  432.  
  433. def window_width; return 0; end
  434.  
  435. def actor=(actor)
  436. return if @actor == actor
  437. @actor = actor
  438. refresh
  439. end
  440.  
  441. def visible_line_number; return 4; end
  442.  
  443. def ok_enabled?
  444. return handle?(current_symbol)
  445. end
  446.  
  447. def make_command_list
  448. return unless @actor
  449. for command in DPB::PSS::COMMANDS
  450. case command[0]
  451. when :pageone, :pagetwo, :pagethree, :pagefour
  452. add_command(command[1], command[0])
  453. else
  454. end
  455. end
  456. if !$game_temp.scene_status_index.nil?
  457. select($game_temp.scene_status_index)
  458. self.oy = $game_temp.scene_status_oy
  459. end
  460. $game_temp.scene_status_index = nil
  461. $game_temp.scene_status_oy = nil
  462. end
  463.  
  464. def process_ok
  465. $game_temp.scene_status_index = index
  466. $game_temp.scene_status_oy = self.oy
  467. super
  468. end
  469.  
  470. def update
  471. super
  472. update_item_window
  473. end
  474.  
  475. def update_item_window
  476. return if @item_window.nil?
  477. return if @current_index == current_symbol
  478. @current_index = current_symbol
  479. @item_window.refresh
  480. end
  481.  
  482. def item_window=(window)
  483. @item_window = window
  484. update
  485. end
  486.  
  487. def update_help
  488. return if @actor.nil?
  489. @help_window.set_text(@actor.actor.description)
  490. end
  491.  
  492. end # Window_StatusCommand
  493.  
  494. #==============================================================================
  495. class Window_StatusItem < Window_Base
  496. #==============================================================================
  497.  
  498. def initialize(dx, dy, command_window)
  499. super(dx, dy, Graphics.width, Graphics.height - dy)
  500. @command_window = command_window
  501. @actor = nil
  502. refresh
  503. end
  504.  
  505. def actor=(actor)
  506. return if @actor == actor
  507. @actor = actor
  508. refresh
  509. end
  510.  
  511. def refresh
  512. contents.clear
  513. reset_font_settings
  514. return unless @actor
  515. draw_window_contents
  516. end
  517.  
  518. def draw_window_contents
  519. case @command_window.current_symbol
  520. when :pageone
  521. draw_block1(line_height * 1)
  522. draw_block2(line_height * 1)
  523. draw_block4(line_height * 14)
  524. draw_page_one(0, 0)
  525. when :pagetwo
  526. draw_block1(line_height * 1)
  527. draw_block2(line_height * 1)
  528. draw_block4(line_height * 14)
  529. draw_page_two(0, 0)
  530. when :pagethree
  531. draw_block1(line_height * 1)
  532. draw_block2(line_height * 1)
  533. draw_block4(line_height * 14)
  534. draw_page_three(0, 0)
  535. when :pagefour
  536. draw_block1(line_height * 1)
  537. draw_block2(line_height * 1)
  538. draw_block3(line_height * 7)
  539. draw_block4(line_height * 14)
  540. draw_page_four(0, 0)
  541. else
  542. end
  543. end
  544.  
  545. def draw_block1(y)
  546. draw_actor_face(@actor, (window_width - 24) / 2.5, 0)
  547. if DPB::PSPDS::DRAW_ACTOR_GRAPHIC
  548. draw_actor_graphic(@actor, DPB::PSPDS::DAG_X, DPB::PSPDS::DAG_Y)#, 50)
  549. else
  550. end
  551. end
  552.  
  553. def draw_block2(y)
  554. draw_basic_info(136, y)
  555. end
  556.  
  557. def draw_block3(y)
  558. draw_equipments((window_width + 24) / 2 * 1, line_height * 6)
  559. end
  560.  
  561. def draw_block4(y)
  562. draw_description(4, y)
  563. end
  564.  
  565. def draw_horz_line(y)
  566. line_y = y + line_height / 2 - 1
  567. contents.fill_rect(0, line_y, contents_width, 2, line_color)
  568. end
  569.  
  570. def line_color
  571. color = normal_color
  572. color.alpha = 48
  573. color
  574. end
  575.  
  576. def draw_basic_info(x, y)
  577. draw_actor_icons(@actor, (window_width - 24) / 2.5, y + line_height * 3)
  578. contents.font.size = DPB::PSPDS::PROPFONTSIZE
  579. draw_new_stats_column
  580. draw_points_column
  581. end
  582.  
  583. def draw_page_one(x, y)
  584. contents.font.size = DPB::PSPDS::FONTSIZE
  585. if DPB::PSPDS::DRAW_PARAM_GAUGES
  586. draw_parameter_graph
  587. if DPB::PSPDS::DRAW_ALL_COLUMNS
  588. draw_actor_hp(@actor, 5, y+106 + line_height * 1,(window_width - 24) / 4 - 12)
  589. draw_actor_mp(@actor, 5, y+106 + line_height * 2,(window_width - 24) / 4 - 12)
  590. else
  591. draw_actor_hp(@actor, 5, y+106 + line_height * 1,(window_width - 24) / 3 - 24)
  592. draw_actor_mp(@actor, 5, y+106 + line_height * 2,(window_width - 24) / 3 - 24)
  593. end
  594. else
  595. draw_properties_paramcolumn
  596. end
  597. contents.font.size = DPB::PSPDS::PROPFONTSIZE
  598. draw_horz_line(line_height * 4)
  599. draw_horz_line(Graphics.height - line_height * 4)
  600. draw_properties_column1
  601. draw_properties_column2
  602. if DPB::PSPDS::DRAW_ALL_COLUMNS
  603. draw_properties_column3
  604. end
  605. reset_font_settings
  606. end
  607.  
  608. def draw_page_two(x, y)
  609. contents.font.size = DPB::PSPDS::PROPFONTSIZE
  610. draw_horz_line(line_height * 4)
  611. draw_elements
  612. draw_atk_elements
  613. if DPB::PSS::SHOW_ELE_ROW_2
  614. draw_elements_row2
  615. draw_atk_elements_row2
  616. end
  617. draw_horz_line(Graphics.height - line_height * 4)
  618. reset_font_settings
  619. end
  620.  
  621. def draw_page_three(x, y)
  622. contents.font.size = DPB::PSPDS::PROPFONTSIZE
  623. draw_horz_line(line_height * 4)
  624. draw_states
  625. draw_states_row_2
  626. draw_atk_states
  627. draw_atk_states_row_2
  628. draw_horz_line(Graphics.height - line_height * 4)
  629. reset_font_settings
  630. end
  631.  
  632. def draw_page_four(x, y)
  633. contents.font.size = DPB::PSPDS::PROPFONTSIZE
  634. draw_horz_line(line_height * 4)
  635. draw_pagefour_info1
  636. draw_pagefour_info2
  637. draw_pagefour_info3
  638. draw_horz_line(Graphics.height - line_height * 4)
  639. reset_font_settings
  640. end
  641.  
  642. def draw_pagefour_info1
  643. dx = 5
  644. dw = (window_width - 24) / 4
  645. dy = line_height * DPB::PSS::INFO1and2LH
  646. for info in DPB::PSS::PAGEFOUR_INFO1
  647. dy = draw_info(info, dx, dy, dw)
  648. end
  649. end
  650.  
  651. def draw_pagefour_info2
  652. dx = 5 + (window_width - 24) / 4
  653. dw = (window_width - 24) / 4
  654. dy = line_height * DPB::PSS::INFO1and2LH
  655. for info in DPB::PSS::PAGEFOUR_INFO2
  656. dy = draw_info(info, dx, dy, dw)
  657. end
  658. end
  659.  
  660. def draw_pagefour_info3
  661. dx = 5
  662. dw = (window_width - 24) / 2
  663. dy = line_height * DPB::PSS::INFO3LH
  664. for info in DPB::PSS::PAGEFOUR_INFO3
  665. dy = draw_info(info, dx, dy, dw)
  666. end
  667. end
  668.  
  669. def draw_info(info, dx, dy, dw)
  670. case info[0]
  671. when :pname
  672. text = @actor.name
  673. when :pnickname
  674. text = @actor.nickname
  675. when :plevel
  676. text = @actor.level
  677. when :pclass
  678. text = @actor.class.name
  679. when :pexp
  680. text = @actor.exp
  681. when :plvlupexp
  682. text = @actor.max_level? ? "----" : @actor.next_level_exp - @actor.exp
  683. when :pinfo1
  684. text = @actor.perfectinfo1
  685. when :pinfo2
  686. text = @actor.perfectinfo2
  687. when :pinfo3
  688. text = @actor.perfectinfo3
  689. when :pinfo4
  690. text = @actor.perfectinfo4
  691. when :pinfo5
  692. text = @actor.perfectinfo5
  693. when :pvari1
  694. text = @actor.perfectvari1
  695. when :pvari2
  696. text = @actor.perfectvari2
  697. when :pvari3
  698. text = @actor.perfectvari3
  699. when :pvari4
  700. text = @actor.perfectvari4
  701. else ; return dy
  702. end
  703. colour = Color.new(0, 0, 0, translucent_alpha/2)
  704. rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  705. contents.fill_rect(rect, colour)
  706. change_color(system_color)
  707. draw_text(dx+4, dy, dw-8, line_height, info[1], 0)
  708. change_color(normal_color)
  709. draw_text(dx+4, dy, dw-8, line_height, text, 2)
  710. return dy + line_height
  711. end
  712.  
  713. def draw_parameters(x, y)
  714. 6.times {|i| draw_actor_param(@actor, x, y + line_height * i, i + 2) }
  715. end
  716.  
  717. def draw_equipments(x, y)
  718. @actor.equips.each_with_index do |item, i|
  719. draw_item_name(item, x, y + line_height * i)
  720. end
  721. end
  722.  
  723. def draw_description(x, y)
  724. draw_text_ex(x, y, @actor.description)
  725. end
  726.  
  727. def draw_elements
  728. dx = 0
  729. dy = 130
  730. contents.font.size = DPB::PSPDS::FONTSIZE
  731. if DPB::PSS::SHOW_ELE_ROW_2
  732. draw_text((window_width - 24) / 3 * 0, line_height * 4.6, contents.width, line_height, DPB::PSS::ELEMENT_VOCAB)
  733. else
  734. draw_text((window_width - 24) / 3 * 0 + 12, line_height * 4.6, contents.width, line_height, DPB::PSS::ELEMENT_VOCAB)
  735. end
  736. for ele_id in DPB::PSS::ELEMENTS_ROW1
  737. if DPB::PSS::SHOW_ELE_ROW_2
  738. draw_element_info(ele_id, (window_width - 0) / 4 * 0, dy)
  739. dx = dx == 1 ? contents.width / 4 : 0
  740. else
  741. draw_element_info(ele_id, (window_width- 24) / 6 * 1, dy)
  742. dx = dx == 1 ? contents.width / 3 : 0
  743. end
  744. dy += dx == 0 ? line_height : 0
  745. end
  746. end
  747.  
  748. def draw_elements_row2
  749. dx = 0
  750. dy = 130
  751. contents.font.size = DPB::PSPDS::FONTSIZE
  752. for ele_id in DPB::PSS::ELEMENTS_ROW2
  753. draw_element_info(ele_id, (window_width - 12) / 4 * 1, dy)
  754. dx = dx == 1 ? contents.width / 4 : 0
  755. dy += dx == 0 ? line_height : 0
  756. end
  757. end
  758.  
  759. def draw_atk_elements
  760. dx = 0
  761. dy = 130
  762. contents.font.size = DPB::PSPDS::FONTSIZE
  763. draw_text((window_width - 24) / 4 * 2, line_height * 4.6, contents.width, line_height, DPB::PSS::ATK_ELE_VOCAB)
  764. for ele_id in DPB::PSS::ELEMENTS_ROW1
  765. if DPB::PSS::SHOW_ELE_ROW_2
  766. draw_atk_element_info(ele_id, (window_width - 12) / 4 * 2, dy)
  767. dx = dx == 1 ? contents.width / 4 : 0
  768. else
  769. draw_atk_element_info(ele_id, (window_width - 24) / 6 * 3, dy)
  770. dx = dx == 1 ? contents.width / 3 : 0
  771. end
  772. dy += dx == 0 ? line_height : 0
  773. end
  774. end
  775.  
  776. def draw_atk_elements_row2
  777. dx = 0
  778. dy = 130
  779. contents.font.size = DPB::PSPDS::FONTSIZE
  780. for ele_id in DPB::PSS::ELEMENTS_ROW2
  781. draw_atk_element_info(ele_id, (window_width - 8) / 4 * 3, dy)
  782. dx = dx == 1 ? contents.width / 4 : 0
  783. dy += dx == 0 ? line_height : 0
  784. end
  785. end
  786.  
  787. def draw_states
  788. dx = 0
  789. dy = 130
  790. contents.font.size = DPB::PSPDS::FONTSIZE
  791. draw_text((window_width - 24) / 4 * 0 , line_height * 4.6, contents.width, line_height, DPB::PSS::STATUS_VOCAB)
  792. contents.font.size = 16
  793. for state_id in DPB::PSS::STATES_ROW_1
  794. draw_state_info(state_id, (window_width - 0) / 4 * 0 , dy)
  795. dx = dx == 1 ? contents.width / 3 : 0
  796. dy += dx == 0 ? line_height : 0
  797. end
  798. end
  799.  
  800. def draw_states_row_2
  801. dx = 0
  802. dy = 130
  803. contents.font.size = DPB::PSPDS::FONTSIZE
  804. for state_id in DPB::PSS::STATES_ROW_2
  805. draw_state_info(state_id, (window_width - 12) / 4 * 1 , dy)
  806. dx = dx == 1 ? contents.width / 3 : 0
  807. dy += dx == 0 ? line_height : 0
  808. end
  809. end
  810.  
  811. def draw_atk_states
  812. dx = 0
  813. dy = 130
  814. contents.font.size = DPB::PSPDS::FONTSIZE
  815. draw_text((window_width - 24) / 4 * 2 + 8, line_height * 4.6, contents.width, line_height, DPB::PSS::ATK_STATUS_VOCAB)
  816. contents.font.size = 16
  817. for state_id in DPB::PSS::STATES_ROW_1
  818. draw_atk_state_info(state_id, (window_width - 12) / 4 * 2 , dy)
  819. dx = dx == 1 ? contents.width / 3 : 0
  820. dy += dx == 0 ? line_height : 0
  821. end
  822. end
  823.  
  824. def draw_atk_states_row_2
  825. dx = 0
  826. dy = 130
  827. contents.font.size = DPB::PSPDS::FONTSIZE
  828. for state_id in DPB::PSS::STATES_ROW_2
  829. draw_atk_state_info(state_id, (window_width - 8) / 4 * 3 , dy)
  830. dx = dx == 1 ? contents.width / 3 : 0
  831. dy += dx == 0 ? line_height : 0
  832. end
  833. end
  834.  
  835. def draw_element_info(ele_id, dx, dy)
  836. if DPB::PSS::SHOW_ELE_ROW_2
  837. dw = (contents.width - 24) / 4.2
  838. else
  839. dw = (contents.width - 24) / 3
  840. end
  841. colour = Color.new(0, 0, 0, translucent_alpha/2)
  842. rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  843. contents.fill_rect(rect, colour)
  844. draw_icon(Icon.element(ele_id), dx, dy)
  845. change_color(system_color)
  846. draw_text(dx+24, dy, dw-24, line_height, $data_system.elements[ele_id])
  847. change_color(normal_color)
  848. text = sprintf("%d%%", (@actor.element_rate(ele_id) * 100).to_i)
  849. draw_text(dx+4, dy, dw-8, line_height, text, 2)
  850. end
  851.  
  852. def draw_atk_element_info(ele_id, dx, dy)
  853. if DPB::PSS::SHOW_ELE_ROW_2
  854. dw = (contents.width - 24) / 4.2
  855. else
  856. dw = (contents.width - 24) / 3
  857. end
  858. colour = Color.new(0, 0, 0, translucent_alpha/2)
  859. rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  860. contents.fill_rect(rect, colour)
  861. draw_icon(Icon.element(ele_id), dx, dy)
  862. change_color(system_color)
  863. draw_text(dx+24, dy, dw-24, line_height, $data_system.elements[ele_id])
  864. change_color(normal_color)
  865. text = sprintf("%d%%", (@actor.atk_element_rate(ele_id) * 100).to_i)
  866. draw_text(dx+4, dy, dw-8, line_height, text, 2)
  867. end
  868.  
  869. def draw_state_info(state_id, dx, dy)
  870. dw = (contents.width - 24) / 4.2
  871. colour = Color.new(0, 0, 0, translucent_alpha/2)
  872. rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  873. contents.fill_rect(rect, colour)
  874. draw_icon($data_states[state_id].icon_index, dx, dy)
  875. change_color(system_color)
  876. draw_text(dx+24, dy, dw-24, line_height, $data_states[state_id].name)
  877. change_color(normal_color)
  878. text = sprintf("%d%%", (@actor.state_rate(state_id) * 100).to_i)
  879. draw_text(dx+4, dy, dw-8, line_height, text, 2)
  880. end
  881.  
  882. def draw_atk_state_info(state_id, dx, dy)
  883. dw = (contents.width - 24) / 4.2
  884. colour = Color.new(0, 0, 0, translucent_alpha/2)
  885. rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  886. contents.fill_rect(rect, colour)
  887. draw_icon($data_states[state_id].icon_index, dx, dy)
  888. change_color(system_color)
  889. draw_text(dx+24, dy, dw-24, line_height, $data_states[state_id].name)
  890. change_color(normal_color)
  891. text = sprintf("%d%%", (@actor.atk_states_rate(state_id) * 100).to_i)
  892. draw_text(dx+4, dy, dw-8, line_height, text, 2)
  893. end
  894.  
  895. def window_width
  896. Graphics.width - 0
  897. end
  898.  
  899. def window_height
  900. Graphics.height - 0
  901. end
  902.  
  903. end #WindowStatusItem
  904.  
  905. #==============================================================================
  906. class Scene_Status < Scene_MenuBase
  907. #==============================================================================
  908.  
  909. def start
  910. super
  911. create_status_window
  912. create_command_window
  913. create_item_window
  914. end
  915.  
  916. def create_command_window
  917. wy = 0
  918. @command_window = Window_StatusCommand.new(0, wy)
  919. @command_window.viewport = @viewport
  920. @command_window.actor = @actor
  921. @command_window.help_window = @help_window
  922. @command_window.set_handler(:cancel, method(:return_scene))
  923. @command_window.set_handler(:pagedown, method(:next_actor))
  924. @command_window.set_handler(:pageup, method(:prev_actor))
  925. @command_window.set_handler(:pageone, method(:command_pageone))
  926. @command_window.set_handler(:pagetwo, method(:command_pagetwo))
  927. @command_window.set_handler(:pagethree, method(:command_pagethree))
  928. @command_window.set_handler(:pagefour, method(:command_pagefour))
  929. end
  930.  
  931. def create_status_window
  932. wy = 0
  933. end
  934.  
  935. def create_item_window
  936. dy = 0
  937. @item_window = Window_StatusItem.new(0, dy, @command_window)
  938. @item_window.viewport = @viewport
  939. @item_window.actor = @actor
  940. @command_window.item_window = @item_window
  941. end
  942.  
  943. def on_actor_change
  944. @command_window.actor = @actor
  945. @item_window.actor = @actor
  946. @command_window.activate
  947. end
  948.  
  949. def command_pageone
  950. SceneManager.call(Scene_Level_Up)
  951. end
  952.  
  953. def command_pagetwo
  954. unless $imported["DPB-ADDESC"]
  955. @command_window.activate
  956. return
  957. end
  958. SceneManager.call(Scene_Element_Up)
  959. end
  960.  
  961. def command_pagethree
  962. unless $imported["DPB-ADDSTC"]
  963. @command_window.activate
  964. return
  965. end
  966. SceneManager.call(Scene_State_Up)
  967. end
  968.  
  969. def command_pagefour
  970. SceneManager.call(Scene_Equip)
  971. end
  972.  
  973. end # Scene_Status
  974.  
  975. #===============================================================================#
  976. # - SCRIPT END - #
  977. #===============================================================================#
  978. # http://dekitarpg.wordpress.com/ #
  979. #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement