=begin
= State Duration Rates, by lilyWhite =
This simple little script allows you to use element rates as a modifier to
the duration of states.
To use, add this notetag to the state:
<stateelem: x>
where x is the number of the element rate you wish to assign to the state.
Then simply assign the relevant element rate to whatever as usual. The
resulting duration rounds to the nearest number, up or down.
Usage: Free to use in any commercial or non-commercial project! Credit to
"lilyWhite"; I reserve the right to be slightly miffed if you get the
capitalization wrong. :3
=end
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# * Alias reset_state_counts
#--------------------------------------------------------------------------
alias elem_rate_state_counts reset_state_counts
def reset_state_counts(state_id)
elem_rate_state_counts(state_id)
state = $data_states[state_id]
if stateelem(state)
@state_turns[state_id] = (@state_turns[state_id] * element_rate(stateelem(state))).round
@state_steps[state_id] = (@state_steps[state_id] * element_rate(stateelem(state))).round
end
end
#--------------------------------------------------------------------------
# * Get State Element Rate
#--------------------------------------------------------------------------
def stateelem(state)
if state.note =~ /<stateelem: (\d+)>/i
return $1.to_i
end
end
end