Exemple #1
0
        /// <summary>
        ///     Resets the fields/properties
        /// </summary>
        private void SoftReset()
        {
            this.Targets  = new List <AIHeroClient>();
            this.PathBase = null;

            PathBaseCopy = null;
        }
Exemple #2
0
        public YasuoPath <Point, ConnectionBase <Point> > GeneratePath()
        {
            this.FindTargetedVector();

            this.PathBase = this.CalculatePath(this.TargetedVector);

            return(this.PathBase);
        }
Exemple #3
0
        // TODO
        /// <summary>
        ///     Returns a bool that determines if it is a good time to use lastbreath or not
        /// </summary>
        /// <param name="execution">The current target</param>
        /// <param name="pathBase">The PathBase to the target</param>
        /// <param name="buffer">a time buffer</param>
        /// <returns></returns>
        public bool ShouldCastNow(LastBreath execution, YasuoPath <Point, ConnectionBase <Point> > pathBase = null, int buffer = 10)
        {
            if (execution == null)
            {
                return(false);
            }

            // Last possible second ultimate
            if (execution.MinRemainingAirboneTime <= 1 + buffer + Game.Ping)
            {
                return(true);
            }

            // if no PathBase is given
            if (pathBase == null)
            {
                var playerpath     = GlobalVariables.Player.GetPath(execution.Target.ServerPosition);
                var playerpathtime = Math.GetPathLenght(playerpath) / GlobalVariables.Player.MoveSpeed;

                // if walking is requires less time than remaining knockup time
                if (playerpathtime <= execution.MinRemainingAirboneTime + buffer + Game.Ping)
                {
                    return(false);
                }

                // Instant Ult in 1 v 1 because armor pen and less time for enemiy to get spells up also you can't gapclose
                if (execution.EndPosition.CountEnemiesInRange(1500) == 0 && !execution.Target.InAutoAttackRange())
                {
                    return(true);
                }
            }

            // if a PathBase is given and the PathBase time is shorter than the knockup time
            else
            {
                if (pathBase.PathCost <= execution.MinRemainingAirboneTime + buffer + Game.Ping)
                {
                    return(false);
                }
            }

            return(execution.MinRemainingAirboneTime <= Game.Ping + buffer);
        }
Exemple #4
0
        /// <summary>
        ///     Raises the <see cref="E:Update" /> event.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void OnUpdate(EventArgs args)
        {
            this.SoftReset();

            if (GlobalVariables.Player.IsDead || GlobalVariables.Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Combo ||
                !GlobalVariables.Spells[SpellSlot.E].IsReady())
            {
                return;
            }

            this.GetTargets();

            this.LogicOnChampion();

            this.Pathfinder.ExecutePath();

            this.PathBase = this.Pathfinder.GetPath();

            PathBaseCopy = this.PathBase;
        }
Exemple #5
0
 /// <summary>
 ///     Resets
 /// </summary>
 private void SoftReset()
 {
     this.Units    = new List <Obj_AI_Base>();
     this.PathBase = null;
 }
