示例#1
0
文件: _Q.cs 项目: Real263/EloBuddy
 private static void Game_OnTick(EventArgs args)
 {
     if (MissileIsValid)
     {
         SpellManager.Q1.SourcePosition        = _missile.Position;
         SpellManager.Q1.RangeCheckSource      = _missile.Position;
         SpellManager.Q1.AllowedCollisionCount = int.MaxValue;
         SpellManager.Q1.CastDelay             = 0;
     }
     else
     {
         SpellManager.Q1.SourcePosition        = Util.MyHero.Position;
         SpellManager.Q1.RangeCheckSource      = Util.MyHero.Position;
         SpellManager.Q1.AllowedCollisionCount = 0;
         SpellManager.Q1.CastDelay             = 250;
     }
     if (IsTryingToSmite)
     {
         if (IsWaitingMissile)//
         {
             var canSmite = false;
             if (Game.Time - _lastCastTime <= 0.25f)
             {
                 if ((SpellManager.Q1.Width + _smiteTarget.BoundingRadius).Pow() > Util.MyHero.Distance(_smiteTarget, true))
                 {
                     canSmite = true;
                 }
             }
             else if (WillHit(_smiteTarget))
             {
                 var pred          = SpellManager.Q1.GetPrediction(_smiteTarget);
                 var width         = _smiteTarget.BoundingRadius + SpellManager.Q1.Width;//
                 var timeToArriveQ = (_missile.Distance(pred.CastPosition) - width) / SpellManager.Q1.Speed - SpellManager.SmiteCastDelay - (Game.Ping / 2000f + 0.07f);
                 if (timeToArriveQ <= 0)
                 {
                     canSmite = true;
                 }
             }
             if (canSmite && _smiteTarget.IsInSmiteRange())
             {
                 Util.MyHero.Spellbook.CastSpell(SpellManager.Smite.Slot, _smiteTarget);
             }
         }
     }
     if (EndTime - Game.Time <= 0.25f)
     {
         if (!ModeManager.IsNone)
         {
             Champion.ForceQ2();
         }
     }
 }