Advertisement
Dekita

PSSv1.3

Aug 29th, 2012
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 51.72 KB | None | 0 0
  1. #Dekita's=======================================================================
  2. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  3. #===============================================================================
  4. #                                                                          v1.3
  5. #                          ★ Perfect Status Screen™ ★
  6. #
  7. #===============================================================================
  8. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  9. #===============================================================================
  10. #
  11. # -- Last updated: 21/08/2o12 <-(D/M/Y)
  12. #
  13. # -- Difficulty: Plug'n'play - (Easy)
  14. #
  15. # -- Customisation: Like a pimped out ride! - (Very Low)
  16. #
  17. # -- Requires: Dekita's - Perfect Stat Point Distribution System v1.1+
  18. #
  19. # -- Recommended: N/A
  20. #
  21. # -- Compatable:  RPG Maker VX Ace ONLY!
  22. #                 Yanfly Skills Cost Manager v1.03+
  23. #                 Yanfly Engine Ace - Skill Restrictions v1.02+
  24. #                
  25. #===============================================================================
  26. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  27. #===============================================================================
  28. #===============================================================================
  29. # ☆ Script Information:
  30. #=======================
  31. # This script will Display necessary information regarding an actors stats,
  32. # parameters, "Vitality", "Strength", "Dexterity" and "Magic".
  33. # Also displays elemental/state resistances and attack values.
  34. #
  35. # NOTE: PAGEFOUR reffers to the fourth page of information i added, i have set it
  36. # to display "PAGEFOUR" first, therefor PAGEFOUR = the first page you see on
  37. # opening the status screen.
  38. #===============================================================================
  39. #===============================================================================
  40. # ☆ TERMS OF USE:
  41. #===============================================================================
  42. #
  43. # 1. You must give credit to Dekita.
  44. #
  45. # 2. This script is for NON-Commercial use ONLY!*
  46. #
  47. # 3. You CANNOT give credit to yourself for Re-posting this script
  48. #    or Posting a modified version.*
  49. #
  50. # 4. Do not Re-Distribute this script.
  51. #
  52. # 5. You are NOT allowed to convert this script to any other engine,
  53. #    E.G converting it from RGSS3 into RGSS2.*
  54. #
  55. # 6. ENJOY!
  56. #
  57. #-------------------------------------------------------------------------------
  58. # * = Unless permissions are given by Dekita. < e-mail DekitaRPG@gmail.com
  59. #===============================================================================
  60. #===============================================================================
  61. # ☆ History:
  62. #============
  63. # D - M - Y
  64. # 27/08/2o12 - Added controlable variable info.
  65. # 21/08/2o12 - Finished.(v1.2)
  66. # 14/08/2o12 - Started modification for Dekita - Elements and states distribution.
  67. # 11/08/2o12 - released Script. (v1.01)
  68. #            - Spiced up some shit
  69. #            - Added "Page Three" (outbound element and status info)
  70. # 08/08/2o12 - Released Script. (v1.0)
  71. # 07/08/2o12 - started script.
  72. #-------------------------------------------------------------------------------
  73. #===============================================================================
  74. # ☆ Thanks to :
  75. #===============
  76. # N/A
  77. #
  78. #===============================================================================
  79. #===============================================================================
  80. # ☆ Foresight Into The Future:
  81. #==============================
  82. # Hmmm....
  83. #
  84. #-------------------------------------------------------------------------------
  85. # If you have any ideas e-mail me at DekitaRPG@gmail.com
  86. #===============================================================================
  87. #===============================================================================
  88. # ☆ Known Bugs:
  89. #=================
  90. # N/A
  91. #
  92. #===============================================================================
  93. #===============================================================================
  94. # ☆ INSTRUCTIONS:
  95. #=================
  96. # Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
  97. # Place this script UNDER "Dekita - Perfect Stat Point Distribution System".
  98. #
  99. #===============================================================================
  100. =begin
  101. #===============================================================================
  102. # ☆ Script Calls:
  103. #=================
  104. # Dont see why you would want to but you can use this script call to
  105. # call the status screen.
  106.  
  107. SceneManager.call(Scene_Status)
  108.  
  109. #
  110. # Use the script call below to change an actors "Perfect information"
  111. # change[x] for the information number, actor_id toactors database number
  112. # and inset your text between the inverted comma's > " "
  113.  
  114. pinfo[x](actor_id, " Text goes here ")
  115.  
  116. # e.g
  117. # pinfo1(1, "This is an example")
  118. # pinfo2(1, "This is an example")
  119. # pinfo3(1, "This is an example")
  120. # pinfo4(1, "This is an example")
  121. # pinfo5(1, "This is an example")
  122. # use this script call to change an actors perfect variable, use these as you see
  123. # fit, youcould do all sorts of things with them, e.g set a common event to run on
  124. # an actors death, and use it as a death counter. whatever you want ^_^
  125.  
  126. pvari[x](actor_id, value)
  127.  
  128. # e.g
  129. # pvari1(1, 50)
  130. # pvari2(1, 50)
  131. # pvari3(1, 50)
  132. # pvari4(1, 50)
  133. #
  134. #===============================================================================
  135. =end
  136. #===============================================================================
  137. # ☆ Import:
  138. #===========
  139. $imported = {} if $imported.nil?
  140. $imported["DPB-PSS"] = true
  141. #
  142. #===============================================================================
  143. #===============================================================================
  144. # ☆ Perfect Status Screen Begin:
  145. #================================
  146. module DPB
  147.   module PSS
  148.     COMMANDS =[
  149.     [:pagefour,  "IIII"],
  150.     [:pageone,   "I"],
  151.     [:pagetwo,   "II"],
  152.     [:pagethree, "III"],
  153.     ]#DO NOT REMOVE
  154. #===============================================================================#
  155. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  156. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  157. #                                                                               #
  158. #                                     PSS                                       #
  159. #                           (Perfect Status Screen)                             #
  160. #                           - CUSTOMISATION BEGIN -                             #
  161. #                                                                               #
  162. #                                                                               #
  163. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  164. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  165. #===============================================================================#    
  166. #===============================================================================
  167. # ☆ Customisation = Tah-Dah
  168. #===========================
  169. # I have added as much customisation as i thought was needed.
  170. # Which wasnt very much as most of the data e.g font sizes and param column data
  171. # is taken from the PSPDS Customisation module.
  172. #
  173. # It is advised you take a moment to look through the cusomisation options
  174. # to see if any apply to your current project.
  175. #
  176. #===============================================================================    
  177.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  178.     # ☆ Elements Row 1
  179.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  180.     # You can control from here which elements are viewable in row 1
  181.     # along with their icons.
  182.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  183.  
  184.     ELEMENT_VOCAB = "Elements: (Inbound DMG)" # for incomming elemental damage
  185.    
  186.     ATK_ELE_VOCAB = "(Attack DMG)" # for outgoing elemental damage
  187.    
  188.     ELEMENTS_ROW1  = [3..10]  # Elements shown. Maximum of 8 can be shown per row.
  189.  
  190.     ELEMENT_ICONS_ROW1   ={         # Contains element icon information.
  191.     # Element ID => Icon,
  192.                3 =>  96, # Fire
  193.                4 =>  97, # Ice
  194.                5 =>  98, # Thunder
  195.                6 =>  99, # Water
  196.                7 => 100, # Earth
  197.                8 => 101, # Wind
  198.                9 => 102, # Holy
  199.               10 => 103, # Dark
  200.     } # Do not remove this.
  201.  
  202.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  203.     # ☆  Elements Row 2
  204.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  205.     # You can control from here whether you want to display a second row of
  206.     # elemental data along with their icons.
  207.     # Just set "SHOW_ELE_ROW_2" to "true" and change the Element ID and Icon
  208.     # to suit your needs.
  209.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  210.    
  211.     SHOW_ELE_ROW_2 = true # made for those who want more elements in their game :D
  212.        
  213.     ELEMENTS_ROW2  = [10, 9, 8, 7, 6, 5, 4, 3]  # Elements shown. Maximum of 8 can be shown per row.
  214.        
  215.     ELEMENT_ICONS_ROW2   ={         # Contains element icon information.
  216.     # Element ID => Icon,
  217.                3 =>  96, # Fire
  218.                4 =>  97, # Ice
  219.                5 =>  98, # Thunder
  220.                6 =>  99, # Water
  221.                7 => 100, # Earth
  222.                8 => 101, # Wind
  223.                9 => 102, # Holy
  224.               10 => 103, # Dark
  225.     } # Do not remove this.
  226.    
  227.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  228.     # ☆  States Row 1
  229.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  230.     # You can control from here what states are shown in row 1.
  231.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  232.    
  233.     STATUS_VOCAB = "Status: (Inbound hit rate)" # for imcomming status effects
  234.  
  235.     ATK_STATUS_VOCAB = "(Attack hit rate)"  # for outgoing status effects
  236.    
  237.     STATES_ROW_1 = [1..8]     # States shown. Maximum of 8 can be shown.
  238.    
  239.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  240.     # ☆  States Row 2
  241.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  242.     # You can control from here what states are shown in row 2.
  243.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  244.  
  245.     STATES_ROW_2 = [12..19]     # States shown. Maximum of 8 can be shown.
  246.      
  247.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  248.     # ☆  Main Actor Info
  249.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  250.     # You can control from here what info is shown on the main page.
  251.     # You can rearrange these in any order you like :D
  252.     # as well as rename them to anything you want
  253.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  254.    
  255.     INFO1and2LH = 5.5 # line height for PAGEFOUR_INFO 1 and 2
  256.    
  257.     PAGEFOUR_INFO1 =[
  258.     [:pname,    "Name:"],    
  259.     [:pnickname,"Nickname:"],
  260.     [:plvlupexp,"Next Lv Exp:"],
  261. #    [:pvari1,   "variable1:"],
  262. #    [:pvari3,   "variable3:"],
  263.     ] # Do not remove this.
  264.    
  265.     PAGEFOUR_INFO2 =[
  266.     [:plevel,   "Level:"],
  267.     [:pclass,   "Class:"],    
  268.     [:pexp,     "Total Exp:"],
  269. #    [:pvari2,   "variable2:"],
  270. #    [:pvari4,   "variable4:"],
  271.     ] # Do not remove this.
  272.    
  273.     INFO3LH = 8.5 # line height for PAGEFOUR_INFO 3
  274.    
  275.     PAGEFOUR_INFO3 =[
  276.     [:pinfo1,   "Hometown:"],    
  277.     [:pinfo2,   "Personality:"],    
  278.     [:pinfo3,   "Favourate Food:"],    
  279.     [:pinfo4,   "Favourate Quote"],    
  280.     [:pinfo5,   "Relationship Status:"],    
  281.     ] # Do not remove this.
  282.  
  283. #===============================================================================#
  284. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  285. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  286. #                                                                               #
  287. #                                     PSS                                       #
  288. #                           (Perfect Status Screen)                             #
  289. #                            - CUSTOMISATION END -                              #
  290. #                                                                               #
  291. #                                                                               #
  292. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  293. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  294. #===============================================================================#
  295. #                           - DekitaRPG@gmail.com -                             #
  296. #===============================================================================#
  297. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  298. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  299. #                                                                               #
  300. #                                     PSS                                       #
  301. #                           (Perfect Status Screen)                             #
  302. #                               - SCRIPT BEGIN -                                #
  303. #                                                                               #
  304. #                                                                               #
  305. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  306. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  307. #===============================================================================#
  308. #===============================================================================#
  309. # ARE YOU MODIFYING BEYOND THIS POINT? \.\.                                     #
  310. # YES?\.\.                                                                      #
  311. # OMG, REALLY?                                                                  #
  312. # WELL SLAP MY FACE AND CALL ME A DRAGON.\..\..                                 #
  313. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\..                                #
  314. #===============================================================================#
  315.  
  316. #==============================================================================#
  317. # Error Message
  318. #==============================================================================#
  319.   unless $imported["DPB-PSPDS"]
  320.     msg = "The script ''%s'' requires ''Dekita - Perfect Stat Point Distribution System'' in order to function properly. It must also be placed below it!"
  321.     script = "Dekita - Perfect Status Screen"
  322.     msgbox(sprintf(msg, script))
  323.     exit
  324.   end
  325. ################
  326. module_function#
  327.     #--------------------------------------------------------------------------
  328.     # convert_integer_array
  329.     #--------------------------------------------------------------------------
  330.     def convert_integer_array(array)
  331.       result = []
  332.       array.each { |i|
  333.         case i
  334.         when Range; result |= i.to_a
  335.         when Integer; result |= [i]
  336.         end }
  337.       return result
  338.     end
  339.     #--------------------------------------------------------------------------
  340.     # converted_contants
  341.     #--------------------------------------------------------------------------
  342.     ELEMENTS_ROW1 = convert_integer_array(ELEMENTS_ROW1)
  343.     ELEMENTS_ROW2 = convert_integer_array(ELEMENTS_ROW2)
  344.     STATES_ROW_1 = convert_integer_array(STATES_ROW_1)
  345.     STATES_ROW_2 = convert_integer_array(STATES_ROW_2)    
  346.   end # PSS
  347. end #DPB
  348. #==============================================================================
  349. # Icon
  350. #==============================================================================
  351. module Icon
  352.   #--------------------------------------------------------------------------
  353.   # self.element
  354.   #--------------------------------------------------------------------------
  355.   def self.element(id)
  356.     return 0 unless DPB::PSS::ELEMENT_ICONS_ROW1.include?(id)
  357.     return DPB::PSS::ELEMENT_ICONS_ROW1[id]
  358.   end    
  359. end # Icon
  360. #==============================================================================
  361. # Game_BattlerBase
  362. #==============================================================================
  363. class Game_BattlerBase
  364.   #--------------------------------------------------------------------------
  365.   # new method: Get Attack Element Rate
  366.   #--------------------------------------------------------------------------
  367.   def atk_element_rate(element_id)
  368.     features_sum(FEATURE_ATK_ELEMENT, element_id)
  369.   end  
  370. end # Game_BattlerBase
  371. ################################################################################
  372. class Game_Actor < Game_Battler
  373.   attr_reader :perfectinfo1
  374.   attr_reader :perfectinfo2
  375.   attr_reader :perfectinfo3
  376.   attr_reader :perfectinfo4
  377.   attr_reader :perfectinfo5
  378.   alias change_pinfo initialize
  379.  def initialize(actor_id)
  380.         change_pinfo(actor_id)
  381.         @perfectinfo1 = "pinfo1"
  382.         @perfectinfo2 = "pinfo2"
  383.         @perfectinfo3 = "pinfo3"
  384.         @perfectinfo4 = "pinfo4"
  385.         @perfectinfo5 = "pinfo5"
  386.  end
  387.   def change_pinfo1(text)
  388.         @perfectinfo1 = text
  389.       end  
  390.   def change_pinfo2(text)
  391.         @perfectinfo2 = text
  392.       end  
  393.   def change_pinfo3(text)
  394.         @perfectinfo3 = text
  395.       end  
  396.   def change_pinfo4(text)
  397.         @perfectinfo4 = text
  398.       end  
  399.   def change_pinfo5(text)
  400.         @perfectinfo5 = text
  401.       end  
  402. end # Game_Actor
  403. #========================
  404. class Game_Interpreter
  405. #--------
  406.   def pinfo1(actor_id, text)
  407.     actor = $game_actors[actor_id]
  408.     return if actor == nil
  409.     actor.change_pinfo1(text)
  410.   end
  411.   def pinfo2(actor_id, text)
  412.     actor = $game_actors[actor_id]
  413.     return if actor == nil
  414.     actor.change_pinfo2(text)
  415.   end
  416.   def pinfo3(actor_id, text)
  417.     actor = $game_actors[actor_id]
  418.     return if actor == nil
  419.     actor.change_pinfo3(text)
  420.   end
  421.   def pinfo4(actor_id, text)
  422.     actor = $game_actors[actor_id]
  423.     return if actor == nil
  424.     actor.change_pinfo4(text)
  425.   end
  426.   def pinfo5(actor_id, text)
  427.     actor = $game_actors[actor_id]
  428.     return if actor == nil
  429.     actor.change_pinfo5(text)
  430.   end
  431. end
  432. #==============================================================================
  433. # Game_Temp
  434. #==============================================================================
  435. class Game_Temp
  436.   #--------------------------------------------------------------------------
  437.   # public instance variables
  438.   #--------------------------------------------------------------------------
  439.   attr_accessor :scene_status_index
  440.   attr_accessor :scene_status_oy
  441. end # Game_Temp
  442. #==============================================================================
  443. # Window_StatusCommand
  444. #==============================================================================
  445. class Window_StatusCommand < Window_Command
  446.   #--------------------------------------------------------------------------
  447.   # public instance variables
  448.   #--------------------------------------------------------------------------
  449.   attr_accessor :item_window
  450.   #--------------------------------------------------------------------------
  451.   # initialize
  452.   #--------------------------------------------------------------------------
  453.   def initialize(dx, dy)
  454.     super(dx, dy)
  455.     @actor = nil
  456.         self.opacity = 0
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # window_width
  460.   #--------------------------------------------------------------------------
  461.   def window_width; return 0; end
  462.   #--------------------------------------------------------------------------
  463.   # actor=
  464.   #--------------------------------------------------------------------------
  465.   def actor=(actor)
  466.     return if @actor == actor
  467.     @actor = actor
  468.     refresh
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # visible_line_number
  472.   #--------------------------------------------------------------------------
  473.   def visible_line_number; return 4; end
  474.   #--------------------------------------------------------------------------
  475.   # ok_enabled?
  476.   #--------------------------------------------------------------------------
  477.   def ok_enabled?
  478.     return handle?(current_symbol)
  479.   end
  480.   #--------------------------------------------------------------------------
  481.   # make_command_list
  482.   #--------------------------------------------------------------------------
  483.   def make_command_list
  484.     return unless @actor
  485.     for command in DPB::PSS::COMMANDS
  486.       case command[0]
  487.       #--- Default ---
  488.       when :pageone, :pagetwo, :pagethree, :pagefour
  489.         add_command(command[1], command[0])
  490.       else
  491.         end
  492.     end
  493.     if !$game_temp.scene_status_index.nil?
  494.       select($game_temp.scene_status_index)
  495.       self.oy = $game_temp.scene_status_oy
  496.     end
  497.     $game_temp.scene_status_index = nil
  498.     $game_temp.scene_status_oy = nil
  499.   end
  500.   #--------------------------------------------------------------------------
  501.   # process_ok
  502.   #--------------------------------------------------------------------------
  503.   def process_ok
  504.     $game_temp.scene_status_index = index
  505.     $game_temp.scene_status_oy = self.oy
  506.     super
  507.   end
  508.   #--------------------------------------------------------------------------
  509.   # update
  510.   #--------------------------------------------------------------------------
  511.   def update
  512.     super
  513.     update_item_window
  514.   end
  515.   #--------------------------------------------------------------------------
  516.   # update_item_window
  517.   #--------------------------------------------------------------------------
  518.   def update_item_window
  519.     return if @item_window.nil?
  520.     return if @current_index == current_symbol
  521.     @current_index = current_symbol
  522.     @item_window.refresh
  523.   end
  524.   #--------------------------------------------------------------------------
  525.   # item_window=
  526.   #--------------------------------------------------------------------------
  527.   def item_window=(window)
  528.     @item_window = window
  529.     update
  530.   end
  531.   #--------------------------------------------------------------------------
  532.   # update_help
  533.   #--------------------------------------------------------------------------
  534.   def update_help
  535.     return if @actor.nil?
  536.     @help_window.set_text(@actor.actor.description)
  537.   end
  538. end # Window_StatusCommand
  539. #==============================================================================
  540. # Window_StatusItem
  541. #==============================================================================
  542. class Window_StatusItem < Window_Base
  543.   #--------------------------------------------------------------------------
  544.   # initialize
  545.   #--------------------------------------------------------------------------
  546.   def initialize(dx, dy, command_window)
  547.     super(dx, dy, Graphics.width, Graphics.height - dy)
  548.     @command_window = command_window
  549.     @actor = nil
  550.     refresh
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # actor=
  554.   #--------------------------------------------------------------------------
  555.   def actor=(actor)
  556.     return if @actor == actor
  557.     @actor = actor
  558.     refresh
  559.   end
  560.   #--------------------------------------------------------------------------
  561.   # refresh
  562.   #--------------------------------------------------------------------------
  563.   def refresh
  564.     contents.clear
  565.     reset_font_settings
  566.     return unless @actor
  567.     draw_window_contents
  568.   end
  569.   #--------------------------------------------------------------------------
  570.   # draw_window_contents
  571.   #--------------------------------------------------------------------------
  572.   def draw_window_contents
  573.     case @command_window.current_symbol
  574.     when :pageone
  575.         draw_block1(line_height * 1)
  576.         draw_block2(line_height * 1)
  577.         draw_block4(line_height * 14)        
  578.         draw_page_one(0, 0)
  579.     when :pagetwo
  580.         draw_block1(line_height * 1)
  581.         draw_block2(line_height * 1)
  582.         draw_block4(line_height * 14)        
  583.         draw_page_two(0, 0)
  584.     when :pagethree
  585.         draw_block1(line_height * 1)
  586.         draw_block2(line_height * 1)
  587.         draw_block4(line_height * 14)        
  588.         draw_page_three(0, 0)
  589.     when :pagefour
  590.         draw_block1(line_height * 1)
  591.         draw_block2(line_height * 1)
  592.         draw_block3(line_height * 7)
  593.         draw_block4(line_height * 14)        
  594.         draw_page_four(0, 0)      
  595.     else
  596.       end
  597.     end
  598.   #--------------------------------------------------------------------------
  599.   # * Draw Block 1
  600.   #--------------------------------------------------------------------------
  601.   def draw_block1(y)
  602.         draw_actor_face(@actor, (window_width - 24) / 2.5, 0)
  603.   if DPB::PSPDS::DRAW_ACTOR_GRAPHIC
  604.     draw_actor_graphic(@actor, DPB::PSPDS::DAG_X, DPB::PSPDS::DAG_Y)#, 50)
  605.   else
  606.   end
  607. end
  608.   #--------------------------------------------------------------------------
  609.   # * Draw Block 2
  610.   #--------------------------------------------------------------------------
  611.   def draw_block2(y)
  612.     draw_basic_info(136, y)
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # * Draw Block 3
  616.   #--------------------------------------------------------------------------
  617.   def draw_block3(y)
  618.     draw_equipments((window_width + 24) / 2 * 1, line_height * 6)
  619.   end
  620.   #--------------------------------------------------------------------------
  621.   # * Draw Block 4
  622.   #--------------------------------------------------------------------------
  623.   def draw_block4(y)
  624.     draw_description(4, y)
  625.   end
  626.   #--------------------------------------------------------------------------
  627.   # * Draw Horizontal Line
  628.   #--------------------------------------------------------------------------
  629.   def draw_horz_line(y)
  630.     line_y = y + line_height / 2 - 1
  631.     contents.fill_rect(0, line_y, contents_width, 2, line_color)
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # * Get Color of Horizontal Line
  635.   #--------------------------------------------------------------------------
  636.   def line_color
  637.     color = normal_color
  638.     color.alpha = 48
  639.     color
  640.   end
  641.   #--------------------------------------------------------------------------
  642.   # * Draw Basic Information
  643.   #--------------------------------------------------------------------------
  644.   def draw_basic_info(x, y)
  645.         draw_actor_icons(@actor, (window_width - 24) / 2.5, y + line_height * 3)
  646.         contents.font.size = DPB::PSPDS::PROPFONTSIZE
  647.         draw_new_stats_column
  648.         draw_points_column
  649.       end
  650.      
  651.   #--------------------------------------------------------------------------
  652.   # * Draw Page One
  653.   #--------------------------------------------------------------------------
  654.   def draw_page_one(x, y)
  655.         contents.font.size = DPB::PSPDS::FONTSIZE          
  656.       if DPB::PSPDS::DRAW_PARAM_GAUGES
  657.         draw_parameter_graph
  658.       if DPB::PSPDS::DRAW_ALL_COLUMNS
  659.         draw_actor_hp(@actor, 5, y+106 + line_height * 1,(window_width - 24) / 4 - 12)
  660.         draw_actor_mp(@actor, 5, y+106 + line_height * 2,(window_width - 24) / 4 - 12)
  661.         else  
  662.         draw_actor_hp(@actor, 5, y+106 + line_height * 1,(window_width - 24) / 3 - 24)
  663.         draw_actor_mp(@actor, 5, y+106 + line_height * 2,(window_width - 24) / 3 - 24)
  664.         end
  665.       else
  666.         draw_properties_paramcolumn
  667.       end
  668.         contents.font.size = DPB::PSPDS::PROPFONTSIZE
  669.         draw_horz_line(line_height * 4)
  670.         draw_horz_line(Graphics.height - line_height * 4)
  671.         draw_properties_column1
  672.         draw_properties_column2
  673.         if DPB::PSPDS::DRAW_ALL_COLUMNS
  674.         draw_properties_column3
  675.       else
  676.       end
  677.         reset_font_settings        
  678.     end
  679.   #--------------------------------------------------------------------------
  680.   # * Draw Page two
  681.   #--------------------------------------------------------------------------
  682.   def draw_page_two(x, y)
  683.         contents.font.size = DPB::PSPDS::PROPFONTSIZE
  684.         draw_horz_line(line_height * 4)
  685.         draw_elements
  686.         draw_atk_elements
  687.       if DPB::PSS::SHOW_ELE_ROW_2
  688.         draw_elements_row2
  689.         draw_atk_elements_row2
  690.       else
  691.         end
  692.       draw_horz_line(Graphics.height - line_height * 4)
  693.       reset_font_settings        
  694.     end
  695.   #--------------------------------------------------------------------------
  696.   # * Draw Page three
  697.   #--------------------------------------------------------------------------
  698.   def draw_page_three(x, y)
  699.         contents.font.size = DPB::PSPDS::PROPFONTSIZE
  700.         draw_horz_line(line_height * 4)
  701.       draw_states
  702.       draw_states_row_2
  703.       draw_atk_states
  704.       draw_atk_states_row_2
  705.         draw_horz_line(Graphics.height - line_height * 4)
  706.         reset_font_settings        
  707.     end
  708.   #--------------------------------------------------------------------------
  709.   # * Draw Page four
  710.   #--------------------------------------------------------------------------
  711.   def draw_page_four(x, y)
  712.         contents.font.size = DPB::PSPDS::PROPFONTSIZE
  713.         draw_horz_line(line_height * 4)
  714.        draw_pagefour_info1
  715.        draw_pagefour_info2      
  716.        draw_pagefour_info3      
  717.         draw_horz_line(Graphics.height - line_height * 4)
  718.         reset_font_settings        
  719.       end
  720.  def draw_pagefour_info1
  721.     dx = 5
  722.     dw = (window_width - 24) / 4
  723.     dy = line_height * DPB::PSS::INFO1and2LH
  724.     for info in DPB::PSS::PAGEFOUR_INFO1
  725.       dy = draw_info(info, dx, dy, dw)
  726.     end
  727.   end
  728.  def draw_pagefour_info2
  729.     dx = 5 + (window_width - 24) / 4
  730.     dw = (window_width - 24) / 4
  731.     dy = line_height * DPB::PSS::INFO1and2LH
  732.     for info in DPB::PSS::PAGEFOUR_INFO2
  733.       dy = draw_info(info, dx, dy, dw)
  734.     end
  735.   end
  736.  def draw_pagefour_info3
  737.     dx = 5
  738.     dw = (window_width - 24) / 2
  739.     dy = line_height * DPB::PSS::INFO3LH
  740.     for info in DPB::PSS::PAGEFOUR_INFO3
  741.       dy = draw_info(info, dx, dy, dw)
  742.     end
  743.   end
  744.   #--------------------------------------------------------------------------
  745.   # draw_info
  746.   #--------------------------------------------------------------------------
  747.   def draw_info(info, dx, dy, dw)
  748.     case info[0]
  749.     #---
  750.     when :pname
  751.     text = @actor.name
  752.     when :pnickname
  753.     text = @actor.nickname
  754.     when :plevel
  755.     text = @actor.level        
  756.     when :pclass
  757.     text = @actor.class.name
  758.     when :pexp
  759.     text = @actor.exp
  760.     when :plvlupexp
  761.     text = @actor.max_level? ? "----" : @actor.next_level_exp - @actor.exp
  762.     when :pinfo1
  763.     text = @actor.perfectinfo1
  764.     when :pinfo2
  765.     text = @actor.perfectinfo2
  766.     when :pinfo3
  767.     text = @actor.perfectinfo3
  768.     when :pinfo4
  769.     text = @actor.perfectinfo4
  770.     when :pinfo5
  771.     text = @actor.perfectinfo5
  772.     #---
  773.     else; return dy
  774.     end
  775.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  776.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  777.     contents.fill_rect(rect, colour)
  778.     change_color(system_color)
  779.     draw_text(dx+4, dy, dw-8, line_height, info[1], 0)
  780.     change_color(normal_color)
  781.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  782.     return dy + line_height
  783.   end  
  784.   #--------------------------------------------------------------------------
  785.   # * Draw Parameters
  786.   #--------------------------------------------------------------------------
  787.   def draw_parameters(x, y)
  788.     6.times {|i| draw_actor_param(@actor, x, y + line_height * i, i + 2) }
  789.   end
  790.   #--------------------------------------------------------------------------
  791.   # * Draw Equipment
  792.   #--------------------------------------------------------------------------
  793.   def draw_equipments(x, y)
  794.     @actor.equips.each_with_index do |item, i|
  795.       draw_item_name(item, x, y + line_height * i)
  796.     end
  797.   end
  798.   #--------------------------------------------------------------------------
  799.   # * Draw Description
  800.   #--------------------------------------------------------------------------
  801.   def draw_description(x, y)
  802.     draw_text_ex(x, y, @actor.description)
  803.   end
  804.  
  805.   if DPB::PSS::SHOW_ELE_ROW_2
  806.   #--------------------------------------------------------------------------
  807.   # draw_elements
  808.   #--------------------------------------------------------------------------
  809.   def draw_elements
  810.     dx = 0; dy = 130
  811.     contents.font.size = DPB::PSPDS::FONTSIZE
  812.     draw_text((window_width - 24) / 3 * 0, line_height * 4.6, contents.width, line_height, DPB::PSS::ELEMENT_VOCAB)    
  813.     for ele_id in DPB::PSS::ELEMENTS_ROW1
  814.       draw_element_info(ele_id, (window_width - 0) / 4 * 0, dy)
  815.       dx = dx == 1 ? contents.width / 4 : 0
  816.       dy += dx == 0 ? line_height : 0
  817.     end
  818.   end
  819.   #--------------------------------------------------------------------------
  820.   # draw_elements_row2
  821.   #--------------------------------------------------------------------------
  822.   def draw_elements_row2
  823.     dx = 0; dy = 130
  824.     contents.font.size = DPB::PSPDS::FONTSIZE
  825.     for ele_id in DPB::PSS::ELEMENTS_ROW2
  826.       draw_element_info(ele_id, (window_width - 12) / 4 * 1, dy)
  827.       dx = dx == 1 ? contents.width / 4 : 0
  828.       dy += dx == 0 ? line_height : 0
  829.     end
  830.   end
  831.   #--------------------------------------------------------------------------
  832.   # draw_atk_elements
  833.   #--------------------------------------------------------------------------
  834.   def draw_atk_elements
  835.     dx = 0; dy = 130
  836.     contents.font.size = DPB::PSPDS::FONTSIZE
  837.     draw_text((window_width - 24) / 4 * 2, line_height * 4.6, contents.width, line_height, DPB::PSS::ATK_ELE_VOCAB)    
  838.     for ele_id in DPB::PSS::ELEMENTS_ROW1
  839.       draw_atk_element_info(ele_id, (window_width - 12) / 4 * 2, dy)
  840.       dx = dx == 1 ? contents.width / 4 : 0
  841.       dy += dx == 0 ? line_height : 0
  842.     end
  843.   end
  844.   #--------------------------------------------------------------------------
  845.   # draw_atk_elements_row2
  846.   #--------------------------------------------------------------------------
  847.   def draw_atk_elements_row2
  848.     dx = 0; dy = 130
  849.     contents.font.size = DPB::PSPDS::FONTSIZE
  850.     for ele_id in DPB::PSS::ELEMENTS_ROW2
  851.       draw_atk_element_info(ele_id, (window_width - 8) / 4 * 3, dy)
  852.       dx = dx == 1 ? contents.width / 4 : 0
  853.       dy += dx == 0 ? line_height : 0
  854.     end
  855.   end
  856.   #--------------------------------------------------------------------------
  857.   # draw_states
  858.   #--------------------------------------------------------------------------
  859.   def draw_states
  860.     dx = 0; dy = 130
  861.     contents.font.size = DPB::PSPDS::FONTSIZE
  862.     draw_text((window_width - 24) / 4 * 0 , line_height * 4.6, contents.width, line_height, DPB::PSS::STATUS_VOCAB)
  863.     contents.font.size = 16
  864.     for state_id in DPB::PSS::STATES_ROW_1
  865.       draw_state_info(state_id, (window_width - 0) / 4 * 0 , dy)
  866.       dx = dx == 1 ? contents.width / 3 : 0
  867.       dy += dx == 0 ? line_height : 0
  868.     end
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # draw_states_row_2
  872.   #--------------------------------------------------------------------------
  873.   def draw_states_row_2
  874.     dx = 0; dy = 130
  875.     contents.font.size = DPB::PSPDS::FONTSIZE
  876.     for state_id in DPB::PSS::STATES_ROW_2
  877.       draw_state_info(state_id, (window_width - 12) / 4 * 1 , dy)
  878.       dx = dx == 1 ? contents.width / 3 : 0
  879.       dy += dx == 0 ? line_height : 0
  880.     end
  881.   end
  882.   #--------------------------------------------------------------------------
  883.   # draw_atk_states
  884.   #--------------------------------------------------------------------------
  885.   def draw_atk_states
  886.     dx = 0; dy = 130
  887.     contents.font.size = DPB::PSPDS::FONTSIZE
  888.     draw_text((window_width - 24) / 4 * 2  + 8, line_height * 4.6, contents.width, line_height, DPB::PSS::ATK_STATUS_VOCAB)
  889.     contents.font.size = 16
  890.     for state_id in DPB::PSS::STATES_ROW_1
  891.       draw_atk_state_info(state_id, (window_width - 12) / 4 * 2 , dy)
  892.       dx = dx == 1 ? contents.width / 3 : 0
  893.       dy += dx == 0 ? line_height : 0
  894.     end
  895.   end
  896.   #--------------------------------------------------------------------------
  897.   # draw_atk_states_row_2
  898.   #--------------------------------------------------------------------------
  899.   def draw_atk_states_row_2
  900.     dx = 0; dy = 130
  901.     contents.font.size = DPB::PSPDS::FONTSIZE
  902.     for state_id in DPB::PSS::STATES_ROW_2
  903.       draw_atk_state_info(state_id, (window_width - 8) / 4 * 3 , dy)
  904.       dx = dx == 1 ? contents.width / 3 : 0
  905.       dy += dx == 0 ? line_height : 0
  906.     end
  907.   end
  908.   #--------------------------------------------------------------------------
  909.   # draw_element_info
  910.   #--------------------------------------------------------------------------
  911.   def draw_element_info(ele_id, dx, dy)
  912.     dw = (contents.width - 24) / 4.2
  913.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  914.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  915.     contents.fill_rect(rect, colour)
  916.     draw_icon(Icon.element(ele_id), dx, dy)
  917.     change_color(system_color)
  918.     draw_text(dx+24, dy, dw-24, line_height, $data_system.elements[ele_id] + "")
  919.     change_color(normal_color)
  920.     text = sprintf("%d%%", (@actor.element_rate(ele_id) * 100).to_i)
  921.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  922.   end
  923.   #--------------------------------------------------------------------------
  924.   # draw_atk_element_info
  925.   #--------------------------------------------------------------------------
  926.   def draw_atk_element_info(ele_id, dx, dy)
  927.     dw = (contents.width - 24) / 4.2
  928.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  929.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  930.     contents.fill_rect(rect, colour)
  931.     draw_icon(Icon.element(ele_id), dx, dy)
  932.     change_color(system_color)
  933.     draw_text(dx+24, dy, dw-24, line_height, $data_system.elements[ele_id] + "")
  934.     change_color(normal_color)
  935.     text = sprintf("%d%%", (@actor.atk_element_rate(ele_id) * 100).to_i)
  936.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  937.   end
  938.   #--------------------------------------------------------------------------
  939.   # draw_state_info
  940.   #--------------------------------------------------------------------------
  941.   def draw_state_info(state_id, dx, dy)
  942.     dw = (contents.width - 24) / 4.2
  943.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  944.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  945.     contents.fill_rect(rect, colour)
  946.     draw_icon($data_states[state_id].icon_index, dx, dy)
  947.     change_color(system_color)
  948.     draw_text(dx+24, dy, dw-24, line_height, $data_states[state_id].name + "")
  949.     change_color(normal_color)
  950.     text = sprintf("%d%%", (@actor.state_rate(state_id) * 100).to_i)
  951.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  952.   end
  953.   #--------------------------------------------------------------------------
  954.   # draw_atk_state_info
  955.   #--------------------------------------------------------------------------
  956.   def draw_atk_state_info(state_id, dx, dy)
  957.     dw = (contents.width - 24) / 4.2
  958.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  959.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  960.     contents.fill_rect(rect, colour)
  961.     draw_icon($data_states[state_id].icon_index, dx, dy)
  962.     change_color(system_color)
  963.     draw_text(dx+24, dy, dw-24, line_height, $data_states[state_id].name + "")
  964.     change_color(normal_color)
  965.     text = sprintf("%d%%", (@actor.atk_states_rate(state_id) * 100).to_i)
  966.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  967.   end
  968.  
  969. else
  970.   #--------------------------------------------------------------------------
  971.   # draw_elements
  972.   #--------------------------------------------------------------------------
  973.   def draw_elements
  974.     dx = 0; dy = 130
  975.     contents.font.size = DPB::PSPDS::FONTSIZE
  976.     draw_text((window_width - 24) / 3 * 0 + 12, line_height * 4.6, contents.width, line_height, DPB::PSS::ELEMENT_VOCAB)
  977.     for ele_id in DPB::PSS::ELEMENTS_ROW1
  978.       draw_element_info(ele_id, (window_width- 24) / 6 * 1, dy)
  979.       dx = dx == 1 ? contents.width / 3 : 0
  980.       dy += dx == 0 ? line_height : 0
  981.     end
  982.   end
  983.   #--------------------------------------------------------------------------
  984.   # draw_atk_elements
  985.   #--------------------------------------------------------------------------
  986.   def draw_atk_elements
  987.     dx = 0; dy = 130
  988.     contents.font.size = DPB::PSPDS::FONTSIZE
  989.     draw_text((window_width - 24) / 4 * 2, line_height * 4.6, contents.width, line_height, DPB::PSS::ATK_ELE_VOCAB)
  990.     for ele_id in DPB::PSS::ELEMENTS_ROW1
  991.       draw_atk_element_info(ele_id, (window_width - 24) / 6 * 3, dy)
  992.       dx = dx == 1 ? contents.width / 3 : 0
  993.       dy += dx == 0 ? line_height : 0
  994.     end
  995.   end
  996.   #--------------------------------------------------------------------------
  997.   # draw_states
  998.   #--------------------------------------------------------------------------
  999.   def draw_states
  1000.     dx = 0; dy = 130
  1001.     contents.font.size = DPB::PSPDS::FONTSIZE
  1002.     draw_text((window_width - 24) / 4 * 0 , line_height * 4.6, contents.width, line_height, DPB::PSS::STATUS_VOCAB)
  1003.     contents.font.size = 16
  1004.     for state_id in DPB::PSS::STATES_ROW_1
  1005.       draw_state_info(state_id, (window_width - 0) / 4 * 0 , dy)
  1006.       dx = dx == 1 ? contents.width / 3 : 0
  1007.       dy += dx == 0 ? line_height : 0
  1008.     end
  1009.   end
  1010.   #--------------------------------------------------------------------------
  1011.   # draw_states_row_2
  1012.   #--------------------------------------------------------------------------
  1013.   def draw_states_row_2
  1014.     dx = 0; dy = 130
  1015.     contents.font.size = DPB::PSPDS::FONTSIZE
  1016.     for state_id in DPB::PSS::STATES_ROW_2
  1017.       draw_state_info(state_id, (window_width - 12) / 4 * 1 , dy)
  1018.       dx = dx == 1 ? contents.width / 3 : 0
  1019.       dy += dx == 0 ? line_height : 0
  1020.     end
  1021.   end
  1022.   #--------------------------------------------------------------------------
  1023.   # draw_atk_states
  1024.   #--------------------------------------------------------------------------
  1025.   def draw_atk_states
  1026.     dx = 0; dy = 130
  1027.     contents.font.size = DPB::PSPDS::FONTSIZE
  1028.     draw_text((window_width - 24) / 4 * 2  + 8, line_height * 4.6, contents.width, line_height, DPB::PSS::ATK_STATUS_VOCAB)
  1029.     contents.font.size = 16
  1030.     for state_id in DPB::PSS::STATES_ROW_1
  1031.       draw_atk_state_info(state_id, (window_width - 12) / 4 * 2 , dy)
  1032.       dx = dx == 1 ? contents.width / 3 : 0
  1033.       dy += dx == 0 ? line_height : 0
  1034.     end
  1035.   end
  1036.   #--------------------------------------------------------------------------
  1037.   # draw_atk_states_row_2
  1038.   #--------------------------------------------------------------------------
  1039.   def draw_atk_states_row_2
  1040.     dx = 0; dy = 130
  1041.     contents.font.size = DPB::PSPDS::FONTSIZE
  1042.     for state_id in DPB::PSS::STATES_ROW_2
  1043.       draw_atk_state_info(state_id, (window_width - 8) / 4 * 3 , dy)
  1044.       dx = dx == 1 ? contents.width / 3 : 0
  1045.       dy += dx == 0 ? line_height : 0
  1046.     end
  1047.   end
  1048.   #--------------------------------------------------------------------------
  1049.   # draw_element_info
  1050.   #--------------------------------------------------------------------------
  1051.   def draw_element_info(ele_id, dx, dy)
  1052.     dw = (contents.width - 24) / 3
  1053.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1054.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1055.     contents.fill_rect(rect, colour)
  1056.     draw_icon(Icon.element(ele_id), dx, dy)
  1057.     change_color(system_color)
  1058.     draw_text(dx+24, dy, dw-24, line_height, $data_system.elements[ele_id] + "")
  1059.     change_color(normal_color)
  1060.     text = sprintf("%d%%", (@actor.element_rate(ele_id) * 100).to_i)
  1061.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  1062.   end
  1063.   #--------------------------------------------------------------------------
  1064.   # draw_atk_element_info
  1065.   #--------------------------------------------------------------------------
  1066.   def draw_atk_element_info(ele_id, dx, dy)
  1067.     dw = (contents.width - 24) / 3
  1068.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1069.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1070.     contents.fill_rect(rect, colour)
  1071.     draw_icon(Icon.element(ele_id), dx, dy)
  1072.     change_color(system_color)
  1073.     draw_text(dx+24, dy, dw-24, line_height, $data_system.elements[ele_id] + "")
  1074.     change_color(normal_color)
  1075.     text = sprintf("%d%%", (@actor.atk_element_rate(ele_id) * 100).to_i)
  1076.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  1077.   end
  1078.   #--------------------------------------------------------------------------
  1079.   # draw_state_info
  1080.   #--------------------------------------------------------------------------
  1081.   def draw_state_info(state_id, dx, dy)
  1082.     dw = (contents.width - 24) / 4.2
  1083.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1084.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1085.     contents.fill_rect(rect, colour)
  1086.     draw_icon($data_states[state_id].icon_index, dx, dy)
  1087.     change_color(system_color)
  1088.     draw_text(dx+24, dy, dw-24, line_height, $data_states[state_id].name + "")
  1089.     change_color(normal_color)
  1090.     text = sprintf("%d%%", (@actor.state_rate(state_id) * 100).to_i)
  1091.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  1092.   end
  1093.   #--------------------------------------------------------------------------
  1094.   # draw_atk_state_info
  1095.   #--------------------------------------------------------------------------
  1096.   def draw_atk_state_info(state_id, dx, dy)
  1097.     dw = (contents.width - 24) / 4.2
  1098.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1099.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1100.     contents.fill_rect(rect, colour)
  1101.     draw_icon($data_states[state_id].icon_index, dx, dy)
  1102.     change_color(system_color)
  1103.     draw_text(dx+24, dy, dw-24, line_height, $data_states[state_id].name + "")
  1104.     change_color(normal_color)
  1105.     text = sprintf("%d%%", (@actor.atk_states_rate(state_id) * 100).to_i)
  1106.     draw_text(dx+4, dy, dw-8, line_height, text, 2)
  1107.   end
  1108. end
  1109.   #--------------------------------------------------------------------------
  1110.   # window width
  1111.   #--------------------------------------------------------------------------
  1112. def window_width
  1113.   Graphics.width - 0
  1114. end
  1115.   #--------------------------------------------------------------------------
  1116.   # window height
  1117.   #--------------------------------------------------------------------------
  1118. def window_height
  1119.   Graphics.height - 0
  1120. end
  1121. end #WindowStatusItem
  1122. #==============================================================================
  1123. # ** Scene_Status
  1124. #------------------------------------------------------------------------------
  1125. #  This class performs the status screen processing.
  1126. #==============================================================================
  1127. class Scene_Status < Scene_MenuBase
  1128.   #--------------------------------------------------------------------------
  1129.   # start
  1130.   #--------------------------------------------------------------------------
  1131.   def start
  1132.     super
  1133.     create_status_window
  1134.     create_command_window
  1135.     create_item_window
  1136.     $game_temp.actor_level_up.delete_at(0)
  1137.   end
  1138.  
  1139.   #--------------------------------------------------------------------------
  1140.   # create_command_window
  1141.   #--------------------------------------------------------------------------
  1142.   def create_command_window
  1143.     wy = 0
  1144.     @command_window = Window_StatusCommand.new(0, wy)
  1145.     @command_window.viewport = @viewport
  1146.     @command_window.actor = @actor
  1147.     @command_window.help_window = @help_window
  1148.     @command_window.set_handler(:cancel,   method(:return_scene))
  1149.     @command_window.set_handler(:pagedown, method(:next_actor))
  1150.     @command_window.set_handler(:pageup,   method(:prev_actor))
  1151.     @command_window.set_handler(:pageone, method(:command_pageone))
  1152.     @command_window.set_handler(:pagetwo, method(:command_pagetwo))
  1153.     @command_window.set_handler(:pagethree, method(:command_pagethree))
  1154.   end
  1155.   #--------------------------------------------------------------------------
  1156.   # create_status_window
  1157.   #--------------------------------------------------------------------------
  1158.   def create_status_window
  1159.     wy = 0
  1160.   end
  1161.   #--------------------------------------------------------------------------
  1162.   # create_item_window
  1163.   #--------------------------------------------------------------------------
  1164.   def create_item_window
  1165.     dy = 0
  1166.     @item_window = Window_StatusItem.new(0, dy, @command_window)
  1167.     @item_window.viewport = @viewport
  1168.     @item_window.actor = @actor
  1169.     @command_window.item_window = @item_window
  1170.   end
  1171.   #--------------------------------------------------------------------------
  1172.   # on_actor_change
  1173.   #--------------------------------------------------------------------------
  1174.   def on_actor_change
  1175.     @command_window.actor = @actor
  1176.     @item_window.actor = @actor
  1177.     @command_window.activate
  1178.   end  
  1179.   #--------------------------------------------------------------------------
  1180.   # new method: command_pspds
  1181.   #--------------------------------------------------------------------------
  1182.   def command_pageone
  1183.     SceneManager.call(Scene_Level_Up)
  1184.   end
  1185.   #--------------------------------------------------------------------------
  1186.   # new method: command_escdef
  1187.   #--------------------------------------------------------------------------
  1188.   def command_pagetwo
  1189.     unless $imported["DPB-ADDESC"]
  1190.       @command_window.activate
  1191.       return
  1192.     end
  1193.     SceneManager.call(Scene_Element_Up)
  1194.   end
  1195.   #--------------------------------------------------------------------------
  1196.   # new method: command_stcdef
  1197.   #--------------------------------------------------------------------------
  1198.   def command_pagethree
  1199.     unless $imported["DPB-ADDSTC"]
  1200.       @command_window.activate
  1201.       return
  1202.     end
  1203.     SceneManager.call(Scene_State_Up)
  1204.   end
  1205. end # Scene_Status
  1206. #===============================================================================#
  1207. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  1208. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  1209. #                                                                               #
  1210. #                                     PSS                                       #
  1211. #                           (Perfect Status Screen)                             #
  1212. #                                - SCRIPT END -                                 #
  1213. #                                                                               #
  1214. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  1215. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  1216. #===============================================================================#
  1217. #                           - DekitaRPG@gmail.com -                             #
  1218. #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement