Example #1
0
        // Token: 0x0600768B RID: 30347 RVA: 0x00207294 File Offset: 0x00205494
        public bool IsRiftChapterUnlockConditionCompleted(int chapterId, RiftChapterUnlockConditionType condition, int param)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsRiftChapterUnlockConditionCompletedInt32RiftChapterUnlockConditionTypeInt32_hotfix != null)
            {
                return(Convert.ToBoolean(this.m_IsRiftChapterUnlockConditionCompletedInt32RiftChapterUnlockConditionTypeInt32_hotfix.call(new object[]
                {
                    this,
                    chapterId,
                    condition,
                    param
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (condition == RiftChapterUnlockConditionType.RiftChapterUnlockConditionType_PlayerLevel)
            {
                return(this.m_basicInfo.GetLevel() >= param);
            }
            if (condition != RiftChapterUnlockConditionType.RiftChapterUnlockConditionType_Scenario)
            {
                return(false);
            }
            ConfigDataScenarioInfo configDataScenarioInfo = this.m_configDataLoader.GetConfigDataScenarioInfo(param);

            if (configDataScenarioInfo == null)
            {
                return(false);
            }
            ConfigDataScenarioInfo configDataScenarioInfo2 = this.m_configDataLoader.GetConfigDataScenarioInfo(this.m_level.GetLastFinishedScenarioId());

            return(configDataScenarioInfo2 != null && configDataScenarioInfo2.m_scenarioDepth >= configDataScenarioInfo.m_scenarioDepth);
        }
        // Token: 0x06012AFC RID: 76540 RVA: 0x004C8A28 File Offset: 0x004C6C28
        public void SetCondition(RiftChapterUnlockConditionType condition, int param)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetConditionRiftChapterUnlockConditionTypeInt32_hotfix != null)
            {
                this.m_SetConditionRiftChapterUnlockConditionTypeInt32_hotfix.call(new object[]
                {
                    this,
                    condition,
                    param
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            IConfigDataLoader configDataLoader = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;

            if (condition == RiftChapterUnlockConditionType.RiftChapterUnlockConditionType_PlayerLevel)
            {
                this.m_text.text = string.Format(configDataLoader.UtilityGetStringByStringTable(StringTableId.StringTableId_UnlockCondition_PlayerLevel), param);
            }
            else if (condition == RiftChapterUnlockConditionType.RiftChapterUnlockConditionType_Scenario)
            {
                ConfigDataScenarioInfo configDataScenarioInfo = configDataLoader.GetConfigDataScenarioInfo(param);
                if (configDataScenarioInfo != null)
                {
                    this.m_text.text  = string.Format(configDataLoader.UtilityGetStringByStringTable(StringTableId.StringTableId_UnlockCondition_Scenario), configDataScenarioInfo.Chapter);
                    this.m_scenarioID = param;
                    this.m_goButton.onClick.AddListener(new UnityAction(this.GoScenario));
                }
            }
            this.m_goButton.gameObject.SetActive(false);
        }
Example #3
0
        // Token: 0x06007683 RID: 30339 RVA: 0x00206AA0 File Offset: 0x00204CA0
        public int CanUnlockChapter(int chapterId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanUnlockChapterInt32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanUnlockChapterInt32_hotfix.call(new object[]
                {
                    this,
                    chapterId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataRiftChapterInfo configDataRiftChapterInfo = this.m_configDataLoader.GetConfigDataRiftChapterInfo(chapterId);

            if (configDataRiftChapterInfo == null)
            {
                return(-805);
            }
            if (!configDataRiftChapterInfo.IsOpened)
            {
                return(-826);
            }
            if (configDataRiftChapterInfo.UnlockConditions == null)
            {
                return(0);
            }
            foreach (RiftChapterInfoUnlockConditions riftChapterInfoUnlockConditions in configDataRiftChapterInfo.UnlockConditions)
            {
                RiftChapterUnlockConditionType conditionType = riftChapterInfoUnlockConditions.ConditionType;
                if (conditionType != RiftChapterUnlockConditionType.RiftChapterUnlockConditionType_PlayerLevel)
                {
                    if (conditionType != RiftChapterUnlockConditionType.RiftChapterUnlockConditionType_Scenario)
                    {
                        if (conditionType == RiftChapterUnlockConditionType.RiftChapterUnlockConditionType_ChapterStar)
                        {
                            if (riftChapterInfoUnlockConditions.Param != 0 && base.GetChapterTotalStars(configDataRiftChapterInfo.HardChapter) < riftChapterInfoUnlockConditions.Param)
                            {
                                return(-822);
                            }
                        }
                    }
                    else if (riftChapterInfoUnlockConditions.Param != 0)
                    {
                        ConfigDataScenarioInfo configDataScenarioInfo  = this.m_configDataLoader.GetConfigDataScenarioInfo(this.m_level.GetLastFinishedScenarioId());
                        ConfigDataScenarioInfo configDataScenarioInfo2 = this.m_configDataLoader.GetConfigDataScenarioInfo(riftChapterInfoUnlockConditions.Param);
                        if (configDataScenarioInfo2 == null)
                        {
                            return(-700);
                        }
                        if (configDataScenarioInfo == null || configDataScenarioInfo.m_scenarioDepth < configDataScenarioInfo2.m_scenarioDepth)
                        {
                            return(-807);
                        }
                    }
                }
                else if (riftChapterInfoUnlockConditions.Param != 0 && this.m_basicInfo.GetLevel() < riftChapterInfoUnlockConditions.Param)
                {
                    return(-806);
                }
            }
            return(0);
        }