Exemple #1
0
        internal bool UseAbilityIfCondition(
            TargetManager targetManager,
            Sleeper comboSleeper,
            ComboModeMenu menu,
            ReversePolarity polarity,
            bool blink,
            bool force)
        {
            if (blink || force || polarity == null)
            {
                return(false);
            }

            var input = polarity.Ability.GetPredictionInput(targetManager.Target, targetManager.EnemyHeroes);

            input.Delay        += this.Ability.CastPoint + 0.5f;
            input.Range        += this.Ability.CastRange;
            input.CastRange     = this.Ability.CastRange;
            input.SkillShotType = SkillShotType.Circle;
            var output = polarity.Ability.GetPredictionOutput(input);

            if (output.HitChance < HitChance.Low || output.AoeTargetsHit.Count < polarity.TargetsToHit(menu))
            {
                return(false);
            }

            var blinkPosition = output.CastPosition;

            if (this.Owner.Distance(blinkPosition) > this.Ability.CastRange)
            {
                return(false);
            }

            var delay = this.Ability.GetCastDelay(targetManager.Target);

            comboSleeper.Sleep(this.Ability.GetHitTime(targetManager.Target));
            this.Sleeper.Sleep(delay + 0.5f);
            this.OrbwalkSleeper.Sleep(delay);
            return(this.Ability.UseAbility(blinkPosition));
        }
        // Token: 0x0600057F RID: 1407 RVA: 0x0001BEC4 File Offset: 0x0001A0C4
        internal bool UseAbilityIfCondition(TargetManager targetManager, Sleeper comboSleeper, ComboModeMenu menu, ReversePolarity polarity, bool blink, bool force)
        {
            if (blink || force || polarity == null)
            {
                return(false);
            }
            PredictionInput9 predictionInput = polarity.Ability.GetPredictionInput(targetManager.Target, targetManager.EnemyHeroes);

            predictionInput.Delay        += base.Ability.CastPoint + 0.5f;
            predictionInput.Range        += base.Ability.CastRange;
            predictionInput.CastRange     = base.Ability.CastRange;
            predictionInput.SkillShotType = 4;
            PredictionOutput9 predictionOutput = polarity.Ability.GetPredictionOutput(predictionInput);

            if (predictionOutput.HitChance < 1 || predictionOutput.AoeTargetsHit.Count < polarity.TargetsToHit(menu))
            {
                return(false);
            }
            Vector3 castPosition = predictionOutput.CastPosition;

            if (base.Owner.Distance(castPosition) > base.Ability.CastRange)
            {
                return(false);
            }
            float castDelay = base.Ability.GetCastDelay(targetManager.Target);

            comboSleeper.Sleep(base.Ability.GetHitTime(targetManager.Target));
            base.Sleeper.Sleep(castDelay + 0.5f);
            base.OrbwalkSleeper.Sleep(castDelay);
            return(base.Ability.UseAbility(castPosition, false, false));
        }