I want to change the LUK system so that it makes a bit more intuitive sense.
Someone who has 68 luck has twice as many luck points as someone with 34. Thus they are "Twice as lucky" which can be understood as getting something good twice as often or dodging something bad twice as often.
Thus, I changed the code from:
def luk_effect_rate(user) [1.0 + (user.luk - luk) * 0.001, 0.0].max endto the following:
def luk_effect_rate(user) [(user.luk) / (luk), 0.0].max endThen I changed my attack states to all be 100% and let LUK quotients be the deciding factor of how often someone is hit by the status condition.
However, I noticed that the code was evaluating something binary; if the target has less luck than the user, then the user always hits. If the target has higher luck than the user, the user never hits. I did some digging and found that the code evaluates variables based on the number of floating digits there are. Since all stats are integers with 0 floaters, I changed the code again to:
def luk_effect_rate(user) [(user.luk * 1.00) / (luk * 1.00), 0.00].max endso that the system rounded the difference to the closest lower 0.01.
However, I'm still getting the binary behavior depending on if the difference is either positive or negative.
What should I change to accomplish what I want out of the luck stat?
Someone who has 68 luck has twice as many luck points as someone with 34. Thus they are "Twice as lucky" which can be understood as getting something good twice as often or dodging something bad twice as often.
Thus, I changed the code from:
def luk_effect_rate(user) [1.0 + (user.luk - luk) * 0.001, 0.0].max endto the following:
def luk_effect_rate(user) [(user.luk) / (luk), 0.0].max endThen I changed my attack states to all be 100% and let LUK quotients be the deciding factor of how often someone is hit by the status condition.
However, I noticed that the code was evaluating something binary; if the target has less luck than the user, then the user always hits. If the target has higher luck than the user, the user never hits. I did some digging and found that the code evaluates variables based on the number of floating digits there are. Since all stats are integers with 0 floaters, I changed the code again to:
def luk_effect_rate(user) [(user.luk * 1.00) / (luk * 1.00), 0.00].max endso that the system rounded the difference to the closest lower 0.01.
However, I'm still getting the binary behavior depending on if the difference is either positive or negative.
What should I change to accomplish what I want out of the luck stat?