This script allows your RPG Maker XP project to have state effects that stack like in Pokemon or MegaTen.
It does this by applying a more powerful version of the state whenever the specified state already exists.
class RPG::State
#-----------------------------------------------------------------------------
# * Tiered States
# States are applied left to right, starting at the state before the =>.
#
# The example provided allows for negative states (stat-downs) to be
# counteracted by positive states (stat-ups)
#-----------------------------------------------------------------------------
Tiered_States = {
20 => [24, 23, 22, 21, 20, 19, 18],
22 => [18, 19, 20, 21, 22, 23, 24]
}
#-----------------------------------------------------------------------------
# * has Additive State?
#-----------------------------------------------------------------------------
def tiered?
Tiered_States.include?(@id)
end
#-----------------------------------------------------------------------------
# * How many tiers?
#-----------------------------------------------------------------------------
def tiers
return Tiered_States.fetch(@id, [])
end
end
#===============================================================================
# ** Game_Battler
#===============================================================================
class Game_Battler
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :mpen_default_add_state, :add_state
#-----------------------------------------------------------------------------
# * Add State
#-----------------------------------------------------------------------------
def add_state(state_id, force = false)
if $data_states[state_id].tiered?
for i in 0...$data_states[state_id].tiers.size
current_tier = $data_states[state_id].tiers[i]
next_tier = $data_states[state_id].tiers[i+1]
if self.state?(current_tier)
if next_tier == nil
#tier at maximum, regular state rules apply
mpen_default_add_state(current_tier, force)
return
else
remove_state(current_tier)
mpen_default_add_state(next_tier, force)
return
end
end
end
#no tiers applyed yet, default behavior.
mpen_default_add_state(state_id, force)
else
#no tiers exist, default behavior
mpen_default_add_state(state_id, force)
end
end
end
Instructions
A hash of states with tiers needs to be provided at the beginning of the script. The key is the default state, the one that is applied when no states of this type are currently attached to the battler. The value is an array of the different tiers, in order of power from left to right.
In the demo provided, a way to have negative effects cancel out positive effects is shown.
Credits and Thanks
This script is based on Kain Nobel's States : Toggle script.
At first I thought it was tired states and was scratching my head in confusion. XD
The idea is nice, certainly =) I haven't tried it yet, but if it works it is a nice addition ^^
I would suggest however that you provide a download link for your demo that does not requite others to make an account. Unless you have one anyway, it is an annoyance and prevents some people from giving this a go.
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis) For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie) If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)
Please don't spell my name "Yamina-chan". It's all small. Thank you =D
mediafire.com is a great page, as you neither need an account not have to wait a certain amount of time untill you can download. You as a host do need an account tough.
filedropper.com is also usefull, but you have less controll over your own files. Same with 2shared.com Both do not requite and account to upload or download.
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis) For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie) If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)
Please don't spell my name "Yamina-chan". It's all small. Thank you =D
You could also make an account on Dropbox. If you use this link you'll get free space, and me too: http://db.tt/JprwsOH
After that you just drop files in your "public" folder and give out the link.
"Turning iron ore into iron swords is a hard process, for one must first dig out the rock, and melt it to refine it, then one must pour that metal into a mould, let it cool a bit, and pound on it while it cools even further. Games are no different." - Ahzoh
Universal Declaration of Human Rights in Vrkhazhian
ʾEšol ḵavud ʾelẕakud lav ʾezʾaẕud zwazaršeru ya lit žalneru lav lit t͛enud. Ṗal sa-ražheru lav raržižu paplam lav ṗal widsaṟam bemaḵu šuku lit ʾeyṭu waẏnilaẇ. All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.
class RPG::State
#-----------------------------------------------------------------------------
# * Tiered States
# States are applied left to right, starting at the state before the =>.
#
# The example provided allows for negative states (stat-downs) to be
# counteracted by positive states (stat-ups)
#-----------------------------------------------------------------------------
Tiered_States = {
20 => [24, 23, 22, 21, 20, 19, 18],
22 => [18, 19, 20, 21, 22, 23, 24]
}
#-----------------------------------------------------------------------------
# * has Tiered State?
#-----------------------------------------------------------------------------
def tiered?
Tiered_States.include?(@id)
end
#-----------------------------------------------------------------------------
# * How many tiers?
#-----------------------------------------------------------------------------
def tiers
return Tiered_States.fetch(@id, [])
end
end
#===============================================================================??
# ** Game_Battler
#===============================================================================??
class Game_Battler
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :mpen_default_add_state, :add_state
#-----------------------------------------------------------------------------
# * Add State
#-----------------------------------------------------------------------------
def add_state(state_id)
if $data_states[state_id].tiered?
for i in 0...$data_states[state_id].tiers.size
current_tier = $data_states[state_id].tiers[i]
next_tier = $data_states[state_id].tiers[i+1]
if self.state?(current_tier)
if next_tier == nil
#tier at maximum, regular state rules apply
mpen_default_add_state(current_tier)
return
else
remove_state(current_tier)
mpen_default_add_state(next_tier)
return
end
end
end
#no tiers applyed yet, default behavior.
mpen_default_add_state(state_id)
else
#no tiers exist, default behavior
mpen_default_add_state(state_id)
end
end