Example #1
0
 public static float GetFastDamage(Obj_AI_Hero target)
 {
     //var statuss = target.GetPassiveStatus(0);
     //if (statuss.HasPassive)
     //{
     //    return statuss.PassivePredictedPositions.Count() * (float)(GetPassiveDamage(target) + Player.GetAutoAttackDamage(target));
     //}
     //return 0;
     ////
     float damage = 0;
     damage += Q.GetDamage(target);
     if (Q.IsReady())
         damage += Q.GetDamage(target);
     if (R.IsReady())
     {
         damage += GetUltiDamage(target);
         return damage;
     }
     else
     {
         var status = target.GetPassiveStatus(0);
         if (status.HasPassive)
         {
             damage += status.PassivePredictedPositions.Count() * (float)(GetPassiveDamage(target) + Player.GetAutoAttackDamage(target));
             if (status.PassivePredictedPositions.Count() < 3)
                 damage += (3 - status.PassivePredictedPositions.Count()) * (float)Player.GetAutoAttackDamage(target);
             return damage;
         }
         else
         {
             damage += (float)Player.GetAutoAttackDamage(target) * 2;
             return damage;
         }
     }
 }
Example #2
0
 private static bool castQtoPassive(Obj_AI_Hero target, float delay)
 {
     if (target == null)
         return false;
     var targetStatus = target.GetPassiveStatus(delay);
     if (!targetStatus.HasPassive || targetStatus.PassiveType != PassiveType.NormalPassive)
         return false;
     if (targetStatus.PassiveType != PassiveType.NormalPassive)
         return false;
     if (!targetStatus.PassivePredictedPositions.Any())
         return false;
     var passivepos = targetStatus.PassivePredictedPositions.First();
     var poses = GetRadiusPoints(targetStatus.TargetPredictedPosition, passivepos);
     var pos = poses.Where(x => x.Distance(Player.Position.To2D()) <= 400 && !x.IsWall())
                    .OrderBy(x => x.Distance(passivepos)).FirstOrDefault();
     if (pos == null || !pos.IsValid())
         return false;
     Q.Cast(pos);
     return true;
 }
Example #3
0
 private static float getQPassivedelay(Obj_AI_Hero target)
 {
     if (target == null)
         return 0;
     PassiveStatus targetStatus;
     if (Prediction.GetPrediction(target, 0.25f).UnitPosition.To2D().Distance(Player.Position.To2D())
         > Player.Position.To2D().Distance(target.Position.To2D()))
         targetStatus = target.GetPassiveStatus(Player.Position.To2D().Distance(target.Position.To2D()) / 1100);
     else
         targetStatus = target.GetPassiveStatus(0);
     if (!targetStatus.HasPassive)
         return 0;
     if (targetStatus.PassiveType == PassiveType.PrePassive || targetStatus.PassiveType == PassiveType.NormalPassive)
     {
         if (!targetStatus.PassivePredictedPositions.Any())
             return 0;
         var pos = targetStatus.PassivePredictedPositions.First();
         return Player.Position.To2D().Distance(pos) / 1100 + Game.Ping / 1000;
     }
     if (targetStatus.PassiveType == PassiveType.UltiPassive)
     {
         if (!targetStatus.PassivePredictedPositions.Any())
             return 0;
         var poses = targetStatus.PassivePredictedPositions;
         var pos = poses.OrderBy(x => Player.Position.To2D().Distance(x)).First();
         return Player.Position.To2D().Distance(pos) / 1100 + Game.Ping / 1000;
     }
     return 0;
 }