Пример #1
0
        public bool Reset(int LevelID, bool bMultiGame)
        {
            this.Clear();
            ResDT_LevelCommonInfo outLevelComInfo = null;

            if (bMultiGame)
            {
                outLevelComInfo = CLevelCfgLogicManager.FindLevelConfigMultiGame(LevelID);
            }
            else
            {
                ResLevelCfgInfo outLevelCfg = null;
                CLevelCfgLogicManager.FindLevelConfigSingleGame(LevelID, out outLevelCfg, out outLevelComInfo);
            }
            bool flag = false;

            if (outLevelComInfo != null)
            {
                this.CurLevelTimeDuration = outLevelComInfo.dwTimeDuration;
                if (outLevelComInfo.dwAddWinCondStarId != 0)
                {
                    ResEvaluateStarInfo dataByKey = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(outLevelComInfo.dwAddWinCondStarId);
                    DebugHelper.Assert(dataByKey != null);
                    if (dataByKey != null)
                    {
                        this.WinnerEvaluation = this.CreateStar(dataByKey);
                        DebugHelper.Assert(this.WinnerEvaluation != null, "我擦,怎会没有?");
                        flag = true;
                    }
                }
                if (outLevelComInfo.dwAddLoseCondStarId != 0)
                {
                    ResEvaluateStarInfo conditionDetail = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(outLevelComInfo.dwAddLoseCondStarId);
                    DebugHelper.Assert(conditionDetail != null);
                    if (conditionDetail != null)
                    {
                        this.LoserEvaluation = this.CreateStar(conditionDetail);
                        DebugHelper.Assert(this.LoserEvaluation != null, "我擦,怎会没有?");
                        flag = true;
                    }
                }
            }
            return(flag);
        }
Пример #2
0
        public override void Init()
        {
            base.Init();
            this.talentSystem = new TalentSystem();
            this.talentSystem.Init(base.actorPtr);
            this.stSkillStat = new CSkillStat();
            if (this.stSkillStat != null)
            {
                this.stSkillStat.Initialize(base.actorPtr);
                this.InitRandomSkill();
                IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

                IGameActorDataProvider provider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

                ActorStaticSkillData skillData = new ActorStaticSkillData();
                for (int i = 0; i < 7; i++)
                {
                    ResDT_LevelCommonInfo info4;
                    if (i == 6)
                    {
                        SLevelContext context = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                        if (context.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_GUIDE)
                        {
                            if (context.iLevelID == CBattleGuideManager.GuideLevelID5v5)
                            {
                                goto Label_00DF;
                            }
                            continue;
                        }
                        ResDT_LevelCommonInfo info = null;
                        info = CLevelCfgLogicManager.FindLevelConfigMultiGame(context.iLevelID);
                        if ((info == null) || (info.bMaxAcntNum != 10))
                        {
                            continue;
                        }
                    }
Label_00DF:
                    if (((i != 4) && (i != 6)) || (base.actor.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero))
                    {
                        goto Label_0284;
                    }
                    SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                    if (curLvelContext == null)
                    {
                        continue;
                    }
                    int iLevelID = curLvelContext.iLevelID;
                    if (iLevelID <= 0)
                    {
                        continue;
                    }
                    if (Singleton <LobbyLogic> .instance.inMultiGame)
                    {
                        goto Label_0214;
                    }
                    ResLevelCfgInfo       outLevelCfg     = null;
                    ResDT_LevelCommonInfo outLevelComInfo = null;
                    CLevelCfgLogicManager.FindLevelConfigSingleGame(iLevelID, out outLevelCfg, out outLevelComInfo);
                    if (outLevelComInfo == null)
                    {
                        goto Label_01AD;
                    }
                    int iExtraSkillId = outLevelComInfo.iExtraSkillId;
                    if (i == 6)
                    {
                        iExtraSkillId = outLevelComInfo.iExtraSkill2Id;
                        if (iExtraSkillId > 0)
                        {
                            goto Label_0185;
                        }
                        continue;
                    }
                    this.CreateTalent(outLevelComInfo.iExtraPassiveSkillId);
Label_0185:
                    this.InitSkillSlot(i, iExtraSkillId, 0);
                    SkillSlot slot = this.SkillSlotArray[i];
                    if (slot != null)
                    {
                        slot.SetSkillLevel(1);
                    }
                    continue;
Label_01AD:
                    if (outLevelCfg == null)
                    {
                        continue;
                    }
                    int num4 = outLevelCfg.iExtraSkillId;
                    if (i == 6)
                    {
                        num4 = outLevelCfg.iExtraSkill2Id;
                        if (num4 > 0)
                        {
                            goto Label_01EC;
                        }
                        continue;
                    }
                    this.CreateTalent(outLevelCfg.iExtraPassiveSkillId);
Label_01EC:
                    this.InitSkillSlot(i, num4, 0);
                    SkillSlot slot2 = this.SkillSlotArray[i];
                    if (slot2 != null)
                    {
                        slot2.SetSkillLevel(1);
                    }
                    continue;
Label_0214:
                    info4 = CLevelCfgLogicManager.FindLevelConfigMultiGame(iLevelID);
                    if (info4 == null)
                    {
                        continue;
                    }
                    int num5 = info4.iExtraSkillId;
                    if (i == 6)
                    {
                        num5 = info4.iExtraSkill2Id;
                        if (num5 > 0)
                        {
                            goto Label_025C;
                        }
                        continue;
                    }
                    this.CreateTalent(info4.iExtraPassiveSkillId);
Label_025C:
                    this.InitSkillSlot(i, num5, 0);
                    SkillSlot slot3 = this.SkillSlotArray[i];
                    if (slot3 != null)
                    {
                        slot3.SetSkillLevel(1);
                    }
                    continue;
Label_0284:
                    if (actorDataProvider.GetActorStaticSkillData(ref base.actor.TheActorMeta, (ActorSkillSlot)i, ref skillData))
                    {
                        this.InitSkillSlot(i, skillData.SkillId, skillData.PassiveSkillId);
                        if (((i > 3) || (i < 1)) || (!Singleton <BattleLogic> .GetInstance().m_GameInfo.gameContext.IsSoulGrow() || (base.actor.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)))
                        {
                            SkillSlot slot4 = this.SkillSlotArray[i];
                            if (slot4 != null)
                            {
                                slot4.SetSkillLevel(1);
                            }
                        }
                    }
                }
                uint skillID = 0;
                if (provider2.GetActorServerCommonSkillData(ref base.actor.TheActorMeta, out skillID))
                {
                    int num7 = 5;
                    if (skillID != 0)
                    {
                        this.InitSkillSlot(num7, (int)skillID, 0);
                        SkillSlot slot5 = this.SkillSlotArray[num7];
                        if (slot5 != null)
                        {
                            slot5.SetSkillLevel(1);
                        }
                    }
                }
                if (base.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    this.SkillUseCache = new SkillCache();
                }
            }
        }