Exemplo n.º 1
0
        public static void InitLevelList(CUIFormScript form, int currentChapter, int levelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                ResChapterInfo dataByKey = GameDataMgr.chapterInfoDatabin.GetDataByKey(currentChapter);
                DebugHelper.Assert(dataByKey != null);
                bool flag = Singleton <CFunctionUnlockSys> .instance.ChapterIsUnlock(dataByKey.dwChapterId);

                PVE_ADV_COMPLETE_INFO     pve_adv_complete_info     = masterRoleInfo.pveLevelDetail[difficulty - 1];
                PVE_CHAPTER_COMPLETE_INFO pve_chapter_complete_info = pve_adv_complete_info.ChapterDetailList[currentChapter - 1];
                PVE_LEVEL_COMPLETE_INFO[] levelDetailList           = pve_chapter_complete_info.LevelDetailList;
                CUIListScript             component = form.transform.FindChild("LevelList").GetComponent <CUIListScript>();
                component.SetElementAmount(levelDetailList.Length);
                CUIListElementScript elemenet = null;
                Sprite     sprite             = CUIUtility.GetSpritePrefeb(GetLevelFramePath(difficulty), false, false).GetComponent <SpriteRenderer>().sprite;
                GameObject prefab             = CUIUtility.GetSpritePrefeb(GetLevelSelectFramePath(difficulty), false, false);
                for (int i = 0; i < levelDetailList.Length; i++)
                {
                    elemenet = component.GetElemenet(i);
                    ResLevelCfgInfo info3        = GameDataMgr.levelDatabin.GetDataByKey(levelDetailList[i].iLevelID);
                    object[]        inParameters = new object[] { levelDetailList[i].iLevelID };
                    DebugHelper.Assert(info3 != null, "Can't find LevelConfig = {0}", inParameters);
                    bool bActive = (levelDetailList[i].levelStatus == 0) || !flag;
                    bool flag3   = (levelDetailList[i].levelStatus == 1) && flag;
                    int  starNum = CAdventureSys.GetStarNum(levelDetailList[i].bStarBits);
                    elemenet.transform.FindChild("Unlock/star1").GetComponent <Image>().color   = (starNum < 1) ? CUIUtility.s_Color_GrayShader : Color.white;
                    elemenet.transform.FindChild("Unlock/star2").GetComponent <Image>().color   = (starNum < 2) ? CUIUtility.s_Color_GrayShader : Color.white;
                    elemenet.transform.FindChild("Unlock/star3").GetComponent <Image>().color   = (starNum < 3) ? CUIUtility.s_Color_GrayShader : Color.white;
                    elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().text = Utility.UTF8Convert(info3.szName);
                    if ((levelNo == (i + 1)) && !bActive)
                    {
                        elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().color = s_Adv_Level_Colors[0];
                    }
                    else if (!bActive)
                    {
                        elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().color = s_Adv_Level_Colors[1];
                    }
                    else
                    {
                        elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().color = s_Adv_Level_Colors[2];
                    }
                    elemenet.transform.FindChild("SelectedFrame").GetComponent <Image>().color        = s_Adv_Difficult_Color[difficulty - 1];
                    elemenet.transform.FindChild("SelectedFrame/Image1").GetComponent <Image>().color = s_Adv_Difficult_Color[((s_Adv_Difficult_Color.Length / 2) + difficulty) - 1];
                    elemenet.transform.FindChild("SelectedFrame/Image2").GetComponent <Image>().color = s_Adv_Difficult_Color[((s_Adv_Difficult_Color.Length / 2) + difficulty) - 1];
                    elemenet.transform.FindChild("SelectedFrame/SelectedFrame").GetComponent <Image>().SetSprite(prefab);
                    elemenet.transform.FindChild("New").gameObject.CustomSetActive(flag3);
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventID         = enUIEventID.Adv_SelectLevel;
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1;
                    elemenet.transform.FindChild("Unlock").gameObject.CustomSetActive(!bActive);
                    elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(bActive);
                    elemenet.m_selectedSprite = sprite;
                    elemenet.GetComponent <Image>().SetSprite(((levelNo - 1) != i) ? elemenet.m_defaultSprite : sprite, elemenet.m_selectedLayout);
                }
                component.SelectElement(levelNo - 1, true);
            }
        }
Exemplo n.º 2
0
        public static void InitExloreList(CUIFormScript form)
        {
            if (form != null)
            {
                int length = s_eventIDs.Length;
                CUIListElementScript elemenet  = null;
                CUIStepListScript    component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>();
                component.SetElementAmount(length);
                for (int i = 0; i < length; i++)
                {
                    elemenet = component.GetElemenet(i);
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventID = s_eventIDs[i];
                    elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText(s_exploreTypes[i]);

                    elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>().color = s_exploreColors[i];
                    Image      image  = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>();
                    GameObject prefab = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false);
                    if (prefab != null)
                    {
                        image.SetSprite(prefab);
                    }
                    GameObject gameObject           = elemenet.transform.FindChild("Lock").gameObject;
                    GameObject obj4                 = elemenet.transform.FindChild("Unlock").gameObject;
                    RES_SPECIALFUNCUNLOCK_TYPE type = s_unlockTypes[i];
                    if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(type))
                    {
                        image.color = CUIUtility.s_Color_White;
                        gameObject.CustomSetActive(false);
                    }
                    else
                    {
                        image.color = CUIUtility.s_Color_GrayShader;
                        gameObject.CustomSetActive(true);
                        ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);
                        if (dataByKey != null)
                        {
                            gameObject.GetComponentInChildren <Text>().text = Utility.UTF8Convert(dataByKey.szLockedTip);
                        }
                    }
                    if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_NONE)
                    {
                        int            lastChapter = CAdventureSys.GetLastChapter(1);
                        ResChapterInfo info        = GameDataMgr.chapterInfoDatabin.GetDataByKey(lastChapter);
                        if (info != null)
                        {
                            obj4.CustomSetActive(true);
                            obj4.GetComponentInChildren <Text>().text = string.Format(Singleton <CTextManager> .instance.GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(info.szChapterName));
                        }
                    }
                    else
                    {
                        obj4.CustomSetActive(false);
                    }
                }
                component.SelectElementImmediately(1);
            }
        }
Exemplo n.º 3
0
        public static void InitChapterList(CUIFormScript formScript, int currentChapter, int levelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                CUIListScript             component             = formScript.transform.FindChild("ChapterList").GetComponent <CUIListScript>();
                PVE_ADV_COMPLETE_INFO     pve_adv_complete_info = masterRoleInfo.pveLevelDetail[difficulty - 1];
                PVE_CHAPTER_COMPLETE_INFO chapterInfo           = null;
                CUIListElementScript      elemenet = null;
                int    stars       = 0;
                string prefabPath  = string.Empty;
                string chapterName = string.Empty;
                component.SetElementAmount(CAdventureSys.CHAPTER_NUM);
                for (int i = 0; i < CAdventureSys.CHAPTER_NUM; i++)
                {
                    ResChapterInfo dataByIndex = GameDataMgr.chapterInfoDatabin.GetDataByIndex(i);
                    DebugHelper.Assert(dataByIndex != null);
                    bool bActive = Singleton <CFunctionUnlockSys> .instance.ChapterIsUnlock(dataByIndex.dwChapterId);

                    bool flag2 = i == (Singleton <CAdventureSys> .instance.bNewChapterId - 1);
                    chapterInfo = pve_adv_complete_info.ChapterDetailList[i];
                    elemenet    = component.GetElemenet(i);
                    stars       = CAdventureSys.GetChapterTotalStar(chapterInfo);
                    SetRewardItem(elemenet.gameObject, chapterInfo, stars, i);
                    chapterName = GetChapterName(i + 1);
                    elemenet.transform.FindChild("ChapterNameText").GetComponent <Text>().text = chapterName;
                    if ((currentChapter == (i + 1)) && bActive)
                    {
                        elemenet.transform.FindChild("ChapterNameText").GetComponent <Text>().color = s_Adv_Chaptper_Colors[0];
                    }
                    else if (bActive)
                    {
                        elemenet.transform.FindChild("ChapterNameText").GetComponent <Text>().color = s_Adv_Chaptper_Colors[1];
                    }
                    else
                    {
                        elemenet.transform.FindChild("ChapterNameText").GetComponent <Text>().color = s_Adv_Chaptper_Colors[2];
                    }
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventID         = enUIEventID.Adv_SelectChapter;
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1;
                    elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(!bActive);
                    elemenet.transform.FindChild("Unlock").gameObject.CustomSetActive(bActive);
                    prefabPath = GetChapterBgPath(i + 1);
                    elemenet.transform.FindChild("BackgroundImg").GetComponent <Image>().SetSprite(prefabPath, component.m_belongedFormScript, true, false, false);
                    elemenet.transform.FindChild("Lock/SelectedImg").GetComponent <Image>().SetSprite(prefabPath, component.m_belongedFormScript, true, false, false);
                    elemenet.transform.FindChild("Lock/LockText").GetComponent <Text>().text = Utility.UTF8Convert(dataByIndex.szLockedTip);
                    elemenet.transform.FindChild("New").gameObject.CustomSetActive(flag2);
                }
                component.SelectElement(currentChapter - 1, true);
                component.MoveElementInScrollArea(currentChapter - 1, true);
            }
        }
