예제 #1
0
        void FillBuffPack(DTOBuffPack buffPack, bool homeFlag, Guid managerId, ArenaTeammemberFrame arenaFrame, List <TeammemberEntity> rawMembers = null, string siteId = "")
        {
            FillBuffPackRaw(buffPack, homeFlag, managerId, arenaFrame, rawMembers, siteId);
            var dicAll = buffPack.GetBuffPlayers(homeFlag);
            var lstOn  = buffPack.GetOnBuffPlayers(homeFlag);

            if (null != dicAll && null != lstOn)
            {
                return;
            }
            var members = buffPack.GetRawMembers(homeFlag);
            var pids    = buffPack.GetOnPids(homeFlag);
            var form    = buffPack.GetSolution(homeFlag);

            dicAll = new Dictionary <Guid, DTOBuffPlayer>(members.Count);
            lstOn  = new List <DTOBuffPlayer>(12);
            int             pid   = 0;
            Guid            tid   = Guid.Empty;
            DicPlayerEntity cfg   = null;
            DTOBuffPlayer   buffP = null;

            int showOrder = 1;

            foreach (var kvp in form.PlayerDic)
            {
                pid = kvp.Key;
                cfg = PlayersdicCache.Instance.GetPlayer(pid);
                if (null == cfg || !pids.TryGetValue(pid, out tid))
                {
                    throw new Exception(string.Format("BuffDataCore:Manager[{0}] Miss Player[{1}] With Config Or Member", managerId, pid));
                }
                buffP             = CreateBuffPlayer(cfg, showOrder++);
                buffP.Pos         = buffP.PosOn = kvp.Value.Position;
                buffP.ActionSkill = kvp.Value.SkillCode;
                dicAll[tid]       = buffP;
                lstOn.Add(buffP);
            }
            foreach (var kvp in members)
            {
                pid = kvp.Value.PlayerId;
                tid = kvp.Key;
                if (dicAll.ContainsKey(tid))
                {
                    continue;
                }
                cfg = PlayersdicCache.Instance.GetPlayer(pid);
                if (null == cfg)
                {
                    continue;
                }
                buffP       = CreateBuffPlayer(cfg, showOrder++, -cfg.Idx);
                dicAll[tid] = buffP;
            }
            buffPack.SetBuffPlayers(homeFlag, dicAll);
            buffPack.SetOnBuffPlayers(homeFlag, lstOn);
        }
예제 #2
0
 void FillBuffPack(DTOBuffPack buffPack, bool homeFlag, Dictionary <Guid, DTOBuffPlayer> buffPlayers)
 {
     if (null == buffPlayers)
     {
         return;
     }
     buffPack.SetBuffPlayers(homeFlag, buffPlayers);
     buffPack.SetOnBuffPlayers(homeFlag, buffPlayers.Values.ToList());
     //buffPack.SetOnPids(homeFlag, buffPlayers.ToDictionary(i => i.Value.Pid, i => i.Key));
 }
예제 #3
0
        public static DTOBuffMemberView GetMemberView(LocalTransferManagerEntity localManager)
        {
            var data = new DTOBuffMemberView();
            //TODO: CombLevel

            var managerSBMList = new List <string>();
            //套装字典 套装id->数量
            var suitDic = new Dictionary <int, int>();
            //套装id->套装类型
            var suitTypeDic = new Dictionary <int, int>();

            var buffPlayers = new Dictionary <Guid, DTOBuffPlayer>(PLAERCOUNT);

            foreach (var playerEntity in localManager.Players)
            {
                buffPlayers.Add(Guid.NewGuid(), BuildPlayer(playerEntity));
            }

            //套装
            //TeammemberDataHelper.FillSuitData(suitDic, suitTypeDic, ref managerSBMList);
            //阵型加成
            TeammemberDataHelper.FillFormationData(localManager.FormationId, localManager.FormationLevel, ref managerSBMList);
            //天赋意志处理
            var skills = new List <string>();

            string[] subSkills = new string[2];
            //天赋
            if (localManager.TalentId > 0)
            {
                var localTalent = LocalHelper.TalentList.Talents.Find(d => d.Id == localManager.TalentId);
                if (localTalent != null)
                {
                    string            talent    = string.Empty;
                    LocalTalentEntity talentCfg = null;
                    int len = 0;
                    foreach (var talentdata in localTalent.Talentdatas)
                    {
                        talent    = talentdata.Id;
                        talentCfg = LocalHelper.LocalCache.Talents.Find(i => i.Id == talent);
                        if (null == talentCfg)
                        {
                            continue;
                        }
                        if (talentCfg.DriveType == 0 || len >= 2)
                        {
                            skills.Add(talent);
                        }
                        else
                        {
                            subSkills[len++] = talent;
                        }
                    }
                }
            }
            //意志 组合
            if (localManager.WillId > 0)
            {
                var localWill = LocalHelper.WillList.Wills.Find(d => d.Id == localManager.WillId);
                if (localWill != null)
                {
                    foreach (var willdata in localWill.Willdatas)
                    {
                        skills.Add(willdata.Id);
                    }
                }
            }
            //套装效果
            if (localManager.SuitId > 0)
            {
                var locaSuit = LocalHelper.SuitList.Suits.Find(d => d.Id == localManager.SuitId);
                if (locaSuit != null)
                {
                    foreach (var suitdata in locaSuit.Suitdatas)
                    {
                        skills.Add(suitdata.Id.ToString());
                    }
                }
            }
            var rankSkills = BuffCache.Instance().GetRankedSkillList(skills);

            foreach (var item in skills)
            {
                if (item.Substring(0, 1).ToUpper() == "H")
                {
                    rankSkills[1].Add(item);
                }
            }
            var        buffPack = new DTOBuffPack();
            const bool homeFlag = true;

            buffPack.SetBuffPlayers(homeFlag, buffPlayers);
            buffPack.SetOnBuffPlayers(homeFlag, buffPlayers.Values.ToList());
            BuffFlowFacade.ProcManagerBuff(buffPack, homeFlag, rankSkills[2], false);
            data.ReadySkillList = rankSkills[0];
            data.LiveSkillList  = rankSkills[1];
            data.SubSkills      = subSkills;
            BuffDataCore.Instance().FillBuffView(data, buffPlayers, true, 1);
            //TODO:球员组合
            //DTOBuffPlayer player = null;
            //foreach (var member in data.BuffMembers.Values)
            //{
            //    if (!buffPlayers.TryGetValue(member.Tid, out player))
            //        continue;
            //    if (string.IsNullOrEmpty(player.StarSkill))
            //        continue;
            //    if (null == member.LiveSkillList)
            //        member.LiveSkillList = new List<string>();
            //    member.LiveSkillList.Add(player.StarSkill);
            //}
            return(data);
        }