Sleep() public method

The sleep.
public Sleep ( float duration ) : void
duration float /// The duration. ///
return void
Beispiel #1
0
        public void OnLoad()
        {
            menu = new MenuManager(addedItems);
            sleeper = new Sleeper();

            menu.OnChange += OnChange;
            sleeper.Sleep(1000);
        }
Beispiel #2
0
        public ArmletOfMordiggian(Ability ability, AbilityType type, AbilityCastTarget target = AbilityCastTarget.Self)
            : base(ability, type, target)
        {
            attacking = new MultiSleeper();
            attackStart = new MultiSleeper();
            delay = new Sleeper();

            delay.Sleep(1000);

            Game.OnUpdate += OnUpdate;
            Player.OnExecuteOrder += OnExecuteOrder;
        }
Beispiel #3
0
        public AbilityUpdater()
        {
            sleeper = new Sleeper();
            allyAbilitiesData = new AllyAbilities();
            enemyAbilitiesData = new EnemyAbilities();

            Menu.UsableAbilities.AddAbility(AbilityNames.GoldSpender, AbilityType.Counter);
            GoldSpender = new GoldSpender();

            Debugger.WriteLine("* Evader =>");
            Debugger.WriteLine("* Total abilities countered: " + enemyAbilitiesData.EvadableAbilities.Count);
            Debugger.WriteLine("* Total usable blink abilities: " + allyAbilitiesData.BlinkAbilities.Count);
            Debugger.WriteLine("* Total usable counter abilities: " + allyAbilitiesData.CounterAbilities.Count);
            Debugger.WriteLine("* Total usable disable abilities: " + allyAbilitiesData.DisableAbilities.Count);

            sleeper.Sleep(1000);

            GameDispatcher.OnUpdate += OnUpdate;
            ObjectManager.OnRemoveEntity += OnRemoveEntity;
        }
Beispiel #4
0
        public void OnLoad()
        {
            hero = ObjectManager.LocalHero;
            abilities =
                hero.Spellbook.Spells.Where(
                    x =>
                        !x.IsHidden && !IgnoredAbilities.List.Contains(x.StoredName())
                        && !x.Name.Contains("special_bonus"));
            menuManager = new MenuManager(abilities.Select(x => x.StoredName()).ToList(), hero.Name);
            sleeper = new Sleeper();
            abilitylBuilder = new AbilityBuilder(hero);
            talents = hero.Spellbook.Spells.Where(x => x.Name.Contains("special_bonus")).ToList();

            sleeper.Sleep(10000);
        }
        /// <summary>
        ///     The execute.
        /// </summary>
        /// <param name="hero">
        ///     The hero.
        /// </param>
        /// <returns>
        ///     The <see cref="bool" />.
        /// </returns>
        public bool Execute(Hero hero = null)
        {
            if (hero == null)
            {
                return false;
            }

            var me = Variables.Techies;
            var heroPosition = hero.PredictedPosition(me.GetTurnTime(hero) * 2);
            if (me.Distance2D(heroPosition) > this.blinkDagger.GetCastRange() + 150)
            {
                return false;
            }

            if (Prediction.StraightTime(hero) / 1000
                < Variables.Menu.HurricanePikeMenu.Item("Techies.HurricanePikeStraightTime").GetValue<Slider>().Value)
            {
                return false;
            }

            if (hero.NetworkActivity == NetworkActivity.Move
                && Variables.Menu.HurricanePikeMenu.Item("Techies.HurricanePikeNoMove").GetValue<bool>())
            {
                return false;
            }

            var stack = GetNearestStackToPush(hero, heroPosition);
            if (stack == null)
            {
                return false;
            }

            stack.AutoDetonate = true;
            stack.MinEnemiesKill = 1;
            var blinkPosition = stack.Position.Extend(heroPosition, stack.Position.Distance2D(hero) + 300);
            this.blinkDagger.UseAbility(blinkPosition);
            var sleeper = new Sleeper();
            Events.OnUpdateDelegate update = args =>
                {
                    if (sleeper.Sleeping || !this.hurricanePike.CanBeCasted())
                    {
                        return;
                    }

                    this.hurricanePike.UseAbility(hero);
                    sleeper.Sleep(150);
                };
            DelayAction.Add((float)(me.GetTurnTime(blinkPosition) * 1000), () => { Events.OnUpdate += update; });
            DelayAction.Add(
                (float)((me.GetTurnTime(blinkPosition) * 1000) + 50 + Game.Ping),
                () => { Events.OnUpdate -= update; });
            this.comboSleeper.Sleep(1000);
            return true;
        }