Exemplo n.º 4
0
        private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button          component          = Mopup.GetComponent <Button>();
            CUIEventScript  component2         = component.gameObject.GetComponent <CUIEventScript>();
            stUIEventParams onClickEventParams = default(stUIEventParams);
            bool            isEnable;

            if (difficulty == 1)
            {
                Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text");
                componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[]
                {
                    "10"
                });

                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip());
                onClickEventParams.tag          = 10;
                component2.m_onClickEventParams = onClickEventParams;
            }
            else
            {
                if (difficulty != 2)
                {
                    DebugHelper.Assert(false, "Invalid difficulty -- {0}", new object[]
                    {
                        difficulty
                    });
                    return;
                }
                Text componetInChild2 = Utility.GetComponetInChild <Text>(Mopup, "Text");
                if (LeftPlayNum > 0)
                {
                    componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[]
                    {
                        LeftPlayNum.ToString()
                    });
                }
                else
                {
                    componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep");
                }
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip() && LeftPlayNum > 0);
                onClickEventParams.tag          = LeftPlayNum;
                component2.m_onClickEventParams = onClickEventParams;
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }
Exemplo n.º 5
0
        private void GotoNextLevel(CUIEvent uiEvent)
        {
            this.CloseItemForm();
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.IsGameTypeAdventure())
            {
                int nextLevelId = CAdventureSys.GetNextLevelId(curLvelContext.m_chapterNo, (int)curLvelContext.m_levelNo, curLvelContext.m_levelDifficulty);
                if (nextLevelId != 0)
                {
                    CUIEvent cUIEvent = new CUIEvent();
                    cUIEvent.m_eventID         = enUIEventID.Adv_OpenLevelForm;
                    cUIEvent.m_eventParams.tag = nextLevelId;
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(cUIEvent);
                }
            }
            else if (curLvelContext != null && curLvelContext.IsGameTypeActivity())
            {
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Explore_OpenForm);
            }
        }
Exemplo n.º 6
0
        private static void SetMopupEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button component = Mopup.GetComponent <Button>();
            bool   isEnable  = false;

            if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NORMAL)
            {
                isEnable = CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL;
            }
            else if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NIGHTMARE)
            {
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && (LeftPlayNum > 0);
            }
            else
            {
                object[] inParameters = new object[] { difficulty };
                DebugHelper.Assert(false, "Invalid difficulty -- {0}", inParameters);
                return;
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }
Exemplo n.º 7
0
        private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button          component = Mopup.GetComponent <Button>();
            bool            isEnable  = false;
            CUIEventScript  script    = component.gameObject.GetComponent <CUIEventScript>();
            stUIEventParams @params   = new stUIEventParams();

            if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NORMAL)
            {
                string[] args = new string[] { "10" };
                Utility.GetComponetInChild <Text>(Mopup, "Text").text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", args);

                isEnable    = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && isVip();
                @params.tag = 10;
                script.m_onClickEventParams = @params;
            }
            else if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NIGHTMARE)
            {
                Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text");
                if (LeftPlayNum > 0)
                {
                    string[] textArray2 = new string[] { LeftPlayNum.ToString() };
                    componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", textArray2);
                }
                else
                {
                    componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep");
                }
                isEnable    = ((CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && isVip()) && (LeftPlayNum > 0);
                @params.tag = LeftPlayNum;
                script.m_onClickEventParams = @params;
            }
            else
            {
                object[] inParameters = new object[] { difficulty };
                DebugHelper.Assert(false, "Invalid difficulty -- {0}", inParameters);
                return;
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }
Exemplo n.º 8
0
        private void GotoNextLevel(CUIEvent uiEvent)
        {
            this.CloseItemForm();
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if ((curLvelContext != null) && (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_ADVENTURE))
            {
                int num = CAdventureSys.GetNextLevelId(curLvelContext.iChapterNo, curLvelContext.bLevelNo, curLvelContext.difficulty);
                if (num != 0)
                {
                    CUIEvent event2 = new CUIEvent {
                        m_eventID = enUIEventID.Adv_OpenLevelForm
                    };
                    event2.m_eventParams.tag = num;
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(event2);
                }
            }
            else if ((curLvelContext != null) && (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_ACTIVITY))
            {
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Explore_OpenForm);
            }
        }
Exemplo n.º 9
0
        public static void InitDifficultList(CUIFormScript form, int currentChapter, int levelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            CUIListScript component              = form.transform.FindChild("DifficultList").GetComponent <CUIListScript>();
            string        text                   = string.Empty;
            string        prefabPath             = string.Empty;
            int           lEVEL_DIFFICULT_OPENED = CAdventureSys.LEVEL_DIFFICULT_OPENED;

            component.SetElementAmount(lEVEL_DIFFICULT_OPENED);
            for (int i = 0; i < lEVEL_DIFFICULT_OPENED; i++)
            {
                bool flag = CAdventureSys.IsDifOpen(currentChapter, i + 1);
                prefabPath = CAdventureView.GetDifficultIcon(i + 1);
                CUIListElementScript elemenet = component.GetElemenet(i);
                Image component2 = elemenet.transform.FindChild("DifficultImg").GetComponent <Image>();
                component2.SetSprite(prefabPath, form, true, false, false, false);
                component2.color = ((!flag) ? CAdventureView.s_Adv_Difficulty_Gray_Color : Color.white);
                elemenet.transform.FindChild("SelectedFrame").GetComponent <Image>().SetSprite(prefabPath, form, true, false, false, false);
                text = Singleton <CTextManager> .get_instance().GetText(string.Format("Adventure_Level_{0}", i + 1));

                elemenet.transform.FindChild("DifficultImg/DifficultText").GetComponent <Text>().text  = text;
                elemenet.transform.FindChild("SelectedFrame/DifficultText").GetComponent <Text>().text = text;
                elemenet.GetComponent <CUIEventScript>().m_onClickEventID         = enUIEventID.Adv_SelectDifficult;
                elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1;
                elemenet.transform.FindChild("SelectedFrame/Frame_circle").GetComponent <Image>().color = CAdventureView.s_Adv_Difficult_Circle_Color[i];
                PVE_ADV_COMPLETE_INFO     pVE_ADV_COMPLETE_INFO     = masterRoleInfo.pveLevelDetail[i];
                PVE_CHAPTER_COMPLETE_INFO pVE_CHAPTER_COMPLETE_INFO = pVE_ADV_COMPLETE_INFO.ChapterDetailList[currentChapter - 1];
                int chapterTotalStar = CAdventureSys.GetChapterTotalStar(pVE_CHAPTER_COMPLETE_INFO);
                elemenet.transform.FindChild("SelectedFrame/RewardBox").gameObject.CustomSetActive(chapterTotalStar == CAdventureSys.LEVEL_PER_CHAPTER * CAdventureSys.STAR_PER_LEVEL && pVE_CHAPTER_COMPLETE_INFO.bIsGetBonus == 0);
                elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(!flag);
            }
            component.SelectElement(difficulty - 1, true);
        }
