So I have a mood based battle system. What I'm trying to do is have each character have a trigger where their fear mood increases when they enter a weak state. I use a unique variable for each of my three characters combined with a common event to make the mood increase.
I've made similar things happen when a character is targeted for an attack to increase their mood. What I'm trying to have happen here is
1) the character gets low HP
2) their 'fear' variable goes up 20
3) the common event triggers in battle and updates their fear state if the mood variable is high enough.
I thought I could accomplish this by having a unique hidden state always on for each character that checks to see if they're low HP and increase the variable from there, but then the problem is, how do I get it to detect only when they character first reaches the low HP state? I don't want it it keep triggering each turn and I don't want it to trigger only once per battle when HP is low. Ideally I want it to trigger each time hp gets below a certain threshold (like a percentage of HP).
*Edit* To clarify that last part, if HP becomes less than let's say 5 percent of max, then it triggers, character heals, then hp drops to 5 percent again later in battle it triggers.
But in scenario 2 where they are still low HP from past turn it doesn't trigger.
Any idea how I would implement such a precise trigger?
I've made similar things happen when a character is targeted for an attack to increase their mood. What I'm trying to have happen here is
1) the character gets low HP
2) their 'fear' variable goes up 20
3) the common event triggers in battle and updates their fear state if the mood variable is high enough.
I thought I could accomplish this by having a unique hidden state always on for each character that checks to see if they're low HP and increase the variable from there, but then the problem is, how do I get it to detect only when they character first reaches the low HP state? I don't want it it keep triggering each turn and I don't want it to trigger only once per battle when HP is low. Ideally I want it to trigger each time hp gets below a certain threshold (like a percentage of HP).
*Edit* To clarify that last part, if HP becomes less than let's say 5 percent of max, then it triggers, character heals, then hp drops to 5 percent again later in battle it triggers.
But in scenario 2 where they are still low HP from past turn it doesn't trigger.
Any idea how I would implement such a precise trigger?