// Token: 0x0600446E RID: 17518 RVA: 0x0014AE98 File Offset: 0x00149098
        private int CanAttackLevelByEnergyAndSoOn(ConfigDataMemoryCorridorLevelInfo levelInfo, bool isTeamBattle)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanAttackLevelByEnergyAndSoOnConfigDataMemoryCorridorLevelInfoBoolean_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanAttackLevelByEnergyAndSoOnConfigDataMemoryCorridorLevelInfoBoolean_hotfix.call(new object[]
                {
                    this,
                    levelInfo,
                    isTeamBattle
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int ticketId = this.m_bag.GetTicketId(GameFunctionType.GameFunctionType_MemoryCorridor);

            if (!this.m_bag.IsBagItemEnough(GoodsType.GoodsType_Item, ticketId, levelInfo.TicketCost))
            {
                return(-1908);
            }
            int consumeEnergy = levelInfo.EnergySuccess;

            if (isTeamBattle)
            {
                consumeEnergy = levelInfo.TeamEnergyCost;
            }
            if (!this.m_basicInfo.IsEnergyEnough(consumeEnergy))
            {
                return(-402);
            }
            if (this.m_bag.IsBagFullByCurrentSize())
            {
                return(-500);
            }
            return(0);
        }
        // Token: 0x0600446C RID: 17516 RVA: 0x0014AC78 File Offset: 0x00148E78
        public virtual int CanAttackMemoryCorridorLevel(int levelId, bool isTeamBattle = false)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanAttackMemoryCorridorLevelInt32Boolean_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanAttackMemoryCorridorLevelInt32Boolean_hotfix.call(new object[]
                {
                    this,
                    levelId,
                    isTeamBattle
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int num = this.CanOpenLevel(levelId);

            if (num != 0)
            {
                return(num);
            }
            if (this.m_battle.IsFighting())
            {
                return(-900);
            }
            ConfigDataMemoryCorridorLevelInfo configDataMemoryCorridorLevelInfo = this.m_configDataLoader.GetConfigDataMemoryCorridorLevelInfo(levelId);

            return(this.CanAttackLevelByEnergyAndSoOn(configDataMemoryCorridorLevelInfo, isTeamBattle));
        }
Beispiel #3
0
        // Token: 0x06011F32 RID: 73522 RVA: 0x004A2884 File Offset: 0x004A0A84
        public void SetMemoryCorridorLevelInfo(ConfigDataMemoryCorridorLevelInfo levelInfo)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetMemoryCorridorLevelInfoConfigDataMemoryCorridorLevelInfo_hotfix != null)
            {
                this.m_SetMemoryCorridorLevelInfoConfigDataMemoryCorridorLevelInfo_hotfix.call(new object[]
                {
                    this,
                    levelInfo
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.m_memoryCorridorLevelInfo = levelInfo;
            this.m_levelText.text          = levelInfo.MonsterLevel.ToString();
            this.m_energyText.text         = levelInfo.EnergySuccess.ToString();
            GameObjectUtility.DestroyChildren(this.m_rewardGroupGameObject);
            GameObject   assetInContainer = base.GetAssetInContainer <GameObject>("RewardGoods");
            List <Goods> list             = new List <Goods>();

            UIUtility.AppendRandomDropRewardGoodsToList(levelInfo.Drop_ID, list);
            if (list.Count > levelInfo.DisplayRewardCount)
            {
                list.RemoveRange(levelInfo.DisplayRewardCount, list.Count - levelInfo.DisplayRewardCount);
            }
            RewardGoodsUIController.CreateRewardGoodsList(list, this.m_rewardGroupGameObject.transform, assetInContainer, null, false, 0, true);
        }
        // Token: 0x0600446B RID: 17515 RVA: 0x0014AB94 File Offset: 0x00148D94
        public int AttackMemoryCorridorLevel(int levelId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_AttackMemoryCorridorLevelInt32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_AttackMemoryCorridorLevelInt32_hotfix.call(new object[]
                {
                    this,
                    levelId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int num = this.CanAttackMemoryCorridorLevel(levelId, false);

            if (num != 0)
            {
                if (num == -900)
                {
                    this.m_battle.FightFinished(GameFunctionStatus.Error, false, true);
                }
                return(num);
            }
            ConfigDataMemoryCorridorLevelInfo configDataMemoryCorridorLevelInfo = this.m_configDataLoader.GetConfigDataMemoryCorridorLevelInfo(levelId);

            this.m_basicInfo.DecreaseEnergy(configDataMemoryCorridorLevelInfo.EnergyFail, GameFunctionType.GameFunctionType_MemoryCorridor, levelId.ToString());
            this.m_battle.SetProcessingBattleInfo(BattleType.MemoryCorridor, levelId);
            return(0);
        }
Beispiel #5
0
        // Token: 0x0600736C RID: 29548 RVA: 0x001FE03C File Offset: 0x001FC23C
        public void SetSuccessMemoryCorridorLevel(ConfigDataMemoryCorridorLevelInfo levelInfo, List <int> battleTreasures, List <int> heroes, bool isTeamBattle)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetSuccessMemoryCorridorLevelConfigDataMemoryCorridorLevelInfoList ` 1List ` 1Boolean_hotfix != null)
            {
                this.m_SetSuccessMemoryCorridorLevelConfigDataMemoryCorridorLevelInfoList ` 1List ` 1Boolean_hotfix.call(new object[]
                {
                    this,
                    levelInfo,
                    battleTreasures,
                    heroes,
                    isTeamBattle
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int energyCost = 0;

            if (!isTeamBattle)
            {
                energyCost = levelInfo.EnergySuccess - levelInfo.EnergyFail;
            }
            base.SetCommonSuccessMemoryCorridorLevel(levelInfo, battleTreasures, heroes, energyCost, isTeamBattle);
            BattleReward battleReward = (this.m_battle as BattleComponent).GetBattleReward();

            battleReward.PlayerExp = levelInfo.PlayerExp;
            battleReward.HeroExp   = this.m_hero.GetAdditiveHeroAddExp(levelInfo.HeroExp);
            battleReward.Gold      = levelInfo.Gold;
        }
Beispiel #6
0
        // Token: 0x0600736B RID: 29547 RVA: 0x001FDF4C File Offset: 0x001FC14C
        public int FinishedMemoryCorridorLevel(int levelId, bool isWin, List <int> battleTreasures)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_FinishedMemoryCorridorLevelInt32BooleanList ` 1_hotfix != null)
            {
                return(Convert.ToInt32(this.m_FinishedMemoryCorridorLevelInt32BooleanList ` 1_hotfix.call(new object[]
                {
                    this,
                    levelId,
                    isWin,
                    battleTreasures
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataMemoryCorridorLevelInfo configDataMemoryCorridorLevelInfo = this.m_configDataLoader.GetConfigDataMemoryCorridorLevelInfo(levelId);

            if (configDataMemoryCorridorLevelInfo == null)
            {
                this.m_battle.FightFinished(GameFunctionStatus.Error, false, true);
                return(-2801);
            }
            if (isWin)
            {
                List <int> pveTeam = this.m_battle.GetPveTeam();
                this.SetSuccessMemoryCorridorLevel(configDataMemoryCorridorLevelInfo, battleTreasures, pveTeam, false);
            }
            this.m_battle.FightFinished(GameFunctionStatus.End, isWin, true);
            return(0);
        }
Beispiel #7
0
        // Token: 0x0600736E RID: 29550 RVA: 0x001FE228 File Offset: 0x001FC428
        public bool IsMemoryCorridorLevelOpened(int levelId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsMemoryCorridorLevelOpenedInt32_hotfix != null)
            {
                return(Convert.ToBoolean(this.m_IsMemoryCorridorLevelOpenedInt32_hotfix.call(new object[]
                {
                    this,
                    levelId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataMemoryCorridorLevelInfo configDataMemoryCorridorLevelInfo = this.m_configDataLoader.GetConfigDataMemoryCorridorLevelInfo(levelId);

            return(configDataMemoryCorridorLevelInfo != null && this.m_basicInfo.GetLevel() >= configDataMemoryCorridorLevelInfo.OpenPlayerLevel);
        }
        // Token: 0x0600446D RID: 17517 RVA: 0x0014AD40 File Offset: 0x00148F40
        private int CanOpenLevel(int levelId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanOpenLevelInt32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanOpenLevelInt32_hotfix.call(new object[]
                {
                    this,
                    levelId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (!this.IsGameFunctionOpened())
            {
                return(-2805);
            }
            ConfigDataMemoryCorridorLevelInfo levelInfo = this.m_configDataLoader.GetConfigDataMemoryCorridorLevelInfo(levelId);

            if (levelInfo == null)
            {
                return(-2801);
            }
            if (levelInfo.m_battleInfo == null)
            {
                return(-2802);
            }
            int dayOfWeek = (int)this.m_basicInfo.GetCurrentTime().DayOfWeek;
            int key       = (dayOfWeek != 0) ? dayOfWeek : 7;
            List <ConfigDataMemoryCorridorInfo> list;

            if (!this.m_configDataLoader.MemoryCorridorData.MemoryCorridorOfWeekDict.TryGetValue(key, out list))
            {
                return(-2804);
            }
            if (list.Find((ConfigDataMemoryCorridorInfo t) => t.ID == levelInfo.m_groupInfo.ID) == null)
            {
                return(-2803);
            }
            int level = this.m_basicInfo.GetLevel();

            if (level < levelInfo.OpenPlayerLevel)
            {
                return(-413);
            }
            return(0);
        }
 // Token: 0x0600446F RID: 17519 RVA: 0x0014AF94 File Offset: 0x00149194
 protected void SetCommonSuccessMemoryCorridorLevel(ConfigDataMemoryCorridorLevelInfo levelInfo, List <int> battleTreasures, List <int> heroes, int energyCost, bool isBattleTeam)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetCommonSuccessMemoryCorridorLevelConfigDataMemoryCorridorLevelInfoList ` 1List ` 1Int32Boolean_hotfix != null)
     {
         this.m_SetCommonSuccessMemoryCorridorLevelConfigDataMemoryCorridorLevelInfoList ` 1List ` 1Int32Boolean_hotfix.call(new object[]
         {
             this,
             levelInfo,
             battleTreasures,
             heroes,
             energyCost,
             isBattleTeam
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
     this.m_battle.AddBattleTreasures(battleTreasures);
     this.m_basicInfo.AddPlayerExp(levelInfo.PlayerExp);
     this.m_battle.AddFightHeroFightNumsAndExp(heroes, levelInfo.HeroExp);
     this.m_basicInfo.AddGold(levelInfo.Gold, GameFunctionType.GameFunctionType_MemoryCorridor, levelInfo.ID.ToString());
     if (levelInfo.TicketCost > 0)
     {
         int         ticketId = this.m_bag.GetTicketId(GameFunctionType.GameFunctionType_MemoryCorridor);
         BagItemBase bagItem  = this.m_bag.FindBagItemByType(GoodsType.GoodsType_Item, ticketId);
         this.m_bag.RemoveBagItemDirectly(bagItem, levelInfo.TicketCost, GameFunctionType.GameFunctionType_MemoryCorridor, levelInfo.ID.ToString());
     }
     if (energyCost > 0)
     {
         this.m_basicInfo.DecreaseEnergy(energyCost, GameFunctionType.GameFunctionType_MemoryCorridor, levelInfo.ID.ToString());
     }
     this.m_battle.WinPveBattle(levelInfo.Battle_ID);
     if (!isBattleTeam)
     {
         this.m_memoryCorridorDS.AddFinishedLevel(levelInfo.ID);
     }
     if (this.IsDailyChallenge())
     {
         this.AddChallengedNums(1);
     }
     if (this.CompleteMemoryCorridorMissionEvent != null)
     {
         this.CompleteMemoryCorridorMissionEvent(BattleType.MemoryCorridor, levelInfo.ID, heroes);
     }
 }
        // Token: 0x06011F82 RID: 73602 RVA: 0x004A3EF0 File Offset: 0x004A20F0
        private void MemoryCorridorUIController_OnStartMemoryCorridorLevel(ConfigDataMemoryCorridorLevelInfo levelInfo)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_MemoryCorridorUIController_OnStartMemoryCorridorLevelConfigDataMemoryCorridorLevelInfo_hotfix != null)
            {
                this.m_MemoryCorridorUIController_OnStartMemoryCorridorLevelConfigDataMemoryCorridorLevelInfo_hotfix.call(new object[]
                {
                    this,
                    levelInfo
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            int num = projectLPlayerContext.CanAttackMemoryCorridorLevel(levelInfo.ID);

            if (num == 0)
            {
                WorldUITask.StartBattleHappening(BattleType.MemoryCorridor, levelInfo.ID);
            }
            else
            {
                WorldUITask.HandleAttackFailResult(num, this.m_currIntent);
            }
        }
 // Token: 0x06011FD5 RID: 73685 RVA: 0x004A4830 File Offset: 0x004A2A30
 public void MemoryCorridorUIController_OnStartMemoryCorridorLevel(ConfigDataMemoryCorridorLevelInfo levelInfo)
 {
     this.m_owner.MemoryCorridorUIController_OnStartMemoryCorridorLevel(levelInfo);
 }
 // Token: 0x06004495 RID: 17557 RVA: 0x0014BD84 File Offset: 0x00149F84
 public void SetCommonSuccessMemoryCorridorLevel(ConfigDataMemoryCorridorLevelInfo levelInfo, List <int> battleTreasures, List <int> heroes, int energyCost, bool isBattleTeam)
 {
     this.m_owner.SetCommonSuccessMemoryCorridorLevel(levelInfo, battleTreasures, heroes, energyCost, isBattleTeam);
 }
 // Token: 0x06004494 RID: 17556 RVA: 0x0014BD74 File Offset: 0x00149F74
 public int CanAttackLevelByEnergyAndSoOn(ConfigDataMemoryCorridorLevelInfo levelInfo, bool isTeamBattle)
 {
     return(this.m_owner.CanAttackLevelByEnergyAndSoOn(levelInfo, isTeamBattle));
 }
Beispiel #14
0
        // Token: 0x0600403F RID: 16447 RVA: 0x0012AAF0 File Offset: 0x00128CF0
        public int CanPostLevelDanmaku(int gameFunctionTypeId, int locationId, List <PostDanmakuEntry> entries)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanPostLevelDanmakuInt32Int32List ` 1_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanPostLevelDanmakuInt32Int32List ` 1_hotfix.call(new object[]
                {
                    this,
                    gameFunctionTypeId,
                    locationId,
                    entries
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int battle_ID;

            switch (gameFunctionTypeId)
            {
            case 9:
            {
                ConfigDataRiftLevelInfo configDataRiftLevelInfo = this.m_configDataLoader.GetConfigDataRiftLevelInfo(locationId);
                if (configDataRiftLevelInfo == null)
                {
                    return(-2701);
                }
                battle_ID = configDataRiftLevelInfo.Battle_ID;
                break;
            }

            case 10:
            {
                ConfigDataScenarioInfo configDataScenarioInfo = this.m_configDataLoader.GetConfigDataScenarioInfo(locationId);
                if (configDataScenarioInfo == null)
                {
                    return(-2701);
                }
                battle_ID = configDataScenarioInfo.Battle_ID;
                break;
            }

            case 11:
            {
                ConfigDataEventInfo configDataEventInfo = this.m_configDataLoader.GetConfigDataEventInfo(locationId);
                if (configDataEventInfo == null)
                {
                    return(-2701);
                }
                battle_ID = configDataEventInfo.Battle_ID;
                break;
            }

            case 12:
            {
                ConfigDataAnikiLevelInfo configDataAnikiLevelInfo = this.m_configDataLoader.GetConfigDataAnikiLevelInfo(locationId);
                if (configDataAnikiLevelInfo == null)
                {
                    return(-2701);
                }
                battle_ID = configDataAnikiLevelInfo.Battle_ID;
                break;
            }

            case 13:
            {
                ConfigDataThearchyTrialLevelInfo configDataThearchyTrialLevelInfo = this.m_configDataLoader.GetConfigDataThearchyTrialLevelInfo(locationId);
                if (configDataThearchyTrialLevelInfo == null)
                {
                    return(-2701);
                }
                battle_ID = configDataThearchyTrialLevelInfo.Battle_ID;
                break;
            }

            default:
                if (gameFunctionTypeId != 41)
                {
                    if (gameFunctionTypeId != 42)
                    {
                        if (gameFunctionTypeId != 56)
                        {
                            if (gameFunctionTypeId != 57)
                            {
                                if (gameFunctionTypeId != 79)
                                {
                                    if (gameFunctionTypeId != 80)
                                    {
                                        if (gameFunctionTypeId != 28)
                                        {
                                            if (gameFunctionTypeId != 51)
                                            {
                                                return(-2700);
                                            }
                                            ConfigDataHeroTrainningLevelInfo configDataHeroTrainningLevelInfo = this.m_configDataLoader.GetConfigDataHeroTrainningLevelInfo(locationId);
                                            if (configDataHeroTrainningLevelInfo == null)
                                            {
                                                return(-2701);
                                            }
                                            battle_ID = configDataHeroTrainningLevelInfo.Battle_ID;
                                        }
                                        else
                                        {
                                            ConfigDataHeroDungeonLevelInfo configDataHeroDungeonLevelInfo = this.m_configDataLoader.GetConfigDataHeroDungeonLevelInfo(locationId);
                                            if (configDataHeroDungeonLevelInfo == null)
                                            {
                                                return(-2701);
                                            }
                                            battle_ID = configDataHeroDungeonLevelInfo.Battle_ID;
                                        }
                                    }
                                    else
                                    {
                                        ConfigDataScoreLevelInfo configDataScoreLevelInfo = this.m_configDataLoader.GetConfigDataScoreLevelInfo(locationId);
                                        if (configDataScoreLevelInfo == null)
                                        {
                                            return(-2701);
                                        }
                                        battle_ID = configDataScoreLevelInfo.Battle_ID;
                                    }
                                }
                                else
                                {
                                    ConfigDataChallengeLevelInfo configDataChallengeLevelInfo = this.m_configDataLoader.GetConfigDataChallengeLevelInfo(locationId);
                                    if (configDataChallengeLevelInfo == null)
                                    {
                                        return(-2701);
                                    }
                                    battle_ID = configDataChallengeLevelInfo.Battle_ID;
                                }
                            }
                            else
                            {
                                ConfigDataCooperateBattleLevelInfo configDataCooperateBattleLevelInfo = this.m_configDataLoader.GetConfigDataCooperateBattleLevelInfo(locationId);
                                if (configDataCooperateBattleLevelInfo == null)
                                {
                                    return(-2701);
                                }
                                battle_ID = configDataCooperateBattleLevelInfo.Battle_ID;
                            }
                        }
                        else
                        {
                            ConfigDataHeroPhantomLevelInfo configDataHeroPhantomLevelInfo = this.m_configDataLoader.GetConfigDataHeroPhantomLevelInfo(locationId);
                            if (configDataHeroPhantomLevelInfo == null)
                            {
                                return(-2701);
                            }
                            battle_ID = configDataHeroPhantomLevelInfo.Battle_ID;
                        }
                    }
                    else
                    {
                        ConfigDataMemoryCorridorLevelInfo configDataMemoryCorridorLevelInfo = this.m_configDataLoader.GetConfigDataMemoryCorridorLevelInfo(locationId);
                        if (configDataMemoryCorridorLevelInfo == null)
                        {
                            return(-2701);
                        }
                        battle_ID = configDataMemoryCorridorLevelInfo.Battle_ID;
                    }
                }
                else
                {
                    ConfigDataTreasureLevelInfo configDataTreasureLevelInfo = this.m_configDataLoader.GetConfigDataTreasureLevelInfo(locationId);
                    if (configDataTreasureLevelInfo == null)
                    {
                        return(-2701);
                    }
                    battle_ID = configDataTreasureLevelInfo.Battle_ID;
                }
                break;
            }
            ConfigDataBattleInfo configDataBattleInfo = this.m_configDataLoader.GetConfigDataBattleInfo(battle_ID);
            int num = 0;

            foreach (PostDanmakuEntry postDanmakuEntry in entries)
            {
                if (postDanmakuEntry.Turn > configDataBattleInfo.TurnMax)
                {
                    return(-2702);
                }
                if (postDanmakuEntry.Turn <= num)
                {
                    return(-2703);
                }
                num = postDanmakuEntry.Turn;
            }
            return(0);
        }
Beispiel #15
0
 // Token: 0x0600737A RID: 29562 RVA: 0x001FE354 File Offset: 0x001FC554
 private void __callBase_SetCommonSuccessMemoryCorridorLevel(ConfigDataMemoryCorridorLevelInfo levelInfo, List <int> battleTreasures, List <int> heroes, int energyCost, bool isBattleTeam)
 {
     base.SetCommonSuccessMemoryCorridorLevel(levelInfo, battleTreasures, heroes, energyCost, isBattleTeam);
 }