Example #1
0
        /// <summary>
        ///     On Mixed
        /// </summary>
        private void Mixed()
        {
            var basename = BaseName + "Mixed.";

            if (StaticObjects.ProjectMenu.Item($"{basename}.UseW").GetValue <bool>())
            {
                if (_manaManager.CheckMixedW())
                {
                    var minHitChance = Prediction.GetHitChance(StaticObjects.ProjectMenu.Item($"{basename}.UseW.Prediction").GetValue <StringList>().SelectedValue);

                    var focusTargetValid = false;
                    //Check if the target in target selector is valid (best target)
                    var focusTarget = TargetSelector.GetTarget(W.Range, W.DamageType);

                    if (focusTarget != null)
                    {
                        if (StaticObjects.ProjectMenu.Item($"{basename}.UseW.On.{focusTarget.ChampionName}").GetValue <bool>())
                        {
                            focusTargetValid = Prediction.DoCast(W, focusTarget, minHitChance);
                        }
                    }
                    if (!focusTargetValid)
                    {
                        var orderedTargets = Prediction.OrderTargets(W);

                        foreach (var target in orderedTargets)
                        {
                            if (StaticObjects.ProjectMenu.Item($"{basename}.UseW.On.{target.ChampionName}").GetValue <bool>())
                            {
                                continue;
                            }

                            if (Prediction.DoCast(W, target, minHitChance))
                            {
                                break;
                            }
                        }
                    }
                }
            }

            if (StaticObjects.ProjectMenu.Item($"{basename}.UseQ").GetValue <bool>())
            {
                if (_manaManager.CheckMixedQ())
                {
                    if (Functions.Objects.Heroes.GetEnemies(StaticObjects.Player.AttackRange - 50).Count >= 1)
                    {
                        Q.Cast();
                    }
                }
            }
        }