Libra (MV Plugin Tips & Tricks) - Yanfly.moe Wiki
Auto Passive States (YEP) - Yanfly.moe Wiki
State Categories (YEP) - Yanfly.moe Wiki
I'm trying to modify the lunatic code for the Libra tips and tricks to show Passive states and their descriptions.
Something like this.
Since checking battler.isStateaffected() doesn't seem to work for passives, I found a workaround for that issue on the state Category plugin page and found some script calls that can be used to check for passive states marked with the category <Category: 'passive'>, but I don't know how to go through each of them and add text for each one detected.
battler.isStateCategoryAffected('text')
- This will return a 'true' or 'false' after checking if battler is affected
by a state with category 'text'. Replace 'text' with the category name but
keep the quotes. This will check even passive states.
battler.getStateCategoryAffectedCount('text');
- This will return a number value to see how many states (passives included)
the battler is affected by with the category 'text'. Replace 'text' with the
category name but keep the quotes.
This is about as far as I got with my terrible js skills and digging through other tips and tricks pages, probably wrong but it was worth a try:
JavaScript:
</Before Eval>
var states = target.getStateCategoryAffectedCount('Passive');
// Loop through each state.
for (var i = 0; i < states.length; ++i) {
// Get currently looped checked state
var checkState = states[i];
var name = states[i].name;
}
text = '\\c[4](Passive) \\c[0] ' + name ;
$gameMessage.add(text);
}
</Before Eval>