Esempio n. 1
0
        private async Task <bool> Clearing()
        {
            ClearAreaHelper.CheckClearArea(_center, _radius);

            if (!await NavigationCoroutine.MoveTo(_currentDestination, 10))
            {
                return(false);
            }
            _currentDestination = _currentDestination = ActorFinder.FindNearestHostileUnitInRadius(_center, _radius);
            if (_currentDestination == Vector3.Zero)
            {
                State = States.Cleared;
            }
            return(false);
        }
Esempio n. 2
0
        public async Task <bool> GetCoroutine()
        {
            CoroutineCoodinator.Current = this;

            if (_worldId > 0 && AdvDia.CurrentWorldId != _worldId)
            {
                State = States.Completed;
                return(false);
            }

            if (_startPosition != Vector3.Zero)
            {
                ClearAreaHelper.CheckClearArea(_startPosition, _radius);
            }

            if (IsQuestStepComplete())
            {
                Core.Logger.Log("Ending ClearAreaForNSecondsCoroutine because quest step appears to be completed!");
                State = States.Completed;
                return(false);
            }

            switch (State)
            {
            case States.NotStarted:
                return(await NotStarted());

            case States.Clearing:
                return(await Clearing());

            case States.MovingBack:
                return(await MovingBack());

            case States.Completed:
                return(await Completed());

            case States.Failed:
                return(await Failed());
            }
            return(false);
        }