public static DTOBuffMemberView GetMemberView(DicNpcEntity npcEntity) { if (npcEntity.Type == 1 || npcEntity.Type == 2 || npcEntity.Type == 3 || npcEntity.Type == 4 || npcEntity.Type == 5 || npcEntity.Type == 6)//球星启示录计算真实kpi { npcEntity.KpiBuff = npcEntity.Buff; npcEntity.Buff = 100;// npcEntity.Buff; } else { npcEntity.KpiBuff = 100; } var data = new DTOBuffMemberView(); //TODO: CombLevel var managerSBMList = new List <string>(); //套装字典 套装id->数量 var suitDic = new Dictionary <int, List <int> >(); //套装id->套装类型 var suitTypeDic = new Dictionary <int, int>(); var formationDetails = CacheFactory.FormationCache.GetFormationDetail(npcEntity.FormationId); int i = 0; var buffPlayers = new Dictionary <Guid, DTOBuffPlayer>(PLAERCOUNT); buffPlayers.Add(Guid.NewGuid(), BuildPlayer(npcEntity, npcEntity.TP1, npcEntity.TE1, npcEntity.TS1, formationDetails[i++].Position, npcEntity.KpiBuff, ref suitDic, ref suitTypeDic)); buffPlayers.Add(Guid.NewGuid(), BuildPlayer(npcEntity, npcEntity.TP2, npcEntity.TE2, npcEntity.TS2, formationDetails[i++].Position, npcEntity.KpiBuff, ref suitDic, ref suitTypeDic)); buffPlayers.Add(Guid.NewGuid(), BuildPlayer(npcEntity, npcEntity.TP3, npcEntity.TE3, npcEntity.TS3, formationDetails[i++].Position, npcEntity.KpiBuff, ref suitDic, ref suitTypeDic)); buffPlayers.Add(Guid.NewGuid(), BuildPlayer(npcEntity, npcEntity.TP4, npcEntity.TE4, npcEntity.TS4, formationDetails[i++].Position, npcEntity.KpiBuff, ref suitDic, ref suitTypeDic)); buffPlayers.Add(Guid.NewGuid(), BuildPlayer(npcEntity, npcEntity.TP5, npcEntity.TE5, npcEntity.TS5, formationDetails[i++].Position, npcEntity.KpiBuff, ref suitDic, ref suitTypeDic)); buffPlayers.Add(Guid.NewGuid(), BuildPlayer(npcEntity, npcEntity.TP6, npcEntity.TE6, npcEntity.TS6, formationDetails[i++].Position, npcEntity.KpiBuff, ref suitDic, ref suitTypeDic)); buffPlayers.Add(Guid.NewGuid(), BuildPlayer(npcEntity, npcEntity.TP7, npcEntity.TE7, npcEntity.TS7, formationDetails[i++].Position, npcEntity.KpiBuff, ref suitDic, ref suitTypeDic)); //套装 TeammemberDataHelper.FillSuitData(suitDic, suitTypeDic, ref managerSBMList); //阵型加成 TeammemberDataHelper.FillFormationData(npcEntity.FormationId, npcEntity.FormationLevel, ref managerSBMList); //TODO:球员组合 BuffDataCore.Instance().FillBuffView(data, buffPlayers, true, 1, npcEntity.FormationId); data.BuffPlayers = buffPlayers; return(data); }
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); }