Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- You could convert level difference D into a float:
- Let X = D / (b + abs(D)), where b is some positive constant that determines how significant level difference is to the outcome.
- While D can range from -inf to +inf, the derived value X will be "smoothly" clamped between -1 and +1. This is easier to make work with probabilities.
- If the attack outcomes are (miss, graze, normal, critical) then we can assign some probabilities to each outcome at spot values of X:
- when X=1, then all attacks will be critical: (0, 0, 0, 1)
- when X=0.5 then normal attacks are more likely: (0, 0.25, 0.5, 0.25)
- when X=0 then attack outcomes are equally likely: (.25, .25, .25, .25)
- when X=-0.5 then grazing attacks are more likely: (.25, 0.5, 0.25, 0)
- when X=-1 then all attacks will be misses: (1, 0, 0, 0)
- Between these spot values, we can interpolate the probabilities
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement