CanCastE() public static method

public static CanCastE ( Obj_AI_Base target ) : bool
target Obj_AI_Base
return bool
Example #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));
         }
     }
 }