Exemplo n.º 1
0
        /// <summary>
        /// 다음 단계 세팅.
        /// </summary>
        private void SetNextProgress()
        {
            var nextValue = _resetValueOnNextProgress ? 0 : _nowProgressValue - NowProgressReqValue;

            _progressIndex = Mathf.Max(_progressIndex + 1, ProgressLength - 1);

            NowProgressModel.ReachProgress(nextValue);
            _nowProgressValue = nextValue;
            _subscribeQuestModule.OnNext(this);
        }
Exemplo n.º 2
0
        public void AcceptQuest()
        {
            if (QuestState != QuestState.NoAccept)
            {
                return;
            }

            QuestState = QuestState.Accept;
            NowProgressModel.ReachProgress();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 퀘스트 반복 처리.
        /// </summary>
        private void IterationQuest()
        {
            QuestState = QuestState.Accept;
            QuestProgresses.ForEach(q => { q.ResetProgress(); });

            var remainValue = _resetValueOnInterateQuest ? 0 : _nowProgressValue - NowProgressReqValue;

            _progressIndex    = 0;
            _nowProgressValue = 0;
            NowProgressModel.ReachProgress();
            AddProgressValue(remainValue);
            _onIteratedQuestAction.CallSafe(_nowProgressValue);
            _subscribeQuestModule.OnNext(this);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 퀘스트가 반복적으로 수행될 경우 초과된 값만큼 반복 완료 한다.
        /// </summary>
        /// <returns></returns>
        public int CompleteIterally()
        {
            if (!_iterateQuest)
            {
                return(0);
            }

            var count       = (int)(_nowProgressValue / TotalReqProgressValue);
            var remainValue = _nowProgressValue % TotalReqProgressValue;

            QuestState = QuestState.Accept;
            QuestProgresses.ForEach(q => { q.ResetProgress(); });

            _progressIndex    = 0;
            _nowProgressValue = 0;
            NowProgressModel.ReachProgress();
            AddProgressValue(remainValue);
            _onIteratedQuestAction.CallSafe(_nowProgressValue);
            _subscribeQuestModule.OnNext(this);

            return(count);
        }