Untitled

 avatar
unknown
plain_text
3 years ago
341 B
3
Indexable
def reduction_inf_steps(dmg, flat, percent, steps=None):
    p = np.array(percent)
    f = np.array(np.clip(flat/dmg, 0, 1))

    ps = f * (1 + ((1-p) * np.log(1-p))/p)
    total_reduction = np.where((p>0) & (p<1) & (f>0) & (f<1),  p+f - ps, p+f)

    dmg = np.clip(dmg * (1-total_reduction), 0, np.inf)
    return np.around(dmg, 10)
Editor is loading...