Example #1
0
        public bool UseDoubleBlinkCombo(ForceStaff force, BlinkAbility blink, float minDistance = 0)
        {
            if (!this.CanBeCasted(force, false) || !this.CanBeCasted(blink, false))
            {
                return(false);
            }

            var target = this.TargetManager.Target;
            var owner  = force.Ability.Owner;

            if (owner.Distance(target) < minDistance || owner.Distance(target) < blink.Ability.Range)
            {
                return(false);
            }

            var range = blink.Ability.Range + force.Ability.Range;

            if (owner.Distance(target) > range)
            {
                return(false);
            }

            if (owner.GetAngle(target.Position) > 0.5f)
            {
                owner.BaseUnit.Move(target.Position);
                this.comboSleeper.Sleep(0.1f);
                return(false);
            }

            force.Ability.UseAbility(owner);
            this.comboSleeper.Sleep(force.Ability.GetCastDelay() + 0.3f);
            return(false);
        }
Example #2
0
        public bool UseBlinkLineCombo(BlinkAbility blink, UsableAbility ability)
        {
            if (!this.CanBeCasted(ability, false) || !this.CanBeCasted(blink))
            {
                return(false);
            }

            if (!(ability.Ability is LineAbility line))
            {
                return(false);
            }

            var target = this.TargetManager.Target;

            var range = line.CastRange;

            if (blink.Ability.CastRange < range)
            {
                range = blink.Ability.CastRange - 100;
            }

            if (line.Owner.Distance(target) < range)
            {
                return(false);
            }

            var input = line.GetPredictionInput(target, this.TargetManager.EnemyHeroes);

            input.CastRange = blink.Ability.Range;
            input.Range     = line.CastRange;
            input.UseBlink  = true;

            var output = line.GetPredictionOutput(input);

            if (output.HitChance < HitChance.Low)
            {
                return(false);
            }

            var blinkPosition = output.BlinkLinePosition;

            if (blink.Ability.UseAbility(blinkPosition))
            {
                if (line.UseAbility(output.CastPosition))
                {
                    var delay = ability.Ability.GetCastDelay(output.CastPosition);

                    this.comboSleeper.Sleep(delay + 0.3f);
                    this.orbwalkSleeper.Sleep(delay + 0.5f);
                    ability.Sleeper.Sleep(delay + 0.5f);
                    blink.Sleeper.Sleep(delay + 0.5f);

                    return(true);
                }
            }

            return(false);
        }
Example #3
0
        public bool UseMoveAbility(BlinkAbility ability)
        {
            if (!this.CanBeCasted(ability, false))
            {
                return(false);
            }

            return(ability.UseAbility(this.TargetManager, this.comboSleeper, Game.MousePosition));
        }
Example #4
0
        public bool UseAbility(BlinkAbility ability, Vector3 position)
        {
            if (!this.CanBeCasted(ability))
            {
                return(false);
            }

            return(ability.UseAbility(this.TargetManager, this.comboSleeper, position));
        }
Example #5
0
        public bool UseAbility(BlinkAbility ability, float minUseRange, float blinkToEnemyRange)
        {
            if (!this.CanBeCasted(ability))
            {
                return(false);
            }

            return(ability.UseAbility(this.TargetManager, this.comboSleeper, minUseRange, blinkToEnemyRange));
        }
        // Token: 0x06000A11 RID: 2577 RVA: 0x0002BD14 File Offset: 0x00029F14
        public bool UseBlinkLineCombo(BlinkAbility blink, UsableAbility ability)
        {
            if (!this.CanBeCasted(ability, false, true, true, true) || !this.CanBeCasted(blink, true, true, true, true))
            {
                return(false);
            }
            LineAbility lineAbility;

            if ((lineAbility = (ability.Ability as LineAbility)) == null)
            {
                return(false);
            }
            Unit9 target = this.TargetManager.Target;
            float num    = lineAbility.CastRange;

            if (blink.Ability.CastRange < num)
            {
                num = blink.Ability.CastRange - 100f;
            }
            if (lineAbility.Owner.Distance(target) < num)
            {
                return(false);
            }
            PredictionInput9 predictionInput = lineAbility.GetPredictionInput(target, this.TargetManager.EnemyHeroes);

            predictionInput.CastRange = blink.Ability.Range;
            predictionInput.Range     = lineAbility.CastRange;
            predictionInput.UseBlink  = true;
            PredictionOutput9 predictionOutput = lineAbility.GetPredictionOutput(predictionInput);

            if (predictionOutput.HitChance < 1)
            {
                return(false);
            }
            Vector3 blinkLinePosition = predictionOutput.BlinkLinePosition;

            if (blink.Ability.UseAbility(blinkLinePosition, false, false) && lineAbility.UseAbility(predictionOutput.CastPosition, false, false))
            {
                float castDelay = ability.Ability.GetCastDelay(predictionOutput.CastPosition);
                this.comboSleeper.Sleep(castDelay + 0.3f);
                this.orbwalkSleeper.Sleep(castDelay + 0.5f);
                ability.Sleeper.Sleep(castDelay + 0.5f);
                blink.Sleeper.Sleep(castDelay + 0.5f);
                return(true);
            }
            return(false);
        }
 // Token: 0x06000A0D RID: 2573 RVA: 0x00007063 File Offset: 0x00005263
 public bool UseAbility(BlinkAbility ability, Vector3 position)
 {
     return(this.CanBeCasted(ability, true, true, true, true) && ability.UseAbility(this.TargetManager, this.comboSleeper, position));
 }