Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tp Add State Script, version 1.0
- # Created by bgillisp, 8/17/2014
- # Add a state when a specific TP value is reached on an actor.
- # By default, this will add a state when a TP value of 100 is
- # reached, then will clear TP to 0.
- #TO USE:
- # Add this script in materials, but below main.
- # By default, it will add state 14 when TP hits 100 unless
- # edited below. See Editable region for how to change this.
- #
- # When setting up your state, it is important to set
- # ***in the state*** when the state is to be removed
- # If this is not done, the state may remain even after the
- # battle has ended.
- #Terms of Use:
- # Free for use in commerical and non-commerical projects, with
- # credit given.
- #-------------------------------------------------------------------------
- #Editable Region
- module BGTpmax_Add_State
- #Constant for when to add the state. Lower if you wish the state to be
- #added sooner.
- TP_MAX = 100
- #Number of state to add when the value TP_MAX is hit. Change this
- #nmber to whatever state you want added when TP_MAX is hit.
- State_to_add = 14
- #Set to true if you wish TP to reset to 0 when state is added.
- #Set to false to leave the TP alone when the state is added.
- Reset_to_zero = true
- end
- #End of Editable Region
- #--------------------------------------------------------------------------
- #Do not edit anything below here unless you know what you are doing.
- #Failure to ahead to this warning may result in unpredictable behavior in
- #your game. Consider yourself warned
- #__________________________________________________________________________
- class Game_Battler < Game_BattlerBase
- alias bgtpmax_add_state_refresh refresh
- def refresh
- #Call aliased method
- bgtpmax_add_state_refresh
- if(self.tp >= BGTpmax_Add_State::TP_MAX)
- add_state(BGTpmax_Add_State::State_to_add)
- #Clear TP if flag enabled for that
- if(BGTpmax_Add_State::Reset_to_zero == true)
- self.tp = 0
- end
- end
- end
- end #End of Game_Battler class
RAW Paste Data