ArcAnnihilation.Core.DoCombo2 C# (CSharp) Method

DoCombo2() private static method

private static DoCombo2 ( Hero me, Hero target ) : void
me Hero
target Hero
return void
        private static void DoCombo2(Hero me, Hero target)
        {
            double targetHull = target.HullRadius;
            foreach (var hero in Objects.Tempest.GetCloneList(me))
            {
                var d = hero.Distance2D(target) - _myHull - targetHull;
                var inv = hero.Inventory.Items;
                var enumerable = inv as Item[] ?? inv.ToArray();

                // use dagger if available
                var dagger =
                    enumerable.Any(
                        x =>
                            x.Name == "item_blink" && x.Cooldown == 0 &&
                            SpellBaseList.Find(z => z.Name == x.StoredName()) == null);

                // uses all items available
                if (!hero.IsInvisible())
                    if (ItemUsage(hero, enumerable, target, d,
                        Menu.Item("BkbUsage").GetValue<StringList>().SelectedIndex == (int) BkbUsage.Clones ||
                        Menu.Item("BkbUsage").GetValue<StringList>().SelectedIndex == (int) BkbUsage.All, true))
                        SpellsUsage(hero, target, d, dagger, true);
                var invis = hero.FindItem(HideItemList[1]) ?? hero.FindItem(HideItemList[2]);
                if (invis != null)
                {
                    Print("invis!" + Utils.SleepCheck("invis" + invis.Handle) +
                          $" {invis.CanBeCasted()} {SpellBaseList.Find(z => z.Name == invis.StoredName()) == null}",print:false);
                    if (Utils.SleepCheck("invis" + invis.Handle) && invis.CanBeCasted() &&
                        SpellBaseList.Find(z => z.Name == invis.StoredName()) == null)
                    {
                        invis.UseAbility();
                        Utils.Sleep(250, "invis" + invis.Handle);
                    }
                }
                // do orbwalking if enabled
                // otherwise simply attack target
                if (hero.IsDisarmed() || !Utils.SleepCheck("magField")) continue;
                if (Menu.Item("OrbWalking.Enable").GetValue<bool>() && OrbMinDist < hero.Distance2D(target))
                {
                    Orbwalk(hero, target);
                }
                else
                {
                    if (!Utils.SleepCheck("clone_attacking" + hero.Handle)) continue;
                    hero.Attack(target);
                    Utils.Sleep(350, "clone_attacking" + hero.Handle);
                }
            }
            var illusions = ObjectManager.GetEntities<Hero>().Where(x => x.IsAlive && x.IsControllable && x.Team == me.Team && x.IsIllusion && !x.HasModifier("modifier_kill")).ToList();
            foreach (var illusion in illusions.TakeWhile(illusion => Utils.SleepCheck("clone_attacking" + illusion.Handle) && illusion.Distance2D(target) <= 1500))
            {
                illusion.Attack(target);
                Utils.Sleep(350, "clone_attacking" + illusion.Handle);
            }
            var necr = Objects.Necronomicon.GetNecronomicons(me);
            foreach (var necronomicon in necr.TakeWhile(illusion => Utils.SleepCheck("clone_attacking" + illusion.Handle) && illusion.Distance2D(target) <= 1500 && !Equals(illusion, me)))
            {
                necronomicon.Attack(target);
                var spell = necronomicon.Spellbook.Spell1;
                if (spell != null && spell.CanBeCasted(target) &&
                    necronomicon.Distance2D(target) <= spell.CastRange + necronomicon.HullRadius + targetHull+50 &&
                    Utils.SleepCheck(spell.Name + "clone_attacking" + necronomicon.Handle))
                {
                    spell.UseAbility(target);
                    Utils.Sleep(300, spell.Name + "clone_attacking" + necronomicon.Handle);
                }
                Utils.Sleep(600, "clone_attacking" + necronomicon.Handle);
            }
        }