Exemplo n.º 1
0
        public void RefreshAllInfo(long cur_chapter_id_)
        {
            HashSet <long> scene_group_ids = new HashSet <long>();

            HashSet <long> one_chapter_scene_group_ids = new HashSet <long>();

            for (int i = 1; i <= cur_chapter_id_; ++i)
            {
                one_chapter_scene_group_ids.Clear();
                long[] scene_ids = ConfChapter.Get(i).scenceIds;

                for (int j = 0; j < scene_ids.Length; ++j)
                {
                    long scene_id       = scene_ids[j];
                    long scene_group_id = ConvertSceneIdToSceneGroupId(scene_id);
                    one_chapter_scene_group_ids.Add(scene_group_id);
                }

                scene_group_ids.UnionWith(one_chapter_scene_group_ids);
            }

            CSSceneDifficultyReq req = new CSSceneDifficultyReq();

            req.BigIds.AddRange(scene_group_ids);
            GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
        }
Exemplo n.º 2
0
        public float GetMainTaskProgress()
        {
            long        chapter_id = AllCompleteTask.m_last_complete_main_task_id / 10000;
            List <long> tasks      = new List <long>(ConfChapter.Get(chapter_id).taskIds);

            int rewarded_count = tasks.IndexOf(AllCompleteTask.m_last_complete_main_task_id) + 1;

            return((float)rewarded_count / (float)tasks.Count);
        }
        public void SetChapterID(long chapterID, bool status)
        {
            this.m_chapterID = chapterID;
            ConfChapter chapterData = ConfChapter.Get(chapterID);

            if (chapterData != null)
            {
                this.m_chapterCover.TextureName = chapterData.cover;
                this.m_chapterCover.SetGray(!status);
            }
        }
Exemplo n.º 4
0
        public void SetTaskList(IList <ChapterTaskInfo> taskInfos, long currentChapterId)
        {
            //只显示完成的及正在做的
            List <ChapterTaskInfo> taskInfoList = new List <ChapterTaskInfo>();

            for (int i = 0; i < taskInfos.Count; ++i)
            {
                ChapterTaskInfo taskInfo = taskInfos[i];
                if (taskInfo.Status == 1 || taskInfo.Status == 2)
                {
                    taskInfoList.Add(taskInfo);
                }
            }

            //排序
            taskInfoList = taskInfoList.OrderByDescending(chapterTaskInfo => - chapterTaskInfo.Status).ToList();

            this.m_taskContainer.EnsureSize <ChapterTaskIntroComponent>(taskInfoList.Count);
            for (int i = 0; i < taskInfoList.Count; ++i)
            {
                ChapterTaskIntroComponent introComponent = this.m_taskContainer.GetChild <ChapterTaskIntroComponent>(i);
                introComponent.SetTaskIntro(taskInfoList[i].TaskId, taskInfoList[i].Status == 2);
                introComponent.Visible = true;
            }

            //m_lastChapterId = currentChapterId;
            ConfChapter chapter  = ConfChapter.Get(currentChapterId);
            List <long> deadBody = new List <long>();
            List <long> suspect  = new List <long>();
            List <long> weapon   = new List <long>();

            for (int i = 0; i < chapter.actorIds.Length; i++)
            {
                ConfNpc confNpc = ConfNpc.Get(chapter.actorIds[i]);
                if (confNpc == null)
                {
                    UnityEngine.Debug.LogError("chapter npc not exist : " + chapter.actorIds[i]);
                    continue;
                }
                bool isTaskComplete = taskInfoList.Find(s => s.TaskId == confNpc.unlockTaskId && s.Status == 2) != null || confNpc.unlockTaskId == 0;
                if (confNpc.identityType == 4 && isTaskComplete) //凶手
                {
                    suspect.Add(chapter.actorIds[i]);
                }
                else if (confNpc.identityType == 2 && isTaskComplete) //死者
                {
                    deadBody.Add(chapter.actorIds[i]);
                }
                else if (confNpc.identityType == 3 && isTaskComplete) //凶器
                {
                    weapon.Add(chapter.actorIds[i]);
                }
            }
            if (this.m_taskDead.Visible)
            {
                this.m_taskDead.SetNpcData(deadBody, 0);
            }
            if (this.m_taskSuspect.Visible)
            {
                this.m_taskSuspect.SetNpcData(suspect, 1);
            }
            if (this.m_taskWeapon.Visible)
            {
                this.m_taskWeapon.SetNpcData(weapon, 2);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 同步玩家解锁的章节列表
        /// </summary>
        /// <param name="msg"></param>
        private void OnSyncPlayerChapterList(object msg)
        {
            SCChapterListResponse messageChapterList = msg as SCChapterListResponse;
            bool allChapterFinished = true;

            for (int i = 0; i < messageChapterList.Chapters.Count; ++i)
            {
                PlayerChapterInfo playerChapterInfo = messageChapterList.Chapters[i];
                long chapterConfID = playerChapterInfo.ChapterId;
                long chapterUUID   = playerChapterInfo.PlayerChapterId;

                //if (chapterConfID > this.m_openChapterCount)
                //    continue;

                ChapterInfo chapterInfo = new ChapterInfo(chapterConfID);
                chapterInfo.ChapterStatus     = (ChapterStatus)playerChapterInfo.Status;
                chapterInfo.PlayerChapterUUID = chapterUUID;

                if (chapterInfo.ChapterStatus == ChapterStatus.UNLOCK)
                {
                    this.m_currentChapterInfo = chapterInfo;
                    FindObjSceneDataManager.Instance.RefreshAllInfo(this.m_currentChapterInfo.ChapterID);

                    allChapterFinished = false;

                    //同步已解锁的章节
                    SyncCurrentChapterDetail();
                }
                //下一章还没解锁


                this.m_playerChapterSet.AddChapterInfo(chapterInfo);
            }


            //初始化玩家未解锁的章节
            for (int i = 1; i <= this.m_openChapterCount; ++i)
            {
                ConfChapter confchapter = ConfChapter.Get(i);
                if (!this.m_playerChapterSet.IsExistChapterInfo(confchapter.id))
                {
                    ChapterInfo chapterInfo = new ChapterInfo(confchapter.id);
                    this.m_playerChapterSet.AddChapterInfo(chapterInfo);
                    allChapterFinished = false;
                }
            }

            //最后所有章节全部解锁
            if (allChapterFinished)
            {
                this.m_currentChapterInfo = this.m_playerChapterSet.GetChapterInfoByID(this.m_openChapterCount);
                FindObjSceneDataManager.Instance.RefreshAllInfo(this.m_currentChapterInfo.ChapterID);
                SyncCurrentChapterDetail();
            }

            if (this.m_currentChapterInfo == null)
            {
                this.m_currentChapterInfo = m_playerChapterSet.GetLastestChapterInfo();
                FindObjSceneDataManager.Instance.RefreshAllInfo(this.m_currentChapterInfo.ChapterID);
                SyncCurrentChapterDetail();
            }
        }