Is there a way, with all the Visustella Core plugins in MZ, to create a status that will reflect one magic attack, then disappear once it has done so? I've looked through the basic tags you can add with Visustella, and while there are some options for reflect, I can't figure out a combination of settings that will function quite this way.
MZ (Visustella) Single-reflect state
Javascript/Plugin SupportAs far as I know, not really.
When a skill is reflected, it never interacts with the intended target in any way - it's cut off before the skill actually activates, and is changed so the attacker uses it on themself.
JS Pre-Start Action would register that the target was selected as a target, but by JS Post-Start Action it wouldn't have changed yet. Then, by the time you get to JS Pre-Apply, the target has been changed and that notetag on the target wouldn't get executed.
The only thing I can think of is to attach code to every single magic skill in your game; you'd use JS Pre-Start Action to store the intended target in a variable, then use a JS Post-Damage to see if the target getting hit was the same as the one you stored.
If they're different, check for the one-time reflection state to be present on the intended target, then remove it.
When a skill is reflected, it never interacts with the intended target in any way - it's cut off before the skill actually activates, and is changed so the attacker uses it on themself.
JS Pre-Start Action would register that the target was selected as a target, but by JS Post-Start Action it wouldn't have changed yet. Then, by the time you get to JS Pre-Apply, the target has been changed and that notetag on the target wouldn't get executed.
The only thing I can think of is to attach code to every single magic skill in your game; you'd use JS Pre-Start Action to store the intended target in a variable, then use a JS Post-Damage to see if the target getting hit was the same as the one you stored.
If they're different, check for the one-time reflection state to be present on the intended target, then remove it.
Yorae actually had a method to make an one time magic reflection here: https://forums.rpgmakerweb.com/index.php?threads/how-to-reflect-magic-one-time-only-solved.116995/
The place you need to go to is rmmz_managers.js, and just ctrl-F "reflect" til you find it inside the battle manager. Then add the code: "if (target.isStateAffected(x)) target.removeState(x);" to have the state that's supposed to be a one time occurence only work once.
It is better to try to make the code modifications plugins, so that it's easier to fix or simply remove.
The place you need to go to is rmmz_managers.js, and just ctrl-F "reflect" til you find it inside the battle manager. Then add the code: "if (target.isStateAffected(x)) target.removeState(x);" to have the state that's supposed to be a one time occurence only work once.
It is better to try to make the code modifications plugins, so that it's easier to fix or simply remove.
I don't know how to make plugins, so I just Ctrl+V'd the code in like this and it doesn't seem to be working, I don't actually know Javascript, so I'm probably doing something wrong, but I tried plugging it into multiple different parts of the chain and none of them worked either.
My bad, I put the code in "BattleManager.invokeAction" function, and then put in the else if statement that dealt with magic reflection.
The problem with the solution that @WindyShadows linked is that you're using a different engine with different plugins.
What you pasted above is correct, but seeing that VisuStella's Battle Core has plugin parameters (and you said notetags?) that deal with reflect, that function may be getting overwritten by their plugin.
You could try putting that modification beneath VisuStella's in your plugin manager, but it may then cause features of the Battle Core to not work.
What you pasted above is correct, but seeing that VisuStella's Battle Core has plugin parameters (and you said notetags?) that deal with reflect, that function may be getting overwritten by their plugin.
You could try putting that modification beneath VisuStella's in your plugin manager, but it may then cause features of the Battle Core to not work.
That makes sense, I tried looking for where Battle Core handled reflects, but couldn't find it. Looks like Visustella has a different plugin that can do what I want, but it sucks that I'll have to buy it. Thank you both for the help!
Original thread: https://forums.rpgmakerweb.com/threads/visustella-single-reflect-state.166990/