jellyjelly

Jelly's Bonus Percent EXP

Oct 3rd, 2015
124
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #===============================================================================
  2. # ** Jelly's Bonus Percent EXP [v1.0]
  3. # Fourm Post: http://goo.gl/Yllrkk
  4. #-------------------------------------------------------------------------------
  5. # - Lets you set a percentage to increase/decrease all exp gains by
  6. #===============================================================================
  7. # ** Credit
  8. #-------------------------------------------------------------------------------
  9. # - Free to use in commercial and otherwise.
  10. # - A little shoutout to myself is appreciated.
  11. # - What I do require is that if you complete a game I be allowed to list it as
  12. # something my work has been included in. I can be contacted at:
  13. # aaron.feldman911@gmail.com Just make sure to have a relevant subject line!
  14. #===============================================================================
  15. # ** Change Log
  16. #-------------------------------------------------------------------------------
  17. # 10/3/15 - v1.0
  18. # - Initial support
  19. #===============================================================================
  20. # ** Compatibility
  21. #-------------------------------------------------------------------------------
  22. # This script aliases Game_Actor's change_exp method.
  23. #===============================================================================
  24. # ** Notes
  25. #-------------------------------------------------------------------------------
  26. # - Currently the message showing how much exp you have gained via battle does
  27. # not take into account what is gained by the bonus. Fixing that may however
  28. # be beyond the scope of the script however.
  29. #===============================================================================
  30. #EDITABLE================EDITABLE===============EDITABLE================EDITABLE
  31. #========EDITABLE================EDITABLE===============EDITABLE================
  32. #================EDITABLE================EDITABLE===============EDITABLE========
  33. # Configuration Module
  34. #-------------------------------------------------------------------------------
  35. module JELLY
  36. BONUS_SWITCH = 1 # change this number to the switch you wish to toggle the ability to gain bonus exp
  37. PERCENT_VARIABLE = 1 # change this number to the variable you wish to hold the percent to increase gained exp by
  38. end
  39. #===============================================================================
  40. #===============================================================================
  41. #===============================================================================
  42. # EDIT AT OWN RISK
  43. #===============================================================================
  44. # ** Game_Actor
  45. #-------------------------------------------------------------------------------
  46. # This class handles actors. It is used within the Game_Actors class
  47. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  48. #===============================================================================
  49. class Game_Actor
  50. #-----------------------------------------------------------------------------
  51. # * Change Experience
  52. # show : Level up display flag
  53. #-----------------------------------------------------------------------------
  54. def change_exp(exp, show)
  55.  
  56. if $game_switches[JELLY::BONUS_SWITCH] == true
  57. percent = $game_variables[JELLY::PERCENT_VARIABLE].to_f/100
  58. bonus = exp * percent
  59. @exp[@class_id] = [exp.to_i + bonus.to_i, 0].max
  60. else # is false
  61. @exp[@class_id] = [exp, 0].max
  62. end
  63.  
  64. last_level = @level
  65. last_skills = skills
  66. level_up while !max_level? && self.exp >= next_level_exp
  67. level_down while self.exp < current_level_exp
  68. display_level_up(skills - last_skills) if show && @level > last_level
  69. refresh
  70. end
  71. end
RAW Paste Data