Hello all, I have a question about arranging a global passive using Yanfly's Auto-Passives plugin.
www.yanfly.moe
I have used this plugin successfully in the past but I am having some trouble writing a particular code.
In wholeness; I wish to reward both players and enemies for striking weaknesses/landing critical hits by applying a state on the user that essentially increases their next attack's damage output by 15% and reduces their MP/HP Costs by 15%. Think of it in a similar vein to the "Smirk" system in SMT. It's also a state that wears off in 1 turn, regardless of action.
I know this seems easy but I have been troubled with actually getting the system to work. I tried this:
(also, the "55" is the "Smirk" state identifier)
<Custom Confirm Effect>
if (this.isHpEffect() && value > 0)
var elements = this.getItemElements();
for (var i = 0; i < elements.length; ++i)
var elementId = elements;
if (target.elementRate(elementId) > 1.00) {
a.addState(55)
break;
</Custom Confirm Effect>
but i feel like it's a bit wonky and all over the place. I personally think I don't have a good handle on writing up this kinda stuff, so if anyone can tell me what they see is the problem I'd love to hear it.
Also noted: This code doesn't have the critical hit variant included. I haven't gotten to that part yet, but if anyone notes of a good way to include that I'm all ears. Thank you for taking the time to consider all this, I know it's a bit of a handful X_X
Auto Passive States (YEP) - Yanfly.moe Wiki
I have used this plugin successfully in the past but I am having some trouble writing a particular code.
In wholeness; I wish to reward both players and enemies for striking weaknesses/landing critical hits by applying a state on the user that essentially increases their next attack's damage output by 15% and reduces their MP/HP Costs by 15%. Think of it in a similar vein to the "Smirk" system in SMT. It's also a state that wears off in 1 turn, regardless of action.
I know this seems easy but I have been troubled with actually getting the system to work. I tried this:
(also, the "55" is the "Smirk" state identifier)
<Custom Confirm Effect>
if (this.isHpEffect() && value > 0)
var elements = this.getItemElements();
for (var i = 0; i < elements.length; ++i)
var elementId = elements;
if (target.elementRate(elementId) > 1.00) {
a.addState(55)
break;
</Custom Confirm Effect>
but i feel like it's a bit wonky and all over the place. I personally think I don't have a good handle on writing up this kinda stuff, so if anyone can tell me what they see is the problem I'd love to hear it.
Also noted: This code doesn't have the critical hit variant included. I haven't gotten to that part yet, but if anyone notes of a good way to include that I'm all ears. Thank you for taking the time to consider all this, I know it's a bit of a handful X_X