/// <summary> /// Calculates the AgrChance for an each target /// </summary> /// <param name="agrZonetion"></param> /// <param name="victim"></param> /// <returns></returns> public float AgrChance(int agrZonetion, BaseLogic victim ) { switch (agrZonetion) { case 1: agrChance = Random.Range(30, 45) + SizeRatio(victim); break; case 2: agrChance = Random.Range(10, 20) + SizeRatio(victim); break; case 3: agrChance = Random.Range(2, 8) + SizeRatio(victim); break; default: agrChance = 0; break; } return agrChance; }
/// <summary> /// Sets the ratio for the enemy size and size of a victim /// </summary> /// <param name="victim"></param> /// <returns></returns> public float SizeRatio(BaseLogic victim) { float ratio = size/victim.size; return ratio * 100; }