Exemplo n.º 1
0
        /// <summary>
        /// 保存战斗结果的数据
        /// </summary>
        /// <param name="battleResp">Battle resp.</param>
        private void storeWarResult(BattleResponse battleResp)
        {
            //把服务器过来的战斗结算消息赋值
            TemporyData        temp  = Core.Data.temper;
            NewDungeonsManager ddMgr = Core.Data.newDungeonsManager;

            if (temp.warBattle == null)
            {
                temp.warBattle = new BattleSequence()
                {
                    //战斗同步数据
                    sync = battleResp.data.sync,
                    // 系统奖励
                    reward = battleResp.data.reward,
                    // 掠夺奖励
                    ext = battleResp.data.ext,
                    //赌博结果
                    gambleResult = battleResp.data.gambleResult,
                    //雷达组队神秘大奖
                    radarReward = battleResp.data.radarReward,
                    //战斗序列
                    battleData = battleResp.data.battleData,
                    //PVE活动副本倒计时
                    explorDoors = battleResp.data.explorDoors,
                    //已打通的次数
                    passCount = battleResp.data.passCount,
                    //连击
                    comboReward = battleResp.data.comboReward,
                };
            }
            else
            {
                //战斗同步数据
                temp.warBattle.sync = battleResp.data.sync;
                // 系统奖励
                temp.warBattle.reward = battleResp.data.reward;
                // 掠夺奖励
                temp.warBattle.ext = battleResp.data.ext;
                //赌博结果
                temp.warBattle.gambleResult = battleResp.data.gambleResult;
                //雷达组队神秘大奖
                temp.warBattle.radarReward = battleResp.data.radarReward;
                // 战斗序列
                temp.warBattle.battleData.stars = battleResp.data.battleData.stars;
                //技能副本的引导需要这个值
                temp.warBattle.battleData.isfirst = battleResp.data.battleData.isfirst;

                temp.warBattle.explorDoors = battleResp.data.explorDoors;
                //已打通的次数
                temp.warBattle.passCount = battleResp.data.passCount;
                //连击
                temp.warBattle.comboReward = battleResp.data.comboReward;
            }

            //PVE活动副本倒计时
            if (battleResp.data.explorDoors != null)
            {
                ddMgr.explorDoors = battleResp.data.explorDoors;
            }

            //保存pvp挑战次数
            NewFloor floor = ddMgr.GetFloorData(ddMgr.curFightingFloor.config.ID);

            if (floor != null)
            {
                floor.passTimes = battleResp.data.passCount;
            }
        }
Exemplo n.º 2
0
    void OnEnable()
    {
        if(Instance == null)Instance = this;

        //初始化特殊副本是否解锁
        NewDungeonsManager newDM = Core.Data.newDungeonsManager;
        ExploreConfigData exploreConfig = newDM.GetExploreData (3);
        PVEType_Exp.isLock = (newDM.lastFloorId < exploreConfig.openfloor);

        string strText = Core.Data.stringManager.getString (9095);
        NewFloor floor = newDM.GetFloorData (exploreConfig.openfloor);
        if(floor != null)
        {
            int chapID = floor.BelongChapterID % 30000 / 100;
            string strLock = string.Format (strText, RED.GetChineseNum(chapID));
            PVEType_Exp.SetLockTxt (strLock);
        }

        exploreConfig = newDM.GetExploreData (1);
        PVEType_Skill.isLock = (newDM.lastFloorId < exploreConfig.openfloor);
        floor = newDM.GetFloorData (exploreConfig.openfloor);
        if(floor != null)
        {
            int chapID = floor.BelongChapterID % 30000 / 100;
            string strLock = string.Format (strText, RED.GetChineseNum(chapID));
            PVEType_Skill.SetLockTxt (strLock);
        }

        exploreConfig = newDM.GetExploreData (2);
        PVEType_FightSoul.isLock = (newDM.lastFloorId < exploreConfig.openfloor);
        floor = newDM.GetFloorData (exploreConfig.openfloor);
        if(floor != null)
        {
            int chapID = floor.BelongChapterID % 30000 / 100;
            string strLock = string.Format (strText, RED.GetChineseNum(chapID));
            PVEType_FightSoul.SetLockTxt (strLock);
        }

        JCPVETimerManager m = JCPVETimerManager.Instance;
        NewDungeonsManager dm = Core.Data.newDungeonsManager;
        int SkillCount = 0;
        int SkillPassCount = 2;
        int FightCount = 0;
        int FightPassCount = 2;
        if(dm.explorDoors!= null)
        {
            //技能副本
            if(dm.explorDoors.skill != null)
            {
                SkillPassCount = dm.explorDoors.skill.passCount;
                SkillCount = dm.explorDoors.skill.count;
                if(SkillPassCount < SkillCount)
                {
                     m.SkillFBCoding = SkillFBCoding;
                     SkillFBCoding(Core.Data.temper.SkillDJS);
                    if(!JCPVETimerManager.Instance.isSkillFBCoding)
                        PVEType_Skill.SetProgress(SkillPassCount,SkillCount,dm.explorDoors.skill.needStone);
                }
               else
                    PVEType_Skill.SetProgress(SkillPassCount,SkillCount,dm.explorDoors.skill.needStone);

            }
            //战魂副本
            if(dm.explorDoors.souls != null)
            {
                FightCount = dm.explorDoors.souls.count;
                FightPassCount = dm.explorDoors.souls.passCount;
                if(FightPassCount < FightCount)
                {
                     m.FightSoulFBCoding = FightSoulFBCoding;
                     FightSoulFBCoding(Core.Data.temper.FightSoulDJS);
                    if(!JCPVETimerManager.Instance.isFightSoulFBCoding)
                        PVEType_FightSoul.SetProgress(FightPassCount,FightCount,dm.explorDoors.souls.needStone);
                }
               else
                    PVEType_FightSoul.SetProgress(FightPassCount,FightCount,dm.explorDoors.souls.needStone);

            }
            int ExpAndGemCount = 0;
            if(dm.explorDoors.exp != null)
                ExpAndGemCount+=dm.explorDoors.exp.count;
            if(dm.explorDoors.gems != null)
                ExpAndGemCount+=dm.explorDoors.gems.count;

            int ExpAndGemPassCount = 0;
            if(dm.explorDoors.exp != null)
                ExpAndGemPassCount+=dm.explorDoors.exp.passCount;
            if(dm.explorDoors.gems != null)
                ExpAndGemPassCount+=dm.explorDoors.gems.passCount;

            PVEType_Exp.SetProgress2(ExpAndGemPassCount.ToString()+"/"+ExpAndGemCount.ToString());
        }
    }