// Token: 0x06007795 RID: 30613 RVA: 0x0020A270 File Offset: 0x00208470
        public void SetSuccessThearchyTrialLevel(ConfigDataThearchyTrialLevelInfo levelInfo, List <int> battleTreasures, List <int> heroes, bool isTeamBattle = false)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetSuccessThearchyTrialLevelConfigDataThearchyTrialLevelInfoList ` 1List ` 1Boolean_hotfix != null)
            {
                this.m_SetSuccessThearchyTrialLevelConfigDataThearchyTrialLevelInfoList ` 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;
            }
            this.SetCommonSuccessThearchyTrialLevel(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;
        }
示例#2
0
        // Token: 0x0600493A RID: 18746 RVA: 0x0016CB4C File Offset: 0x0016AD4C
        public int AttackThearchyTrialLevel(int levelId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_AttackThearchyTrialLevelInt32_hotfix != null)
            {
                return(Convert.ToInt32(this.m_AttackThearchyTrialLevelInt32_hotfix.call(new object[]
                {
                    this,
                    levelId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int num = this.CanAttackThearchyTrialLevel(levelId, false);

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

            this.m_basicInfo.DecreaseEnergy(configDataThearchyTrialLevelInfo.EnergyFail, GameFunctionType.GameFunctionType_ThearchyTrial, levelId.ToString());
            this.m_battle.SetProcessingBattleInfo(BattleType.ThearchyTrial, levelId);
            return(0);
        }
        // Token: 0x06007794 RID: 30612 RVA: 0x0020A180 File Offset: 0x00208380
        public int FinishedThearchyTrialLevel(int levelId, bool isWin, List <int> battleTreasures)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_FinishedThearchyTrialLevelInt32BooleanList ` 1_hotfix != null)
            {
                return(Convert.ToInt32(this.m_FinishedThearchyTrialLevelInt32BooleanList ` 1_hotfix.call(new object[]
                {
                    this,
                    levelId,
                    isWin,
                    battleTreasures
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataThearchyTrialLevelInfo configDataThearchyTrialLevelInfo = this.m_configDataLoader.GetConfigDataThearchyTrialLevelInfo(levelId);

            if (configDataThearchyTrialLevelInfo == null)
            {
                this.m_battle.FightFinished(GameFunctionStatus.Error, false, true);
                return(-1801);
            }
            if (isWin)
            {
                List <int> pveTeam = this.m_battle.GetPveTeam();
                this.SetSuccessThearchyTrialLevel(configDataThearchyTrialLevelInfo, battleTreasures, pveTeam, false);
            }
            this.m_battle.FightFinished(GameFunctionStatus.End, isWin, true);
            return(0);
        }
示例#4
0
        // Token: 0x0600493F RID: 18751 RVA: 0x0016CF60 File Offset: 0x0016B160
        protected int CanAttackLevelByEnergyAndSoOn(ConfigDataThearchyTrialLevelInfo levelInfo, bool isTeamBattle)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanAttackLevelByEnergyAndSoOnConfigDataThearchyTrialLevelInfoBoolean_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanAttackLevelByEnergyAndSoOnConfigDataThearchyTrialLevelInfoBoolean_hotfix.call(new object[]
                {
                    this,
                    levelInfo,
                    isTeamBattle
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            int ticketId = this.m_bag.GetTicketId(GameFunctionType.GameFunctionType_ThearchyTrial);

            if (!this.m_bag.IsBagItemEnough(GoodsType.GoodsType_Item, ticketId, levelInfo.TicketCost))
            {
                return(-1808);
            }
            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);
        }
示例#5
0
        // Token: 0x0600493D RID: 18749 RVA: 0x0016CD34 File Offset: 0x0016AF34
        public virtual int CanAttackThearchyTrialLevel(int levelId, bool isTeamBattle = false)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CanAttackThearchyTrialLevelInt32Boolean_hotfix != null)
            {
                return(Convert.ToInt32(this.m_CanAttackThearchyTrialLevelInt32Boolean_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);
            }
            ConfigDataThearchyTrialLevelInfo configDataThearchyTrialLevelInfo = this.m_configDataLoader.GetConfigDataThearchyTrialLevelInfo(levelId);

            return(this.CanAttackLevelByEnergyAndSoOn(configDataThearchyTrialLevelInfo, isTeamBattle));
        }
示例#6
0
        // Token: 0x060142BC RID: 82620 RVA: 0x00522C24 File Offset: 0x00520E24
        public void SetThearchyLevelInfo(ConfigDataThearchyTrialLevelInfo levelInfo)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetThearchyLevelInfoConfigDataThearchyTrialLevelInfo_hotfix != null)
            {
                this.m_SetThearchyLevelInfoConfigDataThearchyTrialLevelInfo_hotfix.call(new object[]
                {
                    this,
                    levelInfo
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.m_thearchyLevelInfo       = 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, false);
        }
        // Token: 0x06007797 RID: 30615 RVA: 0x0020A45C File Offset: 0x0020865C
        public bool IsThearchyLevelOpened(int levelId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsThearchyLevelOpenedInt32_hotfix != null)
            {
                return(Convert.ToBoolean(this.m_IsThearchyLevelOpenedInt32_hotfix.call(new object[]
                {
                    this,
                    levelId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataThearchyTrialLevelInfo configDataThearchyTrialLevelInfo = this.m_configDataLoader.GetConfigDataThearchyTrialLevelInfo(levelId);

            return(configDataThearchyTrialLevelInfo != null && (configDataThearchyTrialLevelInfo.PreLevel == 0 || this.m_thearchyTrial.IsLevelFinished(configDataThearchyTrialLevelInfo.PreLevel)));
        }
    public static int GetThearchyLevelInfo(IntPtr l)
    {
        int result;

        try
        {
            ThearchyLevelListItemUIController thearchyLevelListItemUIController = (ThearchyLevelListItemUIController)LuaObject.checkSelf(l);
            ConfigDataThearchyTrialLevelInfo  thearchyLevelInfo = thearchyLevelListItemUIController.GetThearchyLevelInfo();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, thearchyLevelInfo);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
示例#9
0
 // Token: 0x06004940 RID: 18752 RVA: 0x0016D05C File Offset: 0x0016B25C
 protected virtual void SetCommonSuccessThearchyTrialLevel(ConfigDataThearchyTrialLevelInfo levelInfo, List <int> battleTreasures, List <int> heroes, int energyCost, bool isBattleTeam)
 {
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetCommonSuccessThearchyTrialLevelConfigDataThearchyTrialLevelInfoList ` 1List ` 1Int32Boolean_hotfix != null)
     {
         this.m_SetCommonSuccessThearchyTrialLevelConfigDataThearchyTrialLevelInfoList ` 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_ThearchyTrial, levelInfo.ID.ToString());
     if (levelInfo.TicketCost > 0)
     {
         int         ticketId = this.m_bag.GetTicketId(GameFunctionType.GameFunctionType_ThearchyTrial);
         BagItemBase bagItem  = this.m_bag.FindBagItemByType(GoodsType.GoodsType_Item, ticketId);
         this.m_bag.RemoveBagItemDirectly(bagItem, levelInfo.TicketCost, GameFunctionType.GameFunctionType_ThearchyTrial, levelInfo.ID.ToString());
     }
     if (energyCost > 0)
     {
         this.m_basicInfo.DecreaseEnergy(energyCost, GameFunctionType.GameFunctionType_ThearchyTrial, levelInfo.ID.ToString());
     }
     this.m_battle.WinPveBattle(levelInfo.Battle_ID);
     if (this.IsDailyChallenge())
     {
         this.AddChallengedNums(1);
     }
     if (!isBattleTeam)
     {
         this.m_thearchyTrial.AddFinishedLevel(levelInfo.ID);
     }
     if (this.CompleteThearchyTrialMissionEvent != null)
     {
         this.CompleteThearchyTrialMissionEvent(BattleType.ThearchyTrial, levelInfo.ID, heroes);
     }
 }
示例#10
0
        // Token: 0x0600493E RID: 18750 RVA: 0x0016CDFC File Offset: 0x0016AFFC
        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(-1809);
            }
            ConfigDataThearchyTrialLevelInfo levelInfo = this.m_configDataLoader.GetConfigDataThearchyTrialLevelInfo(levelId);

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

            if (!this.m_configDataLoader.ThearchyTrialData.ThearchyTrailOfWeekDict.TryGetValue(key, out list))
            {
                return(-1800);
            }
            if (list.Find((ConfigDataThearchyTrialInfo t) => t.ID == levelInfo.m_groupInfo.ID) == null)
            {
                return(-1802);
            }
            if (levelInfo.PreLevel != 0 && !this.m_thearchyTrial.IsLevelFinished(levelInfo.PreLevel))
            {
                return(-1803);
            }
            return(0);
        }
