/// <summary> /// Calculates the dodge. /// </summary> /// <returns>The dodge.</returns> /// <param name="src">Source.</param> /// <param name="target">Target.</param> public int calcDodge(HeroData src,HeroData target) { int offset = target.level - src.level; if(offset <= 0) offset = 0; if(offset >= 10) offset = 10; float a = MonoInstancePool.getInstance<MathParam>().dod_attenuation_coefficient_a; float b = MonoInstancePool.getInstance<MathParam>().dod_attenuation_coefficient_b; float c = MonoInstancePool.getInstance<MathParam>().dod_attenuation_coefficient_c; float falloff = a * Mathf.Pow(target.level, 2) + b * target.level + c; float param_a = MonoInstancePool.getInstance<MathParam>().crirate_coefficient_a; float param_b = MonoInstancePool.getInstance<MathParam>().crirate_coefficient_b; float res = ((target.getDodgelv() - src.getHitLv()) * param_a + param_b) / 10000*100*falloff/1000; return (int)res; }