Example #1
0
        public OneKeyCombo NewCombo(
            string name,
            List <IUnitOrbwalker> orbwalkers,
            List <IOrderIssuer> orderIssuers,
            uint key,
            Action targetAssign,
            Action targetReset,
            bool toggle        = false,
            string description = null)
        {
            var subMenu = new AbilitySubMenu(name);

            subMenu.AddToMenu(this.Menu);

            foreach (var orbwalker in orbwalkers)
            {
                orderIssuers.Add(orbwalker);
            }

            var combo = new OneKeyCombo(
                orderIssuers,
                subMenu,
                key,
                2000,
                targetAssign,
                targetReset,
                toggle,
                description);

            this.Combos.Add(combo);
            return(combo);
        }
Example #2
0
        public override void OnLoad()
        {
            this.LycanOrbwalker = new LycanOrbwalker(this.LocalHero);

            // var loneRuneTaker = new RuneTaker(this.LocalHero, this.MapData, false);
            // this.LocalHero.AddOrderIssuer(loneRuneTaker);
            this.AddOrbwalker(this.LycanOrbwalker);

            var orbwalkers = new List <IUnitOrbwalker> {
                this.LycanOrbwalker
            };
            var orderIssuers = new List <IOrderIssuer>();

            var targetReset = new Action(() => { this.LocalHero.TargetSelector.ResetTarget(); });

            var targetAssign = new Action(() => { this.LocalHero.TargetSelector.GetTarget(); });

            this.LocalHero.TargetSelector.TargetChanged.Subscribe(
                () =>
            {
                foreach (var controllableUnitsUnit in this.LocalHero.ControllableUnits.Units)
                {
                    controllableUnitsUnit.Value.TargetSelector.Target = this.LocalHero.TargetSelector.Target;
                }
            });

            this.ChaseCombo = this.NewCombo(
                "ChaseCombo",
                orbwalkers,
                orderIssuers,
                'G',
                targetAssign,
                targetReset,
                false,
                "everyone chases enemy, 1 wolf will bodyblock");

            this.RetreatCombo = this.NewCombo(
                "RetreatCombo",
                new List <IUnitOrbwalker> {
                new LycanRetreatOrbwalker(this.LocalHero)
            },
                new List <IOrderIssuer>(),
                'H',
                targetAssign,
                targetReset,
                false,
                "lycan will run to mouse, wolves will attack/bodyblock target");

            this.controllableUnits = this.LocalHero.ControllableUnits as LycanControllableUnits;

            this.controllableUnits.AddedUnit.Subscribe(new DataObserver <IAbilityUnit>(unit => this.UnitAdded(unit)));
            this.controllableUnits.RemovedUnit.Subscribe(new DataObserver <IAbilityUnit>(unit => this.UnitRemoved(unit)));

            foreach (var controllableUnitsUnit in this.controllableUnits.Units)
            {
                this.UnitAdded(controllableUnitsUnit.Value);
            }
        }
Example #3
0
        public override void OnLoad()
        {
            this.LoneDruidOrbwalker = new LoneDruidOrbwalker(this.LocalHero);
            var loneRuneTaker = new RuneTaker(this.LocalHero, this.MapData, false);

            if (Game.ShortLevelName == "start")
            {
                this.LocalHero.AddOrderIssuer(loneRuneTaker);
            }

            this.AddOrbwalker(this.LoneDruidOrbwalker);

            var orbwalkers = new List <IUnitOrbwalker> {
                this.LoneDruidOrbwalker
            };
            var orderIssuers = new List <IOrderIssuer>();

            var targetReset = new Action(() => { this.LocalHero.TargetSelector.ResetTarget(); });

            var targetAssign = new Action(() => { this.LocalHero.TargetSelector.GetTarget(); });

            this.LocalHero.TargetSelector.TargetChanged.Subscribe(
                () =>
            {
                foreach (var localHeroControllableUnit in this.LocalHero.ControllableUnits.Units)
                {
                    localHeroControllableUnit.Value.TargetSelector.Target = this.LocalHero.TargetSelector.Target;
                }

                if (this.Bear == null)
                {
                    return;
                }

                this.Bear.TargetSelector.Target = this.LocalHero.TargetSelector.Target;
            });

            this.BodyBlockCombo = this.NewCombo(
                "BodyBlockCombo",
                orbwalkers,
                orderIssuers,
                'B',
                targetAssign,
                targetReset,
                false,
                "bear will bodyblock, lone druid will attack");

            this.ChaseCombo = this.NewCombo(
                "ChaseCombo",
                orbwalkers,
                orderIssuers,
                'G',
                targetAssign,
                targetReset,
                false,
                "bear will chase enemy, lone will attack and move to mouse and keep range if not in true form");

            this.BearRetreatOrbwalker = new BearRetreatOrbwalker {
                LocalHero = this.LocalHero
            };

            this.RetreatCombo = this.NewCombo(
                "RetreatCombo",
                new List <IUnitOrbwalker> {
                new LoneDruidRetreatOrbwalker(this.LocalHero)
            },
                new List <IOrderIssuer>(),
                'H',
                () =>
            {
                this.Bear?.TargetSelector.GetTarget();
                foreach (var localHeroControllableUnit in this.LocalHero.ControllableUnits.Units)
                {
                    localHeroControllableUnit.Value.TargetSelector.GetTarget();
                }
            },
                () =>
            {
                this.Bear?.TargetSelector.ResetTarget();
                foreach (var localHeroControllableUnit in this.LocalHero.ControllableUnits.Units)
                {
                    localHeroControllableUnit.Value.TargetSelector.ResetTarget();
                }
            },
                false,
                "lone will run to mouse, bear will attack/bodyblock target or run if low hp");

            this.BearRetreatOrbwalker.LowHp.AddToMenu(this.RetreatCombo.SubMenu);

            this.controllableUnits = this.LocalHero.ControllableUnits as LoneDruidControllableUnits;
            this.controllableUnits.BearAdded.Subscribe(this.BearAdded);

            this.controllableUnits.AddedUnit.Subscribe(new DataObserver <IAbilityUnit>(unit => this.UnitAdded(unit)));
            this.controllableUnits.RemovedUnit.Subscribe(new DataObserver <IAbilityUnit>(unit => this.UnitRemoved(unit)));

            var runeTakerMenu = new AbilitySubMenu("RuneTaker");

            runeTakerMenu.AddToMenu(this.Menu);

            this.BearRuneTaker = new BearRuneTaker(null, this.MapData);
            this.BearRuneTaker.ConnectToMenu(runeTakerMenu, true, true);

            loneRuneTaker.ConnectToMenu(runeTakerMenu, false, false);


            if (this.controllableUnits.Bear != null)
            {
                this.BearAdded();
            }

            foreach (var controllableUnitsUnit in this.controllableUnits.Units)
            {
                this.UnitAdded(controllableUnitsUnit.Value);
            }
        }