Exemplo n.º 1
0
        public static void AddToMenu(Menu menu)
        {
            menu.Name = "sfx.ts";
            Menu      = menu;

            Drawings.AddToMainMenu();
            Weights.AddToMainMenu();
            Priorities.AddToMainMenu();
            Selected.Focus.AddToMainMenu();
            Humanizer.AddToMainMenu();
            Modes.AddToMainMenu();
        }
Exemplo n.º 2
0
        public static IEnumerable <Obj_AI_Hero> GetTargets(float range,
                                                           DamageType damageType = DamageType.True,
                                                           bool ignoreShields    = true,
                                                           Vector3 from          = default(Vector3),
                                                           IEnumerable <Obj_AI_Hero> ignoredChampions = null)
        {
            Weights.Range = Math.Max(range, Weights.Range);

            var selectedTarget = Selected.GetTarget(range, damageType, ignoreShields, from);

            if (selectedTarget != null)
            {
                return(new List <Obj_AI_Hero> {
                    selectedTarget
                });
            }

            range = ForceFocusWeight && Mode == ModeType.Weights ? Weights.Range : range;

            var targets =
                Humanizer.FilterTargets(Targets.Items)
                .Where(h => ignoredChampions == null || ignoredChampions.All(i => i.NetworkId != h.Hero.NetworkId))
                .Where(h => IsValidTarget(h.Hero, range, damageType, ignoreShields, from))
                .ToList();

            if (targets.Count > 0)
            {
                var t = GetOrderedChampions(targets).ToList();
                if (t.Count > 0)
                {
                    if (ForceFocusWeight)
                    {
                        return(new List <Obj_AI_Hero> {
                            t.First().Hero
                        });
                    }
                    if (Selected.Target != null && Focus && t.Count > 1)
                    {
                        t = t.OrderByDescending(x => x.Hero.NetworkId.Equals(Selected.Target.NetworkId)).ToList();
                    }
                    return(t.Select(h => h.Hero).ToList());
                }
            }

            return(new List <Obj_AI_Hero>());
        }
Exemplo n.º 3
0
        public static void AddToMenu(Menu menu)
        {
            _menu = menu.AddSubMenu(new Menu("Target Selector", "sfx.ts"));

            var drawingMenu = _menu.AddSubMenu(new Menu("Drawings", _menu.Name + ".drawing"));

            drawingMenu.AddItem(
                new MenuItem(drawingMenu.Name + ".circle-thickness", "Circle Thickness").SetShared()
                .SetValue(new Slider(5, 1, 10)));

            Selected.AddToMenu(_menu, drawingMenu);
            Weights.AddToMenu(_menu, drawingMenu);
            Priorities.AddToMenu(_menu);

            _menu.AddItem(new MenuItem(_menu.Name + ".focus", "Focus Selected Target").SetShared().SetValue(true));
            _menu.AddItem(
                new MenuItem(_menu.Name + ".force-focus", "Only Attack Selected Target").SetShared().SetValue(false));
            _menu.AddItem(
                new MenuItem(_menu.Name + ".force-focus-weight", "Only Attack Highest Weight Target").SetShared()
                .SetValue(false));

            Humanizer.AddToMenu(_menu);

            _menu.AddItem(
                new MenuItem(_menu.Name + ".mode", "Mode").SetShared()
                .SetValue(
                    new StringList(
                        new[]
            {
                "Weigths", "Priorities", "Less Attacks To Kill", "Most Ability Power",
                "Most Attack Damage", "Closest", "Near Mouse", "Less Cast Priority", "Least Health"
            })))
            .ValueChanged +=
                delegate(object sender, OnValueChangeEventArgs args)
            {
                Mode = GetModeBySelectedIndex(args.GetNewValue <StringList>().SelectedIndex);
            };

            Mode = GetModeBySelectedIndex(_menu.Item(_menu.Name + ".mode").GetValue <StringList>().SelectedIndex);
            LeagueSharp.Common.TargetSelector.CustomTS = true;
        }