AkaCore.AkaLib.Evade.Skillshot.IsAboutToHit C# (CSharp) Method

IsAboutToHit() public method

public IsAboutToHit ( int time, Obj_AI_Base unit ) : bool
time int
unit Obj_AI_Base
return bool
        public bool IsAboutToHit(int time, Obj_AI_Base unit)
        {
            if (this.SpellData.Type != SkillShotType.SkillshotMissileLine)
            {
                return !this.IsSafePoint(unit.ServerPosition.To2D())
                       && this.SpellData.ExtraDuration + this.SpellData.Delay
                       + (int)(1000 * this.Start.Distance(this.End) / this.SpellData.MissileSpeed)
                       - (Extensions.GameTimeTickCount - this.StartTick) <= time;
            }
            var project = unit.ServerPosition.To2D()
                .ProjectOn(this.GetMissilePosition(0), this.GetMissilePosition(time));
            return project.IsOnSegment && unit.Distance(project.SegmentPoint) < this.SpellData.Radius;
        }