Of course, custom tags! Honestly, I thought detecting those would be a lot harder than that. According to the plugin's wiki article, the
value variable seems to only appear in React, maybe readable (not writable) in Respond.
I already have a skill that increases final damage dealt by a percentage, and what I did was to make it apply another state in Confirm. That other state has a React effect that applies the damage increase based on what the user has for bonus damage, then removes itself from the target.
TL;DR of what's below: It works perfectly, now I'm pushing it further and showing how it's done in case somebody comes across this topic in the future.
Now I'm not very good at writing my own code, but I gave it a try anyway. I've got basic knowledge, Google, and clever copy-pasting skills.
JavaScript:
user.setStateCounter(20,0);
for (var i = 0; i < 5; i++) {
user.addStateCounter(20, parseInt(user.equips()[i].meta.bonusDmg, 10) || 0);
}
These few lines in a Custom Battle Effect. What this modification does is that it doesn't just look for a bonusDmg tag in the user's weapon, but also in the rest of their equipment.
The state (#20 here) is set as a passive for all actors, it has an icon so I can see the counter for now, and it works like a charm.
I'm doing a battle test with 3 actors:
- The first one has 3 pieces of equipment: a +10 bonusDmg weapon, a +15 bonusDmg off-hand, and a tagless piece of body equipment. His counter is 25 as planned.
- The other 2 have no equipment at all, their counters are 0.
Fantastic. Let's push it further. The 2nd actor now has a skill that increases his own damage stat by 10 for 2 turns. No way around it, I'm using a state to properly apply the temporary effect.
Spoiler: State tags
<Custom Apply Effect>
user.addStateCounter(20, 10);
</Custom Apply Effect>
<Custom Leave Effect>
user.addStateCounter(20, -10);
</Custom Leave Effect>
And it works perfectly again.
Time to put this in practice, the variances are at 0%, the tags are added to make the damage increase work.
Spoiler: Added to the bonus damage state
<Custom Confirm Effect>
value += user.getStateCounter(20);
</Custom Confirm Effect>
Well F me backwards, it's working as intended. So I've got another passive I can shorten into a single state, which is awesome.
Thank you so much for your help, and for what you taught me today.