Example #1
0
        private string GetTaskCrateIcon()
        {
            StaticDataController staticDataController = Service.StaticDataController;
            EpisodeProgressInfo  episodeProgressInfo  = Service.CurrentPlayer.EpisodeProgressInfo;

            if (episodeProgressInfo == null)
            {
                Service.Logger.WarnFormat("GetTaskCrateIcon: No episode progress found", new object[0]);
                return("episode_hudicon_crate_ready_bronzium");
            }
            EpisodeTaskProgressInfo currentTask = episodeProgressInfo.currentTask;

            if (currentTask == null)
            {
                Service.Logger.WarnFormat("GetTaskCrateIcon: No current task found", new object[0]);
                return("episode_hudicon_crate_ready_bronzium");
            }
            EpisodeTaskVO optional = staticDataController.GetOptional <EpisodeTaskVO>(currentTask.uid);

            if (optional == null)
            {
                Service.Logger.WarnFormat("GetTaskCrateIcon: Missing task data for {0}", new object[]
                {
                    currentTask.uid
                });
                return("episode_hudicon_crate_ready_bronzium");
            }
            if (string.IsNullOrEmpty(optional.CrateIconAsset))
            {
                return("episode_hudicon_crate_ready_bronzium");
            }
            return(optional.CrateIconAsset);
        }
Example #2
0
        public bool PlayMostRecentStoryAction()
        {
            StaticDataController staticDataController = Service.StaticDataController;
            EpisodeProgressInfo  episodeProgressInfo  = Service.CurrentPlayer.EpisodeProgressInfo;
            EpisodeDataVO        episodeDataVO        = staticDataController.Get <EpisodeDataVO>(episodeProgressInfo.uid);
            string text = string.Empty;

            if (episodeProgressInfo.grindInfo.Started > 0)
            {
                text = staticDataController.Get <EpisodeTaskVO>(episodeDataVO.GrindTask).StoryID;
            }
            if (string.IsNullOrEmpty(text))
            {
                int num = Math.Min(episodeProgressInfo.currentTaskIndex, episodeDataVO.Tasks.Length - 1);
                for (int i = num; i >= 0; i--)
                {
                    EpisodeTaskVO optional = staticDataController.GetOptional <EpisodeTaskVO>(episodeDataVO.Tasks[i]);
                    if (optional != null && !string.IsNullOrEmpty(optional.StoryID))
                    {
                        text = optional.StoryID;
                        break;
                    }
                }
            }
            if (string.IsNullOrEmpty(text))
            {
                Service.Logger.Error("EpisodeInfoScreen: Could not determine most recent story ID");
            }
            return(this.PlayTaskStoryAction(text));
        }
Example #3
0
        public static FinishNowScreen ShowModalEpisodeTask(EpisodeTaskVO vo, OnScreenModalResult onModalResult, object modalResultCookie, int crystalCost, string title, string message, bool alwaysOnTop)
        {
            FinishNowScreen finishNowScreen = new FinishNowScreen();

            finishNowScreen.OnModalResult     = onModalResult;
            finishNowScreen.ModalResultCookie = modalResultCookie;
            finishNowScreen.crystals          = crystalCost;
            finishNowScreen.titleOverride     = title;
            finishNowScreen.messageOverride   = message;
            finishNowScreen.IsAlwaysOnTop     = alwaysOnTop;
            Service.ScreenController.AddScreen(finishNowScreen);
            return(finishNowScreen);
        }
Example #4
0
        protected override void FillProcessorMap()
        {
            if (this.processorMap.Count > 0)
            {
                Service.Logger.Error("Attempting to fill an already-full processorMap!");
            }
            EpisodeTaskProgressInfo currentEpisodeTaskProgress = this.GetCurrentEpisodeTaskProgress();

            if (currentEpisodeTaskProgress != null)
            {
                EpisodeTaskVO     vo        = Service.StaticDataController.Get <EpisodeTaskVO>(currentEpisodeTaskProgress.uid);
                BaseGoalProcessor processor = GoalFactory.GetProcessor(vo, this);
                this.processorMap.Add(processor, currentEpisodeTaskProgress);
            }
        }
Example #5
0
        public bool PlayStoryActionForTaskUid(string uid)
        {
            StaticDataController staticDataController = Service.StaticDataController;
            EpisodeTaskVO        optional             = staticDataController.GetOptional <EpisodeTaskVO>(uid);

            if (optional == null)
            {
                Service.Logger.ErrorFormat("EpisodeController: Cannot play story action! Missing EpisodeTaskVO data for uid:{0}", new object[]
                {
                    uid
                });
                return(false);
            }
            return(Service.EpisodeController.PlayTaskStoryAction(optional.StoryID));
        }
Example #6
0
        public List <PlanetLootEntryVO> GetFeaturedLootEntriesForEpisodeTask(EpisodeTaskVO vo, int maxEntries)
        {
            StaticDataController     staticDataController = Service.StaticDataController;
            CurrentPlayer            currentPlayer        = Service.CurrentPlayer;
            List <PlanetLootEntryVO> list = new List <PlanetLootEntryVO>();

            string[] array;
            if (currentPlayer.Faction == FactionType.Empire)
            {
                array = vo.EmpireRewardItemIds;
            }
            else
            {
                array = vo.RebelRewardItemIds;
            }
            if (array == null)
            {
                return(list);
            }
            int i   = 0;
            int num = array.Length;

            while (i < num)
            {
                PlanetLootEntryVO optional = staticDataController.GetOptional <PlanetLootEntryVO>(array[i]);
                if (optional == null)
                {
                    Service.Logger.ErrorFormat("Couldn't find PlanetLootEntryVO: {0} specified in EpisodeTaskVO: {1}", new object[]
                    {
                        array[i],
                        vo.Uid
                    });
                }
                else if (this.IsPlanetLootEntryValidToShow(currentPlayer, optional))
                {
                    list.Add(optional);
                    if (list.Count >= maxEntries)
                    {
                        break;
                    }
                }
                i++;
            }
            return(list);
        }
Example #7
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);
        }
Example #8
0
        public int GetCurrentTaskTimeGate()
        {
            EpisodeProgressInfo episodeProgressInfo = Service.CurrentPlayer.EpisodeProgressInfo;

            if (episodeProgressInfo == null)
            {
                return(0);
            }
            EpisodeTaskProgressInfo currentTask = episodeProgressInfo.currentTask;

            if (currentTask == null)
            {
                return(0);
            }
            EpisodeTaskVO optional = Service.StaticDataController.GetOptional <EpisodeTaskVO>(currentTask.uid);

            if (optional == null)
            {
                return(0);
            }
            return(optional.TimeGate);
        }