private void InitGearLevelAchievementProgress(TrackingAchievement achievement)
        {
            PlayerPackageLogic pp = new PlayerPackageLogic();

            pp.SetUser(m_UserId);
            PlayerHeroLogic ph = new PlayerHeroLogic();

            ph.SetUser(m_UserId);
            int       progress = 0;
            GearLogic g        = new GearLogic();

            foreach (var hero in ph.GetHeroList())
            {
                foreach (var gear in hero.Value.Gears)
                {
                    g.SetGear(gear.Value);
                    if (g.MyGear.Level >= achievement.Params[0])
                    {
                        progress++;
                    }
                }
            }
            foreach (var gear in pp.MyPackage.Gears)
            {
                g.SetGear(gear.Key);
                if (g.MyGear.Level >= achievement.Params[0])
                {
                    progress++;
                }
            }
            achievement.Progress = progress;
        }
        private void InitHeroCountProgress(TrackingAchievement achievement)
        {
            PlayerHeroLogic ph = new PlayerHeroLogic();

            ph.SetUser(m_UserId);
            achievement.Progress = ph.GetHeroList().Count;
        }
示例#3
0
        private void SetHeroInfo()
        {
            PlayerHeroLogic playerHeros = new PlayerHeroLogic();

            playerHeros.SetUser(m_UserId);
            CacheDictionary <int, Hero> heros = playerHeros.GetHeroList();

            foreach (var hero in heros)
            {
                PBLobbyHeroInfo heroInfo = new PBLobbyHeroInfo();
                heroInfo.Type               = hero.Key;
                heroInfo.Level              = hero.Value.HeroLv;
                heroInfo.Exp                = hero.Value.HeroExp;
                heroInfo.StarLevel          = hero.Value.HeroStarLevel;
                heroInfo.ConsciousnessLevel = hero.Value.ConsciousnessLevel;
                heroInfo.ElevationLevel     = hero.Value.ElevationLevel;
                heroInfo.SkillLevels.AddRange(hero.Value.SkillLevels);
                heroInfo.SkillExps.AddRange(hero.Value.SkillExps);
                heroInfo.Might = hero.Value.Might;
                foreach (var gear in hero.Value.Gears)
                {
                    if (gear.Value == 0)
                    {
                        continue;
                    }
                    PBGearInfo gearInfo = new PBGearInfo();
                    gearInfo.Id = gear.Value;
                    Gears gearData = CacheSet.GearCache.FindKey(gear.Value);
                    gearInfo.Level           = gearData.Level;
                    gearInfo.StrengthenLevel = gearData.StrengthenLevel;
                    gearInfo.Type            = gearData.TypeId;
                    heroInfo.GearInfo.Add(gearInfo);
                }
                foreach (var soul in hero.Value.Souls)
                {
                    if (soul.Value == 0)
                    {
                        continue;
                    }
                    PBSoulInfo soulInfo = new PBSoulInfo();
                    soulInfo.Id = soul.Value;
                    Souls soulData = CacheSet.SoulCache.FindKey(soul.Value);
                    soulInfo.Type = soulData.TypeId;
                    heroInfo.SoulInfo.Add(soulInfo);
                }
                m_ResponsePacket.LobbyHeroInfo.Add(heroInfo);
            }
        }
示例#4
0
        private void InitHeroStarLevelProgress(TrackingAchievement achievement)
        {
            PlayerHeroLogic ph = new PlayerHeroLogic();

            ph.SetUser(m_UserId);
            int progress = 0;

            foreach (var hero in ph.GetHeroList())
            {
                if (hero.Value.HeroStarLevel >= achievement.Params[0])
                {
                    progress++;
                }
            }
            achievement.Progress = progress;
        }
示例#5
0
        private void InitHeroLevelAchievementProgress(TrackingAchievement achievement)
        {
            PlayerHeroLogic ph = new PlayerHeroLogic();

            ph.SetUser(m_UserId);
            int progress = 0;

            foreach (var hero in ph.GetHeroList())
            {
                if (hero.Value.HeroLv > progress)
                {
                    progress = hero.Value.HeroLv;
                }
            }
            achievement.Progress = progress;
        }