示例#1
0
        private static void ProcessE(Obj_AI_Base target)
        {
            if (target.IsValidTarget())
            {
                foreach (var sphere in
                         SphereManager.GetSpheres(true)
                         .Where(
                             o =>
                             o.To2D().IsValid() &&
                             EntryPoint.Player.Distance(o, true) < Math.Pow(Spells[SpellSlot.E].Range, 2)))
                {
                    var sp = sphere.To2D() +
                             (EntryPoint.Player.ServerPosition.To2D() - sphere.To2D()).Normalized() * 100f;
                    var esp = sphere.To2D() +
                              (sphere.To2D() - EntryPoint.Player.ServerPosition.To2D()).Normalized() * 592f;

                    Spells[SpellSlot.SphereE].Instance.Delay = Spells[SpellSlot.Q].Delay + Spells[SpellSlot.E].Delay +
                                                               EntryPoint.Player.Distance(sphere) /
                                                               Spells[SpellSlot.E].MissileSpeed;
                    Spells[SpellSlot.SphereE].Instance.UpdateSourcePosition(sphere);

                    var prediction = Spells[SpellSlot.SphereE].Instance.GetPrediction(target).UnitPosition.To2D();
                    if (prediction.Distance(sp, esp, true, true) <=
                        Math.Pow(Spells[SpellSlot.SphereE].Instance.Width + target.BoundingRadius, 2))
                    {
                        Spells[SpellSlot.E].Instance.Cast(sphere);
                        Spells[SpellSlot.E].LastCastAttemptTick = (int)(Game.ClockTime * 0x3E8);
                    }
                }
            }
        }
示例#2
0
 private static Vector3 GetGrabbableObjectPos(bool onlyOrbs)
 {
     if (onlyOrbs)
     {
         return(SphereManager.GetGrabbableSpheres((int)Spells[SpellSlot.W].Range));
     }
     foreach (var minion in
              ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget(Spells[SpellSlot.W].Range)))
     {
         return(minion.ServerPosition);
     }
     return(SphereManager.GetGrabbableSpheres((int)Spells[SpellSlot.W].Range));
 }