Exemplo n.º 10
0
        private static void SetMopupEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button component = Mopup.GetComponent <Button>();
            bool   isEnable;

            if (difficulty == 1)
            {
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL);
            }
            else
            {
                if (difficulty != 2)
                {
                    DebugHelper.Assert(false, "Invalid difficulty -- {0}", new object[]
                    {
                        difficulty
                    });
                    return;
                }
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && LeftPlayNum > 0);
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }
    public static bool CheckTriggerCondition(uint id, NewbieGuideTriggerConditionItem condition)
    {
        switch (condition.wType)
        {
        case 1:
            return(NewbieGuideCheckTriggerConditionUtil.CheckCompleteNewbieDungeonCondition(condition));

        case 2:
            return(NewbieGuideCheckTriggerConditionUtil.CheckCompleteNormalDungeonCondition(condition));

        case 3:
            return(NewbieGuideCheckTriggerConditionUtil.CheckOwnCompleteNewbieGuideCondition(condition));

        case 4:
            return(NewbieGuideCheckTriggerConditionUtil.CheckUnCompleteNewbieGuideCondition(condition));

        case 5:
            return(false);

        case 6:
            return(false);

        case 7:
            NewbieGuideCheckTriggerConditionUtil.AvailableTask = null;
            return(Singleton <CTaskSys> .get_instance().model.AnyTaskOfState(1, 0, out NewbieGuideCheckTriggerConditionUtil.AvailableTask));

        case 8:
            return(false);

        case 9:
            return(false);

        case 10:
            return(false);

        case 11:
        {
            uint      num            = condition.Param[0];
            uint      num2           = condition.Param[1];
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                uint haveHeroCount = (uint)masterRoleInfo.GetHaveHeroCount(false);
                bool result        = false;
                switch (num2)
                {
                case 0u:
                    result = (haveHeroCount == num);
                    break;

                case 1u:
                    result = (haveHeroCount > num);
                    break;

                case 2u:
                    result = (haveHeroCount < num);
                    break;

                default:
                    DebugHelper.Assert(false);
                    break;
                }
                return(result);
            }
            return(false);
        }

        case 12:
        {
            bool flag = false;
            uint num3 = condition.Param[0];
            RES_SHOPBUY_COINTYPE coinType        = (condition.Param[1] != 0u) ? 4 : 2;
            CRoleInfo            masterRoleInfo2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo2 != null)
            {
                if (num3 > 0u)
                {
                    flag = masterRoleInfo2.CheckHeroBuyable(num3, coinType);
                }
                else
                {
                    ListView <ResHeroCfgInfo> .Enumerator enumerator = CHeroDataFactory.GetAllHeroList().GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        num3  = enumerator.get_Current().dwCfgID;
                        flag |= masterRoleInfo2.CheckHeroBuyable(num3, coinType);
                        if (flag)
                        {
                            break;
                        }
                    }
                }
            }
            if (flag)
            {
                NewbieGuideCheckTriggerConditionUtil.AvailableHeroId = num3;
            }
            return(flag);
        }

        case 13:
            return(Singleton <CShopSystem> .GetInstance().IsNormalShopItemsInited());

        case 14:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GoldCoin >= condition.Param[0] && Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(12) && Singleton <CShopSystem> .GetInstance().IsNormalShopItemsInited());

        case 15:
            return(CAdventureSys.IsChapterFullStar(Singleton <CAdventureSys> .GetInstance().currentChapter, Singleton <CAdventureSys> .GetInstance().currentDifficulty));

        case 16:
        {
            uint num4 = condition.Param[0];
            return(num4 > 0u && Singleton <CAdventureSys> .GetInstance().IsLevelFinished((int)num4) && CAdventureSys.IsLevelFullStar((int)num4));
        }

        case 17:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(10));

        case 18:
        {
            CRoleInfo masterRoleInfo3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            CUseableContainer useableContainer = masterRoleInfo3.GetUseableContainer(enCONTAINER_TYPE.ITEM);
            int useableStackCount = useableContainer.GetUseableStackCount(2, CAdventureSys.MOPUP_TICKET_ID);
            return((long)useableStackCount >= (long)((ulong)condition.Param[0]));
        }

        case 19:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(3));

        case 20:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(5));

        case 21:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(4));

        case 22:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(6));

        case 23:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(13));

        case 24:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(8));

        case 25:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(11) && Singleton <CShopSystem> .GetInstance().IsMysteryShopAvailable());

        case 26:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(15));

        case 27:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(16));

        case 28:
            return(false);

        case 30:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(26));

        case 31:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(27));

        case 32:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(21));

        case 33:
        {
            CRoleInfo masterRoleInfo4 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo4 != null && masterRoleInfo4.GoldCoin >= condition.Param[0]);
        }

        case 34:
            return(false);

        case 36:
            return(false);

        case 37:
        {
            bool      flag2           = false;
            uint      num5            = condition.Param[0];
            CRoleInfo masterRoleInfo5 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo5 != null)
            {
                CUseableContainer useableContainer2 = masterRoleInfo5.GetUseableContainer(enCONTAINER_TYPE.ITEM);
                if (useableContainer2 != null)
                {
                    CUseable useableByBaseID = useableContainer2.GetUseableByBaseID(2, num5);
                    if (useableByBaseID != null)
                    {
                        flag2 = true;
                    }
                }
            }
            NewbieGuideCheckTriggerConditionUtil.AvailableItemId = ((!flag2) ? 0u : num5);
            return(flag2);
        }

        case 38:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(9));

        case 39:
        {
            uint      num6            = condition.Param[0];
            CRoleInfo masterRoleInfo6 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo6 != null && (long)masterRoleInfo6.GetHaveHeroCount(false) >= (long)((ulong)num6));
        }

        case 40:
        {
            CRoleInfo masterRoleInfo7 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo7 != null)
            {
                masterRoleInfo7.m_symbolInfo.CheckAnyWearSymbol(out NewbieGuideCheckTriggerConditionUtil.AvailableSymbolPos, out NewbieGuideCheckTriggerConditionUtil.AvailableSymbolId, 2);
                return((long)NewbieGuideCheckTriggerConditionUtil.AvailableSymbolPos == (long)((ulong)condition.Param[0]));
            }
            return(false);
        }

        case 41:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(9));

        case 42:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(44));

        case 43:
        {
            uint      num7            = condition.Param[0];
            CRoleInfo masterRoleInfo8 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo8 != null && masterRoleInfo8.SymbolCoin >= num7);
        }

        case 44:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(22));

        case 45:
            return(CAddSkillSys.IsSelSkillAvailable());

        case 46:
            return(NewbieGuideCheckTriggerConditionUtil.CheckOwnCompleteNewWeakGuideCondition(condition));

        case 47:
            return(NewbieGuideCheckTriggerConditionUtil.CheckOwnCompleteNewWeakGuideCondition(condition));

        case 48:
        {
            CRoleInfo masterRoleInfo9 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo9.m_symbolInfo.m_pageCount > 1);
        }

        case 49:
        {
            LevelRewardData levelRewardData = Singleton <CTaskSys> .get_instance().model.GetLevelRewardData((int)condition.Param[0]);

            return(levelRewardData != null && !levelRewardData.m_bHasGetReward);
        }

        case 50:
        {
            CRoleInfo masterRoleInfo10 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo10.m_freeDrawInfo[4].dwLeftFreeDrawCnt > 0);
        }

        case 51:
            return(Singleton <CFunctionUnlockSys> .get_instance().FucIsUnlock(condition.Param[0]));

        case 52:
        {
            CRoleInfo masterRoleInfo11 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo11 != null && masterRoleInfo11.IsOldPlayer() && !masterRoleInfo11.IsOldPlayerGuided());
        }

        case 53:
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            return(curLvelContext != null && curLvelContext.IsMultilModeWithWarmBattle());
        }

        case 54:
        {
            bool      result2          = false;
            CRoleInfo masterRoleInfo12 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo12 != null)
            {
                result2 = masterRoleInfo12.IsGuidedStateSet(98);
            }
            return(result2);
        }

        case 55:
            return(CBattleGuideManager.EnableHeroVictoryTips());

        case 56:
            return(Singleton <GameReplayModule> .GetInstance().HasRecord);

        case 57:
        {
            SLevelContext curLvelContext2 = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            return(curLvelContext2 != null && (long)curLvelContext2.m_mapID == (long)((ulong)condition.Param[0]));
        }
        }
        return(false);
    }
Exemplo n.º 12
0
 protected override string Execute(string[] InArguments, ref CSDT_CHEATCMD_DETAIL CheatCmdRef)
 {
     CAdventureSys.ResetElitePlayNum();
     CheatCmdRef.set_stClrEliteLevel(new CSDT_CHEAT_CLR_ELITE_LEVEL());
     return(CheatCommandBase.Done);
 }
Exemplo n.º 13
0
        public static void InitLevelForm(CUIFormScript formScript, int chapterNo, int LevelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                PVE_ADV_COMPLETE_INFO   pve_adv_complete_info   = masterRoleInfo.pveLevelDetail[difficulty - 1];
                PVE_LEVEL_COMPLETE_INFO pve_level_complete_info = pve_adv_complete_info.ChapterDetailList[chapterNo - 1].LevelDetailList[LevelNo - 1];
                GameObject      gameObject = formScript.gameObject;
                ResLevelCfgInfo dataByKey  = GameDataMgr.levelDatabin.GetDataByKey(pve_level_complete_info.iLevelID);
                if (dataByKey != null)
                {
                    string str = StringHelper.UTF8BytesToString(ref dataByKey.szName);
                    formScript.transform.Find("PanelLeft/DifficultText").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText(string.Format("Adventure_Level_{0}", difficulty));

                    formScript.transform.Find("Panel_Main/ImgMapNameBg/MapNameText").GetComponent <Text>().text = str;
                    formScript.transform.Find("PanelLeft/MapNameText").GetComponent <Text>().text = str;
                    formScript.transform.Find("PanelLeft/MapDescText").GetComponent <Text>().text = StringHelper.UTF8BytesToString(ref dataByKey.szLevelDesc);
                    string[] args = new string[] { dataByKey.RecommendLevel[difficulty - 1].ToString() };
                    formScript.transform.Find("PanelLeft/RecPlayerLvlText").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText("Level_Recommend_Tips_1", args);

                    formScript.transform.Find("PanelLeft/ChapterImg").GetComponent <Image>().SetSprite(GetLevelBgPath(chapterNo, LevelNo, difficulty), formScript, true, false, false);
                    formScript.transform.Find("PanelLeft/DifficultImg").GetComponent <Image>().SetSprite(GetDifficultIcon(difficulty), formScript, true, false, false);
                    for (int i = 1; i <= CAdventureSys.STAR_PER_LEVEL; i++)
                    {
                        GameObject descCon = gameObject.transform.Find("PanelRight/WinCondition" + i).gameObject;
                        SetStarConditionDesc(formScript, descCon, (uint)dataByKey.astStarDetail[i - 1].iParam, CAdventureSys.IsStarGained(pve_level_complete_info.bStarBits, i));
                    }
                    GameObject itemCell = gameObject.transform.Find("PanelRight/itemCell").gameObject;
                    SetReward(formScript, itemCell, dataByKey, difficulty);
                    GameObject  obj5      = gameObject.transform.Find("PanelRight/HeroList").gameObject;
                    int         teamPower = 0;
                    List <uint> heroListForBattleListID = Singleton <CHeroSelectSystem> .GetInstance().GetHeroListForBattleListID(dataByKey.dwBattleListID);

                    SetTeamHeroList(obj5, heroListForBattleListID, out teamPower);
                    SetStartBtnEnable(gameObject.transform.Find("BtnStart").gameObject, heroListForBattleListID);
                    formScript.GetComponent <Image>().color = s_Adv_Difficult_Bg_Color[difficulty - 1];
                }
                else
                {
                    object[] inParameters = new object[] { pve_level_complete_info.iLevelID };
                    DebugHelper.Assert(false, "Can't find level info -- id: {0}", inParameters);
                }
            }
        }
