Advertisement
Rafael_Sol_Maker

RAFAEL_SOL_MAKER's VX STATUS 2003 STYLE v1.0

Nov 17th, 2011
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 12.07 KB | None | 0 0
  1. #===============================================================================
  2. #                RAFAEL_SOL_MAKER's VX STATUS 2003 STYLE v1.0
  3. #-------------------------------------------------------------------------------
  4. # Description:  Status scene redesigned to be similar to the RPG Maker 2003
  5. #               version. Added gold window and the information were well
  6. #               distributed and organized in multiple windows.
  7. #               Compatible with 544x416 and 640x480 resolutions.
  8. #-------------------------------------------------------------------------------
  9. # How to Use: -
  10. #-------------------------------------------------------------------------------
  11. # Special Thanks: -
  12. #-------------------------------------------------------------------------------
  13. #                      ADDITIONAL INFORMATIONS:
  14. #   New windows: Window_Status_Info, Window_Status_Statistics,
  15. # and Window_Status_Equip
  16. #
  17. #   Scene_Status -> Totally remade
  18. # Additional windows: @gold_window(improved), @info_window, @statistics_window
  19. # and @equip_window
  20. #
  21. #   Window_Gold (improved)
  22. # New optional parameter on initialization: (w = 160)
  23. #
  24. #   Window_Status -> Totally remade
  25. # New optional parameters on initialization: (x = 0, y = 0)
  26. # Removed procedures: draw_equipments, draw_parameters, draw_basic_info
  27. #-------------------------------------------------------------------------------
  28. #===============================================================================
  29.  
  30. module Vocab  
  31.   #NEW WORDS!  
  32.   Name        = "Name"
  33.   Class       = "Class"
  34.   Condition   = "Condition"
  35. end
  36.  
  37. #==============================================================================
  38. # Scene_Status
  39. #------------------------------------------------------------------------------
  40. # Operation class on the Status screen.
  41. #==============================================================================
  42. class Scene_Status < Scene_Base
  43.  
  44.   def start
  45.     super
  46.     create_menu_background
  47.     @actor = $game_party.members[@actor_index]    
  48.     @status_window = Window_Status.new(@actor, 0, 0)
  49.     @gold_window = Window_Gold.new(0, Graphics.height - 56, @status_window.width)
  50.     @info_window = Window_Status_Info.new(@status_window.width, 0, @actor)
  51.     @statistics_window = Window_Status_Statistics.new(@status_window.width,
  52.                           @info_window.height, @actor)
  53.     @equip_window = Window_Status_Equip.new(@status_window.width,
  54.                       @info_window.height + @statistics_window.height, @actor)
  55.   end
  56.  
  57.   def terminate
  58.     super
  59.     dispose_menu_background
  60.     @gold_window.dispose
  61.     @status_window.dispose
  62.     @info_window.dispose
  63.     @statistics_window.dispose
  64.     @equip_window.dispose
  65.   end
  66.  
  67.   def update
  68.     update_menu_background
  69.    
  70.     @gold_window.update
  71.     @status_window.update
  72.     @info_window.update
  73.     @statistics_window.update
  74.     @equip_window.update
  75.    
  76.     if Input.trigger?(Input::B)
  77.       Sound.play_cancel
  78.       return_scene
  79.     elsif Input.trigger?(Input::R)
  80.       Sound.play_cursor
  81.       next_actor
  82.     elsif Input.trigger?(Input::L)
  83.       Sound.play_cursor
  84.       prev_actor
  85.     end
  86.     super
  87.   end
  88.  
  89. end
  90.  
  91. #==============================================================================
  92. # Window_Status_Info
  93. #------------------------------------------------------------------------------
  94. # Window that displays the hit points, magic points and the experience
  95. # obtained by the character.
  96. #==============================================================================
  97. class Window_Status_Info < Window_Base
  98.   #--------------------------------------------------------------------------
  99.   # Object initialization
  100.   #     x     : X window coordinate
  101.   #     y     : Y window coordinate
  102.   #     actor : character
  103.   #--------------------------------------------------------------------------
  104.   def initialize(x, y, actor)
  105.     w = Graphics.width.to_f * 0.65
  106.     mh = (Graphics.height.to_f / 416)
  107.     h = (WLH * 4 + 40) * mh
  108.     super(x, y, w, h)    
  109.     @actor = actor
  110.     refresh
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # Update
  114.   #--------------------------------------------------------------------------
  115.   def refresh
  116.     self.contents.clear
  117.     s1 = @actor.exp_s
  118.     s2 = @actor.next_rest_exp_s
  119.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  120.     self.contents.font.color = system_color
  121.     self.contents.draw_text(4, y + WLH * 0, 200, WLH, Vocab::ExpTotal)
  122.     self.contents.draw_text(4, y + WLH * 1, 200, WLH, s_next)
  123.     self.contents.font.color = normal_color
  124.     cx  = contents.text_size(Vocab::ExpTotal).width    
  125.     cx2 = contents.text_size(s_next).width    
  126.     self.contents.draw_text(cx  + 18,  y + WLH * 0, width - cx , WLH, s2) #, 2)
  127.     self.contents.draw_text(cx2 + 18, y + WLH * 1, width - cx2, WLH, s1) #, 2)
  128.    
  129.     draw_actor_hp(@actor, 4, y + WLH * 2)
  130.     draw_actor_mp(@actor, 4, y + WLH * 3)
  131.   end
  132.  
  133. end
  134.  
  135. #==============================================================================
  136. # Window_Status_Statistics
  137. #------------------------------------------------------------------------------
  138. # Window that displays the statistics of the equipment used by the character.
  139. #==============================================================================
  140. class Window_Status_Statistics < Window_Base
  141.   #--------------------------------------------------------------------------
  142.   # Object initialization
  143.   #     x     : X window coordinate
  144.   #     y     : Y window coordinate
  145.   #     actor : character
  146.   #--------------------------------------------------------------------------
  147.   def initialize(x, y, actor)
  148.     w = Graphics.width.to_f * 0.65
  149.     mh = (Graphics.height.to_f / 416)
  150.     h = (WLH * 4 + 32) * mh
  151.     super(x, y, w, h)
  152.     @actor = actor
  153.     refresh
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # Update
  157.   #--------------------------------------------------------------------------
  158.   def refresh
  159.     self.contents.clear
  160.     draw_parameter(0, WLH * 0, 0)
  161.     draw_parameter(0, WLH * 1, 1)
  162.     draw_parameter(0, WLH * 2, 2)
  163.     draw_parameter(0, WLH * 3, 3)
  164.   end
  165.  
  166.   #--------------------------------------------------------------------------
  167.   # Parameter Display
  168.   #     x    : X window coordinate
  169.   #     y    : Y window coordinate
  170.   #     type : value type (0~3)
  171.   #--------------------------------------------------------------------------
  172.   def draw_parameter(x, y, type)
  173.     w2 = (width / 2) - 32
  174.     case type
  175.     when 0
  176.       name = Vocab::atk; value = @actor.atk
  177.     when 1
  178.       name = Vocab::def; value = @actor.def
  179.     when 2
  180.       name = Vocab::spi; value = @actor.spi
  181.     when 3
  182.       name = Vocab::agi; value = @actor.agi
  183.     end    
  184.     self.contents.font.color = system_color
  185.     self.contents.draw_text(x + 4, y, 128, WLH, name)
  186.     self.contents.font.color = normal_color
  187.     self.contents.draw_text(x + w2, y, 32, WLH, value, 2) #w2>144
  188.     self.contents.font.color = system_color
  189.  
  190.   end
  191. end
  192.  
  193. #==============================================================================
  194. # Window_Status_Equip
  195. #------------------------------------------------------------------------------
  196. # Window that displays the items equipped on the hero in the status screen.
  197. #==============================================================================
  198. class Window_Status_Equip < Window_Base
  199.   #--------------------------------------------------------------------------
  200.   # Object initialization
  201.   #     x     : X window coordinate
  202.   #     y     : Y window coordinate
  203.   #     actor : character
  204.   #--------------------------------------------------------------------------
  205.   def initialize(x, y, actor)
  206.     w = Graphics.width.to_f * 0.65
  207.     mh = (Graphics.height.to_f / 416)
  208.     h = (Graphics.height - y) #(WLH * 5 + 32) * mh
  209.     super(x, y, w, h)
  210.     @actor = actor
  211.     refresh
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # Update
  215.   #--------------------------------------------------------------------------
  216.   def refresh
  217.     w2 = (width / 2) - 32
  218.     self.contents.clear
  219.     @data = []
  220.     for item in @actor.equips do @data.push(item) end
  221.     @item_max = @data.size
  222.     self.contents.font.color = system_color
  223.     if @actor.two_swords_style
  224.       self.contents.draw_text(4, WLH * 0, w2, WLH, Vocab::weapon1)
  225.       self.contents.draw_text(4, WLH * 1, w2, WLH, Vocab::weapon2)
  226.     else
  227.       self.contents.draw_text(4, WLH * 0, w2, WLH, Vocab::weapon)
  228.       self.contents.draw_text(4, WLH * 1, w2, WLH, Vocab::armor1)
  229.     end
  230.     self.contents.draw_text(4, WLH * 2, w2, WLH, Vocab::armor2)
  231.     self.contents.draw_text(4, WLH * 3, w2, WLH, Vocab::armor3)
  232.     self.contents.draw_text(4, WLH * 4, w2, WLH, Vocab::armor4)
  233.     draw_item_name(@data[0], w2, WLH * 0)
  234.     draw_item_name(@data[1], w2, WLH * 1)
  235.     draw_item_name(@data[2], w2, WLH * 2)
  236.     draw_item_name(@data[3], w2, WLH * 3)
  237.     draw_item_name(@data[4], w2, WLH * 4)
  238.   end
  239.  
  240. end
  241.  
  242. #==============================================================================
  243. # Window_Status
  244. #------------------------------------------------------------------------------
  245. # Window that displays basic information of the characters.
  246. #==============================================================================
  247. class Window_Status < Window_Base
  248.   #--------------------------------------------------------------------------
  249.   # Object initialization
  250.   #     actor :   character
  251.   #--------------------------------------------------------------------------
  252.   def initialize(actor, x = 0, y = 0 )
  253.     h = Graphics.height - (WLH + 32)
  254.     w = Graphics.width.to_f * 0.35
  255.     super(x, y, w, h )
  256.     @actor = actor
  257.     refresh
  258.   end
  259.   #--------------------------------------------------------------------------
  260.   # Update
  261.   #--------------------------------------------------------------------------
  262.   def refresh
  263.     self.contents.clear
  264.     draw_basic_info (4, 0)   #NEW WINDOW
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # Display of the basic information
  268.   #     x: displays in x coordinate
  269.   #     y: displays in y coordinate  
  270.   #--------------------------------------------------------------------------
  271.   def draw_basic_info(x, y)
  272.     draw_actor_face         (@actor, x, y + WLH * 0)
  273.     self.contents.font.color = system_color
  274.     self.contents.draw_text (x, y + WLH * 1 + 96, 256, WLH, Vocab::Name)
  275.     draw_actor_name         (@actor, x + 32, y + WLH * 2 + 96)
  276.     self.contents.font.color = system_color
  277.     self.contents.draw_text (x, y + WLH * 3 + 96, 256, WLH, Vocab::Class )
  278.     draw_actor_class        (@actor, x + 32, y +WLH * 4 + 96)
  279.     self.contents.font.color = system_color
  280.     self.contents.draw_text (x, y + WLH * 5 + 96, 256, WLH, Vocab::level )
  281.     draw_actor_level        (@actor, x + 32, y + WLH * 6 + 96)
  282.     self.contents.font.color = system_color
  283.     self.contents.draw_text (x, y + WLH * 7 + 96, 256, WLH, Vocab::Condition )
  284.     draw_actor_state        (@actor, x + 32, y + WLH * 8 + 96)
  285.   end
  286.  
  287.   def draw_parameters(x, y);  end
  288.   def draw_exp_info  (x, y);  end
  289.   def draw_equipments(x, y);  end
  290.  
  291. end
  292.  
  293. #==============================================================================
  294. # Window_Gold
  295. #------------------------------------------------------------------------------
  296. # Window that displays the money.
  297. #==============================================================================
  298. class Window_Gold < Window_Base
  299.   #--------------------------------------------------------------------------
  300.   # Object initialization
  301.   #     x     : X window coordinate
  302.   #     y     : Y window coordinate
  303.   #--------------------------------------------------------------------------
  304.   def initialize(x, y, w = 160)
  305.     super(x, y, w, WLH + 32)
  306.     refresh
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # Update
  310.   #--------------------------------------------------------------------------
  311.   def refresh
  312.     self.contents.clear
  313.     draw_currency_value($game_party.gold, 4, 0, width - 40)
  314.   end
  315. end
  316.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement