From 11570739f312a31a3c437e0f635eb7aec2f3249a Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 24 一月 2019 14:45:03 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/GeneralConfig/GeneralDefine.cs                      |   34 ++++++++++++++++
 System/Compose/New/ComposeWinModel.cs                      |   10 +++++
 Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs      |   14 +++++-
 System/Compose/New/SelectEquipModel.cs                     |   24 ++++++++----
 System/Compose/New/ComposeMatCell.cs                       |    6 ++-
 System/JadeDynastyBoss/JadeDynastyBossModel.cs             |   30 +++++++++++++++
 Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs.meta |    2 
 7 files changed, 105 insertions(+), 15 deletions(-)

diff --git a/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs b/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs
index 7401ee4..978b8d5 100644
--- a/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs
+++ b/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs
@@ -1,6 +1,6 @@
 锘�//--------------------------------------------------------
 //    [Author]:			绗簩涓栫晫
-//    [  Date ]:		   Friday, January 18, 2019
+//    [  Date ]:		   Thursday, January 24, 2019
 //--------------------------------------------------------
 
 using UnityEngine;
@@ -17,7 +17,8 @@
 		public int RealmLV { get ; private set ; }
 		public int ZhuXianScore { get ; private set ; }
 		public string dropItems { get ; private set; } 
-		public string PortraitID { get ; private set; } 
+		public string PortraitID { get ; private set; } 
+		public int[] conditionSorts;
 
 		public override string getKey()
         {
@@ -39,7 +40,14 @@
 			
 				dropItems = rawContents[5].Trim();
 			
-				PortraitID = rawContents[6].Trim();
+				PortraitID = rawContents[6].Trim();
+			
+				string[] conditionSortsStringArray = rawContents[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+				conditionSorts = new int[conditionSortsStringArray.Length];
+				for (int i=0;i<conditionSortsStringArray.Length;i++)
+				{
+					 int.TryParse(conditionSortsStringArray[i],out conditionSorts[i]);
+				}
             }
             catch (Exception ex)
             {
diff --git a/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs.meta b/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs.meta
index 69ebe16..8335861 100644
--- a/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs.meta
+++ b/Core/GameEngine/Model/Config/JadeDynastyBossConfig.cs.meta
@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: bc9f70989c6d3344aad5bd0dbda7bc2b
-timeCreated: 1547804881
+timeCreated: 1548302334
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2
diff --git a/System/Compose/New/ComposeMatCell.cs b/System/Compose/New/ComposeMatCell.cs
index 0e4eb4f..6b62f71 100644
--- a/System/Compose/New/ComposeMatCell.cs
+++ b/System/Compose/New/ComposeMatCell.cs
@@ -36,7 +36,8 @@
         public void SetDisplay(ItemCompoundConfig _itemCompound,NeedMatType _matType,bool isLock,string des = "", int _itemId = 0,int _itemIndex = -1)
         {
             this.itemCompound = _itemCompound;
-            this.itemModel = playerPack.GetItemModelByIndex(PackType.rptItem, _itemIndex);
+            var packType = composeModel.GetPackTypeByMakerId(itemCompound.makeID);
+            this.itemModel = playerPack.GetItemModelByIndex(packType, _itemIndex);
             this.matType = _matType;
             this.itemId = _itemId;
             matDes = des;
@@ -98,7 +99,8 @@
                 case NeedMatType.fixedItem:
                     int needCount = 0;
                     TryGetCountById(out needCount);
-                    int haveCount = playerPack.GetItemCountByID(PackType.rptItem, itemId);
+                    var packType = composeModel.GetPackTypeByMakerId(itemCompound.makeID);
+                    int haveCount = playerPack.GetItemCountByID(packType, itemId);
                     itemCell.countText.gameObject.SetActive(true);
                     if (haveCount >= needCount)
                     {
diff --git a/System/Compose/New/ComposeWinModel.cs b/System/Compose/New/ComposeWinModel.cs
index 23f42f2..c470e4f 100644
--- a/System/Compose/New/ComposeWinModel.cs
+++ b/System/Compose/New/ComposeWinModel.cs
@@ -417,6 +417,16 @@
     }
     #endregion
 
+    public PackType GetPackTypeByMakerId(int[] makeIds)
+    {
+        if (makeIds == null || makeIds.Length < 1) return PackType.rptDeleted;
+
+        int makeId = makeIds[0];
+        var itemConfig = Config.Instance.Get<ItemConfig>(makeId);
+
+        return GeneralDefine.GetPackTypeByItemType(itemConfig.Type); 
+    }
+
     public void SetUpdateSendComposeEvent()
     {
         if(UpdateSendComposeEvent != null)
diff --git a/System/Compose/New/SelectEquipModel.cs b/System/Compose/New/SelectEquipModel.cs
index ed9c02a..271b420 100644
--- a/System/Compose/New/SelectEquipModel.cs
+++ b/System/Compose/New/SelectEquipModel.cs
@@ -56,9 +56,11 @@
 
     public Dictionary<int, ItemModel> GetUnfixedItemModel()
     {
-        SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
-        if (singlePack == null || composeWinModel.CurComposeModel == null)
-            return null;
+        if (composeWinModel.CurComposeModel == null) return null;
+
+        var packType = composeWinModel.GetPackTypeByMakerId(composeWinModel.CurComposeModel.makeID);
+        SinglePackModel singlePack = playerPack.GetSinglePackModel(packType);
+        if (singlePack == null) return null;
 
         int[] unfixedIds = composeWinModel.CurComposeModel.unfixedItemID;
         allBagItemInfo = singlePack.GetPackModelIndexDict();
@@ -96,9 +98,10 @@
 
     public Dictionary<int, ItemModel> GetAddItemModel()
     {
-        SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
-        if (singlePack == null)
-            return null;
+        if (composeWinModel.CurComposeModel == null) return null;
+        var packType = composeWinModel.GetPackTypeByMakerId(composeWinModel.CurComposeModel.makeID);
+        SinglePackModel singlePack = playerPack.GetSinglePackModel(packType);
+        if (singlePack == null) return null;
 
         allBagItemInfo = singlePack.GetPackModelIndexDict();
         List<ItemModel> modellist = allBagItemInfo.Values.ToList();
@@ -215,7 +218,10 @@
 
     public void AddHaveUnfixedSelectItem(int itemPlace)
     {
-        ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptItem, itemPlace);
+        if (composeWinModel.CurComposeModel == null) return;
+        var packType = composeWinModel.GetPackTypeByMakerId(composeWinModel.CurComposeModel.makeID);
+
+        ItemModel itemModel = playerPack.GetItemModelByIndex(packType, itemPlace);
         if (!haveUnfixedSelectItemDic.ContainsKey(itemPlace))
         {
             haveUnfixedSelectItemDic.Add(itemPlace, itemModel);
@@ -232,7 +238,9 @@
 
     public void AddHaveAddSelectItem(int itemPlace)
     {
-        ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptItem, itemPlace);
+        if (composeWinModel.CurComposeModel == null) return;
+        var packType = composeWinModel.GetPackTypeByMakerId(composeWinModel.CurComposeModel.makeID);
+        ItemModel itemModel = playerPack.GetItemModelByIndex(packType, itemPlace);
         if (!haveAddSelectItemDic.ContainsKey(itemPlace))
         {
             haveAddSelectItemDic.Add(itemPlace, itemModel);
diff --git a/System/GeneralConfig/GeneralDefine.cs b/System/GeneralConfig/GeneralDefine.cs
index 7dab617..4a7464f 100644
--- a/System/GeneralConfig/GeneralDefine.cs
+++ b/System/GeneralConfig/GeneralDefine.cs
@@ -138,7 +138,7 @@
     public static Dictionary<int, int> fairyGrabBossMapLines { get; private set; }
 
     public static Dictionary<int, List<int>> DropItemEffectMapID { get; private set; }
-
+    public static Dictionary<int, List<int>> itemPutInPackDict { get; private set; }
     public static List<int> RebornAutoFightMapID { get; private set; }
 
     public static string teamWorldCall;
@@ -278,6 +278,25 @@
                 _pos[0] = (double)_data[_key][0];
                 _pos[1] = (double)_data[_key][1];
                 NpcPosOffset.Add(_npcID, new Vector3((float)_pos[0], 0, (float)_pos[1]));
+            }
+
+            var putInItemPack = Config.Instance.Get<FuncConfigConfig>("PutInItemPack");
+            LitJson.JsonData itemPutInData = LitJson.JsonMapper.ToObject(putInItemPack.Numerical1);
+            itemPutInPackDict = new Dictionary<int, List<int>>();
+            foreach(var _key in itemPutInData.Keys)
+            {
+                var itemTypeData = itemPutInData[_key];
+                int packType = int.Parse(_key);
+                List<int> itemTypes = new List<int>();
+                itemPutInPackDict.Add(packType,itemTypes);
+                if(itemTypeData.IsArray)
+                {
+                    for (i = 0; i < itemTypeData.Count; i++)
+                    {
+                        int itemType = int.Parse(itemTypeData[i].ToString());
+                        itemTypes.Add(itemType);
+                    }
+                }
             }
 
             FuncConfigConfig nxxdImg = Config.Instance.Get<FuncConfigConfig>("NXXDPicture");
@@ -689,6 +708,19 @@
         }
     }
 
+    public static PackType GetPackTypeByItemType(int itemType)
+    {
+        foreach(var key in itemPutInPackDict.Keys)
+        {
+            var types = itemPutInPackDict[key];
+            if(types.Contains(itemType))
+            {
+                return (PackType)key;
+            }
+        }
+        return PackType.rptItem;
+    }
+
     private static int GetInt(string _key, int _index = 1)
     {
         var result = 0;
diff --git a/System/JadeDynastyBoss/JadeDynastyBossModel.cs b/System/JadeDynastyBoss/JadeDynastyBossModel.cs
index d0c24b7..1cd07fd 100644
--- a/System/JadeDynastyBoss/JadeDynastyBossModel.cs
+++ b/System/JadeDynastyBoss/JadeDynastyBossModel.cs
@@ -126,6 +126,7 @@
                             realmLevel = config.RealmLV,
                             score = config.ZhuXianScore,
                         },
+                        conditionSorts = new List<int>(config.conditionSorts),
                     });
 
                     var itemArray = LitJson.JsonMapper.ToObject<int[][]>(config.dropItems);
@@ -170,7 +171,35 @@
             });
             if (index != -1)
             {
+                var boss = jadeDynastyBosses[index];
                 var challengeCondition = jadeDynastyBosses[index].challengeCondition;
+                foreach (var code in boss.conditionSorts)
+                {
+                    switch (code)
+                    {
+                        case 1:
+                            if (PlayerDatas.Instance.baseData.LV < challengeCondition.level)
+                            {
+                                condition = 1;
+                                return false;
+                            }
+                            break;
+                        case 2:
+                            if (PlayerDatas.Instance.baseData.realmLevel < challengeCondition.realmLevel)
+                            {
+                                condition = 2;
+                                return false;
+                            }
+                            break;
+                        case 3:
+                            if (jadeDynastyScore < (ulong)challengeCondition.score)
+                            {
+                                condition = 3;
+                                return false;
+                            }
+                            break;
+                    }
+                }
                 if (PlayerDatas.Instance.baseData.LV < challengeCondition.level)
                 {
                     condition = 1;
@@ -481,6 +510,7 @@
         public int bossNpcId;
         public int lineId;
         public JadeDynastyBossCondition challengeCondition;
+        public List<int> conditionSorts;
     }
 
     public struct JadeDynastyBossCondition

--
Gitblit v1.8.0