From f3fb1aa143be2b56ff3ed5c8bc6bc1bf7c1c5e0c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 16 十月 2019 14:09:27 +0800
Subject: [PATCH] 0312 BOSS首杀

---
 System/OpenServerActivity/BossFirstBloodWin.cs.meta                                                     |   12 
 System/OpenServerActivity/BossFirstBloodItemInfo.cs                                                     |   30 +
 System/OpenServerActivity/BossFirstBloodItemInfo.cs.meta                                                |   12 
 Utility/ConfigInitiator.cs                                                                              |    1 
 Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs.meta         |   12 
 System/OpenServerActivity/BossFirstBloodCell.cs                                                         |   39 ++
 Core/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA901_tagCGGetBossFirstKillAward.cs.meta |   12 
 Core/GameEngine/Model/Config/BOSSFirstKillConfig.cs.meta                                                |   12 
 Core/GameEngine/Model/Config/BOSSFirstKillConfig.cs                                                     |  212 +++++++++++++
 System/OpenServerActivity/BossFirstBloodModel.cs                                                        |  156 +++++++++
 System/OpenServerActivity/OpenServerActivityRankWin.cs                                                  |   62 +++
 System/Vip/DayPackageModel.cs                                                                           |    2 
 Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs              |    8 
 System/OpenServerActivity/BossFirstBloodWin.cs                                                          |  309 +++++++++++++++++++
 System/OpenServerActivity/BossFirstBloodModel.cs.meta                                                   |   12 
 Core/GameEngine/DataToCtl/PackageRegedit.cs                                                             |    2 
 System/OpenServerActivity/BossFirstBloodCell.cs.meta                                                    |   12 
 Core/NetworkPackage/ServerPack/HAB_Activity/HAB01_tagMCBossFirstKillStateInfo.cs.meta                   |   12 
 System/WindowBase/ModelCenter.cs                                                                        |    4 
 19 files changed, 912 insertions(+), 9 deletions(-)

diff --git a/Core/GameEngine/DataToCtl/PackageRegedit.cs b/Core/GameEngine/DataToCtl/PackageRegedit.cs
index b662d9a..9787176 100644
--- a/Core/GameEngine/DataToCtl/PackageRegedit.cs
+++ b/Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -481,6 +481,8 @@
         Register(typeof(HA502_tagMCFamilyActivityExchangeResult), typeof(DTCA502_tagMCFamilyActivityExchangeResult));//瑁呭鎹㈡椿璺冨害
 
         Register(typeof(HAA24_tagMCDayFreeGoldGiftState), typeof(DTCAA24_tagMCDayFreeGoldGiftState));
+        Register(typeof(HAB01_tagMCBossFirstKillStateInfo), typeof(DTCAB01_tagMCBossFirstKillStateInfo));
+
     }
 
     private static void Register(Type _pack, Type _business)
diff --git a/Core/GameEngine/Model/Config/BOSSFirstKillConfig.cs b/Core/GameEngine/Model/Config/BOSSFirstKillConfig.cs
new file mode 100644
index 0000000..c78fcf0
--- /dev/null
+++ b/Core/GameEngine/Model/Config/BOSSFirstKillConfig.cs
@@ -0,0 +1,212 @@
+锘�//--------------------------------------------------------
+//    [Author]:           Fish
+//    [  Date ]:           Wednesday, October 16, 2019
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+
+[XLua.LuaCallCSharp]
+public partial class BOSSFirstKillConfig
+{
+
+    public readonly int NPCID;
+	public readonly string ServerFirstKillPlayerAward;
+	public readonly int PerPlayerMoneyAward;
+	public readonly string PersonFirstKillAward;
+	public readonly int Sort;
+
+	public BOSSFirstKillConfig()
+    {
+    }
+
+    public BOSSFirstKillConfig(string input)
+    {
+        try
+        {
+            var tables = input.Split('\t');
+
+            int.TryParse(tables[0],out NPCID); 
+
+			ServerFirstKillPlayerAward = tables[1];
+
+			int.TryParse(tables[2],out PerPlayerMoneyAward); 
+
+			PersonFirstKillAward = tables[3];
+
+			int.TryParse(tables[4],out Sort); 
+        }
+        catch (Exception ex)
+        {
+            DebugEx.Log(ex);
+        }
+    }
+
+    static Dictionary<string, BOSSFirstKillConfig> configs = new Dictionary<string, BOSSFirstKillConfig>();
+    public static BOSSFirstKillConfig Get(string id)
+    {   
+		if (!inited)
+        {
+            Debug.Log("BOSSFirstKillConfig 杩樻湭瀹屾垚鍒濆鍖栥��");
+            return null;
+        }
+		
+        if (configs.ContainsKey(id))
+        {
+            return configs[id];
+        }
+
+        BOSSFirstKillConfig config = null;
+        if (rawDatas.ContainsKey(id))
+        {
+            config = configs[id] = new BOSSFirstKillConfig(rawDatas[id]);
+            rawDatas.Remove(id);
+        }
+
+        return config;
+    }
+
+	public static BOSSFirstKillConfig Get(int id)
+    {
+        return Get(id.ToString());
+    }
+
+    public static List<string> GetKeys()
+    {
+        var keys = new List<string>();
+        keys.AddRange(configs.Keys);
+        keys.AddRange(rawDatas.Keys);
+        return keys;
+    }
+
+    public static List<BOSSFirstKillConfig> GetValues()
+    {
+        var values = new List<BOSSFirstKillConfig>();
+        values.AddRange(configs.Values);
+
+        var keys = new List<string>(rawDatas.Keys);
+        foreach (var key in keys)
+        {
+            values.Add(Get(key));
+        }
+
+        return values;
+    }
+
+	public static bool Has(string id)
+    {
+        return configs.ContainsKey(id) || rawDatas.ContainsKey(id);
+    }
+
+	public static bool Has(int id)
+    {
+        return Has(id.ToString());
+    }
+
+	public static bool inited { get; private set; }
+    protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>();
+    public static void Init(bool sync=false)
+    {
+	    inited = false;
+		var path = string.Empty;
+        if (AssetSource.refdataFromEditor)
+        {
+            path = ResourcesPath.CONFIG_FODLER +"/BOSSFirstKill.txt";
+        }
+        else
+        {
+            path = AssetVersionUtility.GetAssetFilePath("config/BOSSFirstKill.txt");
+        }
+
+        configs.Clear();
+		var tempConfig = new BOSSFirstKillConfig();
+        var preParse = tempConfig is IConfigPostProcess;
+
+        if (sync)
+        {
+            var lines = File.ReadAllLines(path);
+            if (!preParse)
+            {
+                rawDatas = new Dictionary<string, string>(lines.Length - 3);
+            }
+            for (int i = 3; i < lines.Length; i++)
+            {
+				try 
+				{
+					var line = lines[i];
+					var index = line.IndexOf("\t");
+					if (index == -1)
+					{
+						continue;
+					}
+					var id = line.Substring(0, index);
+
+					if (preParse)
+					{
+						var config = new BOSSFirstKillConfig(line);
+						configs[id] = config;
+						(config as IConfigPostProcess).OnConfigParseCompleted();
+					}
+					else
+					{
+						rawDatas[id] = line;
+					}
+				}
+				catch (System.Exception ex)
+                {
+                    Debug.LogError(ex);
+                }
+            }
+			inited = true;
+        }
+        else
+        {
+            ThreadPool.QueueUserWorkItem((object _object) =>
+            {
+                var lines = File.ReadAllLines(path);
+				if (!preParse)
+				{
+					rawDatas = new Dictionary<string, string>(lines.Length - 3);
+				}
+                for (int i = 3; i < lines.Length; i++)
+                {
+					try 
+					{
+					   var line = lines[i];
+						var index = line.IndexOf("\t");
+						if (index == -1)
+						{
+							continue;
+						}
+						var id = line.Substring(0, index);
+
+						if (preParse)
+						{
+							var config = new BOSSFirstKillConfig(line);
+							configs[id] = config;
+							(config as IConfigPostProcess).OnConfigParseCompleted();
+						}
+						else
+						{
+							rawDatas[id] = line;
+						}
+					}
+					catch (System.Exception ex)
+                    {
+                        Debug.LogError(ex);
+                    }
+                }
+
+                inited = true;
+            });
+        }
+    }
+
+}
+
+
+
+
diff --git a/Core/GameEngine/Model/Config/BOSSFirstKillConfig.cs.meta b/Core/GameEngine/Model/Config/BOSSFirstKillConfig.cs.meta
new file mode 100644
index 0000000..a49d6fc
--- /dev/null
+++ b/Core/GameEngine/Model/Config/BOSSFirstKillConfig.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 5ca772d5c4e9a55429c17ebcaccfe4a3
+timeCreated: 1571198699
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Core/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA901_tagCGGetBossFirstKillAward.cs.meta b/Core/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA901_tagCGGetBossFirstKillAward.cs.meta
new file mode 100644
index 0000000..bf30dfe
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA901_tagCGGetBossFirstKillAward.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: c655e19a477d35042a649499baca7649
+timeCreated: 1571173614
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs b/Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs
index d57b2a5..3ed0a03 100644
--- a/Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs
@@ -1,11 +1,15 @@
 using UnityEngine;
 using System.Collections;
+using Snxxz.UI;
 
 // AB 01 Boss首杀玩家奖励信息 #tagMCBossFirstKillStateInfo

 

-public class DTCAB01_tagMCBossFirstKillStateInfo : DtcBasic {

+public class DTCAB01_tagMCBossFirstKillStateInfo : DtcBasic {
+
+    BossFirstBloodModel model { get { return ModelCenter.Instance.GetModel<BossFirstBloodModel>(); } }
+
     public override void Done(GameNetPackBasic vNetPack) {

         base.Done(vNetPack);

-        HAB01_tagMCBossFirstKillStateInfo vNetData = vNetPack as HAB01_tagMCBossFirstKillStateInfo;

+        HAB01_tagMCBossFirstKillStateInfo vNetData = vNetPack as HAB01_tagMCBossFirstKillStateInfo;
        model.BossFirstKillStateInfo(vNetData);
     }

 }

diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs.meta b/Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs.meta
new file mode 100644
index 0000000..bf77eef
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HAB_Activity/DTCAB01_tagMCBossFirstKillStateInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 06605f7cdac6d5d4c9fbeebbddc55643
+timeCreated: 1571173613
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Core/NetworkPackage/ServerPack/HAB_Activity/HAB01_tagMCBossFirstKillStateInfo.cs.meta b/Core/NetworkPackage/ServerPack/HAB_Activity/HAB01_tagMCBossFirstKillStateInfo.cs.meta
new file mode 100644
index 0000000..bd452e4
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HAB_Activity/HAB01_tagMCBossFirstKillStateInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 560fee9fcb7d5f640ab899e9d565de5a
+timeCreated: 1571173614
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/OpenServerActivity/BossFirstBloodCell.cs b/System/OpenServerActivity/BossFirstBloodCell.cs
new file mode 100644
index 0000000..991b190
--- /dev/null
+++ b/System/OpenServerActivity/BossFirstBloodCell.cs
@@ -0,0 +1,39 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+    public class BossFirstBloodCell : CellView
+    {
+        [SerializeField] Image m_Select;
+        [SerializeField] Image m_NPCIcon;
+        [SerializeField] Button m_FuncBtn;
+        public Button funcBtn
+        {
+            get
+            {
+                return m_FuncBtn;
+            }
+        }
+
+        public void Display(int index)
+        {
+
+        }
+
+        public void ShowIcon(int _npcId, bool isSelect)
+        {
+            m_Select.SetActive(isSelect);
+            m_NPCIcon.SetActive(true);
+            var npcConfig = NPCConfig.Get(_npcId);
+            m_NPCIcon.SetSprite(npcConfig.HeadPortrait);
+        }
+
+
+    }
+
+}
+
diff --git a/System/OpenServerActivity/BossFirstBloodCell.cs.meta b/System/OpenServerActivity/BossFirstBloodCell.cs.meta
new file mode 100644
index 0000000..49ab74a
--- /dev/null
+++ b/System/OpenServerActivity/BossFirstBloodCell.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 8bbc9f5e82bef84429cb0e84e3fe3f09
+timeCreated: 1571153190
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/OpenServerActivity/BossFirstBloodItemInfo.cs b/System/OpenServerActivity/BossFirstBloodItemInfo.cs
new file mode 100644
index 0000000..f892f35
--- /dev/null
+++ b/System/OpenServerActivity/BossFirstBloodItemInfo.cs
@@ -0,0 +1,30 @@
+锘�//--------------------------------------------------------
+//    [Author]:           绗簩涓栫晫
+//    [  Date ]:           Monday, July 23, 2018
+//--------------------------------------------------------
+using UnityEngine;
+using System.Collections;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+    public class BossFirstBloodItemInfo : MonoBehaviour
+    {
+        [SerializeField] RectTransform m_AlreadyGet;
+        [SerializeField] ItemCell m_Itemcell;
+        public RectTransform AlreadyGetImage
+        {
+            get { return m_AlreadyGet; }
+        }
+        public ItemCell Item_Cell
+        {
+            get { return m_Itemcell; }
+            set { m_Itemcell = value; }
+        }
+    }
+
+}
+
+
+
diff --git a/System/OpenServerActivity/BossFirstBloodItemInfo.cs.meta b/System/OpenServerActivity/BossFirstBloodItemInfo.cs.meta
new file mode 100644
index 0000000..9053703
--- /dev/null
+++ b/System/OpenServerActivity/BossFirstBloodItemInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: e1dbecb5544a32d408e1e900f6617f37
+timeCreated: 1571188092
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/OpenServerActivity/BossFirstBloodModel.cs b/System/OpenServerActivity/BossFirstBloodModel.cs
new file mode 100644
index 0000000..961ff79
--- /dev/null
+++ b/System/OpenServerActivity/BossFirstBloodModel.cs
@@ -0,0 +1,156 @@
+锘縰sing System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+namespace Snxxz.UI
+{
+    [XLua.LuaCallCSharp]
+    public class BossFirstBloodModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
+    {
+
+
+        ImpactRankModel impactRankModel
+        {
+            get
+            {
+                return ModelCenter.Instance.GetModel<ImpactRankModel>();
+            }
+        }
+
+        public int selectIndex = 0;
+        public int selectNPCID = 0;
+
+        public struct FirstKillTimeInfo
+        {
+            public string name;
+            public string time;
+        }
+
+        Dictionary<int, int> FirstKillStateInfo = new Dictionary<int, int>(); // 鍑绘潃濂栧姳鐘舵��
+        public Dictionary<int, FirstKillTimeInfo> firstKillTimeInfo = new Dictionary<int, FirstKillTimeInfo>(); // 棣栨潃鍚嶅拰鏃堕棿
+        public List<string> npcIDConfig;
+        public bool IsOpen
+        {
+            get
+            {
+                return impactRankModel.IsOpen;
+            }
+        }
+
+        public bool priorityOpen
+        {
+            get
+            {
+                //var state = impactRankRedpoint.state;
+                //return state == RedPointState.Simple || state == RedPointState.GetReward;
+                return false;
+            }
+        }
+
+        public bool IsAdvance
+        {
+            get
+            {
+                return false;
+            }
+        }
+
+
+        public event Action<int> onStateUpdate;
+
+        public override void Init()
+        {
+            OpenServerActivityCenter.Instance.Register(100, this);
+            InitNpcInfo();
+            DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo += OnGetUniversalGameInfo;
+        }
+        private void SendGameRec()
+        {
+            var pak = new CA001_tagViewUniversalGameRec();
+            pak.ViewType = 31;
+            GameNetSystem.Instance.SendInfo(pak);
+        }
+        public event Action<int> OnFirstKillInfo;
+        private void OnGetUniversalGameInfo(HA003_tagUniversalGameRecInfo package)
+        {
+            if (package.Type == 31)
+            {
+                for (int i = 0; i < package.Count; i++)
+                {
+                    int npcID = (int)package.UniversalGameRec[i].Value1;
+                    firstKillTimeInfo[(int)package.UniversalGameRec[i].Value1] = new FirstKillTimeInfo()
+                    {
+                        name = package.UniversalGameRec[i].StrValue3,
+                        time = package.UniversalGameRec[i].StrValue2,
+
+                    };
+                    if (!WindowCenter.Instance.IsOpen<BossFirstBloodWin>() && OnFirstKillInfo != null)
+                        OnFirstKillInfo(npcID);
+                }
+            }
+
+        }
+
+        public void OnBeforePlayerDataInitialize()
+        {
+            FirstKillStateInfo.Clear();
+            firstKillTimeInfo.Clear();
+        }
+
+        public void OnPlayerLoginOk()
+        {
+            SendGameRec();
+        }
+
+        public void InitNpcInfo()
+        {
+            npcIDConfig = BOSSFirstKillConfig.GetKeys();
+            npcIDConfig.Sort((string x, string y) =>
+            {
+                var infoX = BOSSFirstKillConfig.Get(x);
+                var infoY = BOSSFirstKillConfig.Get(y);
+                return infoX.Sort.CompareTo(infoY.Sort);
+            });
+        }
+
+        public override void UnInit()
+        {
+
+        }
+        public event Action<int> UpdatePersonnalKillEvent;
+        public void BossFirstKillStateInfo(HAB01_tagMCBossFirstKillStateInfo package)
+        {
+            for (int i=0; i < package.BossCount; i++)
+            {
+                FirstKillStateInfo[(int)package.FirstKillStateList[i].NPCID] = (int)package.FirstKillStateList[i].FKState;
+                if (UpdatePersonnalKillEvent != null)
+                    UpdatePersonnalKillEvent((int)package.FirstKillStateList[i].NPCID);
+            }
+        }
+
+        public int GetPersonalKillAwardState(int npcID)
+        {
+            //0 鏈嚮鏉� 1 鍙鍙� 2 宸查鍙�
+            if (FirstKillStateInfo.ContainsKey(npcID))
+            {
+                int state = FirstKillStateInfo[npcID];
+                if (state % 10 == 0)
+                    return 0;
+                if (state % 10 > 0 && state/100 == 0)
+                    return 1;
+                if (state % 10 > 0 && state / 100 == 1)
+                    return 2;
+            }
+            return 0;
+        }
+
+        public bool IsAlreadyFirstKill(int npcID)
+        {
+            if (firstKillTimeInfo.ContainsKey(npcID))
+                return true;
+            return false;
+        }
+    }
+}
diff --git a/System/OpenServerActivity/BossFirstBloodModel.cs.meta b/System/OpenServerActivity/BossFirstBloodModel.cs.meta
new file mode 100644
index 0000000..a5b8d95
--- /dev/null
+++ b/System/OpenServerActivity/BossFirstBloodModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d2c7a8e1ad666b94d925259e5ab528a0
+timeCreated: 1571131037
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/OpenServerActivity/BossFirstBloodWin.cs b/System/OpenServerActivity/BossFirstBloodWin.cs
new file mode 100644
index 0000000..4a962b5
--- /dev/null
+++ b/System/OpenServerActivity/BossFirstBloodWin.cs
@@ -0,0 +1,309 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using LitJson;
+
+namespace Snxxz.UI
+{
+    //寮�鏈嶆椿鍔˙OSS棣栨潃
+    public class BossFirstBloodWin : Window
+    {
+        [SerializeField] Button m_Goto;
+        [SerializeField] Button m_GetAward; 
+        [SerializeField] ScrollerController m_BossCtrl;
+        [SerializeField] RawImage m_MonsterPortrait;
+        [SerializeField] Transform m_HorizontaFirstBlood;
+        [SerializeField] Transform m_HorizontaKill;
+        [SerializeField] Text m_NPCNameLV;
+        [SerializeField] Text m_PlayerName;
+        [SerializeField] Text m_KillTime;
+
+        BossFirstBloodModel model
+        {
+            get
+            {
+                return ModelCenter.Instance.GetModel<BossFirstBloodModel>();
+            }
+        }
+        FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
+        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
+        protected override void AddListeners()
+        {
+            
+        }
+
+        private void OnRefreshCell(ScrollerDataType type, CellView cell)
+        {
+            if (type == ScrollerDataType.Header)
+                RefreshNPCCell(cell as BossFirstBloodCell);
+
+        }
+        private void RefreshNPCCell(BossFirstBloodCell _cell)
+        {
+            int npcID = _cell.info.Value.infoInt1;
+            _cell.ShowIcon(npcID, _cell.index == model.selectIndex);
+            _cell.funcBtn.onClick.RemoveAllListeners();
+            _cell.funcBtn.onClick.AddListener(() =>
+            {
+                OnBossIconClick(npcID, _cell.index);
+            });
+
+        }
+        private void GotoKillBoss(int npcID)
+        {
+            var error = 0;
+            if (TestGotoKillBoss(npcID, out error))
+            {
+                WindowJumpMgr.Instance.ClearJumpData();
+                WindowCenter.Instance.Close<OpenServerActivityRankWin>();
+                MapTransferUtility.Instance.MoveToNPC(npcID);
+            }
+            else
+            {
+                ProcessGotoKillBossError(npcID, error);
+            }
+        }
+        private void ProcessGotoKillBossError(int npcID, int _error)
+        {
+            switch (_error)
+            {
+                case 1:
+                    var dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
+                    var config = DungeonOpenTimeConfig.Get(dataMapId);
+                    var tip = Language.Get(config.ExitDescription);
+
+
+                    ConfirmCancel.ShowPopConfirm(
+                        Language.Get("Mail101"),
+                        tip,
+                        (bool _ok) =>
+                        {
+                            if (_ok)
+                            {
+                                WindowCenter.Instance.Close<FindPreciousFrameWin>();
+                                MapTransferUtility.Instance.MoveToNPC(npcID);
+                            }
+                        }
+                        );
+                    break;
+                case 2:
+                    SysNotifyMgr.Instance.ShowTip("InDungeon_CantGo");
+                    break;
+                case 3:
+                    SysNotifyMgr.Instance.ShowTip("CrossMap10");
+                    break;
+                case 4:
+                    SysNotifyMgr.Instance.ShowTip("BossRealmHint2", NPCConfig.Get(npcID).Realm);
+                    break;
+            }
+        }
+        private bool TestGotoKillBoss(int npcID, out int _error)
+        {
+            if (!findPreciousModel.IsBossUnlock(npcID))
+            {
+                _error = 4;
+                return false;
+            }
+
+            var mapId = PlayerDatas.Instance.baseData.MapID;
+            var dataMapId = MapUtility.GetDataMapId(mapId);
+            if (dataMapId == ElderGodAreaModel.ELDERGODAREA_MAPID)
+            {
+                _error = 1;
+                return false;
+            }
+
+            var mapConfig = MapConfig.Get(mapId);
+            if (mapConfig.MapFBType != (int)MapType.OpenCountry)
+            {
+                _error = 2;
+                return false;
+            }
+
+            if (CrossServerUtility.IsCrossServer() || ClientCrossServerOneVsOne.isClientCrossServerOneVsOne)
+            {
+                _error = 3;
+                return false;
+            }
+
+            _error = 0;
+            return true;
+        }
+
+        private void SendGetAward(int npcID, int awardType)
+        {
+            var pak = new CA901_tagCGGetBossFirstKillAward();
+            pak.NPCID = (uint)npcID;
+            pak.AwardType = (byte)awardType;
+            GameNetSystem.Instance.SendInfo(pak);
+        }
+
+
+
+        private void OnBossIconClick(int npcID, int index)
+        {
+            var npcConfig = NPCConfig.Get(npcID);
+            UI3DModelExhibition.Instance.ShowNPC(npcID, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_MonsterPortrait);
+            model.selectIndex = index;
+            model.selectNPCID = npcID;
+            m_BossCtrl.m_Scorller.RefreshActiveCellViews();
+
+            m_NPCNameLV.text = npcConfig.charName + " LV." + npcConfig.NPCLV;
+
+            ShowKillInfo(npcID);
+        }
+
+        public void ShowKillInfo(int npcID)
+        {
+            if (model.selectNPCID != npcID)
+                return;
+            var fkInfo = BOSSFirstKillConfig.Get(npcID);
+            bool isAlreadyFirstKill = model.IsAlreadyFirstKill(npcID);
+            int killStateSelf = model.GetPersonalKillAwardState(npcID);
+
+            m_Goto.RemoveAllListeners();
+            m_GetAward.RemoveAllListeners();
+            if (killStateSelf == 1)
+            {
+                m_GetAward.gameObject.SetActive(true);
+                m_Goto.gameObject.SetActive(false);
+                m_GetAward.AddListener(() =>
+                {
+                    SendGetAward(npcID, 1);
+                });
+
+            }
+            else
+            {
+                m_GetAward.gameObject.SetActive(false);
+                m_Goto.gameObject.SetActive(true);
+                m_Goto.AddListener(() =>
+                {
+                    GotoKillBoss(npcID);
+                });
+            }
+            if (isAlreadyFirstKill)
+            {
+                m_PlayerName.text = "棣栨潃鐜╁锛�" + model.firstKillTimeInfo[npcID].name;
+                m_KillTime.text = "棣栨潃鏃堕棿锛�" + model.firstKillTimeInfo[npcID].time;
+            }
+            else
+            {
+                m_PlayerName.text = "鏆傛棤鐜╁棣栨潃";
+                m_KillTime.text = string.Empty;
+            }
+
+
+            //棣栨潃濂栧姳
+            for (int i = 0; i < m_HorizontaFirstBlood.childCount; i++)
+            {
+                m_HorizontaFirstBlood.GetChild(i).gameObject.SetActive(false);
+            }
+            var fkitemsArray = JsonMapper.ToObject<int[][]>(fkInfo.ServerFirstKillPlayerAward);
+
+            for (int type = 0; type < fkitemsArray.Length; type++)
+            {
+                if (type < m_HorizontaFirstBlood.childCount)
+                {
+                    int itemId = fkitemsArray[type][0];
+                    var Item_Info = m_HorizontaFirstBlood.GetChild(type);
+                    Item_Info.gameObject.SetActive(true);
+                    BossFirstBloodItemInfo firstBItemInfo = Item_Info.GetComponent<BossFirstBloodItemInfo>();
+
+                    firstBItemInfo.AlreadyGetImage.SetActive(isAlreadyFirstKill);
+                    var ItemCell = firstBItemInfo.Item_Cell;
+                    var Item = ItemConfig.Get(itemId);
+                    ItemCellModel cellModel = new ItemCellModel(itemId, true, (ulong)fkitemsArray[type][1]);
+                    ItemCell.Init(cellModel);
+                    ItemCell.button.RemoveAllListeners();
+                    ItemCell.button.AddListener(() =>
+                    {
+                        ItemTipUtility.Show(itemId);
+                    });
+                }
+            }
+
+
+            //鍑绘潃濂栧姳
+            for (int i = 0; i < m_HorizontaKill.childCount; i++)
+            {
+                m_HorizontaKill.GetChild(i).gameObject.SetActive(false);
+            }
+            var itemsArray = JsonMapper.ToObject<int[][]>(fkInfo.PersonFirstKillAward);
+
+            for (int type = 0; type < itemsArray.Length; type++)
+            {
+                if (type < m_HorizontaKill.childCount)
+                {
+                    int itemId = itemsArray[type][0];
+                    var Item_Info = m_HorizontaKill.GetChild(type);
+                    Item_Info.gameObject.SetActive(true);
+                    BossFirstBloodItemInfo itemInfo = Item_Info.GetComponent<BossFirstBloodItemInfo>();
+
+                    itemInfo.AlreadyGetImage.SetActive(killStateSelf == 2);
+
+                    var ItemCell = itemInfo.Item_Cell;
+                    var Item = ItemConfig.Get(itemId);
+                    ItemCellModel cellModel = new ItemCellModel(itemId, true, (ulong)itemsArray[type][1]);
+                    ItemCell.Init(cellModel);
+                    ItemCell.button.RemoveAllListeners();
+                    ItemCell.button.AddListener(() =>
+                    {
+                        ItemTipUtility.Show(itemId);
+                    });
+                }
+            }
+        }
+        protected override void BindController()
+        {
+        }
+
+        protected override void OnAfterClose()
+        {
+        }
+
+        protected override void OnAfterOpen()
+        {
+            JumpNpcByIndex(0);
+        }
+
+        protected override void OnPreClose()
+        {
+            m_BossCtrl.OnRefreshCell -= OnRefreshCell;
+            model.UpdatePersonnalKillEvent -= ShowKillInfo;
+
+        }
+
+        protected override void OnPreOpen()
+        {
+            m_BossCtrl.OnRefreshCell += OnRefreshCell;
+            model.UpdatePersonnalKillEvent += ShowKillInfo;
+            CreateNPCScroll();
+        }
+        private void CreateNPCScroll()
+        { 
+            int i = 0;
+            m_BossCtrl.Refresh();
+            foreach (string npcID in model.npcIDConfig)
+            {
+                CellInfo info = new CellInfo();
+                info.infoInt1 = int.Parse(npcID);
+                m_BossCtrl.AddCell(ScrollerDataType.Header, i, info);
+                i++;
+            }
+            m_BossCtrl.Restart();
+            m_BossCtrl.m_Scorller.RefreshActiveCellViews();
+        }
+
+        public void JumpNpcByIndex(int index)
+        {
+            m_BossCtrl.JumpIndex(index);
+            CellView cell = m_BossCtrl.GetActiveCellView(index);
+            int npcID = cell.info.Value.infoInt1;
+            OnBossIconClick(npcID, index);
+        }
+
+    }
+}
\ No newline at end of file
diff --git a/System/OpenServerActivity/BossFirstBloodWin.cs.meta b/System/OpenServerActivity/BossFirstBloodWin.cs.meta
new file mode 100644
index 0000000..7fa0e06
--- /dev/null
+++ b/System/OpenServerActivity/BossFirstBloodWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 9d4a5b1d950033e4db894f82da239494
+timeCreated: 1571125936
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/OpenServerActivity/OpenServerActivityRankWin.cs b/System/OpenServerActivity/OpenServerActivityRankWin.cs
index 490e896..77f1680 100644
--- a/System/OpenServerActivity/OpenServerActivityRankWin.cs
+++ b/System/OpenServerActivity/OpenServerActivityRankWin.cs
@@ -26,6 +26,7 @@
 
         protected override void BindController()
         {
+            m_OpenServerActivities.Add(100);
             m_OpenServerActivities.Add(0);
 
         }
@@ -65,8 +66,10 @@
                 functionOrder = GetDefaultSelect();
                 UpdateFunctionBtns();
             }
-
-            WindowCenter.Instance.Open("ImpactRankWin", true);
+            if (functionOrder != 0)
+                WindowCenter.Instance.Open<BossFirstBloodWin>();
+            else
+                WindowCenter.Instance.Open<ImpactRankWin>();
 
             var index = alreadyOpenActivitys.IndexOf(functionOrder);
 
@@ -83,7 +86,7 @@
             TimeUtility.OnServerOpenDayRefresh -= OnStepServerDayEvent;
             OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
             impactRankModel.gotoImpactRankType = 0;
-            WindowCenter.Instance.Close("ImpactRankWin");
+            CloseOtherWin();
         }
 
         protected override void OnAfterClose()
@@ -190,14 +193,58 @@
 
             _cell.redpoint.redpointId = MainRedDot.REDPOINT_OPENRANK * 100 + activityType;
             _cell.SetSelect(_cell.activityType == functionOrder);
-            _cell.icon.SetSprite("OpenServerActivty_QMCB");
-
+            if (_cell.activityType == 0)
+                _cell.icon.SetSprite("OpenServerActivty_QMCB");
+            else
+                _cell.icon.SetSprite("OpenServerActivty_BOSSFK");
             _cell.downArrow.gameObject.SetActive(false);
             _cell.upArrow.gameObject.SetActive(false);
 
 
             _cell.funcBtn.onClick.RemoveAllListeners();
-            
+            _cell.funcBtn.onClick.AddListener(() =>
+            {
+                OnActivityClick(_cell.activityType);
+            });
+
+        }
+
+        private void CloseOtherWin()
+        {
+            var children = WindowConfig.GetChildWindows("OpenServerActivityRankWin");
+            foreach (var window in children)
+            {
+                WindowCenter.Instance.Close(window);
+            }
+        }
+
+        private void OnActivityClick(int _order)
+        {
+
+            if (functionOrder != _order)
+            {
+                functionOrder = _order;
+                OnOpenActivity(functionOrder);
+            }
+
+
+            UpdateFunctionBtns();
+        }
+
+        private void OnOpenActivity(int _order)
+        {
+            CloseOtherWin();
+
+            var functionInfos = WindowConfig.GetWindowFunctionInfos("OpenServerActivityRankWin");
+            var index = functionInfos.FindIndex((x) =>
+            {
+                return x.order == _order;
+            });
+
+            if (index != -1)
+            {
+                WindowCenter.Instance.Open(functionInfos[index].window, true);
+            }
         }
 
         private void OnStepServerDayEvent()
@@ -258,6 +305,7 @@
                         break;
                     
                     default:
+                        m_ActivityCtrl.AddCell(ScrollerDataType.Header, activityId);
                         break;
                 }
             }
@@ -268,6 +316,8 @@
 
         private void OnActivityType(int _index)
         {
+            if (!WindowCenter.Instance.IsOpen<ImpactRankWin>())
+                OnActivityClick(0);
             var _order = _index / 100;
             var _type = _index % 100;
             if (impactRankModel.IsLock(_type))
diff --git a/System/Vip/DayPackageModel.cs b/System/Vip/DayPackageModel.cs
index 7e06883..c2f0b01 100644
--- a/System/Vip/DayPackageModel.cs
+++ b/System/Vip/DayPackageModel.cs
@@ -152,6 +152,8 @@
         m_RechargeDict[0].getCount = package.DayFreeGoldGiftState;
         
         if (onStateUpdate != null) onStateUpdate(selectIndex);
+
+        IsShowTip();
     }
 
     public void OpenFreePlat(string Title, float RMBNum, string OrderInfo)
diff --git a/System/WindowBase/ModelCenter.cs b/System/WindowBase/ModelCenter.cs
index 60f5c5c..cc19126 100644
--- a/System/WindowBase/ModelCenter.cs
+++ b/System/WindowBase/ModelCenter.cs
@@ -80,7 +80,8 @@
             {
                 RegisterModel<GMCmdModel>();
             }
-
+            
+            RegisterModel<BossFirstBloodModel>();
             RegisterModel<UnionTaskModel>();
             RegisterModel<FriendsModel>();
             RegisterModel<RoleParticularModel>();
