System/Equip/EquipFightPower.cs
@@ -8,7 +8,6 @@ public class EquipFightPower : Singleton<EquipFightPower> { PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } EquipStarModel starModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } } @@ -86,13 +85,18 @@ private List<int> CountEightSuitSkills(int level) { var eightSuitLevel = equipModel.GetSuitLevel(level, EquipSuitType.EightSuit); return CountEightSuitSkills(PlayerDatas.Instance.baseData.Job, level, eightSuitLevel); } private List<int> CountEightSuitSkills(int job, int level, int eightSuitLevel) { var skills = new List<int>(); var eightSuitLevel = equipModel.GetSuitLevel(level, EquipSuitType.EightSuit); List<EquipSuitConfig> eightConfigs = null; if (eightSuitLevel >= 0) { eightConfigs = EquipSuitConfig.GetConfigs(PlayerDatas.Instance.baseData.Job, level, EquipSuitType.EightSuit); eightConfigs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.EightSuit); } for (int i = 9; i >= 0; i--) @@ -130,20 +134,25 @@ var fiveSuitLevel = equipModel.GetSuitLevel(level, EquipSuitType.FiveSuit); var eightSuitLevel = equipModel.GetSuitLevel(level, EquipSuitType.EightSuit); CountSuitProperties(level, twoSuitLevel, fiveSuitLevel, eightSuitLevel, ref container); } private void CountSuitProperties(int level, int twoLevel, int fiveLevel, int eightLevel, ref Properties container) { List<EquipSuitConfig> twoConfigs = null; if (twoSuitLevel >= 0) if (twoLevel >= 0) { twoConfigs = EquipSuitConfig.GetConfigs(PlayerDatas.Instance.baseData.Job, level, EquipSuitType.TwoSuit); } List<EquipSuitConfig> fiveConfigs = null; if (fiveSuitLevel >= 0) if (fiveLevel >= 0) { fiveConfigs = EquipSuitConfig.GetConfigs(PlayerDatas.Instance.baseData.Job, level, EquipSuitType.FiveSuit); } List<EquipSuitConfig> eightConfigs = null; if (eightSuitLevel >= 0) if (eightLevel >= 0) { eightConfigs = EquipSuitConfig.GetConfigs(PlayerDatas.Instance.baseData.Job, level, EquipSuitType.EightSuit); } @@ -155,7 +164,7 @@ continue; } if (twoSuitLevel >= i) if (twoLevel >= i) { var config = twoConfigs.Find(x => { return x.star == i; }); foreach (var property in config.attr) @@ -164,7 +173,7 @@ } } if (fiveSuitLevel >= i) if (fiveLevel >= i) { var config = fiveConfigs.Find(x => { return x.star == i; }); foreach (var property in config.attr) @@ -173,7 +182,7 @@ } } if (eightSuitLevel >= i) if (eightLevel >= i) { var config = eightConfigs.Find(x => { return x.star == i; }); foreach (var property in config.attr) @@ -196,11 +205,19 @@ continue; } var values = strengthenModel.GetEquipValueList(level, i); foreach (var item in values) { container.Add(item.AttType, item.AttValue); } var type = EquipStrengthModel.GetEquipStrengthType(i); var strengthenLevel = strengthenModel.GetStrengthLevel(level, i); CountStrengthenProperties(type, strengthenLevel, ref container); } } private void CountStrengthenProperties(int type, int strengthenLevel, ref Properties container) { var config = ItemPlusConfig.GetTypeAndLevel(type, strengthenLevel); var min = Mathf.Min(config.attType.Length, config.attValue.Length); for (int i = 0; i < min; i++) { container.Add(config.attType[i], config.attValue[i]); } } @@ -216,23 +233,27 @@ } var star = starModel.GetEquipStarLevel(equipPosition); var config = EquipStarConfig.Get(equipPosition.x, equipPosition.y, star); if (config == null) { continue; } CountStarProperties(level, i, star, ref container); } } foreach (var property in config.BaseAttrInfo) { container.Add(property.x, property.y); } foreach (var property in config.StarAttrInfo) { container.Add(property.x, property.y); } private void CountStarProperties(int level, int place, int star, ref Properties container) { var config = EquipStarConfig.Get(level, place, star); if (config == null) { return; } foreach (var property in config.BaseAttrInfo) { container.Add(property.x, property.y); } foreach (var property in config.StarAttrInfo) { container.Add(property.x, property.y); } } private void CountGemProperties(int level, ref Properties container) @@ -259,30 +280,34 @@ continue; } var itemConfig = ItemConfig.Get(gem); if (itemConfig.Effect2 > 0) { container.Add(itemConfig.Effect2, itemConfig.EffectValueA2); } if (itemConfig.Effect3 > 0) { container.Add(itemConfig.Effect3, itemConfig.EffectValueA3); } if (itemConfig.Effect4 > 0) { container.Add(itemConfig.Effect4, itemConfig.EffectValueA4); } if (itemConfig.Effect5 > 0) { container.Add(itemConfig.Effect5, itemConfig.EffectValueA5); } CountGemItemProperties(gem, ref container); } } } private void CountGemItemProperties(int gem, ref Properties container) { var config = ItemConfig.Get(gem); if (config.Effect2 > 0) { container.Add(config.Effect2, config.EffectValueA2); } if (config.Effect3 > 0) { container.Add(config.Effect3, config.EffectValueA3); } if (config.Effect4 > 0) { container.Add(config.Effect4, config.EffectValueA4); } if (config.Effect5 > 0) { container.Add(config.Effect5, config.EffectValueA5); } } private void CountTrainProperties(int level, ref Properties container) @@ -317,15 +342,72 @@ } public int CalculateScore(EquipInfo info) public int CalculatePower(int job, int level, List<EquipInfo> equipInfos) { var propertyContainer = new Properties(); var totalScore = 0; return 0; } var stars = new List<int>(); foreach (var info in equipInfos) { totalScore += info.score; stars.Add(info.starLevel); public int CalculatePower() { return 0; var config = ItemConfig.Get(info.itemId); var strengthenType = EquipStrengthModel.GetEquipStrengthType(config.EquipPlace); CountStrengthenProperties(strengthenType, info.strengthenLevel, ref propertyContainer); CountStarProperties(config.LV, config.EquipPlace, info.starLevel, ref propertyContainer); if (!info.stones.IsNullOrEmpty()) { foreach (var gem in info.stones) { CountGemItemProperties(gem, ref propertyContainer); } } if (!info.trainProperties.IsNullOrEmpty()) { foreach (var property in info.trainProperties) { propertyContainer.Add(property.x, property.y); } } } stars.Sort((int x, int y) => { return x.CompareTo(y); }); var twoSuitLevel = stars.Count > 1 ? stars[1] : 0; var fiveSuitLevel = stars.Count > 4 ? stars[4] : 0; var eightSuitLevel = stars.Count > 7 ? stars[7] : 0; CountSuitProperties(level, twoSuitLevel, fiveSuitLevel, eightSuitLevel, ref propertyContainer); Equation.Instance.Clear(); Equation.Instance.AddKeyValue("equipScoreTotal", totalScore); var power = Equation.Instance.Eval<int>(scoreFormula); Equation.Instance.Clear(); var keys = propertyContainer.keys; for (int i = 0; i < keys.Count; i++) { var id = keys[i]; var value = propertyContainer[id]; var config = PlayerPropertyConfig.Get(id); Equation.Instance.AddKeyValue(config.Parameter, value); } power += Equation.Instance.Eval<int>(propertyFormula); var skills = CountEightSuitSkills(job, level, eightSuitLevel); if (!skills.IsNullOrEmpty()) { foreach (var skill in skills) { var config = SkillConfig.Get(skill); power += config.FightPower; } } return power; } class Properties @@ -375,11 +457,12 @@ public struct EquipInfo { public int itemId; public int strengthLevel; public int score; public int strengthenLevel; public int breakLevel; public int starLevel; public int[] stones; public Int2 trainProperties; public List<int> stones; public List<Int2> trainProperties; } } System/EquipGem/EquipEvolutionWin.cs
@@ -147,7 +147,7 @@ int equipLevel = strengthModel.SelectLevel; int equipPlace = strengthModel.SelectEquipPlace; int equipIndex = EquipPlaceMapConfig.GetServerPlace(equipLevel, equipPlace); equipType = strengthModel.GetEquipStrengthType(equipPlace); equipType = EquipStrengthModel.GetEquipStrengthType(equipPlace); int equipLv = 0; int advancedLv = 0; if (strengthModel.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级 System/EquipGem/EquipStrengthFull.cs
@@ -41,7 +41,7 @@ } NeedMoney.gameObject.SetActive(false); m_TextNumber.text = "+" + equipLv; int equipType = strengthModel.GetEquipStrengthType(equipPlace); int equipType = EquipStrengthModel.GetEquipStrengthType(equipPlace); var star = equipStarModel.GetEquipStarLevel(new Int2(level, equipPlace)); var item = packModel.GetItemByGuid(equipGuid); System/EquipGem/EquipStrengthModel.cs
@@ -46,7 +46,7 @@ { public Dictionary<int, EquipStrength> EquipStrengthDic = new Dictionary<int, EquipStrength>();//强化数据 public Dictionary<int, Dictionary<int, int>> EquipLevelMaxDic = new Dictionary<int, Dictionary<int, int>>();//强化类型的最大等级上限 public Dictionary<int, int> PartTypeDic = new Dictionary<int, int>();//强化的部位类型 static Dictionary<int, int> PartTypeDic = new Dictionary<int, int>();//强化的部位类型 public Dictionary<int, int> EvolutionTypeMaxDic = new Dictionary<int, int>(); public event Action EquipStrengthUpdate;//强化数据刷新 public event Action EquipStrengthLvUpdate;//强化升级成功 @@ -55,8 +55,7 @@ public event Action SelectLevelRefresh;//一级页签刷新 private bool isChangeBool = true; public bool IsChangeBool { public bool IsChangeBool { get { return isChangeBool; } set { isChangeBool = value; } } @@ -64,8 +63,7 @@ public int SelectLevel//装备类别 { get { return selectLevel; } set { set { if (selectLevel != value) { selectLevel = value; @@ -80,8 +78,7 @@ public int SelectEquipPlace//装备类别 { get { return selectEquipPlace; } set { set { if (selectEquipPlace != value) { selectEquipPlace = value; @@ -182,7 +179,7 @@ } } public int GetEquipStrengthType(int equipPlace)//获取装备类型 public static int GetEquipStrengthType(int equipPlace)//获取装备类型 { int type = 1; if (PartTypeDic.ContainsKey(equipPlace)) @@ -192,7 +189,7 @@ return type; } public int GetEquipLevelMax(int type,int star)//获取某一类型的最大强化等级 public int GetEquipLevelMax(int type, int star)//获取某一类型的最大强化等级 { int lv = 0; if (EquipLevelMaxDic.ContainsKey(type)) System/EquipGem/EquipStrengthRein.cs
@@ -64,7 +64,7 @@ DisplayMoney(); int equipType = strengthModel.GetEquipStrengthType(equipPlace); int equipType = EquipStrengthModel.GetEquipStrengthType(equipPlace); var star = equipStarModel.GetEquipStarLevel(new Int2(level, equipPlace)); var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, level); System/EquipGem/EquipStrengthUpper.cs
@@ -61,7 +61,7 @@ DisplayMoney(); int equipType = strengthModel.GetEquipStrengthType(equipPlace); int equipType = EquipStrengthModel.GetEquipStrengthType(equipPlace); var star = equipStarModel.GetEquipStarLevel(new Int2(level, equipPlace)); var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, level); System/EquipGem/EquipStrengthWin.cs
@@ -322,7 +322,7 @@ advancedLv = model.EquipStrengthDic[equipIndex].EvolveLV; } int equipType = model.GetEquipStrengthType(equipPlace); int equipType = EquipStrengthModel.GetEquipStrengthType(equipPlace); var itemPlusMaxConfig = ItemPlusMaxConfig.GetEquipTypeAndEquipStar(equipType, star);//获取强化等级上限值 if (itemPlusMaxConfig == null) { @@ -410,7 +410,7 @@ if (m_EquipStrengthUpper.gameObject.activeSelf) { int equipType = model.GetEquipStrengthType(model.SelectEquipPlace); int equipType = EquipStrengthModel.GetEquipStrengthType(model.SelectEquipPlace); var equipPosition = new Int2(model.SelectLevel, model.SelectEquipPlace); var star = equipStarModel.GetEquipStarLevel(equipPosition); var equipGuid = equipModel.GetEquip(equipPosition); @@ -449,7 +449,7 @@ { equipLv = model.EquipStrengthDic[equipIndex].StrengthLevel; } int equipType = model.GetEquipStrengthType(model.SelectEquipPlace); int equipType = EquipStrengthModel.GetEquipStrengthType(model.SelectEquipPlace); var itemPlusMaxConfig = ItemPlusMaxConfig.GetEquipTypeAndEquipStar(equipType, star);//获取强化等级上限值 if (itemPlusMaxConfig.levelMax > equipLv) { System/ItemTip/ItemTipUtility.cs
@@ -141,7 +141,7 @@ { public int job; public int itemId; public int sorce; public int score; public List<Int2> legendProperties; public List<int> suitPlaces; public Dictionary<EquipSuitType, int> suitLevels; @@ -150,7 +150,6 @@ public List<Int2> trainProperties; public Dictionary<int, bool> gemHoleActiveStates; public Dictionary<int, int> gems; public List<int> skills; } static PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } @@ -462,7 +461,7 @@ itemId = info.itemId, star = info.starLevel, strengthenLevel = info.strengthenLevel, score = info.sorce, score = info.score, }; var baseProperty = GetBaseProperty(info.itemId); @@ -555,7 +554,7 @@ maxLevel = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV), }; var type = strengthenModel.GetEquipStrengthType(config.EquipPlace); var type = EquipStrengthModel.GetEquipStrengthType(config.EquipPlace); var strengthenConfig = ItemPlusConfig.GetTypeAndLevel(type, info.strengthenLevel); var strengthenProperties = new List<Int2>(); for (int i = 0; i < strengthenConfig.attType.Length; i++) @@ -853,7 +852,7 @@ var isEquiped = equipModel.GetEquip(new Int2(level, place)) == guid; var type = strengthenModel.GetEquipStrengthType(place); var type = EquipStrengthModel.GetEquipStrengthType(place); var star = starModel.GetEquipStarLevel(new Int2(level, place)); var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, level); var maxStrengthenLevel = strengthenModel.GetEquipLevelMax(type, Mathf.Min(star, maxStar)); @@ -1233,7 +1232,7 @@ var data = new StrengthenProperty(); var strengthenLevel = strengthenModel.GetStrengthLevel(level, place); var type = strengthenModel.GetEquipStrengthType(place); var type = EquipStrengthModel.GetEquipStrengthType(place); var star = starModel.GetEquipStarLevel(new Int2(level, place)); var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV); var maxStrengthenLevel = strengthenModel.GetEquipLevelMax(type, Mathf.Min(star, maxStar)); System/RoleParticulars/OtherPlayerEquipLevelBehaviour.cs
@@ -13,6 +13,7 @@ { [SerializeField] Text m_Title; [SerializeField] Image m_BackGround; [SerializeField] Button m_Select; int level; OtherPlayerEquipModel model { get { return ModelCenter.Instance.GetModel<OtherPlayerEquipModel>(); } } @@ -25,12 +26,19 @@ var realm = EquipControlConfig.Get(this.level, 1).realm; this.m_Title.text = RealmConfig.Get(realm).Name; model.selectedLevelChangeEvent += OnSelected; m_Select.SetListener(Select); } public override void Dispose() { model.selectedLevelChangeEvent -= OnSelected; base.Dispose(); } private void Select() { model.SelectLevel(this.level); } private void OnSelected() @@ -40,7 +48,7 @@ private void DisplayBackGround(bool selected) { m_BackGround.SetSprite(selected ? "" : ""); m_BackGround.SetSprite(selected ? "ListBtn_Select" : "ListBtn_UnSelect"); } } System/RoleParticulars/OtherPlayerEquipModel.cs
@@ -30,6 +30,8 @@ public int playerId { get; private set; } public int playerJob { get; private set; } public int playerRealm { get; private set; } public int playerVipLevel { get; private set; } public int wing { get; private set; } public event Action selectedLevelChangeEvent; Dictionary<int, EquipDetailsGroup> equipDetailsGroups = new Dictionary<int, EquipDetailsGroup>(); @@ -45,11 +47,18 @@ { } public void ViewPlayerEquip(int playerId, int job, int realmLevel) public void ViewPlayerEquip(PlayerBriefInfo info) { this.playerId = playerId; this.playerJob = job; this.playerRealm = realmLevel; Clear(); this.playerId = info.id; this.playerJob = info.job; this.playerRealm = info.realm; this.playerVipLevel = info.vipLevel; this.wing = info.wing; SelectLevel(1); WindowCenter.Instance.Open<OtherPlayerEquipWin>(); } public void SelectLevel(int level) @@ -93,7 +102,8 @@ public void OnGetEquipDetails(HA719_tagSCPlayerEquipCacheResult info) { equipDetailsGroups[info.EquipClassLV] = new EquipDetailsGroup(info.EquipClassLV, info.ItemData); equipDetailsGroups[info.EquipClassLV] = new EquipDetailsGroup(playerJob, info.EquipClassLV, info.ItemData); selectedLevel = info.EquipClassLV; } public Dictionary<int, EquipBrief> GetEquipBriefs() @@ -132,6 +142,30 @@ } } public EquipAppearance GetEquipAppearance() { if (equipDetailsGroups.ContainsKey(selectedLevel)) { var equipDetailsGroup = equipDetailsGroups[selectedLevel]; var equips = equipDetailsGroup.equips; var suitLevels = equipDetailsGroup.GetSuitLevels(); var appearance = new EquipAppearance() { clothes = equips.ContainsKey((int)RoleEquipType.Clothes) ? equips[(int)RoleEquipType.Clothes].itemId : 0, weapon = equips.ContainsKey((int)RoleEquipType.Weapon) ? equips[(int)RoleEquipType.Weapon].itemId : 0, secondary = equips.ContainsKey((int)RoleEquipType.Weapon2) ? equips[(int)RoleEquipType.Weapon2].itemId : 0, wings = wing, isSuit = suitLevels.ContainsKey(EquipSuitType.EightSuit) && suitLevels[EquipSuitType.EightSuit] > 0, }; return appearance; } else { return default(EquipAppearance); } } public ItemTipUtility.OtherPlayerEquipInfo GetEquipInfo(int level, int place) { if (!equipDetailsGroups.ContainsKey(level)) @@ -144,46 +178,51 @@ return default(ItemTipUtility.OtherPlayerEquipInfo); } // public int job; // public int itemId; // public int sorce; // public List<Int2> legendProperties; // public List<int> suitPlaces; // public Dictionary<EquipSuitType, int> suitLevels; // public int strengthenLevel; // public int starLevel; // public List<Int2> trainProperties; // public Dictionary<int, bool> gemHoleActiveStates; // public Dictionary<int, int> gems; // public List<int> skills; var details = equipDetailsGroups[level].equips[place]; var equipInfo = new ItemTipUtility.OtherPlayerEquipInfo(); equipInfo.job = playerJob; equipInfo.itemId = details.itemId; var legendIds = new List<int>(); var legendValues = new List<int>(); var userData = new Dictionary<int, List<int>>(); equipInfo.score = details.score; equipInfo.legendProperties = details.legendProperties; equipInfo.suitPlaces = equipDetailsGroups[level].GetSuitPlaces(); equipInfo.suitLevels = equipDetailsGroups[level].GetSuitLevels(); equipInfo.strengthenLevel = details.strengthenLevel; equipInfo.starLevel = details.star; if (!details.legendProperties.IsNullOrEmpty()) equipInfo.trainProperties = details.trainProperties; var gemHoleActiveStates = new Dictionary<int, bool>(); gemHoleActiveStates[0] = true; gemHoleActiveStates[1] = details.star >= 2; gemHoleActiveStates[2] = details.star >= 5; gemHoleActiveStates[3] = playerVipLevel >= 6; equipInfo.gemHoleActiveStates = gemHoleActiveStates; equipInfo.gems = new Dictionary<int, int>(); for (var i = 0; i < details.stones.Count; i++) { foreach (var property in details.legendProperties) { legendIds.Add(property.x); legendValues.Add(property.y); } userData[17] = legendIds; userData[19] = legendValues; equipInfo.gems[i] = details.stones[i]; } equipInfo.sorce = ItemLogicUtility.Instance.GetEquipScore(PackType.Item, details.itemId, userData); equipInfo.legendProperties = details.legendProperties; return equipInfo; } public SuitInfo GetSuitInfo() { if (!equipDetailsGroups.ContainsKey(selectedLevel)) { return default(SuitInfo); } return new ItemTipUtility.OtherPlayerEquipInfo(); var suitInfo = new SuitInfo(); suitInfo.job = playerJob; suitInfo.level = selectedLevel; suitInfo.collectedPlaces = equipDetailsGroups[selectedLevel].GetSuitPlaces(); suitInfo.suitLevels = equipDetailsGroups[selectedLevel].GetSuitLevels(); return suitInfo; } public void Clear() @@ -200,19 +239,20 @@ public class EquipDetails { public int itemId; public int score; public int star; public int strengthLevel; public int strengthenLevel; public int evolveLevel; public List<int> stones = new List<int>(); public int trainLevel; public List<int> trainValues = new List<int>(); public List<Int2> trainProperties = new List<Int2>(); public List<Int2> legendProperties = new List<Int2>(); public EquipDetails(JsonData serverInfo) { itemId = (int)serverInfo["ItemID"]; star = serverInfo.Keys.Contains("Star") ? (int)serverInfo["Star"] : 0; strengthLevel = serverInfo.Keys.Contains("PlusLV") ? (int)serverInfo["PlusLV"] : 0; strengthenLevel = serverInfo.Keys.Contains("PlusLV") ? (int)serverInfo["PlusLV"] : 0; evolveLevel = serverInfo.Keys.Contains("EvolveLV") ? (int)serverInfo["EvolveLV"] : 0; if (serverInfo.Keys.Contains("Stone")) @@ -230,10 +270,13 @@ trainLevel = (int)washJson["LV"]; var washValueJson = washJson["Value"]; for (int i = 0; i < washValueJson.Count; i++) { trainValues.Add((int)washValueJson[i]); } var config = ItemConfig.Get(itemId); var trainType = EquipTrainModel.GetTrainType(config.EquipPlace); var trainData = EquipWashConfig.Get(trainType, trainLevel); trainProperties.Add(new Int2(trainData.config.attType1, (int)washValueJson[0])); trainProperties.Add(new Int2(trainData.config.attType2, (int)washValueJson[1])); trainProperties.Add(new Int2(trainData.config.attType3, (int)washValueJson[2])); } if (serverInfo.Keys.Contains("UserData")) @@ -249,18 +292,32 @@ } } var legendIds = new List<int>(); var legendValues = new List<int>(); var userData = new Dictionary<int, List<int>>(); foreach (var property in legendProperties) { legendIds.Add(property.x); legendValues.Add(property.y); } userData[17] = legendIds; userData[19] = legendValues; this.score = ItemLogicUtility.Instance.GetEquipScore(PackType.Item, itemId, userData); } } public class EquipDetailsGroup { public readonly int job; public readonly int level = 0; public readonly int fightPoint = 0; public Dictionary<int, EquipDetails> equips = new Dictionary<int, EquipDetails>(); public EquipDetailsGroup(int level, string equipInfo) public EquipDetailsGroup(int job, int level, string equipInfo) { this.job = job; this.level = level; var json = JsonMapper.ToObject(equipInfo); foreach (var key in json.Keys) @@ -276,11 +333,82 @@ equips[equipPosition.y] = new EquipDetails(json[key]); } fightPoint = EquipFightPower.Instance.CalculatePower(); var equipInfos = new List<EquipFightPower.EquipInfo>(); foreach (var equip in equips.Values) { equipInfos.Add(new EquipFightPower.EquipInfo() { itemId = equip.itemId, score = equip.score, strengthenLevel = equip.strengthenLevel, starLevel = equip.star, stones = equip.stones, trainProperties = equip.trainProperties, }); } fightPoint = EquipFightPower.Instance.CalculatePower(this.job, this.level, equipInfos); } public List<int> GetSuitPlaces() { var places = new List<int>(); foreach (var item in equips) { if (ItemLogicUtility.Instance.IsSuitEquip(item.Value.itemId)) { places.Add(item.Key); } } return places; } public Dictionary<EquipSuitType, int> GetSuitLevels() { var stars = new List<int>(); foreach (var item in equips) { if (item.Key > 8) { continue; } var star = item.Value.star; stars.Add(star); } stars.Sort((int x, int y) => { return x.CompareTo(y); }); var twoSuitLevel = stars.Count > 1 ? stars[1] : 0; var fiveSuitLevel = stars.Count > 4 ? stars[4] : 0; var eightSuitLevel = stars.Count > 7 ? stars[7] : 0; return new Dictionary<EquipSuitType, int>() { { EquipSuitType.TwoSuit, twoSuitLevel }, { EquipSuitType.FiveSuit, fiveSuitLevel}, {EquipSuitType.EightSuit, eightSuitLevel }, }; } } public struct PlayerBriefInfo { public int id; public int job; public int realm; public int vipLevel; public int wing; } public struct SuitInfo { public int level; public int job; public List<int> collectedPlaces; public Dictionary<EquipSuitType, int> suitLevels; } } System/RoleParticulars/OtherPlayerEquipSlotBehaviour.cs
@@ -74,6 +74,18 @@ ItemTipUtility.ShowOtherPlayerEquip(model.GetEquipInfo(model.selectedLevel, this.place)); } [ContextMenu("addd")] public void FindChild() { m_ViewDetials = this.GetComponent<Button>(); m_SlotName = this.GetComponent<Text>("Txt_Name"); m_Star = this.GetComponent<Text>("Txt_Star"); m_Icon = this.GetComponent<Image>("Img_Icon"); m_IconFrame = this.GetComponent<Image>("Img_Frame"); } } } System/RoleParticulars/OtherPlayerEquipWin.cs
@@ -19,9 +19,9 @@ [SerializeField] EquipSlots m_EquipSlots; [SerializeField] Text m_FightPoint; [SerializeField] RawImage m_Role; [SerializeField] OtherPlayerSuitWidget m_WidgetSuit; OtherPlayerEquipModel model { get { return ModelCenter.Instance.GetModel<OtherPlayerEquipModel>(); } } RoleParticularModel roleParticularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } } EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } #region Built-in @@ -58,6 +58,8 @@ DisplayEquipLevels(); DisplayEquips(); DisplayFightPoint(); DisplayAppearance(true); DisplaySuitInfo(); } #endregion @@ -66,6 +68,8 @@ { DisplayEquips(); DisplayFightPoint(); DisplayAppearance(false); DisplaySuitInfo(); } private void DisplayEquipLevels() @@ -102,6 +106,24 @@ m_FightPoint.text = model.GetFightPoint().ToString(); } private void DisplayAppearance(bool resetRotation) { var appearance = model.GetEquipAppearance(); UI3DModelExhibition.Instance.ShowPlayer(m_Role, new UI3DPlayerExhibitionData() { job = PlayerDatas.Instance.baseData.Job, clothesId = appearance.clothes, weaponId = appearance.weapon, secondaryId = appearance.secondary, keepRotation = !resetRotation, }); } private void DisplaySuitInfo() { m_WidgetSuit.Display(model.GetSuitInfo()); } [System.Serializable] public class EquipSlots { System/RoleParticulars/OtherPlayerSuitWidget.cs
@@ -4,13 +4,158 @@ //-------------------------------------------------------- using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using System; namespace Snxxz.UI { namespace Snxxz.UI { public class OtherPlayerSuitWidget : MonoBehaviour { [SerializeField] Text m_SuitName; [SerializeField] StarToggle[] m_StarToggles; [SerializeField] Text[] m_SuitEquipNames; public class OtherPlayerSuitWidget:MonoBehaviour { [SerializeField] EquipSuitPropertyBar m_TwoSuit; [SerializeField] EquipSuitPropertyBar m_FiveSuit; [SerializeField] Text m_EightSuitTitle; [SerializeField] Text m_EightSuitDescription; List<int> collectedPlaces; int level; int job; int twoSuitLevel; int fiveSuitLevel; int eightSuitLevel; public void Display(OtherPlayerEquipModel.SuitInfo suitInfo) { collectedPlaces = suitInfo.collectedPlaces; level = suitInfo.level; job = suitInfo.job; twoSuitLevel = suitInfo.suitLevels[EquipSuitType.TwoSuit]; fiveSuitLevel = suitInfo.suitLevels[EquipSuitType.FiveSuit]; eightSuitLevel = suitInfo.suitLevels[EquipSuitType.EightSuit]; m_SuitName.text = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.TwoSuit)[0].name; var maxLevel = EquipStarModel.GetMaxStarLevel(level); m_StarToggles[3].SetActive(maxLevel >= 9); m_StarToggles[2].SetActive(maxLevel >= 6); m_StarToggles[1].SetActive(maxLevel >= 3); m_StarToggles[0].SetActive(true); m_StarToggles[3].AddListener(() => { DisplayProperty(9); }); m_StarToggles[2].AddListener(() => { DisplayProperty(6); }); m_StarToggles[1].AddListener(() => { DisplayProperty(3); }); m_StarToggles[0].AddListener(() => { DisplayProperty(0); }); m_StarToggles[0].Select(); for (int i = 1; i <= 8; i++) { var hasSuit = collectedPlaces.Contains(i); m_SuitEquipNames[i - 1].color = UIHelper.GetUIColor(hasSuit ? TextColType.Green : TextColType.White, true); m_SuitEquipNames[i - 1].text = UIHelper.GetEquipPlaceName(i); } } void DisplayProperty(int star) { var twoConfigs = EquipSuitConfig.GetConfigs(PlayerDatas.Instance.baseData.Job, level, EquipSuitType.TwoSuit); var fiveConfigs = EquipSuitConfig.GetConfigs(PlayerDatas.Instance.baseData.Job, level, EquipSuitType.FiveSuit); var eightConfigs = EquipSuitConfig.GetConfigs(PlayerDatas.Instance.baseData.Job, level, EquipSuitType.EightSuit); var config = twoConfigs.Find(x => { return x.star == star; }); var properties = new List<Int2>(); var twoSuit = new EquipSuitPropertyEntry() { type = EquipSuitType.TwoSuit, actived = twoSuitLevel >= star, properties = new List<Int2>(config.attr), }; config = fiveConfigs.Find(x => { return x.star == star; }); properties = new List<Int2>(); var fiveSuit = new EquipSuitPropertyEntry() { type = EquipSuitType.FiveSuit, actived = fiveSuitLevel >= star, properties = new List<Int2>(config.attr), }; config = eightConfigs.Find(x => { return x.star == star; }); m_TwoSuit.Display(twoSuit); m_FiveSuit.Display(fiveSuit); m_EightSuitDescription.text = GetEightSuitDescription(config.id); var color = UIHelper.GetUIColor(eightSuitLevel >= star ? TextColType.Green : TextColType.White, true); m_EightSuitTitle.color = color; m_EightSuitDescription.color = color; } public void Dispose() { } private string GetEightSuitDescription(int suitId) { var config = EquipSuitConfig.Get(suitId); if (config.skillID > 0) { return config.description; } else { return PlayerPropertyConfig.GetFullDescription(config.attr[0]); } } [System.Serializable] public class StarToggle { public int star; public Text title; public Toggle toggle; Action onSelect; public void SetActive(bool active) { title.gameObject.SetActive(active); toggle.interactable = active; if (active) { toggle.SetListener(OnValueChange); } else { toggle.RemoveAllListeners(); } } public void Select() { toggle.isOn = true; } public void AddListener(Action callBack) { onSelect = callBack; } private void OnValueChange(bool value) { if (value) { if (onSelect != null) { onSelect(); } } } } } System/RoleParticulars/RoleParticularModel.cs
@@ -742,6 +742,7 @@ public ulong FightPower; public uint EquipShowSwitch; public int ServerGroupID; public int VIPLV; } public class RolePlusData