Hey guys!
In a custom formula, how do I check for multiple states? I want a skill do deal more damage if the enemy is inflicted with at least one state of a certain kind. Is there any way to do it quick and elegant? With something like "[3,7,13]" where you just list the states? :)
Thanks!
Custom Formula: Check for multiple states
● ARCHIVED · READ-ONLY
-
-
Hello
If you mean if the target of this attack has any of a states list, it'd be of this way
if [3,7,13].any? {|state_id| b.state?(state_id)} -
Thank you, Piers. :) So there is no way to make that any shorter?
-
That is pretty much the shortest way. Unless you want to put s instead of state_id in both locations :)
The only other way is to check for each one individually, and that'd give you
if b.state?(3) or b.state?(7) or b.state?(13)which is pretty ugly (and obviously becomes very large as you add more states to check for)
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.