Exemplo n.º 14
0
        public static void InitExloreList(CUIFormScript form)
        {
            if (form != null)
            {
                int length = s_eventIDs.Length;
                CUIListElementScript elemenet  = null;
                CUIStepListScript    component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>();
                component.SetElementAmount(length);
                for (int i = 0; i < length; i++)
                {
                    elemenet = component.GetElemenet(i);
                    elemenet.GetComponent <CUIEventScript>().m_onClickEventID = s_eventIDs[i];
                    elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>().text = Singleton <CTextManager> .instance.GetText(s_exploreTypes[i]);

                    elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>().color = s_exploreColors[i];
                    Image      image2 = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>();
                    GameObject prefab = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false);
                    if (prefab != null)
                    {
                        image2.SetSprite(prefab);
                    }
                    GameObject gameObject           = elemenet.transform.FindChild("Lock").gameObject;
                    GameObject obj4                 = elemenet.transform.FindChild("Unlock").gameObject;
                    RES_SPECIALFUNCUNLOCK_TYPE type = s_unlockTypes[i];
                    if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(type))
                    {
                        image2.color = CUIUtility.s_Color_White;
                        gameObject.CustomSetActive(false);
                    }
                    else
                    {
                        image2.color = CUIUtility.s_Color_GrayShader;
                        gameObject.CustomSetActive(true);
                        ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)type);
                        if (dataByKey != null)
                        {
                            gameObject.GetComponentInChildren <Text>().text = Utility.UTF8Convert(dataByKey.szLockedTip);
                        }
                    }
                    if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_NONE)
                    {
                        int            lastChapter = CAdventureSys.GetLastChapter(1);
                        ResChapterInfo info        = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)lastChapter);
                        if (info != null)
                        {
                            obj4.CustomSetActive(true);
                            obj4.GetComponentInChildren <Text>().text = string.Format(Singleton <CTextManager> .instance.GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(info.szChapterName));
                        }
                    }
                    else if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ARENA)
                    {
                        if ((Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList == null) || (Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank == 0))
                        {
                            obj4.CustomSetActive(false);
                        }
                        else
                        {
                            string str = string.Empty;
                            str = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreArenaRankText"), Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank);
                            obj4.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = str;
                            obj4.CustomSetActive(true);
                        }
                    }
                    else if (s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG)
                    {
                        BurnExpeditionModel model = Singleton <BurnExpeditionController> .GetInstance().model;

                        if (model._data == null)
                        {
                            obj4.CustomSetActive(false);
                        }
                        else
                        {
                            string str2 = string.Empty;
                            if (model.IsAllCompelte())
                            {
                                str2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnFinishText"), new object[0]);
                            }
                            else
                            {
                                str2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnText"), Math.Max(1, model.Get_LastUnlockLevelIndex(model.curDifficultyType) + 1));
                            }
                            obj4.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().text = str2;
                            obj4.CustomSetActive(true);
                        }
                    }
                }
                component.SelectElementImmediately(1);
                Text  text2  = form.gameObject.transform.FindChild("AwardGroup/Name1").gameObject.GetComponent <Text>();
                Text  text3  = form.gameObject.transform.FindChild("AwardGroup/Name2").gameObject.GetComponent <Text>();
                Image image  = form.gameObject.transform.FindChild("AwardGroup/Icon1").gameObject.GetComponent <Image>();
                Image image4 = form.gameObject.transform.FindChild("AwardGroup/Icon2").gameObject.GetComponent <Image>();
                text2.gameObject.CustomSetActive(false);
                text3.gameObject.CustomSetActive(false);
                image.gameObject.CustomSetActive(false);
                image4.gameObject.CustomSetActive(false);
                uint key = 0;
                try
                {
                    key = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHeroId"));
                }
                catch (Exception)
                {
                }
                if (key != 0)
                {
                    ResHeroCfgInfo info2 = GameDataMgr.heroDatabin.GetDataByKey(key);
                    if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(key, false) && (info2 != null))
                    {
                        text2.gameObject.CustomSetActive(true);
                        text2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHero"), info2.szName);
                        image.gameObject.CustomSetActive(true);
                        image.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(key, 0)), form, true, false, false);
                    }
                }
                key = 0;
                try
                {
                    key = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHeroId"));
                }
                catch (Exception)
                {
                }
                if (key != 0)
                {
                    ResHeroCfgInfo info3 = GameDataMgr.heroDatabin.GetDataByKey(key);
                    if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(key, false) && (info3 != null))
                    {
                        text3.gameObject.CustomSetActive(true);
                        text3.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHero"), info3.szName);
                        image4.gameObject.CustomSetActive(true);
                        image4.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(key, 0)), form, true, false, false);
                    }
                }
            }
        }
    public static bool CheckTriggerCondition(uint id, NewbieGuideTriggerConditionItem condition)
    {
        switch (condition.wType)
        {
        case 1:
            return(NewbieGuideCheckTriggerConditionUtil.CheckCompleteNewbieDungeonCondition(condition));

        case 2:
            return(NewbieGuideCheckTriggerConditionUtil.CheckCompleteNormalDungeonCondition(condition));

        case 3:
            return(NewbieGuideCheckTriggerConditionUtil.CheckOwnCompleteNewbieGuideCondition(condition));

        case 4:
            return(NewbieGuideCheckTriggerConditionUtil.CheckUnCompleteNewbieGuideCondition(condition));

        case 5:
            return(false);

        case 6:
            return(false);

        case 7:
            NewbieGuideCheckTriggerConditionUtil.AvailableTask = null;
            return(Singleton <CTaskSys> .instance.model.AnyTaskOfState(COM_TASK_STATE.COM_TASK_HAVEDONE, RES_TASK_TYPE.RES_TASKTYPE_MAIN, out NewbieGuideCheckTriggerConditionUtil.AvailableTask));

        case 8:
            return(false);

        case 9:
            return(false);

        case 10:
            return(false);

        case 11:
        {
            uint      num            = condition.Param[0];
            uint      num2           = condition.Param[1];
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                uint haveHeroCount = (uint)masterRoleInfo.GetHaveHeroCount(false);
                bool result        = false;
                switch (num2)
                {
                case 0u:
                    result = (haveHeroCount == num);
                    break;

                case 1u:
                    result = (haveHeroCount > num);
                    break;

                case 2u:
                    result = (haveHeroCount < num);
                    break;

                default:
                    DebugHelper.Assert(false);
                    break;
                }
                return(result);
            }
            return(false);
        }

        case 12:
        {
            bool flag = false;
            uint num3 = condition.Param[0];
            RES_SHOPBUY_COINTYPE coinType        = (condition.Param[1] == 0u) ? RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_COUPONS : RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_PVPCOIN;
            CRoleInfo            masterRoleInfo2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo2 != null)
            {
                if (num3 > 0u)
                {
                    flag = masterRoleInfo2.CheckHeroBuyable(num3, coinType);
                }
                else
                {
                    ListView <ResHeroCfgInfo> .Enumerator enumerator = CHeroDataFactory.GetAllHeroList().GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        num3  = enumerator.Current.dwCfgID;
                        flag |= masterRoleInfo2.CheckHeroBuyable(num3, coinType);
                        if (flag)
                        {
                            break;
                        }
                    }
                }
            }
            if (flag)
            {
                NewbieGuideCheckTriggerConditionUtil.AvailableHeroId = num3;
            }
            return(flag);
        }

        case 13:
            return(Singleton <CShopSystem> .GetInstance().IsNormalShopItemsInited());

        case 14:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GoldCoin >= condition.Param[0] && Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_SHOP) && Singleton <CShopSystem> .GetInstance().IsNormalShopItemsInited());

        case 15:
            return(CAdventureSys.IsChapterFullStar(Singleton <CAdventureSys> .GetInstance().currentChapter, Singleton <CAdventureSys> .GetInstance().currentDifficulty));

        case 16:
        {
            uint num4 = condition.Param[0];
            return(num4 > 0u && Singleton <CAdventureSys> .GetInstance().IsLevelFinished((int)num4) && CAdventureSys.IsLevelFullStar((int)num4));
        }

        case 17:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_PVPMODE));

        case 18:
        {
            CRoleInfo masterRoleInfo3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            CUseableContainer useableContainer = masterRoleInfo3.GetUseableContainer(enCONTAINER_TYPE.ITEM);
            int useableStackCount = useableContainer.GetUseableStackCount(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, CAdventureSys.MOPUP_TICKET_ID);
            return((long)useableStackCount >= (long)((ulong)condition.Param[0]));
        }

        case 19:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ZONGSHILIAN));

        case 20:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ZHUANGZIHUANMENG));

        case 21:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG));

        case 22:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ELITELEVEL));

        case 23:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_UNION));

        case 24:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_SYMBOL));

        case 25:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_BLACKSHOP) && Singleton <CShopSystem> .GetInstance().IsMysteryShopAvailable());

        case 26:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_PVPCOINSHOP));

        case 27:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_TASK));

        case 28:
            return(false);

        case 30:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(26));

        case 31:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(27));

        case 32:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(21));

        case 33:
        {
            CRoleInfo masterRoleInfo4 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo4 != null && masterRoleInfo4.GoldCoin >= condition.Param[0]);
        }

        case 34:
            return(false);

        case 36:
            return(false);

        case 37:
        {
            bool      flag2           = false;
            uint      num5            = condition.Param[0];
            CRoleInfo masterRoleInfo5 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo5 != null)
            {
                CUseableContainer useableContainer2 = masterRoleInfo5.GetUseableContainer(enCONTAINER_TYPE.ITEM);
                if (useableContainer2 != null)
                {
                    CUseable useableByBaseID = useableContainer2.GetUseableByBaseID(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, num5);
                    if (useableByBaseID != null)
                    {
                        flag2 = true;
                    }
                }
            }
            NewbieGuideCheckTriggerConditionUtil.AvailableItemId = (flag2 ? num5 : 0u);
            return(flag2);
        }

        case 38:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(9));

        case 39:
        {
            uint      num6            = condition.Param[0];
            CRoleInfo masterRoleInfo6 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo6 != null && (long)masterRoleInfo6.GetHaveHeroCount(false) >= (long)((ulong)num6));
        }

        case 40:
        {
            CRoleInfo masterRoleInfo7 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo7 != null)
            {
                masterRoleInfo7.m_symbolInfo.CheckAnyWearSymbol(out NewbieGuideCheckTriggerConditionUtil.AvailableSymbolPos, out NewbieGuideCheckTriggerConditionUtil.AvailableSymbolId, 2);
                return((long)NewbieGuideCheckTriggerConditionUtil.AvailableSymbolPos == (long)((ulong)condition.Param[0]));
            }
            return(false);
        }

        case 41:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ARENA));

        case 42:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(44));

        case 43:
        {
            uint      num7            = condition.Param[0];
            CRoleInfo masterRoleInfo8 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo8 != null && masterRoleInfo8.SymbolCoin >= num7);
        }

        case 44:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ADDEDSKILL));

        case 45:
            return(CAddSkillSys.IsSelSkillAvailable());

        case 46:
            return(NewbieGuideCheckTriggerConditionUtil.CheckOwnCompleteNewWeakGuideCondition(condition));

        case 47:
            return(NewbieGuideCheckTriggerConditionUtil.CheckOwnCompleteNewWeakGuideCondition(condition));

        case 48:
        {
            CRoleInfo masterRoleInfo9 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo9.m_symbolInfo.m_pageCount > 1);
        }

        case 49:
        {
            LevelRewardData levelRewardData = Singleton <CTaskSys> .instance.model.GetLevelRewardData((int)condition.Param[0]);

            return(levelRewardData != null && !levelRewardData.m_bHasGetReward);
        }

        case 50:
        {
            CRoleInfo masterRoleInfo10 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo10.m_freeDrawInfo[4].dwLeftFreeDrawCnt > 0);
        }

        case 51:
            return(Singleton <CFunctionUnlockSys> .instance.FucIsUnlock((RES_SPECIALFUNCUNLOCK_TYPE)condition.Param[0]));

        case 52:
        {
            CRoleInfo masterRoleInfo11 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(masterRoleInfo11 != null && masterRoleInfo11.IsOldPlayer() && !masterRoleInfo11.IsOldPlayerGuided());
        }

        case 53:
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            return(curLvelContext != null && curLvelContext.IsMultilModeWithWarmBattle());
        }

        case 54:
        {
            bool      result2          = false;
            CRoleInfo masterRoleInfo12 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo12 != null)
            {
                result2 = masterRoleInfo12.IsGuidedStateSet(98);
            }
            return(result2);
        }

        case 55:
            return(CBattleGuideManager.EnableHeroVictoryTips());

        case 56:
            return(Singleton <GameReplayModule> .GetInstance().HasRecord&& Singleton <WatchController> .GetInstance().FightOverJust);

        case 57:
        {
            SLevelContext curLvelContext2 = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            return(curLvelContext2 != null && (long)curLvelContext2.m_mapID == (long)((ulong)condition.Param[0]));
        }

        case 58:
        {
            CSkillButtonManager cSkillButtonManager = (Singleton <CBattleSystem> .GetInstance().FightForm == null) ? null : Singleton <CBattleSystem> .GetInstance().FightForm.m_skillButtonManager;

            SkillSlotType skillSlotType;
            return(cSkillButtonManager != null && cSkillButtonManager.HasMapSlectTargetSkill(out skillSlotType) && skillSlotType == SkillSlotType.SLOT_SKILL_5);
        }
        }
        return(false);
    }
