Hello,
I'm looking for some assistance with a problem that is probably easy to fix but I can't figure out how to work with it. I want to find a way to make certain things happen when a state is forcibly removed but not when it naturally wears off (And it's the type of state that does have to naturally wear off).
If the state naturally wears off, I want nothing to happen. If the state is forcibly removed with a skill, I want a new state to be applied (or even an animation to play when it is removed, but again, not when it wears off). However, I don't want the skill to add the new state unless the old one has already been applied.
I'm usually pretty crafty at making clever combat systems but this simple problem has me stumped.
I think you could use an if then statement in the damage formula of the skill. Check if the state is applied, if so then remove it and add a new state, else do regular damage or whatever
Put this inside the state's note box
<Custom Remove Effect>
target.addState(x);
</Custom Remove Effect>
x is the number of the state you want to be applied
P.S you need yanfly's buffs and states plugin.
That’s weird, it returns 0 when something is wrong, so maybe there’s an extra space or typo in it? Idk, seems like it should work
Try HIME conditional states maybe.
Busting my brain figuring this out. Doesn't help that I'm not a programmer, although I seem to be doing well enough deciphering what it means and manipulating it. The answer is definitely in that Unstable Affliction code. I've tried writing my own a few times with varying results, but not the results I want. Sometimes I can make it so that the state evolves with or without forcing it, sometimes the new state is applied to me instead of my target. Sometimes the second state is just never applied at all.
Maybe some context will help. This is what I want to see happen:
I cast an ice spell on a target which has a chance to freeze it causing the Frozen state. If one of my other characters uses one of a few specific Blunt skills like Crushing Blow, it deals bonus critical damage and "shatters" the target, breaking it out of the ice. However, if the target's frozen state wears off without being shattered, I don't want it to do anything at all.
The reason I want it to transition from one state to another is because I want an animation to play upon the Frozen state's removal, however the only way I know how to make states play animations is on application, not its removal. So I created a second state, called Shatter, to activate for a short time when a Frozen target is smacked by Crushing Blow. This will cause the shatter animation upon application. A nice bonus for the Shatter state is that it can last a few turns, rendering the target immune to further freezing to prevent abuse.
Obviously, if the target thaws out on its own, it wouldn't make sense for it to shatter.
Crushing Blow removes Frozen, and the Frozen state has an inherent 200% weakness to Blunt.
I tried using this
if (b.isStateAffected(34)) {a.atk*500} else {a.atk*5}
Just to make sure it was working that way. It works fine. It's only with the inclusion of b.removeState and b.addState that screw with it.