Ejemplo n.º 1
0
        public static bool IsInDanger(this Obj_AI_Base target, ActiveSpells spell)
        {
            if (spell.spell.Speed > 90000)
            {
                return(spell.ToPolygon().IsInside(target.PrediectPosition((int)spell.spell.CastDelay)));
            }

            if (spell.Missile != null)
            {
                var arrivetime = spell.Missile.Distance(target) / spell.spell.Speed * 1000;
                return(spell.ToPolygon().IsInside(target.PrediectPosition((int)arrivetime)));
            }

            var arrivetime2 = spell.Start.Distance(target) / spell.spell.Speed * 1000 + spell.spell.CastDelay;

            return(spell.ToPolygon().IsInside(target.PrediectPosition((int)arrivetime2)));
        }
        public static bool IsInDanger(this Obj_AI_Base target, ActiveSpells spell)
        {
            var HitBox = new Geometry.Polygon.Circle(target.ServerPosition, target.BoundingRadius + 10);

            return(HitBox.Points.Any(p => spell.ToPolygon().IsInside(p)));
        }
Ejemplo n.º 3
0
 public static bool IsInDanger(this Obj_AI_Base target, ActiveSpells spell)
 {
     return(spell.ToPolygon().IsInside(target));
 }
Ejemplo n.º 4
0
        public static bool IsInDanger(this Obj_AI_Base target, ActiveSpells spell)
        {
            var traveltime = target.Distance(spell.Start) / spell.spell.Speed * 1000 + spell.spell.CastDelay;

            return(spell.ToPolygon().IsInside(target.PrediectPosition((int)traveltime)));
        }