Exemplo n.º 16
0
        public static void InitLevelList(CUIFormScript form, int currentChapter, int levelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            ResChapterInfo dataByKey = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)currentChapter);

            DebugHelper.Assert(dataByKey != null);
            bool flag = Singleton <CFunctionUnlockSys> .instance.ChapterIsUnlock(dataByKey.dwChapterId);

            PVE_ADV_COMPLETE_INFO     pVE_ADV_COMPLETE_INFO     = masterRoleInfo.pveLevelDetail[difficulty - 1];
            PVE_CHAPTER_COMPLETE_INFO pVE_CHAPTER_COMPLETE_INFO = pVE_ADV_COMPLETE_INFO.ChapterDetailList[currentChapter - 1];

            PVE_LEVEL_COMPLETE_INFO[] levelDetailList = pVE_CHAPTER_COMPLETE_INFO.LevelDetailList;
            CUIListScript             component       = form.transform.FindChild("LevelList").GetComponent <CUIListScript>();

            component.SetElementAmount(levelDetailList.Length);
            Sprite     sprite       = CUIUtility.GetSpritePrefeb(CAdventureView.GetLevelFramePath(difficulty), false, false).GetComponent <SpriteRenderer>().sprite;
            GameObject spritePrefeb = CUIUtility.GetSpritePrefeb(CAdventureView.GetLevelSelectFramePath(difficulty), false, false);

            for (int i = 0; i < levelDetailList.Length; i++)
            {
                CUIListElementScript elemenet   = component.GetElemenet(i);
                ResLevelCfgInfo      dataByKey2 = GameDataMgr.levelDatabin.GetDataByKey((long)levelDetailList[i].iLevelID);
                DebugHelper.Assert(dataByKey2 != null, "Can't find LevelConfig = {0}", new object[]
                {
                    levelDetailList[i].iLevelID
                });
                bool flag2   = levelDetailList[i].levelStatus == 0 || !flag;
                bool bActive = levelDetailList[i].levelStatus == 1 && flag;
                int  starNum = CAdventureSys.GetStarNum(levelDetailList[i].bStarBits);
                elemenet.transform.FindChild("Unlock/star1").GetComponent <Image>().set_color((starNum >= 1) ? Color.white : CUIUtility.s_Color_GrayShader);
                elemenet.transform.FindChild("Unlock/star2").GetComponent <Image>().set_color((starNum >= 2) ? Color.white : CUIUtility.s_Color_GrayShader);
                elemenet.transform.FindChild("Unlock/star3").GetComponent <Image>().set_color((starNum >= 3) ? Color.white : CUIUtility.s_Color_GrayShader);
                elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_text(Utility.UTF8Convert(dataByKey2.szName));
                if (levelNo == i + 1 && !flag2)
                {
                    elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[0]);
                }
                else if (!flag2)
                {
                    elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[1]);
                }
                else
                {
                    elemenet.transform.FindChild("TxtLevelNameText").GetComponent <Text>().set_color(CAdventureView.s_Adv_Level_Colors[2]);
                }
                elemenet.transform.FindChild("SelectedFrame").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[difficulty - 1]);
                elemenet.transform.FindChild("SelectedFrame/Image1").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[CAdventureView.s_Adv_Difficult_Color.Length / 2 + difficulty - 1]);
                elemenet.transform.FindChild("SelectedFrame/Image2").GetComponent <Image>().set_color(CAdventureView.s_Adv_Difficult_Color[CAdventureView.s_Adv_Difficult_Color.Length / 2 + difficulty - 1]);
                elemenet.transform.FindChild("SelectedFrame/SelectedFrame").GetComponent <Image>().SetSprite(spritePrefeb, false);
                elemenet.transform.FindChild("New").gameObject.CustomSetActive(bActive);
                elemenet.GetComponent <CUIEventScript>().m_onClickEventID         = enUIEventID.Adv_SelectLevel;
                elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1;
                elemenet.transform.FindChild("Unlock").gameObject.CustomSetActive(!flag2);
                elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(flag2);
                elemenet.m_selectedSprite = sprite;
                elemenet.GetComponent <Image>().SetSprite((levelNo - 1 == i) ? sprite : elemenet.m_defaultSprite, elemenet.m_selectedLayout);
            }
            component.SelectElement(levelNo - 1, true);
        }
