コード例 #1
0
	/// <summary>
	/// Calculates the critical.
	/// </summary>
	/// <returns>The critical.</returns>
	/// <param name="src">Source.</param>
	/// <param name="target">Target.</param>
	public int calcCritical(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>().cri_attenuation_coefficient_a;
		float b = MonoInstancePool.getInstance<MathParam>().cri_attenuation_coefficient_a;
		float c = MonoInstancePool.getInstance<MathParam>().cri_attenuation_coefficient_a;
		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 = ((src.getCriticallv() - target.getTenacitylv()) * a + b) / 10000*100*falloff;
		return (int)res;
	}