Пример #1
0
        private double GetRecallPercent(Recall recall)
        {
            var recallDuration = recall.Duration;
            var cd             = recall.Started + recallDuration - Game.Time;
            var percent        = cd > 0 && Math.Abs(recallDuration) > float.Epsilon ? 1f - cd / recallDuration : 1f;

            return(percent);
        }
Пример #2
0
        private void BaseUltCalcs(Recall recall)
        {
            var finishedRecall = recall.Started + recall.Duration;
            var spellData      = BaseUltSpells.Find(h => h.Name == Player.Instance.ChampionName);
            var timeNeeded     = GetBaseUltTravelTime(spellData.Delay, spellData.Speed);
            var fireTime       = finishedRecall - timeNeeded;
            var spellDmg       = GetBaseUltSpellDamage(spellData, recall.Unit) - recall.Unit.MaxHealth * 0.1;
            var collision      = GetCollision(spellData.Radius, spellData).Any();

            if (fireTime > Game.Time && fireTime < recall.Started + recall.Duration && recall.Unit.Health < spellDmg &&
                Value.Use("baseult." + recall.Unit.ChampionName) && Value.Use("baseult.use"))
            {
                BaseUltUnits.Add(new BaseUltUnit(recall.Unit, fireTime, collision));
            }
            else if (BaseUltUnits.Any(h => h.Unit.NetworkId == recall.Unit.NetworkId))
            {
                BaseUltUnits.Remove(BaseUltUnits.Find(h => h.Unit.NetworkId == recall.Unit.NetworkId));
            }
        }
Пример #3
0
 private double GetRecallPercent(Recall recall)
 {
     var recallDuration = recall.Duration;
     var cd = recall.Started + recallDuration - Game.Time;
     var percent = cd > 0 && Math.Abs(recallDuration) > float.Epsilon ? 1f - cd / recallDuration : 1f;
     return percent;
 }
Пример #4
0
 private void BaseUltCalcs(Recall recall)
 {
     var finishedRecall = recall.Started + recall.Duration;
     var spellData = BaseUltSpells.Find(h => h.Name == Player.Instance.ChampionName);
     var timeNeeded = GetBaseUltTravelTime(spellData.Delay, spellData.Speed);
     var fireTime = finishedRecall - timeNeeded;
     var spellDmg = GetBaseUltSpellDamage(spellData, recall.Unit) - recall.Unit.MaxHealth * 0.1;
     var collision = GetCollision(spellData.Radius, spellData).Any();
     if (fireTime > Game.Time && fireTime < recall.Started + recall.Duration && recall.Unit.Health < spellDmg
         && Value.Use("baseult." + recall.Unit.ChampionName) && Value.Use("baseult.use"))
     {
         BaseUltUnits.Add(new BaseUltUnit(recall.Unit, fireTime, collision));
     }
     else if (BaseUltUnits.Any(h => h.Unit.NetworkId == recall.Unit.NetworkId))
     {
         BaseUltUnits.Remove(BaseUltUnits.Find(h => h.Unit.NetworkId == recall.Unit.NetworkId));
     }
 }