Exemplo n.º 17
0
        public bool CheckUnlock(uint id)
        {
            bool flag = false;
            ResUnlockCondition dataByKey = GameDataMgr.unlockConditionDatabin.GetDataByKey(id);

            object[] inParameters = new object[] { id };
            DebugHelper.Assert(dataByKey != null, "ResUnlockCondition[{0}] can not be find.", inParameters);
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "roleinfo can't be null in CheckUnlock");
            if ((masterRoleInfo != null) && (dataByKey != null))
            {
                switch (dataByKey.wUnlockType)
                {
                case 1:
                    return(masterRoleInfo.PvpLevel >= dataByKey.UnlockParam[0]);

                case 2:
                {
                    int             num       = (int)dataByKey.UnlockParam[0];
                    int             num2      = (int)dataByKey.UnlockParam[1];
                    int             index     = 0;
                    ResLevelCfgInfo info2     = GameDataMgr.levelDatabin.GetDataByKey((long)num);
                    object[]        objArray2 = new object[] { num };
                    DebugHelper.Assert(info2 != null, "can't find level = {0}", objArray2);
                    flag = false;
                    if (((info2 != null) && (info2 != null)) && ((masterRoleInfo.pveLevelDetail[index] != null) && (masterRoleInfo.pveLevelDetail[index].ChapterDetailList[info2.iChapterId - 1] != null)))
                    {
                        PVE_CHAPTER_COMPLETE_INFO pve_chapter_complete_info = masterRoleInfo.pveLevelDetail[index].ChapterDetailList[info2.iChapterId - 1];
                        for (int i = 0; i < pve_chapter_complete_info.LevelDetailList.Length; i++)
                        {
                            PVE_LEVEL_COMPLETE_INFO pve_level_complete_info = pve_chapter_complete_info.LevelDetailList[i];
                            if ((pve_level_complete_info != null) && (pve_level_complete_info.iLevelID == num))
                            {
                                flag = (pve_level_complete_info.levelStatus == 1) && (num2 <= CAdventureSys.GetStarNum(pve_level_complete_info.bStarBits));
                                break;
                            }
                        }
                    }
                    return(true);
                }

                case 3:
                    return(flag);

                case 4:
                {
                    uint num5 = 0;
                    if (masterRoleInfo.pvpDetail != null)
                    {
                        num5 = (masterRoleInfo.pvpDetail.stOneVsOneInfo.dwTotalNum + masterRoleInfo.pvpDetail.stTwoVsTwoInfo.dwTotalNum) + masterRoleInfo.pvpDetail.stThreeVsThreeInfo.dwTotalNum;
                    }
                    return((dataByKey.UnlockParam[0] <= num5) && (dataByKey.UnlockParam[1] <= masterRoleInfo.PvpLevel));
                }
                }
            }
            return(flag);
        }
Exemplo n.º 18
0
    public static bool CheckTriggerCondition(uint id, NewbieGuideTriggerConditionItem condition)
    {
        bool flag6;
        uint dwCfgID;

        switch (condition.wType)
        {
        case 1:
            return(CheckCompleteNewbieDungeonCondition(condition));

        case 2:
            return(CheckCompleteNormalDungeonCondition(condition));

        case 3:
            return(CheckOwnCompleteNewbieGuideCondition(condition));

        case 4:
            return(CheckUnCompleteNewbieGuideCondition(condition));

        case 5:
            return(false);

        case 6:
            return(false);

        case 7:
            AvailableTask = null;
            return(Singleton <CTaskSys> .instance.model.AnyTaskOfState(COM_TASK_STATE.COM_TASK_HAVEDONE, RES_TASK_TYPE.RES_TASKTYPE_MAIN, out AvailableTask));

        case 8:
            return(false);

        case 9:
            return(false);

        case 10:
            return(false);

        case 11:
        {
            uint      num3           = condition.Param[0];
            uint      num4           = condition.Param[1];
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return(false);
            }
            uint haveHeroCount = (uint)masterRoleInfo.GetHaveHeroCount(false);
            switch (num4)
            {
            case 0:
                return(haveHeroCount == num3);

            case 1:
                return(haveHeroCount > num3);

            case 2:
                return(haveHeroCount < num3);
            }
            DebugHelper.Assert(false);
            return(false);
        }

        case 12:
        {
            flag6   = false;
            dwCfgID = condition.Param[0];
            RES_SHOPBUY_COINTYPE coinType = (condition.Param[1] != 0) ? RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_PVPCOIN : RES_SHOPBUY_COINTYPE.RES_SHOPBUY_TYPE_COUPONS;
            CRoleInfo            info5    = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (info5 != null)
            {
                if (dwCfgID <= 0)
                {
                    ListView <ResHeroCfgInfo> .Enumerator enumerator = CHeroDataFactory.GetAllHeroList().GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        dwCfgID = enumerator.Current.dwCfgID;
                        flag6  |= info5.CheckHeroBuyable(dwCfgID, coinType);
                        if (flag6)
                        {
                            break;
                        }
                    }
                    break;
                }
                flag6 = info5.CheckHeroBuyable(dwCfgID, coinType);
            }
            break;
        }

        case 13:
            return(Singleton <CShopSystem> .GetInstance().IsNormalShopItemsInited());

        case 14:
            return(((Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GoldCoin >= condition.Param[0]) && Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_SHOP)) && Singleton <CShopSystem> .GetInstance().IsNormalShopItemsInited());

        case 15:
            return(CAdventureSys.IsChapterFullStar(Singleton <CAdventureSys> .GetInstance().currentChapter, Singleton <CAdventureSys> .GetInstance().currentDifficulty));

        case 0x10:
        {
            uint num7 = condition.Param[0];
            if (num7 <= 0)
            {
                return(false);
            }
            if (!Singleton <CAdventureSys> .GetInstance().IsLevelFinished((int)num7))
            {
                return(false);
            }
            return(CAdventureSys.IsLevelFullStar((int)num7));
        }

        case 0x11:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_PVPMODE));

        case 0x12:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM).GetUseableStackCount(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, CAdventureSys.MOPUP_TICKET_ID) >= condition.Param[0]);

        case 0x13:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ZONGSHILIAN));

        case 20:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ZHUANGZIHUANMENG));

        case 0x15:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG));

        case 0x16:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ELITELEVEL));

        case 0x17:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_UNION));

        case 0x18:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_SYMBOL));

        case 0x19:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_BLACKSHOP) && Singleton <CShopSystem> .GetInstance().IsMysteryShopAvailable());

        case 0x1a:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_PVPCOINSHOP));

        case 0x1b:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_TASK));

        case 0x1c:
            return(false);

        case 30:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(0x1a));

        case 0x1f:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(0x1b));

        case 0x20:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(0x15));

        case 0x21:
        {
            CRoleInfo info7 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return((info7 != null) && (info7.GoldCoin >= condition.Param[0]));
        }

        case 0x22:
            return(false);

        case 0x24:
            return(false);

        case 0x25:
        {
            bool      flag   = false;
            uint      baseID = condition.Param[0];
            CRoleInfo info   = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (info != null)
            {
                CUseableContainer useableContainer = info.GetUseableContainer(enCONTAINER_TYPE.ITEM);
                if ((useableContainer != null) && (useableContainer.GetUseableByBaseID(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, baseID) != null))
                {
                    flag = true;
                }
            }
            AvailableItemId = !flag ? 0 : baseID;
            return(flag);
        }

        case 0x26:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(9));

        case 0x27:
        {
            uint      num2  = condition.Param[0];
            CRoleInfo info3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return((info3 != null) && (info3.GetHaveHeroCount(false) >= num2));
        }

        case 40:
        {
            CRoleInfo info2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (info2 == null)
            {
                return(false);
            }
            return(info2.m_symbolInfo.CheckAnyWearSymbol(out AvailableSymbolPos, out AvailableSymbolId));
        }

        case 0x29:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ARENA));

        case 0x2a:
            return(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsGuidedStateSet(0x2c));

        case 0x2b:
        {
            uint          key       = condition.Param[0];
            ResSymbolInfo dataByKey = GameDataMgr.symbolInfoDatabin.GetDataByKey(key);
            if (dataByKey == null)
            {
                goto Label_057D;
            }
            CRoleInfo info9 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (info9 == null)
            {
                goto Label_057D;
            }
            return(info9.SymbolCoin >= dataByKey.dwMakeCoin);
        }

        case 0x2c:
            return(Singleton <CFunctionUnlockSys> .GetInstance().FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ADDEDSKILL));

        case 0x2d:
            return(CAddSkillSys.IsSelSkillAvailable());

        case 0x2e:
            return(CheckOwnCompleteNewWeakGuideCondition(condition));

        case 0x2f:
            return(CheckOwnCompleteNewWeakGuideCondition(condition));

        case 0x30:
            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_symbolInfo.m_pageCount <= 1)
            {
                return(false);
            }
            return(true);

        case 0x31:
        {
            LevelRewardData levelRewardData = Singleton <CTaskSys> .instance.model.GetLevelRewardData((int)condition.Param[0]);

            if (levelRewardData == null)
            {
                return(false);
            }
            return(!levelRewardData.m_bHasGetReward);
        }

        case 50:
            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_freeDrawInfo[4].dwLeftFreeDrawCnt <= 0)
            {
                return(false);
            }
            return(true);

        case 0x33:
            return(Singleton <CFunctionUnlockSys> .instance.FucIsUnlock((RES_SPECIALFUNCUNLOCK_TYPE)condition.Param[0]));

        case 0x34:
        {
            CRoleInfo info12 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (((info12 == null) || !info12.IsOldPlayer()) || info12.IsOldPlayerGuided())
            {
                return(false);
            }
            return(true);
        }

        case 0x35:
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext == null)
            {
                return(false);
            }
            return(curLvelContext.IsMultilModeWithWarmBattle());
        }

        case 0x36:
        {
            bool      flag12 = false;
            CRoleInfo info13 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (info13 != null)
            {
                flag12 = info13.IsGuidedStateSet(0x62);
            }
            return(flag12);
        }

        case 0x37:
            return(CBattleGuideManager.EnableHeroVictoryTips());

        case 0x38:
            return(Singleton <GameReplayModule> .GetInstance().HasRecord);

        default:
            return(false);
        }
        if (flag6)
        {
            AvailableHeroId = dwCfgID;
        }
        return(flag6);

