Thanks for finding that bug. I'm not sure how I haven;t noticed that before, what with all the thorough testing the state has been getting in my own project. I updated the copy+paste code for that state to reflect your change.
Magic Blindness:
This can be made by changing the magical accuracy formula in the plugin you mentioned. By changing it from 1.00 to something like the following, it would change accuracy if the state were applied:
1.00 - (0.30 * user.isStateAffected(201))
This would give a 30% miss chance to magic spells when affected by state 201.
Kidnap:
The answer to this I'm not so sure about just yet. If I set the state to check every turn if the affected battler is the only creature on it's side of combat, and remove the state if it finds that to be true, it might work this way. But I foresee problems where the other living enemy dies and three actors have actions queued up that don't do anything while this dude is still kidnapped.
Opportunism:
I think forcing actions in non-time based battle systems might work normally, though I hadn't tried it. What I can say for sure is that the original method I was using for added effect states was forcing actions, and it had the added bonus that I could use an action sequence on the forced skill ( to make it look pretty), but it would interfere with the turns of the following battlers in weird ways. Since Yanfly discontinued support for the CTB and ATB plugins, I could try without them to see if the same sort of thing happens again. Worst case is that it won't work with those plugins, which is already true. Otherwise, you basically have to do what you said, in the action sequence of basically every skill, you'd need to do checks for who's in the party, if they're dead or not, and if the opportunism state is up. That's a lot of work.
Now, this week I'm doing something small. I've cleared off the list of 'promised states' from the OP, and I'm not really sure which of my myriad states I should share, so I'll go with something basic that most people can use.
Overload!
Overload is a state that makes skills belonging to a certain skilltype deal massive extra damage, at the cost of dealing some of that damage back to the caster. While it was designed as a passive effect, it could easily be rolled into a buff skill as well. For this skill, I have specified that skills belonging to skilltype 12 will be overloaded. You can change this to match your own projects better, of course.
Here is the paste code for our state:
Code:
<Custom Confirm Effect>
if (this.isMagical() && this._item.isSkill() && $dataSkills[this._item._itemId].stypeId == 12 && value !== 0) {
value = Math.ceil(value * 1.8)
user.gainHp(-Math.floor(Math.abs(value * 0.15)))
}
</Custom Confirm Effect>
The if condition at the start is checking to make sure the action our affected actor took met the requirements for overload.
- Was it magical?
- Was it a skill?
- Was it stypeId 12?
- Did it deal more damage/healing than 0?
When it passes these checks, the value of the effect is multiplied by 1.8, and 15% of the effect is dealt as damage to the caster. Note that in the case of a healing spell, the caster still takes damage due to the Math.abs function being used. You can tweak these values to tune this effect for your game more specifically, as well. Maybe 15% is too much, or 1.8 times damage is too much, it's up to you.
That's all for today.