Assigning Types To States

I'm working on a game that is very state-heavy. In an effort to create a more dynamic combat system, the database is filled with states that apply to the user, target, ect to modify the gameplay of individual classes and boss battles. The problem, however, is Dispel abilities. Because there are so many states in the game, it's become tricky to create Dispel abilities for individual classes because they have to have a list of about 30 or 40 states they can remove.

Is there a way to add types to individual states, like Magic, Poison, Curse, Disease, ect. That way I can simply have the Dispel ability try to remove a given type instead of every state in the game?
Well you could try to add this snippet

class RPG::State def state_type return $1.to_s if self.note =~ /<stype🙁.*)>/ return "default" endendclass Game_Battler def clear_state_by_type(type) @states.each {|st| remove_state(st) if $data_states[id].state_type == type} endendthen tag your states with <stype:whatever_type_it_is>then on your dispel skill, do this on the damage formula

b.clear_state_by_type(type);damage_formula

So like you can tag states as "magic"

<stype:magic>

then on your dispel, it would be

b.clear_state_by_type("magic");damage_formula

PS: This isn't tested, I just kind of made it up at this very moment.
Unfortunately while it was a solid idea, it doesn't actually remove the state.
Actually it should give you an error... because this


$data_states[id].state_type == type}


should be


$data_states[st].state_type == type}
That did it. Wonderful. Thank you very much.

Original thread: https://forums.rpgmakerweb.com/threads/assigning-types-to-states.45765/