GetAttackRate() public static method

Gets the attack rate.
public static GetAttackRate ( Hero unit ) : double
unit Hero /// The unit. ///
return double
Esempio n. 1
0
        /// <summary>
        ///     Checks if attack is currently on cooldown
        /// </summary>
        /// <param name="target"></param>
        /// <param name="bonusWindupMs"></param>
        /// <returns></returns>
        public static bool AttackOnCooldown(Entity target = null, float bonusWindupMs = 0)
        {
            if (me == null)
            {
                return(false);
            }
            var turnTime = 0d;

            if (target != null)
            {
                turnTime = me.GetTurnTime(target);
            }
            //Console.WriteLine(turnTime*1000);
            return((LastAttackStart + UnitDatabase.GetAttackRate(me) * 1000 - Game.Ping - turnTime * 1000 - 75
                    + bonusWindupMs) > tick);
        }