Exemple #6
0
        // TODO: Decomposite
        /// <summary>
        ///     Method to stack Q.
        /// </summary>
        private void LogicStacking()
        {
            var stacksettingsMenu = this.Menu.SubMenu(this.Menu.Name + "Stack-Settings");

            if (stacksettingsMenu.Item(stacksettingsMenu.Name + "Mode").GetValue <StringList>().SelectedValue
                == "Disabled" || GlobalVariables.Player.HasQ3())
            {
                return;
            }

            this.Units = this.providerE.GetUnits(GlobalVariables.Player.ServerPosition);

            this.PathBase = SweepingBlade.PathBaseCopy;

            switch (stacksettingsMenu.Item(stacksettingsMenu.Name + "Mode").GetValue <StringList>().SelectedIndex)
            {
                #region Mode: Custom

            case 0:
                var nearesthero =
                    HeroManager.Enemies.Where(x => !x.IsDead || !x.IsZombie)
                    .MinOrDefault(x => x.Distance(GlobalVariables.Player));

                if (nearesthero == null ||
                    nearesthero.Distance(GlobalVariables.Player.ServerPosition)
                    > stacksettingsMenu.Item(stacksettingsMenu.Name + "MaxDistance").GetValue <Slider>().Value ||
                    nearesthero.Distance(GlobalVariables.Player.ServerPosition)
                    < stacksettingsMenu.Item(stacksettingsMenu.Name + "MinDistance").GetValue <Slider>().Value ||
                    this.providerQ.RealCooldown()
                    > stacksettingsMenu.Item(stacksettingsMenu.Name + "MaxCooldownQ").GetValue <Slider>().Value ||
                    !this.Units.Any())
                {
                    return;
                }

                var path = this.PathBase;

                if (path?.Connections != null &&
                    stacksettingsMenu.Item(stacksettingsMenu.Name + "CarePath").GetValue <bool>())
                {
                    var dashConnections = path.Connections.OfType <YasuoDashConnection>();

                    var yasuoDashConnections = dashConnections as IList <YasuoDashConnection> ?? dashConnections.ToList();

                    if (!yasuoDashConnections.Any())
                    {
                        return;
                    }

                    foreach (var unit in this.Units.ToList())
                    {
                        if (yasuoDashConnections.Where(x => x.Unit != null).Any(x => x.Unit.Equals(unit)))
                        {
                            this.Units.Remove(unit);
                        }
                    }
                }

                if (true)
                {
                    var unitsNotMoving =
                        this.Units.Where(
                            x =>
                            !x.IsMoving &&
                            x.Distance(GlobalVariables.Player) <= GlobalVariables.Spells[SpellSlot.Q].Range)
                        .ToList();

                    if (unitsNotMoving.Any())
                    {
                        var unit = unitsNotMoving.MinOrDefault(x => x.Health);

                        if (unit != null)
                        {
                            if (GlobalVariables.Debug)
                            {
                                Console.WriteLine(
                                    @"OrbwalkingModes > Combo > SteelTempest > Stacking > Case 0: not moving units");
                            }

                            this.Execute(unit);
                        }
                    }
                    else
                    {
                        var unit =
                            this.Units.Where(x => GlobalVariables.Spells[SpellSlot.Q].IsInRange(x))
                            .MinOrDefault(x => x.Health);

                        if (unit != null)
                        {
                            if (GlobalVariables.Debug)
                            {
                                Console.WriteLine(
                                    @"OrbwalkingModes > Combo > SteelTempest > Stacking > Case 0: moving units");
                            }

                            this.Execute(unit);
                        }
                    }
                }

                break;

                #endregion

                #region Mode: Always

            case 1:
                if (this.Units.Any())
                {
                    var unitsNotMoving =
                        this.Units.Where(
                            x =>
                            !x.IsMoving &&
                            x.Distance(GlobalVariables.Player) <= GlobalVariables.Spells[SpellSlot.Q].Range)
                        .ToList();

                    if (unitsNotMoving.Any())
                    {
                        var unit = unitsNotMoving.MinOrDefault(x => x.Health);

                        if (unit != null)
                        {
                            if (GlobalVariables.Debug)
                            {
                                Console.WriteLine(
                                    @"OrbwalkingModes > Combo > SteelTempest > Stacking > Case 1: not moving units");
                            }

                            this.Execute(unit);
                        }
                    }
                    else
                    {
                        var unit =
                            this.Units.Where(x => GlobalVariables.Spells[SpellSlot.Q].IsInRange(x))
                            .MinOrDefault(x => x.Health);

                        if (unit != null)
                        {
                            if (GlobalVariables.Debug)
                            {
                                Console.WriteLine(
                                    @"OrbwalkingModes > Combo > SteelTempest > Stacking > Case 1: moving units");
                            }

                            this.Execute(unit);
                        }
                    }
                }
                break;

                #endregion

                #region Mode: PathBase Based

            case 2:
                if (this.PathBase != null && this.Units.Any())
                {
                    foreach (var unit in this.Units.ToList())
                    {
                        var dashConnections = this.PathBase.Connections.OfType <YasuoDashConnection>();

                        if (dashConnections.Any(x => x.Unit != null && x.Unit.Equals(unit)))
                        {
                            this.Units.Remove(unit);
                        }
                    }

                    if (GlobalVariables.Player.CountEnemiesInRange(GlobalVariables.Spells[SpellSlot.Q].Range) == 0 &&
                        this.PathBase.PathCost + 500 > GlobalVariables.Spells[SpellSlot.Q].Cooldown)
                    {
                        var dashConnections = this.PathBase.Connections.OfType <YasuoDashConnection>().ToList();

                        if (dashConnections.Any(
                                x =>
                                x.Unit.Health
                                > this.providerE.GetDamage(x.Unit) + this.providerQ.GetDamage(x.Unit)))
                        {
                            if (GlobalVariables.Player.IsDashing())
                            {
                                this.Execute(dashConnections.FirstOrDefault(x => x.Unit != null)?.Unit);
                            }
                        }

                        else if (this.Units.Count > 0)
                        {
                            var unitsNotMoving =
                                this.Units.Where(
                                    x =>
                                    !x.IsMoving &&
                                    x.Distance(GlobalVariables.Player)
                                    <= GlobalVariables.Spells[SpellSlot.Q].Range).ToList();

                            if (unitsNotMoving.Any())
                            {
                                this.Execute(unitsNotMoving.MinOrDefault(x => x.Distance(GlobalVariables.Player)));
                            }
                            else
                            {
                                var unit = this.Units.MinOrDefault(x => x.Distance(GlobalVariables.Player));

                                if (unit != null &&
                                    unit.Distance(GlobalVariables.Player)
                                    <= GlobalVariables.Spells[SpellSlot.Q].Range)
                                {
                                    this.Execute(unit);
                                }
                            }
                        }
                    }
                }

                break;

                #endregion
            }
        }
Exemple #7
0
 private void Reset()
 {
     this.PathBase = null;
 }