PosAfterE() публичный статический Метод

public static PosAfterE ( Obj_AI_Base target ) : System.Vector3
target Obj_AI_Base
Результат System.Vector3
Пример #1
0
 private static void OnUpdateTarget(EventArgs args)
 {
     if (ObjectManager.Player.IsDead)
     {
         return;
     }
     if (ObjectManager.Player.HasBuffOfType(BuffType.SpellImmunity) || ObjectManager.Player.HasBuffOfType(BuffType.SpellShield))
     {
         return;
     }
     if (!Extensions.YasuoW.IsReady(300) && (Wall == null || !Extensions.YasuoE.IsReady(200)))
     {
         return;
     }
     foreach (var target in
              DetectedTargets.Where(i => ObjectManager.Player.Distance(i.Obj.Position) < 700))
     {
         if (Extensions.YasuoE.IsReady() && Manager.MenuManager.EvadeMenu["E"].Cast <CheckBox>().CurrentValue&& Wall != null &&
             !GoThroughWall(ObjectManager.Player.ServerPosition.To2D(), target.Obj.Position.To2D()) &&
             Extensions.YasuoW.IsInRange(target.Obj.Position))
         {
             var obj = new List <Obj_AI_Base>();
             obj.AddRange(EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, ObjectManager.Player.ServerPosition, Extensions.YasuoE.Range));
             obj.AddRange(EntityManager.Heroes.Enemies.Where(i => i.IsValidTarget(Extensions.YasuoE.Range)));
             if (
                 obj.Where(
                     i =>
                     Extensions.CanCastE(i) && EvadeSkillshot.IsSafePoint(i.ServerPosition.To2D()).IsSafe &&
                     EvadeSkillshot.IsSafePoint(Extensions.PosAfterE(i).To2D()).IsSafe &&
                     (!Extensions.PosAfterE(i).IsUnderTurret() || Manager.MenuManager.EvadeMenu["ETower"].Cast <CheckBox>().CurrentValue) &&
                     GoThroughWall(ObjectManager.Player.ServerPosition.To2D(), Extensions.PosAfterE(i).To2D()))
                 .OrderBy(i => Extensions.PosAfterE(i).Distance(Game.CursorPos))
                 .Any(i => Extensions.YasuoE.Cast(i)))
             {
                 return;
             }
         }
         if (Extensions.YasuoW.IsReady() && Manager.MenuManager.EvadeMenu["W"].Cast <CheckBox>().CurrentValue&& Extensions.YasuoW.IsInRange(target.Obj.Position))
         {
             Extensions.YasuoW.Cast((Vector3)ObjectManager.Player.ServerPosition.Extend(target.Start, 100));
         }
     }
 }
Пример #2
0
            private static void TryToEvade(List <Skillshot> hitBy, Vector2 to)
            {
                var dangerLevel =
                    hitBy.Select(i => Manager.MenuManager.EDLVL.Cast <Slider>().CurrentValue) //championmenu["DangerLevel"].Cast<Slider>().CurrentValue
                    .Concat(new[] { 0 })
                    .Max();

                foreach (var evadeSpell in
                         EvadeSpellDatabase.Spells.Where(i => i.Enabled && i.DangerLevel <= dangerLevel && i.IsReady)
                         .OrderBy(i => i.DangerLevel))
                {
                    if (evadeSpell.EvadeType == EvadeTypes.Dash && evadeSpell.CastType == CastTypes.Target)
                    {
                        var targets =
                            GetEvadeTargets(evadeSpell)
                            .Where(
                                i =>
                                IsSafePoint(Extensions.PosAfterE(i).To2D()).IsSafe &&
                                (!Extensions.PosAfterE(i).IsUnderTurret()) || Manager.MenuManager.EvadeMenu["ETower"].Cast <CheckBox>().CurrentValue)
                            .ToList();
                        if (targets.Count > 0)
                        {
                            var closestTarget = targets.MinOrDefault(i => Extensions.PosAfterE(i).To2D().Distance(to));
                            ObjectManager.Player.Spellbook.CastSpell(evadeSpell.Slot, closestTarget);
                            return;
                        }
                    }
                    if (evadeSpell.EvadeType == EvadeTypes.WindWall &&
                        hitBy.Where(
                            i =>
                            i.SpellData.CollisionObjects.Contains(CollisionObjectTypes.YasuoWall) &&
                            i.IsAboutToHit(
                                150 + evadeSpell.Delay - Manager.MenuManager.EvadeMenu["WDelay"].Cast <Slider>().CurrentValue,
                                ObjectManager.Player))
                        .OrderByDescending(
                            i => Manager.MenuManager.EDLVL.Cast <Slider>().CurrentValue)
                        .Any(
                            i =>
                            ObjectManager.Player.Spellbook.CastSpell(
                                evadeSpell.Slot,
                                ObjectManager.Player.ServerPosition.Extend(i.Start.To3D(), 100).To3D(), true)))
                    {
                        return;
                    }
                    if (evadeSpell.EvadeType == EvadeTypes.Dash && evadeSpell.CastType == CastTypes.Position)
                    {
                        var points = GetEvadePoints(evadeSpell.Speed, evadeSpell.Delay, false);

                        points.RemoveAll(
                            item => item.Distance(ObjectManager.Player.ServerPosition) > evadeSpell.MaxRange);

                        if (evadeSpell.FixedRange)
                        {
                            for (var i = 0; i < points.Count; i++)
                            {
                                points[i] = ObjectManager.Player.Position
                                            .Extend(points[i], evadeSpell.MaxRange);
                            }

                            for (var i = points.Count - 1; i > 0; i--)
                            {
                                if (!IsSafePoint(points[i]).IsSafe)
                                {
                                    points.RemoveAt(i);
                                }
                            }
                        }

                        if (points.Count > 0)
                        {
                            var EvadePoint = to.Closest(points);

                            var castPoint = ObjectManager.Player.Position -
                                            (EvadePoint.To3D() - ObjectManager.Player.Position);
                            ObjectManager.Player.Spellbook.CastSpell(evadeSpell.Slot, castPoint);
                        }

                        return;
                    }
                }
            }