Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- # THIS IS A SNIPPET FOR MY PERFECT STAT POINT DISTRUBUTION SCRIPT TO ALLOW FOR
- # EACH ACTOR TO HAVE DIFFERENT FORMULAS FOR GAINING LEVEL UP POINTS
- # PLACE THIS SCRIPT BELOW THE STAT POINT DISTRIBUTION SCRIPT !!
- #
- # BIG NOTE:
- # The old script calls of $pts and $bonuspts to change level up points should
- # !! NoT !! be used if using this snippet.
- # NEW Script calls:
- # $game_actors[ACTOR_ID].pts_form(" your formula ") (normal points)
- # $game_actors[ACTOR_ID].b_pts_form(" your formula ") (bonus level up points)
- # if you want to do a bigger formula do something like this...
- # a = (self.level + 19 / 100).to_f + self.level
- # b = (self.level + 10) * (self.atk + self.def + self.mat + self.mdf) / 9999
- # c = (self.vit + self.mag + self.str + self.dex * (self.atl + self.dfl))
- # $game_actors[ACTOR_ID].pts_form("#{ a + b - c + 1 }")
- # NOTE:
- # Make sure your formula always returns at least the value of 1
- # an easy way to do this is by putting " + 1 " at the end of your formula.
- module PSPDS_ADDON
- # ...
- Use_Snippet = true
- # Default NORMAL Points formula.
- Points_Gain_Formula = " ( self.level + 5 * (self.level/10) ) + 1 "
- # Default BONUS Points formula.
- Bonus_Points_Gain_Formula = " ( self.level + 5 ) + 1 "
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- class Game_Actor < Game_Battler #
- #==============================================================================#
- if PSPDS_ADDON::Use_Snippet
- attr_reader :points_gain_formula
- attr_reader :bonus_pts_gain_formula
- alias :old_PSPDS_initialize :initialize
- def initialize(actor_id)
- old_PSPDS_initialize(actor_id)
- @points_gain_formula = PSPDS_ADDON::Points_Gain_Formula
- @bonus_pts_gain_formula = PSPDS_ADDON::Bonus_Points_Gain_Formula
- end
- def points_formula
- eval(@points_gain_formula).to_i
- end
- def bonus_pts_formula
- eval(@bonus_pts_gain_formula).to_i
- end
- def pts_form(script)
- @points_gain_formula = script
- end
- def b_pts_form(script)
- @bonus_pts_gain_formula = script
- end
- end # if PSPDS_ADDON::Use_Snippet
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement