I'm trying to modify this scriplet so that after taking damage, the charecter gains TP eequal to half there luck stat. But if luck is 1 or 0, thus would return 0 it returns 1 instead. How would i do this?
#===============================================================================
#TP CONFIGURATOR BY DEENOS
#Created : 24-01-2013
#===============================================================================
#Please give Credit to Deenos in a non-commercial and commercial project.
#You can re-distribute any of my scripts but not claim as your own.
#===============================================================================
#Description
#===============================================================================
#This just simple script i'm combine to make easier you to configuration TP.
#===============================================================================
#Change log
#===============================================================================
#24-01-2013 : First release
#25-01-2013 : Adding regenerate TP
#===============================================================================
#Customization line
#===============================================================================
module DEENOS
module TP
MAX_TP = 10 #Max TP in constant. [Default : 100]
INIT_TP = 0 #Initial TP when battle begin in random. [Default : 25]
CHARGE_TP = 10 #Charging TP when damaged in percentage. [Default : 50]
RE_TP = -1 #Regenerating TP when turn end in random. [Default : 100]
end
end
#===============================================================================
#DON'T EDIT BELOW THIS LINE!!! I WARN YOU!!!
#===============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# * Overwrite method : Get Percentage of TP
#--------------------------------------------------------------------------
def tp_rate
@tp.to_f / DEENOS::TP::MAX_TP
end
#--------------------------------------------------------------------------
# * Overwrite method : Get Maximum Value of TP
#--------------------------------------------------------------------------
def max_tp
return DEENOS::TP::MAX_TP
end
end
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# * Overwrite method : Initialize TP
#--------------------------------------------------------------------------
def init_tp
self.tp = DEENOS::TP::INIT_TP
end
#--------------------------------------------------------------------------
# * Overwrite method : Clear TP
#--------------------------------------------------------------------------
def clear_tp
self.tp = 0
end
#--------------------------------------------------------------------------
# * Overwrite method : Charge TP by Damage Suffered
#--------------------------------------------------------------------------
def charge_tp_by_damage(damage_rate)
self.tp += [(This is where i want to change)]
end
#--------------------------------------------------------------------------
# * Regenerate TP
#--------------------------------------------------------------------------
def regenerate_tp
self.tp += DEENOS::TP::RE_TP * tcr
end
end
[\spoiler]
#TP CONFIGURATOR BY DEENOS
#Created : 24-01-2013
#===============================================================================
#Please give Credit to Deenos in a non-commercial and commercial project.
#You can re-distribute any of my scripts but not claim as your own.
#===============================================================================
#Description
#===============================================================================
#This just simple script i'm combine to make easier you to configuration TP.
#===============================================================================
#Change log
#===============================================================================
#24-01-2013 : First release
#25-01-2013 : Adding regenerate TP
#===============================================================================
#Customization line
#===============================================================================
module DEENOS
module TP
MAX_TP = 10 #Max TP in constant. [Default : 100]
INIT_TP = 0 #Initial TP when battle begin in random. [Default : 25]
CHARGE_TP = 10 #Charging TP when damaged in percentage. [Default : 50]
RE_TP = -1 #Regenerating TP when turn end in random. [Default : 100]
end
end
#===============================================================================
#DON'T EDIT BELOW THIS LINE!!! I WARN YOU!!!
#===============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# * Overwrite method : Get Percentage of TP
#--------------------------------------------------------------------------
def tp_rate
@tp.to_f / DEENOS::TP::MAX_TP
end
#--------------------------------------------------------------------------
# * Overwrite method : Get Maximum Value of TP
#--------------------------------------------------------------------------
def max_tp
return DEENOS::TP::MAX_TP
end
end
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# * Overwrite method : Initialize TP
#--------------------------------------------------------------------------
def init_tp
self.tp = DEENOS::TP::INIT_TP
end
#--------------------------------------------------------------------------
# * Overwrite method : Clear TP
#--------------------------------------------------------------------------
def clear_tp
self.tp = 0
end
#--------------------------------------------------------------------------
# * Overwrite method : Charge TP by Damage Suffered
#--------------------------------------------------------------------------
def charge_tp_by_damage(damage_rate)
self.tp += [(This is where i want to change)]
end
#--------------------------------------------------------------------------
# * Regenerate TP
#--------------------------------------------------------------------------
def regenerate_tp
self.tp += DEENOS::TP::RE_TP * tcr
end
end
[\spoiler]