Is there a way to check who an item is being used on? For instance, in my game, I have a skill that kills the caster (Shinzu) and buffs a target character. But I want Shinzu to stay dead until the battle ends, then be revivable. I would prefer if a revive item is impossible to use on Shinzu until the battle ends, but I also wonder if killing Shinzu again after being revived in the same battle would work.
Is there a way to check if the revive item is being used on Shinzu after they used the skill so it can revive them fine until they use the skill, and so that it can revive other characters just fine?
I imagine it could be possible with states but I can't quite figure it out.
Also sorry if this is very confusing to read, it was hard for me to explain.
there are two ways, the default way and one that requires a plugin and javascript.
the default way would be to have the item use a common event as well as an invisible target state.
then in the common event check all actors for the target state to see which actor it is, and give different effects for different actors. would probably need additional use of a switch to remember skill use.
the other way is to add a plugin that enables skill use conditions, and use javascript in those conditions to check everything. not recommended unless you have some experience with javascript in RM.
you have a conditional branch with the option <actor> is affected by <state>.
you need one such branch for every actor in your game.
yes, that can be a lot if you have a lot of actors, but by defaulot and without scripts that is the onlx way.
How is Shinzu being "killed" upon using this skill? Would it make sense to not "kill" Shinzu upon using this skill, and instead give him/her a state (let's call it "Drained" for example) that:
Grants immortality
Restriction: cannot move
[SV] Motion: dead (if you're using sideview battles)
Sets HP to 0 (this is just for esthetics so is not necessary I suppose)
...and has as removal condition "remove at battle end"?
Since revive items can only target "dead" allies, Shinzu with "drained" status should not be a viable target. Sorry if I'm misunderstanding your situation.
Correct. Ideally you'd want Shinzu to count both as dead and alive but I don't think there's a (non-plugin) solution for that...