Label_057D:
        return(false);
    }
        public static void InitExloreList(CUIFormScript form)
        {
            if (form == null)
            {
                return;
            }
            int num = CExploreView.s_eventIDs.Length;
            CUIStepListScript component = form.transform.Find("ExploreList").gameObject.GetComponent <CUIStepListScript>();

            component.SetElementAmount(num);
            for (int i = 0; i < num; i++)
            {
                CUIListElementScript elemenet   = component.GetElemenet(i);
                CUIEventScript       component2 = elemenet.GetComponent <CUIEventScript>();
                component2.m_onClickEventID = CExploreView.s_eventIDs[i];
                Text component3 = elemenet.gameObject.transform.Find("TitleBg/ExlporeNameText").GetComponent <Text>();
                component3.set_text(Singleton <CTextManager> .instance.GetText(CExploreView.s_exploreTypes[i]));
                Image component4 = elemenet.gameObject.transform.Find("TitleBg/Image").GetComponent <Image>();
                component4.set_color(CExploreView.s_exploreColors[i]);
                Image      component5   = elemenet.gameObject.transform.Find("Icon").gameObject.GetComponent <Image>();
                GameObject spritePrefeb = CUIUtility.GetSpritePrefeb(CUIUtility.s_Sprite_Dynamic_Adventure_Dir + (i + 1), false, false);
                if (spritePrefeb != null)
                {
                    component5.SetSprite(spritePrefeb, false);
                }
                GameObject gameObject  = elemenet.transform.FindChild("Lock").gameObject;
                GameObject gameObject2 = elemenet.transform.FindChild("Unlock").gameObject;
                RES_SPECIALFUNCUNLOCK_TYPE rES_SPECIALFUNCUNLOCK_TYPE = CExploreView.s_unlockTypes[i];
                if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(rES_SPECIALFUNCUNLOCK_TYPE))
                {
                    component5.set_color(CUIUtility.s_Color_White);
                    gameObject.CustomSetActive(false);
                }
                else
                {
                    component5.set_color(CUIUtility.s_Color_GrayShader);
                    gameObject.CustomSetActive(true);
                    ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)rES_SPECIALFUNCUNLOCK_TYPE);
                    if (dataByKey != null)
                    {
                        gameObject.GetComponentInChildren <Text>().set_text(Utility.UTF8Convert(dataByKey.szLockedTip));
                    }
                }
                if (CExploreView.s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_NONE)
                {
                    int            lastChapter = CAdventureSys.GetLastChapter(1);
                    ResChapterInfo dataByKey2  = GameDataMgr.chapterInfoDatabin.GetDataByKey((long)lastChapter);
                    if (dataByKey2 != null)
                    {
                        gameObject2.CustomSetActive(true);
                        gameObject2.GetComponentInChildren <Text>().set_text(string.Format(Singleton <CTextManager> .instance.GetText("Adventure_Chapter_Max_Tips"), Utility.UTF8Convert(dataByKey2.szChapterName)));
                    }
                }
                else if (CExploreView.s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ARENA)
                {
                    if (Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList == null || Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank == 0u)
                    {
                        gameObject2.CustomSetActive(false);
                    }
                    else
                    {
                        string text = string.Empty;
                        text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreArenaRankText"), Singleton <CArenaSystem> .GetInstance().m_fightHeroInfoList.stArenaInfo.dwSelfRank);
                        gameObject2.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().set_text(text);
                        gameObject2.CustomSetActive(true);
                    }
                }
                else if (CExploreView.s_unlockTypes[i] == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_LIUGUOYUANZHENG)
                {
                    BurnExpeditionModel model = Singleton <BurnExpeditionController> .GetInstance().model;

                    if (model._data == null)
                    {
                        gameObject2.CustomSetActive(false);
                    }
                    else
                    {
                        string text2 = string.Empty;
                        if (model.IsAllCompelte())
                        {
                            text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnFinishText"), new object[0]);
                        }
                        else
                        {
                            text2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("ExploreBurnText"), Math.Max(1, model.Get_LastUnlockLevelIndex(model.curDifficultyType) + 1));
                        }
                        gameObject2.gameObject.transform.FindChild("Text").gameObject.GetComponent <Text>().set_text(text2);
                        gameObject2.CustomSetActive(true);
                    }
                }
            }
            component.SelectElementImmediately(1);
            Text  component6 = form.gameObject.transform.FindChild("AwardGroup/Name1").gameObject.GetComponent <Text>();
            Text  component7 = form.gameObject.transform.FindChild("AwardGroup/Name2").gameObject.GetComponent <Text>();
            Image component8 = form.gameObject.transform.FindChild("AwardGroup/Icon1").gameObject.GetComponent <Image>();
            Image component9 = form.gameObject.transform.FindChild("AwardGroup/Icon2").gameObject.GetComponent <Image>();

            component6.gameObject.CustomSetActive(false);
            component7.gameObject.CustomSetActive(false);
            component8.gameObject.CustomSetActive(false);
            component9.gameObject.CustomSetActive(false);
            uint   num2  = 0u;
            string empty = string.Empty;

            try
            {
                num2 = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHeroId"));
            }
            catch (Exception)
            {
            }
            if (num2 != 0u)
            {
                ResHeroCfgInfo dataByKey3 = GameDataMgr.heroDatabin.GetDataByKey(num2);
                if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(num2, false) && dataByKey3 != null)
                {
                    component6.gameObject.CustomSetActive(true);
                    component6.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("ArenaAwardHero"), dataByKey3.szName));
                    component8.gameObject.CustomSetActive(true);
                    component8.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(num2, 0u)), form, true, false, false, false);
                }
            }
            num2 = 0u;
            try
            {
                num2 = uint.Parse(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHeroId"));
            }
            catch (Exception)
            {
            }
            if (num2 != 0u)
            {
                ResHeroCfgInfo dataByKey4 = GameDataMgr.heroDatabin.GetDataByKey(num2);
                if (!Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().IsHaveHero(num2, false) && dataByKey4 != null)
                {
                    component7.gameObject.CustomSetActive(true);
                    component7.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("BurningAwardHero"), dataByKey4.szName));
                    component9.gameObject.CustomSetActive(true);
                    component9.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, CSkinInfo.GetHeroSkinPic(num2, 0u)), form, true, false, false, false);
                }
            }
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform = form.transform.FindChild("AwardGroup");
                if (transform)
                {
                    transform.gameObject.CustomSetActive(false);
                }
            }
        }
