vindaca510

V's Level Up Stats v1.5

Aug 30th, 2013
921
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  4. #                                                                              #
  5. #                              V's Level Up Stats                              #
  6. #                                 Version  1.5                                 #
  7. #                                                                              #
  8. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  9. #                                Written By:  V                                #
  10. #                      Last Edited:  December 29, 2013                         #
  11. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  12. #                                                                              #
  13. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  14.  
  15.  
  16. #==============================================================================#
  17. #------------------------------------------------------------------------------#
  18. # ** Disclaimer                                                                #
  19. #------------------------------------------------------------------------------#
  20. #                                                                              #
  21. # This script was commissioned by JJR for his doings, I release all copyrights #
  22. # to him regarding this script. My only terms are that I am listed as writer   #
  23. # of this script if a game is ever produced using this script.(Demo's Included)#
  24. # I also ask that I am notified upon release of said game/demo.                #
  25. #                                                                              #
  26. #------------------------------------------------------------------------------#
  27. # ** How To Use                                                                #
  28. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  29. #                                                                              #
  30. # * This script is semi-plug-and-play.                                         #
  31. #                                                                              #
  32. # * All images must be imported to the Graphics/Pictures resource folder       #
  33. #                                                                              #
  34. # * If you wish to use your own images the names must be filled in below,      #
  35. #   the dimensions can vary within reason.                                     #
  36. #                                                                              #
  37. # * The dimensions for the graphics I used and their var names are as follows: #
  38. #                                                                              #
  39. #     Level_Up_Background = 544 x 544                                          #
  40. #     Level_Up_Title = 454 x 76                                                #
  41. #     All Buttons = 16 x 16                                                    #
  42. #                                                                              #
  43. # * ALL CLASSES MUST HAVE THIS TAG OR YOU WILL GET AN ERROR!                   #
  44. #                                                                              #
  45. #   Replace the stats with the amounts you want that classes bonuses.          #
  46. #   If you do not want that classes to use a bonuses for a stat replace        #
  47. #   it with a 1.                                                               #
  48. #                                                                              #
  49. #   <Bonuses: HP, MP, Str, Def, Mat, Mdf, Agi, Luk>                            #
  50. #                                                                              #
  51. #------------------------------------------------------------------------------#
  52. # ** Description                                                               #
  53. #------------------------------------------------------------------------------#
  54. #                                                                              #
  55. #  v0.1                                                                        #
  56. # ~=~=~=~                                                                      #
  57. #                                                                              #
  58. # This script creates a stat distribution window when a player levels. The     #
  59. # player will then be able to add a designated amount of points to the original#
  60. # class base stats created in the database.                                    #
  61. #                                                                              #
  62. #  v0.2                                                                        #
  63. # ~=~=~=~                                                                      #
  64. #                                                                              #
  65. # I fix an issue where the level up screen displays just the class during the  #
  66. # start of game and the name and class upon leveling.                          #
  67. #                                                                              #
  68. #  v1.0                                                                        #
  69. # ~=~=~=~                                                                      #
  70. #                                                                              #
  71. # I added a feature to add bonuses too the params dependent on classes.        #
  72. #                                                                              #
  73. #  v1.1                                                                        #
  74. # ~=~=~=~                                                                      #
  75. #                                                                              #
  76. # I made a few changes to make this script available and useable to the public.#
  77. #                                                                              #
  78. #  v1.2                                                                        #
  79. # ~=~=~=~                                                                      #
  80. #                                                                              #
  81. # Fixed a bug that was not returning the right amount of points upon leveling. #
  82. #                                                                              #
  83. #  v1.3                                                                        #
  84. # ~=~=~=~                                                                      #
  85. #                                                                              #
  86. # I added an option to stop the level up screen from popping up automatically. #
  87. #                                                                              #
  88. #  v1.4                                                                        #
  89. # ~=~=~=~                                                                      #
  90. #                                                                              #
  91. # I removed a lot of unused methods and checks.                                #
  92. #                                                                              #
  93. #  v1.5                                                                        #
  94. # ~=~=~=~                                                                      #
  95. #                                                                              #
  96. # The window size should automatically change to fit the screen's resolution.  #                                #
  97. #                                                                              #
  98. #------------------------------------------------------------------------------#
  99. #==============================================================================#
  100.  
  101.  
  102.  
  103. #==============================================================================
  104. # ** V's Level Up Stats Module
  105. #------------------------------------------------------------------------------
  106. #  This module manages customizable features and methods.
  107. #==============================================================================
  108. module V_Level_Up_Stats
  109.   module Specs
  110.    
  111. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  112. #                                                                              #
  113. #                           Start Customizable Area.                           #
  114. #                                                                              #
  115. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  116. #                                                                              #
  117. #                      ONLY EDIT AFTER THE EQUALS SYMBOL.                      #
  118. #                                                                              #
  119. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  120.    
  121.    
  122.   #============================================================================
  123.   #  Images
  124.   #============================================================================
  125.  
  126.     #--------------------------------------------------------------------------
  127.     #  Background
  128.     #--------------------------------------------------------------------------
  129.  
  130.       Level_Up_Background = "StarlitSky"
  131.    
  132.     #--------------------------------------------------------------------------
  133.     #  Title
  134.     #--------------------------------------------------------------------------
  135.  
  136.       Level_Up_Title = "Level Up Title"
  137.       Level_Up_Title_x = 30
  138.       Level_Up_Title_y = 60
  139.    
  140.     #--------------------------------------------------------------------------
  141.     #  Buttons
  142.     #--------------------------------------------------------------------------
  143.  
  144.       Remove_Button = "Remove"
  145.       Minus_Button = "Minus"
  146.       Plus_Button = "Plus"
  147.       Max_Button = "Max"
  148.  
  149.   #============================================================================
  150.   #  Selector
  151.   #============================================================================
  152.  
  153.     Icon = 338
  154.     Icon_x = 0
  155.     Icon_y = 0
  156.    
  157.   #============================================================================
  158.   #  Additional Options
  159.   #============================================================================
  160.  
  161.     #--------------------------------------------------------------------------
  162.     #  Menu Command Window Options
  163.     #--------------------------------------------------------------------------
  164.  
  165.       Use_Menu_Command = true
  166.       Use_Menu_Command_Only = true
  167.       Level_Up_Command_Title = "Spend Points"
  168.    
  169.     #--------------------------------------------------------------------------
  170.     #  Point Set-Up
  171.     #--------------------------------------------------------------------------
  172.  
  173.       Initial_Points = 0
  174.       Points_Per_Level = 5
  175.       Level_Up_Points_Vocab = "Level Up Points"
  176.    
  177.    
  178. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  179. #                                                                              #
  180. #                            End Customizable Area.                            #
  181. #                                                                              #
  182. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  183. #                                                                              #
  184. #         DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING.         #
  185. #                                                                              #
  186. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  187.    
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.    
  224.   end
  225. end
  226.  
  227. #==============================================================================
  228. # ** Scene Level Up Stats
  229. #------------------------------------------------------------------------------
  230. #  This class performs Path Selection scene processing.
  231. #==============================================================================
  232.  
  233. class Window_Level_Up_Stats < Window_Base
  234.  
  235.   #--------------------------------------------------------------------------
  236.   # * Includes Module's Variables With Class
  237.   #--------------------------------------------------------------------------
  238.  
  239.   include V_Level_Up_Stats::Specs
  240.  
  241.   #--------------------------------------------------------------------------
  242.   # * Start Processing
  243.   #--------------------------------------------------------------------------
  244.  
  245.   def initialize(x, y, w, h)
  246.     super(x, y, w, h)
  247.     @remove_button = []
  248.     @minus_button = []
  249.     @plus_button = []
  250.     @max_button = []
  251.     refresh
  252.   end
  253.  
  254.   #--------------------------------------------------------------------------
  255.   # * Refresh
  256.   #--------------------------------------------------------------------------
  257.  
  258.   def refresh
  259.     contents.clear
  260.     draw_current_actor_graphic
  261.     draw_current_actor_name
  262.     draw_current_actor_class
  263.     draw_availabe_text
  264.     draw_lvupp_vocab
  265.     draw_available_lv_up_points
  266.     draw_lv_up_stats
  267.     draw_lv_up_stat_buttons
  268.     draw_lv_up_accept_buttons
  269.     create_lvup_icon
  270.   end
  271.  
  272.   #--------------------------------------------------------------------------
  273.   # * Draw Current Actor Graphic
  274.   #--------------------------------------------------------------------------
  275.  
  276.   def draw_current_actor_graphic
  277.     x = 90
  278.     y = 220
  279.     actor = $game_party.members[$game_system.leveling_actor]
  280.     draw_actor_graphic(actor, x, y)
  281.   end
  282.  
  283.   #--------------------------------------------------------------------------
  284.   # * Draw Current Actor Name
  285.   #--------------------------------------------------------------------------
  286.  
  287.   def draw_current_actor_name
  288.     x = -180
  289.     y = 30
  290.     w = 544
  291.     h = 416
  292.     actor = $game_party.members[$game_system.leveling_actor]
  293.     draw_text(x, y, w, h, actor.name, 1)
  294.   end
  295.  
  296.   #--------------------------------------------------------------------------
  297.   # * Draw Current Actor Name
  298.   #--------------------------------------------------------------------------
  299.  
  300.   def draw_current_actor_class
  301.     x = -180
  302.     y = 30
  303.     w = 544
  304.     h = 416
  305.     actor = $game_party.members[$game_system.leveling_actor]
  306.     make_font_smaller
  307.     draw_text(x, y + 15, w, h, actor.class.name, 1)
  308.     make_font_bigger
  309.   end
  310.  
  311.   #--------------------------------------------------------------------------
  312.   # * Draw Available Text
  313.   #--------------------------------------------------------------------------
  314.  
  315.   def draw_availabe_text
  316.     x = -180
  317.     y = 75
  318.     w = 544
  319.     h = 416
  320.     actor = $game_party.members[$game_system.leveling_actor]
  321.     make_font_smaller
  322.     draw_text(x, y, w, h, "Available", 1)
  323.     make_font_bigger
  324.   end
  325.  
  326.   #--------------------------------------------------------------------------
  327.   # * Draw Points Vocab
  328.   #--------------------------------------------------------------------------
  329.  
  330.   def draw_lvupp_vocab
  331.     x = -180
  332.     y = 95
  333.     w = 544
  334.     h = 416
  335.     actor = $game_party.members[$game_system.leveling_actor]
  336.     make_font_smaller
  337.     draw_text(x, y, w, h, Level_Up_Points_Vocab, 1)
  338.     make_font_bigger
  339.   end
  340.  
  341.   #--------------------------------------------------------------------------
  342.   # * Draw Available Level Up Points
  343.   #--------------------------------------------------------------------------
  344.  
  345.   def draw_available_lv_up_points
  346.     x = -180
  347.     y = 115
  348.     w = 544
  349.     h = 416
  350.     temp_mhp = $game_party.members[$game_system.leveling_actor].temp_param[0]
  351.     temp_mmp = $game_party.members[$game_system.leveling_actor].temp_param[1]
  352.     temp_atk = $game_party.members[$game_system.leveling_actor].temp_param[2]
  353.     temp_def = $game_party.members[$game_system.leveling_actor].temp_param[3]
  354.     temp_mat = $game_party.members[$game_system.leveling_actor].temp_param[4]
  355.     temp_mdf = $game_party.members[$game_system.leveling_actor].temp_param[5]
  356.     temp_agi = $game_party.members[$game_system.leveling_actor].temp_param[6]
  357.     temp_luk = $game_party.members[$game_system.leveling_actor].temp_param[7]
  358.    
  359.     temp_used_points = temp_mhp + temp_mmp + temp_atk + temp_def + temp_mat + temp_mdf + temp_agi + temp_luk
  360.     actor = $game_party.members[$game_system.leveling_actor]
  361.     points = actor.lvupp - temp_used_points
  362.     draw_text(x, y, w, h, points, 1)
  363.   end
  364.  
  365.   #--------------------------------------------------------------------------
  366.   # * Creates the Accept Button
  367.   #--------------------------------------------------------------------------
  368.  
  369.   def draw_lv_up_accept_buttons
  370.     x = 330
  371.     y = 350
  372.     draw_text_ex(x, y, "Accept")
  373.   end
  374.  
  375.   #--------------------------------------------------------------------------
  376.   # * Draw Bonus Parameters
  377.   #--------------------------------------------------------------------------
  378.  
  379.   def draw_actor_bonus_param(actor, x, y, param_id)
  380.     bonuses = /<Bonuses:\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\s*>/
  381.     note = $data_classes[$game_party.members[$game_system.leveling_actor].class_id].note
  382.     bonostats = note.scan(bonuses)
  383.     bhp = bonostats[0][0]
  384.     bmp = bonostats[0][1]
  385.     batk = bonostats[0][2]
  386.     bdef = bonostats[0][3]
  387.     bmat = bonostats[0][4]
  388.     bmdf = bonostats[0][5]
  389.     bagi = bonostats[0][6]
  390.     bluk = bonostats[0][7]
  391.     bonus_param = [bhp, bmp, batk, bdef, bmat, bmdf, bagi, bluk]
  392.  
  393.     draw_text(x + 210, y, 36, line_height, "x", 2) if param_id == 0
  394.     draw_text(x + 210, y, 36, line_height, "x", 2) if param_id == 1
  395.     draw_text(x + 210, y, 36, line_height, "x", 2) if param_id == 2
  396.     draw_text(x + 210, y, 36, line_height, "x", 2) if param_id == 3
  397.     draw_text(x + 210, y, 36, line_height, "x", 2) if param_id == 4
  398.     draw_text(x + 210, y, 36, line_height, "x", 2) if param_id == 5
  399.     draw_text(x + 210, y, 36, line_height, "x", 2) if param_id == 6
  400.     draw_text(x + 210, y, 36, line_height, "x", 2) if param_id == 7
  401.  
  402.     draw_text(x + 230, y, 36, line_height, bonus_param[0], 2) if param_id == 0
  403.     draw_text(x + 230, y, 36, line_height, bonus_param[1], 2) if param_id == 1
  404.     draw_text(x + 230, y, 36, line_height, bonus_param[2], 2) if param_id == 2
  405.     draw_text(x + 230, y, 36, line_height, bonus_param[3], 2) if param_id == 3
  406.     draw_text(x + 230, y, 36, line_height, bonus_param[4], 2) if param_id == 4
  407.     draw_text(x + 230, y, 36, line_height, bonus_param[5], 2) if param_id == 5
  408.     draw_text(x + 230, y, 36, line_height, bonus_param[6], 2) if param_id == 6
  409.     draw_text(x + 230, y, 36, line_height, bonus_param[7], 2) if param_id == 7
  410.   end
  411.  
  412.   #--------------------------------------------------------------------------
  413.   # * Draw Parameters
  414.   #--------------------------------------------------------------------------
  415.  
  416.   def draw_actor_param(actor, x, y, param_id)
  417.     bonuses = /<Bonuses:\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\s*>/
  418.     note = $data_classes[$game_party.members[$game_system.leveling_actor].class_id].note
  419.     bonostats = note.scan(bonuses)
  420.     bhp = bonostats[0][0].to_i
  421.     bmp = bonostats[0][1].to_i
  422.     batk = bonostats[0][2].to_i
  423.     bdef = bonostats[0][3].to_i
  424.     bmat = bonostats[0][4].to_i
  425.     bmdf = bonostats[0][5].to_i
  426.     bagi = bonostats[0][6].to_i
  427.     bluk = bonostats[0][7].to_i
  428.     bonus_param = [bhp, bmp, batk, bdef, bmat, bmdf, bagi, bluk]
  429.  
  430.     change_color(system_color)
  431.     draw_text(x, y, 120, line_height, Vocab::param(param_id))
  432.     change_color(normal_color)
  433.     draw_text(x + 120, y, 36, line_height, (actor.param(0) + (actor.temp_param[0] * bonus_param[0])), 2) if param_id == 0
  434.     draw_text(x + 120, y, 36, line_height, (actor.param(1) + (actor.temp_param[1] * bonus_param[1])), 2) if param_id == 1
  435.     draw_text(x + 120, y, 36, line_height, (actor.param(2) + (actor.temp_param[2] * bonus_param[2])), 2) if param_id == 2
  436.     draw_text(x + 120, y, 36, line_height, (actor.param(3) + (actor.temp_param[3] * bonus_param[3])), 2) if param_id == 3
  437.     draw_text(x + 120, y, 36, line_height, (actor.param(4) + (actor.temp_param[4] * bonus_param[4])), 2) if param_id == 4
  438.     draw_text(x + 120, y, 36, line_height, (actor.param(5) + (actor.temp_param[5] * bonus_param[5])), 2) if param_id == 5
  439.     draw_text(x + 120, y, 36, line_height, (actor.param(6) + (actor.temp_param[6] * bonus_param[6])), 2) if param_id == 6
  440.     draw_text(x + 120, y, 36, line_height, (actor.param(7) + (actor.temp_param[7] * bonus_param[7])), 2) if param_id == 7
  441.   end
  442.  
  443.   #--------------------------------------------------------------------------
  444.   # * Draw Level Up Stats
  445.   #--------------------------------------------------------------------------
  446.  
  447.   def draw_lv_up_stats
  448.     line_height = 25
  449.     x = 220
  450.     y = 145
  451.     actor = $game_party.members[$game_system.leveling_actor]
  452.     8.times {|i| draw_actor_bonus_param(actor, x, y + line_height * i, i) }
  453.     8.times {|i| draw_actor_param(actor, x, y + line_height * i, i) }
  454.   end
  455.  
  456.   #--------------------------------------------------------------------------
  457.   # * Draw Level Up Stat Buttons
  458.   #--------------------------------------------------------------------------
  459.  
  460.   def draw_lv_up_stat_buttons
  461.     i = 1
  462.     x = 300
  463.     y = 131
  464.     pad = 5
  465.     8.times {
  466.     draw_remove_button(i, x, y + pad)
  467.     draw_minus_button(i, x, y + pad)
  468.     draw_plus_button(i, x, y + pad)
  469.     draw_max_button(i, x, y + pad)
  470.     i += 1
  471.     }
  472.   end
  473.  
  474.   #--------------------------------------------------------------------------
  475.   # * Draws the Remove Button
  476.   #--------------------------------------------------------------------------
  477.  
  478.   def draw_remove_button(i, x, y)
  479.     line_height = 25
  480.     @remove_button[i] = Sprite.new
  481.     @remove_button[i].bitmap = Cache.picture(Remove_Button)
  482.     @remove_button[i].x = x
  483.     @remove_button[i].y = y + line_height * i
  484.     @remove_button[i].z = 20
  485.   end
  486.  
  487.   #--------------------------------------------------------------------------
  488.   # * Draws the Minus Button
  489.   #--------------------------------------------------------------------------
  490.  
  491.   def draw_minus_button(i, x, y)
  492.     line_height = 25
  493.     @minus_button[i] = Sprite.new
  494.     @minus_button[i].bitmap = Cache.picture(Minus_Button)
  495.     @minus_button[i].x = x + 25
  496.     @minus_button[i].y = y + line_height * i
  497.     @minus_button[i].z = 20
  498.   end
  499.  
  500.   #--------------------------------------------------------------------------
  501.   # * Draws the Plus Button
  502.   #--------------------------------------------------------------------------
  503.  
  504.   def draw_plus_button(i, x, y)
  505.     line_height = 25
  506.     @plus_button[i] = Sprite.new
  507.     @plus_button[i].bitmap = Cache.picture(Plus_Button)
  508.     @plus_button[i].x = x + 100
  509.     @plus_button[i].y = y + line_height * i
  510.     @plus_button[i].z = 20
  511.   end
  512.  
  513.   #--------------------------------------------------------------------------
  514.   # * Draws the Max Button
  515.   #--------------------------------------------------------------------------
  516.  
  517.   def draw_max_button(i, x, y)
  518.     line_height = 25
  519.     @max_button[i] = Sprite.new
  520.     @max_button[i].bitmap = Cache.picture(Max_Button)
  521.     @max_button[i].x = x + 125
  522.     @max_button[i].y = y + line_height * i
  523.     @max_button[i].z = 20
  524.   end
  525.  
  526.   #--------------------------------------------------------------------------
  527.   # * Creates the Selection Icon
  528.   #--------------------------------------------------------------------------
  529.  
  530.   def create_lvup_icon
  531.    
  532.     ix = Icon_x
  533.     iy = Icon_y
  534.    
  535.     if $game_system.icon_y == 8
  536.       x = 310 + ix
  537.       y = 362 + iy
  538.     else
  539.       x = 275 + ix if $game_system.icon_x == 0 && $game_system.icon_y != 8
  540.       x = 300 + ix if $game_system.icon_x == 1 && $game_system.icon_y != 8
  541.       x = 375 + ix if $game_system.icon_x == 2 && $game_system.icon_y != 8
  542.       x = 400 + ix if $game_system.icon_x == 3 && $game_system.icon_y != 8
  543.       y = 153 + iy if $game_system.icon_y == 0
  544.       y = 178 + iy if $game_system.icon_y == 1
  545.       y = 203 + iy if $game_system.icon_y == 2
  546.       y = 228 + iy if $game_system.icon_y == 3
  547.       y = 253 + iy if $game_system.icon_y == 4
  548.       y = 278 + iy if $game_system.icon_y == 5
  549.       y = 303 + iy if $game_system.icon_y == 6
  550.       y = 328 + iy if $game_system.icon_y == 7
  551.     end
  552.    
  553.     draw_icon(Icon, x, y)
  554.   end
  555.  
  556.   #--------------------------------------------------------------------------
  557.   # * Add the Temp Stats to Actors Added Stats
  558.   #--------------------------------------------------------------------------
  559.  
  560.   def add_stats
  561.     bonuses = /<Bonuses:\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)\s*>/
  562.     note = $data_classes[$game_party.members[$game_system.leveling_actor].class_id].note
  563.     bonostats = note.scan(bonuses)
  564.     bhp = bonostats[0][0].to_i
  565.     bmp = bonostats[0][1].to_i
  566.     batk = bonostats[0][2].to_i
  567.     bdef = bonostats[0][3].to_i
  568.     bmat = bonostats[0][4].to_i
  569.     bmdf = bonostats[0][5].to_i
  570.     bagi = bonostats[0][6].to_i
  571.     bluk = bonostats[0][7].to_i
  572.     bonus_param = [bhp, bmp, batk, bdef, bmat, bmdf, bagi, bluk]
  573.  
  574.     temp_mhp = $game_party.members[$game_system.leveling_actor].temp_param[0]
  575.     temp_mmp = $game_party.members[$game_system.leveling_actor].temp_param[1]
  576.     temp_atk = $game_party.members[$game_system.leveling_actor].temp_param[2]
  577.     temp_def = $game_party.members[$game_system.leveling_actor].temp_param[3]
  578.     temp_mat = $game_party.members[$game_system.leveling_actor].temp_param[4]
  579.     temp_mdf = $game_party.members[$game_system.leveling_actor].temp_param[5]
  580.     temp_agi = $game_party.members[$game_system.leveling_actor].temp_param[6]
  581.     temp_luk = $game_party.members[$game_system.leveling_actor].temp_param[7]
  582.    
  583.     temp_used_points = temp_mhp + temp_mmp + temp_atk + temp_def + temp_mat + temp_mdf + temp_agi + temp_luk
  584.     actor = $game_party.members[$game_system.leveling_actor]
  585.     points = actor.lvupp - temp_used_points
  586.  
  587.     8.times {|i| $game_party.members[$game_system.leveling_actor].added_param[i] += (actor.temp_param[i] * bonus_param[i])} unless actor == nil
  588.     8.times {|i| $game_party.members[0].added_param[i] += (actor.temp_param[i] * bonus_param[i])} if actor == nil
  589.  
  590.     reset_temp_stats
  591.   end
  592.  
  593.   #--------------------------------------------------------------------------
  594.   # * Resets the Temp Stats to 0
  595.   #--------------------------------------------------------------------------
  596.  
  597.   def reset_temp_stats
  598.     temp_mhp = $game_party.members[$game_system.leveling_actor].temp_param[0]
  599.     temp_mmp = $game_party.members[$game_system.leveling_actor].temp_param[1]
  600.     temp_atk = $game_party.members[$game_system.leveling_actor].temp_param[2]
  601.     temp_def = $game_party.members[$game_system.leveling_actor].temp_param[3]
  602.     temp_mat = $game_party.members[$game_system.leveling_actor].temp_param[4]
  603.     temp_mdf = $game_party.members[$game_system.leveling_actor].temp_param[5]
  604.     temp_agi = $game_party.members[$game_system.leveling_actor].temp_param[6]
  605.     temp_luk = $game_party.members[$game_system.leveling_actor].temp_param[7]
  606.    
  607.     temp_used_points = temp_mhp + temp_mmp + temp_atk + temp_def + temp_mat + temp_mdf + temp_agi + temp_luk
  608.     8.times {|i| $game_party.members[$game_system.leveling_actor].temp_param[i] = 0 }
  609.   end
  610.  
  611.   #--------------------------------------------------------------------------
  612.   # * Dispose Level Up Stat Buttons
  613.   #--------------------------------------------------------------------------
  614.  
  615.   def dispose_lv_up_stat_buttons
  616.     i = 1
  617.     8.times {
  618.     @remove_button[i].dispose
  619.     @remove_button[i].bitmap.dispose
  620.     @minus_button[i].dispose
  621.     @minus_button[i].bitmap.dispose
  622.     @plus_button[i].dispose
  623.     @plus_button[i].bitmap.dispose
  624.     @max_button[i].dispose
  625.     @max_button[i].bitmap.dispose
  626.     i += 1
  627.     }
  628.   end
  629.  
  630. end
  631.  
  632.  
  633.  
  634.  
  635. #==============================================================================
  636. # ** Scene Level Up Stats
  637. #------------------------------------------------------------------------------
  638. #  This class performs Path Selection scene processing.
  639. #==============================================================================
  640.  
  641. class Scene_Level_Up_Stats < Scene_Base
  642.  
  643.   #--------------------------------------------------------------------------
  644.   # * Includes Module's Variables With Class
  645.   #--------------------------------------------------------------------------
  646.  
  647.   include V_Level_Up_Stats::Specs
  648.  
  649.   #--------------------------------------------------------------------------
  650.   # * Start Processing
  651.   #--------------------------------------------------------------------------
  652.  
  653.   def start
  654.     super
  655.     $game_system.icon_y = 8
  656.     actor = $game_party.members
  657.    
  658.     actor.each_index do |i|
  659.       if actor[i].lvupp > 0
  660.         $game_system.leveling_actor = i
  661.         break
  662.       else
  663.         $game_system.leveling_actor = 0
  664.       end
  665.     end
  666.      
  667.     create_lvup_bg
  668.     create_lvup_title
  669.     create_stat_window
  670.   end
  671.  
  672.   #--------------------------------------------------------------------------
  673.   # * Creates the Level Up Stats Background
  674.   #--------------------------------------------------------------------------
  675.  
  676.   def create_lvup_bg
  677.     @lvup_bg = Sprite.new
  678.     @lvup_bg.bitmap = Cache.picture(Level_Up_Background)
  679.     @lvup_bg.x = 0
  680.     @lvup_bg.y = 0
  681.     @lvup_bg.z = 1
  682.     @lvup_bg.zoom_x = (Graphics.width / 544)
  683.     @lvup_bg.zoom_y = (Graphics.height / 416)
  684.   end
  685.  
  686.   #--------------------------------------------------------------------------
  687.   # * Creates the Stat Window
  688.   #--------------------------------------------------------------------------
  689.  
  690.   def create_stat_window
  691.     @lvup_window = Window_Level_Up_Stats.new(0, 0, Graphics.width, Graphics.height)
  692.     @lvup_window.back_opacity = 0
  693.   end
  694.  
  695.   #--------------------------------------------------------------------------
  696.   # * Creates the Level Up Title Picture
  697.   #--------------------------------------------------------------------------
  698.  
  699.   def create_lvup_title
  700.     @lvup_title = Sprite.new
  701.     @lvup_title.bitmap = Cache.picture(Level_Up_Title)
  702.     @lvup_title.x = Level_Up_Title_x
  703.     @lvup_title.y = Level_Up_Title_y
  704.     @lvup_title.z = 4
  705.   end
  706.  
  707.   #--------------------------------------------------------------------------
  708.   # * Disposes the Level Up Background
  709.   #--------------------------------------------------------------------------
  710.  
  711.   def dispose_lvup_graphics
  712.     @lvup_bg.dispose
  713.     @lvup_bg.bitmap.dispose
  714.     @lvup_title.dispose
  715.     @lvup_title.bitmap.dispose
  716.   end
  717.  
  718.   #--------------------------------------------------------------------------
  719.   # * Process the Inputs for the Stat selection
  720.   #--------------------------------------------------------------------------
  721.  
  722.   def process_stat_input
  723.     leveling_actor = $game_system.leveling_actor
  724.    
  725.     if Input.trigger?(:LEFT) && $game_system.icon_x > 0
  726.       $game_system.icon_x -= 1
  727.       Sound.play_cursor
  728.       @lvup_window.refresh
  729.     elsif Input.trigger?(:LEFT) && $game_system.icon_x == 0
  730.       $game_system.icon_x = 3
  731.       Sound.play_cursor
  732.       @lvup_window.refresh
  733.     elsif Input.trigger?(:RIGHT) && $game_system.icon_x < 3
  734.       $game_system.icon_x += 1
  735.       Sound.play_cursor
  736.       @lvup_window.refresh
  737.     elsif Input.trigger?(:RIGHT) && $game_system.icon_x == 3
  738.       $game_system.icon_x = 0
  739.       Sound.play_cursor
  740.       @lvup_window.refresh
  741.     elsif Input.trigger?(:UP) && $game_system.icon_y > 0
  742.       $game_system.icon_y -= 1
  743.       Sound.play_cursor
  744.       @lvup_window.refresh
  745.     elsif Input.trigger?(:UP) && $game_system.icon_y == 0
  746.       $game_system.icon_y = 8
  747.       Sound.play_cursor
  748.       @lvup_window.refresh
  749.     elsif Input.trigger?(:DOWN) && $game_system.icon_y < 8
  750.       $game_system.icon_y += 1
  751.       Sound.play_cursor
  752.       @lvup_window.refresh
  753.     elsif Input.trigger?(:DOWN) && $game_system.icon_y == 8
  754.       $game_system.icon_y = 0
  755.       Sound.play_cursor
  756.       @lvup_window.refresh
  757.     elsif Input.trigger?(:A)
  758.       @lvup_window.reset_temp_stats
  759.       @lvup_window.refresh
  760.       Sound.play_cursor
  761.     elsif Input.trigger?(:L)
  762.       $game_system.leveling_actor = ($game_party.members.size - 1) if leveling_actor == 0
  763.       $game_system.leveling_actor -= 1 unless leveling_actor == 0
  764.       @lvup_window.reset_temp_stats
  765.       @lvup_window.refresh
  766.       Sound.play_cursor unless $game_party.members.size == 1
  767.       Sound.play_buzzer if $game_party.members.size == 1
  768.     elsif Input.trigger?(:R)
  769.       $game_system.leveling_actor = 0 if leveling_actor == ($game_party.members.size - 1)
  770.       $game_system.leveling_actor += 1 unless leveling_actor == ($game_party.members.size - 1)
  771.       @lvup_window.reset_temp_stats
  772.       @lvup_window.refresh
  773.       Sound.play_cursor unless $game_party.members.size == 1
  774.       Sound.play_buzzer if $game_party.members.size == 1
  775.     elsif Input.trigger?(:B)
  776.       Sound.play_cancel
  777.       @lvup_window.dispose
  778.       dispose_lvup_graphics
  779.       @lvup_window.dispose_lv_up_stat_buttons
  780.       @lvup_window.reset_temp_stats
  781.       $game_system.leveling = false
  782.       SceneManager.goto(Scene_Map) unless $game_system.menu_usage
  783.       return_scene if $game_system.menu_usage
  784.     elsif Input.trigger?(:C)
  785.       process_ok unless $game_system.icon_y == 8
  786.       process_accept if $game_system.icon_y == 8
  787.     end
  788.    
  789.   end
  790.  
  791.   #--------------------------------------------------------------------------
  792.   # * OK Accept
  793.   #--------------------------------------------------------------------------
  794.  
  795.   def process_accept
  796.     temp_mhp = $game_party.members[$game_system.leveling_actor].temp_param[0]
  797.     temp_mmp = $game_party.members[$game_system.leveling_actor].temp_param[1]
  798.     temp_atk = $game_party.members[$game_system.leveling_actor].temp_param[2]
  799.     temp_def = $game_party.members[$game_system.leveling_actor].temp_param[3]
  800.     temp_mat = $game_party.members[$game_system.leveling_actor].temp_param[4]
  801.     temp_mdf = $game_party.members[$game_system.leveling_actor].temp_param[5]
  802.     temp_agi = $game_party.members[$game_system.leveling_actor].temp_param[6]
  803.     temp_luk = $game_party.members[$game_system.leveling_actor].temp_param[7]
  804.    
  805.     temp_used_points = temp_mhp + temp_mmp + temp_atk + temp_def + temp_mat + temp_mdf + temp_agi + temp_luk
  806.     actor = $game_party.members[$game_system.leveling_actor]
  807.     points = actor.lvupp - temp_used_points
  808.     param_id = $game_system.icon_y
  809.     $game_system.leveling = false
  810.     SceneManager.goto(Scene_Map) unless $game_system.menu_usage
  811.     return_scene if $game_system.menu_usage
  812.     @lvup_window.add_stats
  813.     $game_party.members[$game_system.leveling_actor].lvupp -= temp_used_points
  814.     @lvup_window.reset_temp_stats
  815.     @lvup_window.refresh
  816.     $game_system.menu_usage = false
  817.   end
  818.    
  819.   #--------------------------------------------------------------------------
  820.   # * OK Processing
  821.   #--------------------------------------------------------------------------
  822.  
  823.   def process_ok
  824.     temp_mhp = $game_party.members[$game_system.leveling_actor].temp_param[0]
  825.     temp_mmp = $game_party.members[$game_system.leveling_actor].temp_param[1]
  826.     temp_atk = $game_party.members[$game_system.leveling_actor].temp_param[2]
  827.     temp_def = $game_party.members[$game_system.leveling_actor].temp_param[3]
  828.     temp_mat = $game_party.members[$game_system.leveling_actor].temp_param[4]
  829.     temp_mdf = $game_party.members[$game_system.leveling_actor].temp_param[5]
  830.     temp_agi = $game_party.members[$game_system.leveling_actor].temp_param[6]
  831.     temp_luk = $game_party.members[$game_system.leveling_actor].temp_param[7]
  832.    
  833.     temp_used_points = temp_mhp + temp_mmp + temp_atk + temp_def + temp_mat + temp_mdf + temp_agi + temp_luk
  834.     actor = $game_party.members[$game_system.leveling_actor]
  835.     points = actor.lvupp - temp_used_points
  836.     param_id = $game_system.icon_y
  837.    
  838.     case
  839.     when $game_system.icon_x == 0
  840.      
  841.       if actor.temp_param[param_id] == 0
  842.         Sound.play_buzzer
  843.       else
  844.         $game_party.members[$game_system.leveling_actor].temp_param[param_id] -= $game_party.members[$game_system.leveling_actor].temp_param[param_id]
  845.         Sound.play_ok
  846.       end
  847.      
  848.     when $game_system.icon_x == 1
  849.      
  850.       if actor.temp_param[param_id] == 0
  851.         Sound.play_buzzer
  852.       else
  853.         $game_party.members[$game_system.leveling_actor].temp_param[param_id] -= 1
  854.         Sound.play_ok
  855.       end
  856.      
  857.     when $game_system.icon_x == 2
  858.      
  859.       if points == 0
  860.         Sound.play_buzzer
  861.       else
  862.         $game_party.members[$game_system.leveling_actor].temp_param[param_id] += 1
  863.         Sound.play_ok
  864.       end
  865.      
  866.     when $game_system.icon_x == 3
  867.      
  868.       if points == 0
  869.         Sound.play_buzzer
  870.       else
  871.         $game_party.members[$game_system.leveling_actor].temp_param[param_id] += points
  872.         Sound.play_ok
  873.       end
  874.      
  875.     end
  876.    
  877.     @lvup_window.refresh
  878.   end
  879.  
  880.   #--------------------------------------------------------------------------
  881.   # * Update Processing
  882.   #--------------------------------------------------------------------------
  883.  
  884.   def update
  885.     super
  886.     process_stat_input
  887.   end
  888.  
  889. end
  890.  
  891.  
  892.      
  893.  
  894. #==============================================================================
  895. # ** Window_MenuCommand
  896. #------------------------------------------------------------------------------
  897. #  This command window appears on the menu screen.
  898. #==============================================================================
  899.  
  900. class Window_MenuCommand < Window_Command
  901.  
  902.   #--------------------------------------------------------------------------
  903.   # * Includes Module's Variables With Class
  904.   #--------------------------------------------------------------------------
  905.  
  906.   include V_Level_Up_Stats::Specs
  907.  
  908.   #--------------------------------------------------------------------------
  909.   # * For Creating An Alias
  910.   #--------------------------------------------------------------------------
  911.  
  912.   alias :aoc13215 :add_original_commands
  913.  
  914.   #--------------------------------------------------------------------------
  915.   # * For Adding Original Commands
  916.   #--------------------------------------------------------------------------
  917.  
  918.   def add_original_commands
  919.     aoc13215()
  920.    
  921.     if Use_Menu_Command
  922.      
  923.       $game_party.members.each_index do |i|
  924.        
  925.         if $game_party.members[i].lvupp > 0 || $game_party.members[i].lvupp != nil
  926.           add_command(Level_Up_Command_Title, :level_up_stats)
  927.         end
  928.         break
  929.       end
  930.      
  931.     end
  932.    
  933.   end
  934.  
  935. end
  936.  
  937.  
  938.  
  939.  
  940. #==============================================================================
  941. # ** Scene_Menu
  942. #------------------------------------------------------------------------------
  943. #  This class performs the menu screen processing.
  944. #==============================================================================
  945.  
  946. class Scene_Menu < Scene_MenuBase
  947.  
  948.  
  949.   #--------------------------------------------------------------------------
  950.   # * Includes Module's Variables With Class
  951.   #--------------------------------------------------------------------------
  952.  
  953.   include V_Level_Up_Stats::Specs
  954.  
  955.   #--------------------------------------------------------------------------
  956.   # * For Creating An Alias
  957.   #--------------------------------------------------------------------------
  958.  
  959.   alias :ccw13215 :create_command_window
  960.  
  961.   #--------------------------------------------------------------------------
  962.   # * Create Command Window
  963.   #--------------------------------------------------------------------------
  964.  
  965.   def create_command_window
  966.     ccw13215()
  967.    
  968.     if Use_Menu_Command
  969.       @command_window.set_handler(:level_up_stats,    method(:command_level_up_stats))
  970.       $game_system.menu_usage = true
  971.     end
  972.    
  973.   end
  974.  
  975.   #--------------------------------------------------------------------------
  976.   # * [Save] Command
  977.   #--------------------------------------------------------------------------
  978.  
  979.   def command_level_up_stats
  980.     SceneManager.call(Scene_Level_Up_Stats)
  981.   end
  982.  
  983. end
  984.  
  985.  
  986. #==============================================================================
  987. # ** Game_Actor
  988. #------------------------------------------------------------------------------
  989. #  This class handles actors. It is used within the Game_Actors class
  990. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  991. #==============================================================================
  992.  
  993. class Game_Actor < Game_Battler
  994.  
  995.   #--------------------------------------------------------------------------
  996.   # * Includes Module's Variables With Class
  997.   #--------------------------------------------------------------------------
  998.  
  999.   include V_Level_Up_Stats::Specs
  1000.  
  1001.   #--------------------------------------------------------------------------
  1002.   # * Public Instance Variables
  1003.   #--------------------------------------------------------------------------
  1004.  
  1005.   attr_accessor :lvupp
  1006.   attr_accessor :added_param
  1007.   attr_accessor :temp_param
  1008.  
  1009.   #--------------------------------------------------------------------------
  1010.   # * For Creating An Alias
  1011.   #--------------------------------------------------------------------------
  1012.  
  1013.   alias :old_init787687322 :initialize
  1014.  
  1015.   #--------------------------------------------------------------------------
  1016.   # * Object Initialization
  1017.   #--------------------------------------------------------------------------
  1018.  
  1019.   def initialize(actor_id)
  1020.     super()
  1021.     @lvupp = Initial_Points
  1022.     @added_param = [0, 0, 0, 0, 0, 0, 0, 0]
  1023.     @temp_param = [0, 0, 0, 0, 0, 0, 0, 0]
  1024.     old_init787687322(actor_id)
  1025.   end
  1026.  
  1027.   #--------------------------------------------------------------------------
  1028.   # * For Creating An Alias
  1029.   #--------------------------------------------------------------------------
  1030.  
  1031.   alias :old_param_base5547 :param_base
  1032.  
  1033.   #--------------------------------------------------------------------------
  1034.   # * Get Base Value of Parameter
  1035.   #--------------------------------------------------------------------------
  1036.   def param_base(param_id)
  1037.     old_param_base5547(param_id) + @added_param[param_id]
  1038.   end  
  1039.  
  1040.   #--------------------------------------------------------------------------
  1041.   # * For Creating An Alias
  1042.   #--------------------------------------------------------------------------
  1043.  
  1044.   alias :old_level_up546345 :level_up
  1045.  
  1046.   #--------------------------------------------------------------------------
  1047.   # * Level Up
  1048.   #--------------------------------------------------------------------------
  1049.   def level_up
  1050.     old_level_up546345()
  1051.     @lvupp += Points_Per_Level
  1052.     $game_system.leveling = true
  1053.   end
  1054.  
  1055. end
  1056.  
  1057.  
  1058. #==============================================================================
  1059. # ** Game_Player
  1060. #------------------------------------------------------------------------------
  1061. #  This class handles the player. It includes event starting determinants and
  1062. # map scrolling functions. The instance of this class is referenced by
  1063. # $game_player.
  1064. #==============================================================================
  1065.  
  1066. class Game_Player < Game_Character
  1067.  
  1068.   #--------------------------------------------------------------------------
  1069.   # * Includes Module's Variables With Class
  1070.   #--------------------------------------------------------------------------
  1071.  
  1072.   include V_Level_Up_Stats::Specs
  1073.  
  1074.   #--------------------------------------------------------------------------
  1075.   # * For Creating An Alias
  1076.   #--------------------------------------------------------------------------
  1077.  
  1078.   alias :update417546345 :update
  1079.  
  1080.   #--------------------------------------------------------------------------
  1081.   # * Frame Update
  1082.   #--------------------------------------------------------------------------
  1083.   def update
  1084.     update417546345()
  1085.     check_leveling
  1086.   end
  1087.  
  1088.   def check_leveling
  1089.     SceneManager.call(Scene_Level_Up_Stats) if $game_system.leveling && Use_Menu_Command_Only == false
  1090.   end
  1091.  
  1092. end
  1093.  
  1094.  
  1095.  
  1096.  
  1097. #==============================================================================
  1098. # ** Game_System
  1099. #------------------------------------------------------------------------------
  1100. #  This class handles system data. It saves the disable state of saving and
  1101. # menus. Instances of this class are referenced by $game_system.
  1102. #==============================================================================
  1103.  
  1104. class Game_System
  1105.  
  1106.   #--------------------------------------------------------------------------
  1107.   # * Includes Module's Variables With Class
  1108.   #--------------------------------------------------------------------------
  1109.  
  1110.   include V_Level_Up_Stats::Specs
  1111.  
  1112.   #--------------------------------------------------------------------------
  1113.   # * Public Instance Variables
  1114.   #--------------------------------------------------------------------------
  1115.   attr_accessor :leveling
  1116.   attr_accessor :leveling_actor
  1117.   attr_accessor :icon_x
  1118.   attr_accessor :icon_y
  1119.   attr_accessor :menu_usage
  1120.  
  1121.   #--------------------------------------------------------------------------
  1122.   # * For Creating An Alias
  1123.   #--------------------------------------------------------------------------
  1124.  
  1125.   alias :old_init7527 :initialize
  1126.  
  1127.   #--------------------------------------------------------------------------
  1128.   # * Object Initialization
  1129.   #--------------------------------------------------------------------------
  1130.  
  1131.   def initialize
  1132.    
  1133.     @leveling = false
  1134.     @leveling_actor = 0
  1135.     @icon_x = 0
  1136.     @icon_y = 0
  1137.     @menu_usage = false
  1138.     old_init7527()
  1139.   end
  1140.  
  1141. end
RAW Paste Data