MrTrivel

Actor Stats on Level Up

Jun 30th, 2014
606
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # )----------------------------------------------------------------------------(
  2. # )--     AUTHOR:     Mr Trivel                                              --(
  3. # )--     NAME:       Actor Stats on Level Up                                --(
  4. # )--     CREATED:    2014-06-30                                             --(
  5. # )--     VERSION:    1.0                                                    --(
  6. # )----------------------------------------------------------------------------(
  7. # )--                         VERSION HISTORY                                --(
  8. # )--  1.0 - Initial push.                                                   --(
  9. # )----------------------------------------------------------------------------(
  10. # )--                          DESCRIPTION                                   --(
  11. # )--  Instead of setting every and single stat for the level ups, you can   --(
  12. # )--  just write a formula in that actors note box.                         --(
  13. # )----------------------------------------------------------------------------(
  14. # )--                          INSTRUCTIONS                                  --(
  15. # )--  The stat you want to be increased by formula on level up, write e.g.: --(
  16. # )--  <MHP: 50 + (@level/10).ceil> - Actor will get 50 HP + extra HP from   --(
  17. # )--  10th level                                                            --(
  18. # )--  <MMP: 10 + @level> - Actor will get 10 + number of his level Max MP.  --(
  19. # )--  <ATK: @level> - Actor will get his level number of ATK.               --(
  20. # )--  <DEF: 3 + @level> - Actor will get his level number + 3 of DEF.       --(
  21. # )--  <MAT: 7> - Actor will get plain 7 MAT each level.                     --(
  22. # )--  <MDF: 5> - Same as above, just 5.                                     --(
  23. # )--  <AGI: 5 + rand(3)> - Actor will get 5 + 0/1/2 AGI per level.          --(
  24. # )--  <LUK: 1> - Actor will get flat 1 LUK per level.                       --(
  25. # )--  In actors note tag.                                                   --(
  26. # )----------------------------------------------------------------------------(
  27. # )--                          LICENSE INFO                                  --(
  28. # )--    http://mrtrivelvx.wordpress.com/terms-of-use/                       --(
  29. # )----------------------------------------------------------------------------(
  30.  
  31. # )----------------------------------------------------------------------------(
  32. # )--  Class: Game_Actor                                                     --(
  33. # )----------------------------------------------------------------------------(
  34. class Game_Actor < Game_Battler
  35.   # )--------------------------------------------------------------------------(
  36.   # )--  Aliases: setup, level_up                                            --(
  37.   # )--------------------------------------------------------------------------(
  38.   alias :mrts_ga_setup :setup
  39.   alias :mrts_ga_level_up :level_up
  40.  
  41.   # )--------------------------------------------------------------------------(
  42.   # )--  Alias Method: setup                                                 --(
  43.   # )--------------------------------------------------------------------------(
  44.   def setup(actor_id)
  45.     mrts_ga_setup(actor_id)
  46.     @stat_formulas = []
  47.     @stat_formulas.push(actor.note =~ /<MHP:(.+)>/i ? $1 : "0")
  48.     @stat_formulas.push(actor.note =~ /<MMP:(.+)>/i ? $1 : "0")
  49.     @stat_formulas.push(actor.note =~ /<ATK:(.+)>/i ? $1 : "0")
  50.     @stat_formulas.push(actor.note =~ /<DEF:(.+)>/i ? $1 : "0")
  51.     @stat_formulas.push(actor.note =~ /<MAT:(.+)>/i ? $1 : "0")
  52.     @stat_formulas.push(actor.note =~ /<MDF:(.+)>/i ? $1 : "0")
  53.     @stat_formulas.push(actor.note =~ /<AGI:(.+)>/i ? $1 : "0")
  54.     @stat_formulas.push(actor.note =~ /<LUK:(.+)>/i ? $1 : "0")
  55.   end
  56.  
  57.   # )--------------------------------------------------------------------------(
  58.   # )--  Alias Method: level_up                                              --(
  59.   # )--------------------------------------------------------------------------(
  60.   def level_up
  61.     mrts_ga_level_up
  62.     count = 0
  63.     @stat_formulas.each { |i| add_param(count, eval(i)) ; count += 1 }
  64.   end
  65. end
RAW Paste Data