示例#11
0
        // Token: 0x06014308 RID: 82696 RVA: 0x00524100 File Offset: 0x00522300
        private void ThearchyUIController_OnStartThearchyLevel(ConfigDataThearchyTrialLevelInfo levelInfo)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_ThearchyUIController_OnStartThearchyLevelConfigDataThearchyTrialLevelInfo_hotfix != null)
            {
                this.m_ThearchyUIController_OnStartThearchyLevelConfigDataThearchyTrialLevelInfo_hotfix.call(new object[]
                {
                    this,
                    levelInfo
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            int num = projectLPlayerContext.CanAttackThearchyLevel(levelInfo.ID);

            if (num == 0)
            {
                WorldUITask.StartBattleHappening(BattleType.ThearchyTrial, levelInfo.ID);
            }
            else
            {
                WorldUITask.HandleAttackFailResult(num, this.m_currIntent);
            }
        }
 // Token: 0x060077B8 RID: 30648 RVA: 0x0020A8CC File Offset: 0x00208ACC
 public void __callBase_SetCommonSuccessThearchyTrialLevel(ConfigDataThearchyTrialLevelInfo levelInfo, List <int> battleTreasures, List <int> heroes, int energyCost, bool isBattleTeam)
 {
     this.m_owner.__callBase_SetCommonSuccessThearchyTrialLevel(levelInfo, battleTreasures, heroes, energyCost, isBattleTeam);
 }
 // Token: 0x060077B7 RID: 30647 RVA: 0x0020A8BC File Offset: 0x00208ABC
 public int __callBase_CanAttackLevelByEnergyAndSoOn(ConfigDataThearchyTrialLevelInfo levelInfo, bool isTeamBattle)
 {
     return(this.m_owner.__callBase_CanAttackLevelByEnergyAndSoOn(levelInfo, isTeamBattle));
 }
 // Token: 0x060077A3 RID: 30627 RVA: 0x0020A598 File Offset: 0x00208798
 private int __callBase_CanAttackLevelByEnergyAndSoOn(ConfigDataThearchyTrialLevelInfo levelInfo, bool isTeamBattle)
 {
     return(base.CanAttackLevelByEnergyAndSoOn(levelInfo, isTeamBattle));
 }
示例#15
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);
        }
示例#16
0
 // Token: 0x0601435A RID: 82778 RVA: 0x005249F8 File Offset: 0x00522BF8
 public void ThearchyUIController_OnStartThearchyLevel(ConfigDataThearchyTrialLevelInfo levelInfo)
 {
     this.m_owner.ThearchyUIController_OnStartThearchyLevel(levelInfo);
 }