I have a character that is rogue like and uses several skills that are more effective when either he or an opponent are in a certain state.
He has a skill that lets him hide (granting him the Hide state). If he's in the Hide state or the target is Paralysed or Asleep, he does more damage.
How would I go about setting up the damage formula for that?
How to alter attack effectiveness based on state.
● ARCHIVED · READ-ONLY
-
-
c = damage formula; a.state?(x)? || b.state?(y)? c * bonus : c
put in the damage formula that you want for the normal attack.
x = hide state number
y = the state/states you are checking for on the target.
bonus = however you want to add bonus, whether it be multiplying or adding additional damage.
That should work =D Goodluck!
~ Dinhbat -
That formula isn't quite correct - you've got an extra ? in there that'll break it.
Code:Also add spaces around ternary operators just to make it clear (which could well be the cause for the extra ?)c = damage formula; a.state?(x) || b.state?(y) ? c * bonus : c -
That formula is needed for checking if the target has a certain state.
Your other intention of giving a damage boost to the rogue when he has the "hidden" state is much simpler - have the state give a feature that increases the damage by increasing the attack parameter. -
dinhbat3's formula checks for both the rogue having one state AND the target having another. What's missing is the second state for the target (I didn't read that):
Code:That's working on the assumption that the damage he gives when in the hide state, is the same as the damage he'd give if the target were in the paralyzed or sleep state.c = damage formula; a.state?(x) || b.state?(y) || b.state?(z) ? c * bonus : c -
thanks guys, that got it working :p
-
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.