Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # ** Jelly's Bonus Percent EXP [v1.0]
- # Fourm Post: http://goo.gl/Yllrkk
- #-------------------------------------------------------------------------------
- # - Lets you set a percentage to increase/decrease all exp gains by
- #===============================================================================
- # ** Credit
- #-------------------------------------------------------------------------------
- # - Free to use in commercial and otherwise.
- # - A little shoutout to myself is appreciated.
- # - What I do require is that if you complete a game I be allowed to list it as
- # something my work has been included in. I can be contacted at:
- # aaron.feldman911@gmail.com Just make sure to have a relevant subject line!
- #===============================================================================
- # ** Change Log
- #-------------------------------------------------------------------------------
- # 10/3/15 - v1.0
- # - Initial support
- #===============================================================================
- # ** Compatibility
- #-------------------------------------------------------------------------------
- # This script aliases Game_Actor's change_exp method.
- #===============================================================================
- # ** Notes
- #-------------------------------------------------------------------------------
- # - Currently the message showing how much exp you have gained via battle does
- # not take into account what is gained by the bonus. Fixing that may however
- # be beyond the scope of the script however.
- #===============================================================================
- #EDITABLE================EDITABLE===============EDITABLE================EDITABLE
- #========EDITABLE================EDITABLE===============EDITABLE================
- #================EDITABLE================EDITABLE===============EDITABLE========
- # Configuration Module
- #-------------------------------------------------------------------------------
- module JELLY
- BONUS_SWITCH = 1 # change this number to the switch you wish to toggle the ability to gain bonus exp
- PERCENT_VARIABLE = 1 # change this number to the variable you wish to hold the percent to increase gained exp by
- end
- #===============================================================================
- #===============================================================================
- #===============================================================================
- # EDIT AT OWN RISK
- #===============================================================================
- # ** Game_Actor
- #-------------------------------------------------------------------------------
- # This class handles actors. It is used within the Game_Actors class
- # ($game_actors) and is also referenced from the Game_Party class ($game_party).
- #===============================================================================
- class Game_Actor
- #-----------------------------------------------------------------------------
- # * Change Experience
- # show : Level up display flag
- #-----------------------------------------------------------------------------
- def change_exp(exp, show)
- if $game_switches[JELLY::BONUS_SWITCH] == true
- percent = $game_variables[JELLY::PERCENT_VARIABLE].to_f/100
- bonus = exp * percent
- @exp[@class_id] = [exp.to_i + bonus.to_i, 0].max
- else # is false
- @exp[@class_id] = [exp, 0].max
- end
- last_level = @level
- last_skills = skills
- level_up while !max_level? && self.exp >= next_level_exp
- level_down while self.exp < current_level_exp
- display_level_up(skills - last_skills) if show && @level > last_level
- refresh
- end
- end
RAW Paste Data