From 49d14c36c7a6ec949fc18c118896550b45bcbfba Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期一, 04 三月 2019 23:24:01 +0800
Subject: [PATCH] 3555 新版装备系统开发。

---
 System/Equip/EquipModel.cs |   42 ++++++++++++++++++++++++++----------------
 1 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/System/Equip/EquipModel.cs b/System/Equip/EquipModel.cs
index ef938a2..4d026be 100644
--- a/System/Equip/EquipModel.cs
+++ b/System/Equip/EquipModel.cs
@@ -7,12 +7,14 @@
 {
     public class EquipModel : Model
     {
-        public int showedUnLockLevel {
+        public int showedUnLockLevel
+        {
             get { return LocalSave.GetInt(StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "EquipSetUnLockHasShowed"), 1); }
             set { LocalSave.SetInt(StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "EquipSetUnLockHasShowed"), value); }
         }
 
-        public int showedUnLockSlot {
+        public int showedUnLockSlot
+        {
             get { return LocalSave.GetInt(StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "EquipSlotUnLockHasShowed"), 1); }
             set { LocalSave.SetInt(StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "EquipSlotUnLockHasShowed"), value); }
         }
@@ -20,6 +22,7 @@
         public readonly LogicInt selectedLevel = new LogicInt();
         public readonly LogicInt selectedPlace = new LogicInt();
         public readonly LogicString selectedEquip = new LogicString();
+        public readonly LogicInt selectedStarLevel = new LogicInt();
 
         int m_AppearanceLevel = 0;
         public int appearanceLevel { get { return m_AppearanceLevel; } }
@@ -28,6 +31,7 @@
         Dictionary<string, CandidateEquip> candidateEquips = new Dictionary<string, CandidateEquip>();
 
         PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
+        EquipStarModel starModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
 
         public override void Init()
         {
@@ -59,6 +63,8 @@
             if (selectedLevel.dirty)
             {
                 selectedPlace.dirty = true;
+                selectedStarLevel.value = 0;
+                selectedStarLevel.dirty = true;
             }
 
             if (selectedLevel.dirty || selectedPlace.dirty)
@@ -285,20 +291,27 @@
             return set.IsBetterThanCurrent(equipGuid);
         }
 
-        public EquipSuitPropertyEntry GetEquipSuitEntry(int level, EquipSuitType type)
+        public EquipSuitPropertyEntry GetEquipSuitEntry(int level, int star, EquipSuitType type)
         {
-            var entry = new EquipSuitPropertyEntry();
-            switch (type)
+            var configs = EquipSuitConfig.GetConfigs(PlayerDatas.Instance.baseData.Job, level, type);
+            var suitLevel = starModel.GetSuitLevel(level, type);
+            var actived = suitLevel >= star;
+            var properties = new List<Int2>();
+            foreach (var item in configs)
             {
-                case EquipSuitType.TwoSuit:
+                if (item.star == star)
+                {
+                    properties.AddRange(item.attr);
                     break;
-                case EquipSuitType.FiveSuit:
-                    break;
-                case EquipSuitType.EightSuit:
-                    break;
-                default:
-                    break;
+                }
             }
+
+            var entry = new EquipSuitPropertyEntry()
+            {
+                actived = actived,
+                type = type,
+                properties = properties
+            };
 
             return entry;
         }
@@ -444,10 +457,7 @@
     {
         public EquipSuitType type;
         public bool actived;
-        public int currentStarLevel;
-        public int nextStarLevel;
-        public List<Int2> currentProperties;
-        public List<Int2> nextProperties;
+        public List<Int2> properties;
     }
 
 }

--
Gitblit v1.8.0