Exemplo n.º 20
0
        public static void InitLevelForm(CUIFormScript formScript, int chapterNo, int LevelNo, int difficulty)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            PVE_ADV_COMPLETE_INFO   pVE_ADV_COMPLETE_INFO   = masterRoleInfo.pveLevelDetail[difficulty - 1];
            PVE_LEVEL_COMPLETE_INFO pVE_LEVEL_COMPLETE_INFO = pVE_ADV_COMPLETE_INFO.ChapterDetailList[chapterNo - 1].LevelDetailList[LevelNo - 1];
            GameObject      gameObject = formScript.gameObject;
            ResLevelCfgInfo dataByKey  = GameDataMgr.levelDatabin.GetDataByKey((long)pVE_LEVEL_COMPLETE_INFO.iLevelID);

            if (dataByKey != null)
            {
                string text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
                formScript.transform.Find("PanelLeft/DifficultText").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText(string.Format("Adventure_Level_{0}", difficulty));

                formScript.transform.Find("Panel_Main/ImgMapNameBg/MapNameText").GetComponent <Text>().text = text;
                formScript.transform.Find("PanelLeft/MapNameText").GetComponent <Text>().text      = text;
                formScript.transform.Find("PanelLeft/MapDescText").GetComponent <Text>().text      = StringHelper.UTF8BytesToString(ref dataByKey.szLevelDesc);
                formScript.transform.Find("PanelLeft/RecPlayerLvlText").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Level_Recommend_Tips_1", new string[]
                {
                    dataByKey.RecommendLevel[difficulty - 1].ToString()
                });

                formScript.transform.Find("PanelLeft/ChapterImg").GetComponent <Image>().SetSprite(CAdventureView.GetLevelBgPath(chapterNo, LevelNo, difficulty), formScript, true, false, false, false);
                formScript.transform.Find("PanelLeft/DifficultImg").GetComponent <Image>().SetSprite(CAdventureView.GetDifficultIcon(difficulty), formScript, true, false, false, false);
                for (int i = 1; i <= CAdventureSys.STAR_PER_LEVEL; i++)
                {
                    GameObject gameObject2 = gameObject.transform.Find("PanelRight/WinCondition" + i).gameObject;
                    CAdventureView.SetStarConditionDesc(formScript, gameObject2, (uint)dataByKey.astStarDetail[i - 1].iParam, CAdventureSys.IsStarGained(pVE_LEVEL_COMPLETE_INFO.bStarBits, i));
                }
                GameObject gameObject3 = gameObject.transform.Find("PanelRight/itemCell").gameObject;
                CAdventureView.SetReward(formScript, gameObject3, dataByKey, difficulty);
                GameObject  gameObject4             = gameObject.transform.Find("PanelRight/HeroList").gameObject;
                int         num                     = 0;
                List <uint> heroListForBattleListID = Singleton <CHeroSelectBaseSystem> .get_instance().GetHeroListForBattleListID(dataByKey.dwBattleListID);

                CAdventureView.SetTeamHeroList(gameObject4, heroListForBattleListID, out num);
                GameObject gameObject5 = gameObject.transform.Find("BtnStart").gameObject;
                CAdventureView.SetStartBtnEnable(gameObject5, heroListForBattleListID);
                formScript.gameObject.transform.FindChild("Bg").gameObject.GetComponent <Image>().color = CAdventureView.s_Adv_Difficult_Bg_Color[difficulty - 1];
            }
            else
            {
                DebugHelper.Assert(false, "Can't find level info -- id: {0}", new object[]
                {
                    pVE_LEVEL_COMPLETE_INFO.iLevelID
                });
            }
        }
        public bool CheckUnlock(uint id)
        {
            bool result = false;
            ResUnlockCondition dataByKey = GameDataMgr.unlockConditionDatabin.GetDataByKey(id);

            DebugHelper.Assert(dataByKey != null, "ResUnlockCondition[{0}] can not be find.", new object[]
            {
                id
            });
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "roleinfo can't be null in CheckUnlock");
            if (masterRoleInfo != null && dataByKey != null)
            {
                switch (dataByKey.wUnlockType)
                {
                case 1:
                    result = (masterRoleInfo.PvpLevel >= dataByKey.UnlockParam[0]);
                    break;

                case 2:
                {
                    int             num        = (int)dataByKey.UnlockParam[0];
                    int             num2       = (int)dataByKey.UnlockParam[1];
                    int             num3       = 0;
                    ResLevelCfgInfo dataByKey2 = GameDataMgr.levelDatabin.GetDataByKey((long)num);
                    DebugHelper.Assert(dataByKey2 != null, "can't find level = {0}", new object[]
                        {
                            num
                        });
                    if (dataByKey2 != null && dataByKey2 != null && masterRoleInfo.pveLevelDetail[num3] != null && masterRoleInfo.pveLevelDetail[num3].ChapterDetailList[dataByKey2.iChapterId - 1] != null)
                    {
                        PVE_CHAPTER_COMPLETE_INFO pVE_CHAPTER_COMPLETE_INFO = masterRoleInfo.pveLevelDetail[num3].ChapterDetailList[dataByKey2.iChapterId - 1];
                        for (int i = 0; i < pVE_CHAPTER_COMPLETE_INFO.LevelDetailList.Length; i++)
                        {
                            PVE_LEVEL_COMPLETE_INFO pVE_LEVEL_COMPLETE_INFO = pVE_CHAPTER_COMPLETE_INFO.LevelDetailList[i];
                            if (pVE_LEVEL_COMPLETE_INFO != null && pVE_LEVEL_COMPLETE_INFO.iLevelID == num)
                            {
                                bool arg_178_0 = pVE_LEVEL_COMPLETE_INFO.levelStatus == 1 && num2 <= CAdventureSys.GetStarNum(pVE_LEVEL_COMPLETE_INFO.bStarBits);
                                break;
                            }
                        }
                    }
                    result = true;
                    break;
                }

                case 4:
                {
                    uint num4 = 0u;
                    if (masterRoleInfo.pvpDetail != null)
                    {
                        num4 = masterRoleInfo.pvpDetail.stOneVsOneInfo.dwTotalNum + masterRoleInfo.pvpDetail.stTwoVsTwoInfo.dwTotalNum + masterRoleInfo.pvpDetail.stThreeVsThreeInfo.dwTotalNum;
                    }
                    result = (dataByKey.UnlockParam[0] <= num4 && dataByKey.UnlockParam[1] <= masterRoleInfo.PvpLevel);
                    break;
                }
                }
            }
            return(result);
        }
Exemplo n.º 22
0
        public static void SetRewardFormData(CUIFormScript form, COMDT_SETTLE_RESULT_DETAIL settleData)
        {
            Singleton <CUIManager> .GetInstance().LoadUIScenePrefab(CUIUtility.s_heroSceneBgPath, form);

            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext == null)
            {
                return;
            }
            GameObject gameObject = form.transform.Find("Root/Panel_Interactable/Button_Next").gameObject;

            if (curLvelContext.IsGameTypeActivity())
            {
                gameObject.CustomSetActive(false);
            }
            else
            {
                int nextLevelId = CAdventureSys.GetNextLevelId(curLvelContext.m_chapterNo, (int)curLvelContext.m_levelNo, curLvelContext.m_levelDifficulty);
                if (nextLevelId != 0)
                {
                    if (Singleton <CAdventureSys> .GetInstance().IsLevelOpen(nextLevelId))
                    {
                        gameObject.CustomSetActive(true);
                    }
                    else
                    {
                        gameObject.CustomSetActive(false);
                    }
                }
                else
                {
                    gameObject.CustomSetActive(false);
                }
            }
            gameObject.CustomSetActive(false);
            PVESettleView.Show3DModel(form);
            GameObject gameObject2 = form.transform.Find("Root/Panel_Award/Award/Panel_GuanKa/GuanKaDifficulty1").gameObject;
            GameObject gameObject3 = form.transform.Find("Root/Panel_Award/Award/Panel_GuanKa/GuanKaDifficulty2").gameObject;
            GameObject gameObject4 = form.transform.Find("Root/Panel_Award/Award/Panel_GuanKa/GuanKaDifficulty3").gameObject;
            Text       component   = form.transform.Find("Root/Panel_Award/Award/Panel_GuanKa/GuanKaName").gameObject.GetComponent <Text>();

            if (curLvelContext.m_levelDifficulty == 1)
            {
                gameObject3.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
            }
            else if (curLvelContext.m_levelDifficulty == 2)
            {
                gameObject2.CustomSetActive(false);
                gameObject4.CustomSetActive(false);
            }
            else if (curLvelContext.m_levelDifficulty == 3)
            {
                gameObject3.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
            }
            component.text = string.Format(curLvelContext.m_levelName, new object[0]);
            PVESettleView._continueBtn1 = form.transform.Find("Root/Panel_Interactable/Button_Once").gameObject;
            PVESettleView._continueBtn2 = form.transform.Find("Root/Panel_Interactable/Button_ReturnLobby").gameObject;
            PVESettleView._continueBtn1.CustomSetActive(true);
            PVESettleView._continueBtn2.CustomSetActive(true);
            PVESettleView.ShowReward(form, settleData);
            CUICommonSystem.PlayAnimator(form.gameObject, "Box_Show_2");
        }