public static double GetAttackPoint(Hero unit)
{
if (unit == null)
{
return 0;
}
try
{
var name = unit.StoredName();
double attackAnimationPoint;
if (!AttackPointDictionary.TryGetValue(unit.Handle, out attackAnimationPoint))
{
attackAnimationPoint =
Game.FindKeyValues(name + "/AttackAnimationPoint", KeyValueSource.Hero).FloatValue;
AttackPointDictionary.Add(unit.Handle, attackAnimationPoint);
}
var attackSpeed = GetAttackSpeed(unit);
return attackAnimationPoint / (1 + (attackSpeed - 100) / 100);
}
catch (KeyValuesNotFoundException)
{
if (!Utils.SleepCheck("Ensage.Common.DemoModeWarning"))
{
return 0;
}
Utils.Sleep(10000, "Ensage.Common.DemoModeWarning");
Console.WriteLine(@"[[Please do not use demo mode for testing assemblies]]");
return 0;
}
}