Skills that Toggle

Is anyone interested in a script that creates Skills that can toggle a State?

Example:  A mage has a state that nullifies all magic that hits them, including healing spells.  The state is induced by using the skill 'Void Barrier' (or whatever) and removed by using the skill a second time.
I think you can do this with the default system, as follows:

1: Set up two versions of the skill, side by side in the database.

2: Give the actor the first version of the skill. In the features, have it apply the state you want, but in the state, have it seal the first skill, and add the ability to use the second skill.

3: In the second version of the skill, have it remove the state the first skill added.

That should do it.
I think you can do this with the default system, as follows:


1: Set up two versions of the skill, side by side in the database.


2: Give the actor the first version of the skill. In the features, have it apply the state you want, but in the state, have it seal the first skill, and add the ability to use the second skill.


3: In the second version of the skill, have it remove the state the first skill added.


That should do it.
That would work for that scenario.


How about this one: you use a skill that adds State A to an enemy. You then use the skill again on the same enemy, and the state is removed.
An alternative, perhaps more reliable (if clunkier) method:

Make the skill activate a Common Event.
Make the Common Event check the target for the relevant State.

If the target has the State, remove it. If the target doesn't have the State, add it.

This way, you don't have to swap around which Skill is active, and the management of the Skill becomes a bit simpler.
Something like this?


The NPC will describe how toggle states work and then proceed to have the two try it out.


https://youtu.be/PESDHBV5V4A3


http://forums.rpgmakerweb.com/index.php?/topic/50791-toggle-able-states/
Yes that's exactly what I was looking for!  I won't be able to try it out until later but thanks for picking this up!

Original thread: https://forums.rpgmakerweb.com/threads/skills-that-toggle.50784/