#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# First, i've aliased the initialize and update method in Game_System.
# If you don't know what aliasing does i suggest that you read Me(tm)'s
# tutorial Aliasing with ease. You can find the tutorial here:
#
# http://www.rmxp.org/forums/index.php?topic=5698
#
#
#==============================================================================
class Game_System
alias gando_timer_init initialize
alias gando_timer_update update
#--------------------------------------------------------------------------
# * Initialize the "Gando_timer".
#--------------------------------------------------------------------------
# gando_timer_init - This will add the old code from def initialize in
# Game_System.
#
# @gando_timer - this is and instance variable holding the amount of
# frames(60). You could say that this is the timer.
#
#
# So what i have done is that i have added the @gando_timer in the
# initialize method in Game_System.
#
#--------------------------------------------------------------------------
def initialize
gando_timer_init
@gando_timer = 60
end
#--------------------------------------------------------------------------
# * Reset_timer
#--------------------------------------------------------------------------
# Here, you can add whatever you want to happen
# when x number of frames has passed.
#
# The line : "unless $game_temp.in_battle" means, as long as your not
# in battle. With other words, it checks so that your not
# in any battle, and if your not, it increases the sp.
#
# The line : $game_party.actors[0].sp += 5, gives the first actor in
# the party 5 sp. if you want to give another member sp you
# can just change the 0 to either 1,2 or 3 depending on which
# party member you want to increase the sp of.
#
# You could also change the .sp to .hp to give the
# party member 5 hp instead of 5 sp.
#
# @gando_timer = 60 - This will reset the timer to 60 again, so that
# the lead actor can keep regenerate sp every 60
# frame.
#
#--------------------------------------------------------------------------
def reset_timer
unless $game_temp.in_battle
if $game_switches[2] == true
$game_party.members[0].mp += 10
else if $game_switches[3] == true
$game_party.members[0].mp += 1
else
$game_party.members[0].mp += 5
end
end
end
@gando_timer = 60
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
# gando_timer_update -This will add the old code from def update in
# Game_System.
#
# reset_timer - This line will call the reset_timer method,
# abd it will execute everything inside it.
#
# I am not 100% sure about this, but i think the update method updates
# every frame. That means, that it will reduce the @gando_timer by 1
# every frame. If i'm wrong, the i hope an experienced scripter can tell
# me if they see this.
#--------------------------------------------------------------------------
def update
gando_timer_update
# reduce timer by 1 if timer is above 0.
if @gando_timer > 0
@gando_timer -= 1
end
# Checks if swith 1 is on
if $game_switches[1] == true
#Checks if @gando_timer has reached 0, (if 60 frames has passed)
if @gando_timer == 0
reset_timer
end
end
end
end