コード例 #1
0
        public override GoalType GetGoalType(IValueObject goalVO)
        {
            EpisodeTaskProgressInfo currentEpisodeTaskProgress = this.GetCurrentEpisodeTaskProgress();

            if (currentEpisodeTaskProgress != null)
            {
                EpisodeTaskActionVO episodeTaskActionVO = Service.StaticDataController.Get <EpisodeTaskActionVO>(currentEpisodeTaskProgress.actionUID);
                return(StringUtils.ParseEnum <GoalType>(episodeTaskActionVO.Type));
            }
            return(GoalType.Invalid);
        }
コード例 #2
0
        public override string GetGoalItem(IValueObject goalVO)
        {
            EpisodeTaskProgressInfo currentEpisodeTaskProgress = this.GetCurrentEpisodeTaskProgress();

            if (currentEpisodeTaskProgress != null)
            {
                EpisodeTaskActionVO episodeTaskActionVO = Service.StaticDataController.Get <EpisodeTaskActionVO>(currentEpisodeTaskProgress.actionUID);
                return(episodeTaskActionVO.Item);
            }
            return(null);
        }
コード例 #3
0
        public bool doesPlayerQualifyForTaskAction(EpisodeTaskActionVO vo)
        {
            if (vo == null)
            {
                return(false);
            }
            CurrentPlayer currentPlayer = Service.CurrentPlayer;

            if (currentPlayer.Faction != vo.Faction)
            {
                return(false);
            }
            int num = currentPlayer.Map.FindHighestHqLevel();

            return((vo.MinHQ == -1 || vo.MinHQ <= num) && (vo.MaxHQ == -1 || vo.MaxHQ >= num));
        }
コード例 #4
0
        public int getTaskActionTargetAmount(EpisodeTaskActionVO vo, int hqLevel)
        {
            StaticDataController staticDataController = Service.StaticDataController;
            EpisodeTaskScaleVO   optional             = staticDataController.GetOptional <EpisodeTaskScaleVO>(vo.ScaleId);

            switch (hqLevel)
            {
            case 1:
                return(optional.HQ1);

            case 2:
                return(optional.HQ2);

            case 3:
                return(optional.HQ3);

            case 4:
                return(optional.HQ4);

            case 5:
                return(optional.HQ5);

            case 6:
                return(optional.HQ6);

            case 7:
                return(optional.HQ7);

            case 8:
                return(optional.HQ8);

            case 9:
                return(optional.HQ9);

            case 10:
                return(optional.HQ10);

            default:
                Service.Logger.WarnFormat("EpisodeController: Unhandled HQ level of {0}", new object[]
                {
                    hqLevel
                });
                return(0);
            }
        }
コード例 #5
0
        public EpisodeTaskActionVO getValidActionForTask(EpisodeTaskVO taskVo)
        {
            EpisodeTaskActionVO result = null;

            string[]             actions = taskVo.Actions;
            StaticDataController staticDataController = Service.StaticDataController;

            for (int i = 0; i < actions.Length; i++)
            {
                EpisodeTaskActionVO optional = staticDataController.GetOptional <EpisodeTaskActionVO>(actions[i]);
                if (this.doesPlayerQualifyForTaskAction(optional))
                {
                    result = optional;
                    break;
                }
            }
            return(result);
        }