@@ -236,6 +237,7 @@
             RegisterModel<NewDropItemModel>();
             RegisterModel<ExchangeActiveTokenModel>();
             RegisterModel<AddUpRechargeModel>();
+            RegisterModel<BossFirstBloodModel>();
             inited = true;
         }
 
diff --git a/Utility/ConfigInitiator.cs b/Utility/ConfigInitiator.cs
index dcff8ab..0a26322 100644
--- a/Utility/ConfigInitiator.cs
+++ b/Utility/ConfigInitiator.cs
@@ -300,6 +300,7 @@
         normalTasks.Add(new ConfigInitTask("ReikiRootEffectConfig", () => { ReikiRootEffectConfig.Init(); }, () => { return ReikiRootEffectConfig.inited; }));
         normalTasks.Add(new ConfigInitTask("ItemExchangeConfig", () => { ItemExchangeConfig.Init(); }, () => { return ItemExchangeConfig.inited; }));
         normalTasks.Add(new ConfigInitTask("AddUpRechargeConfig", () => { AddUpRechargeConfig.Init(); }, () => { return AddUpRechargeConfig.inited; }));
+        normalTasks.Add(new ConfigInitTask("BOSSFirstKillConfig", () => { BOSSFirstKillConfig.Init(); }, () => { return BOSSFirstKillConfig.inited; }));
     }
 
     static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>();

--
Gitblit v1.8.0