From 62d9cc10d465a9a47e08e55e76ff9f134f3ba574 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 03 四月 2019 14:15:10 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/MainInterfacePanel/TaskModel.cs |  224 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 138 insertions(+), 86 deletions(-)

diff --git a/System/MainInterfacePanel/TaskModel.cs b/System/MainInterfacePanel/TaskModel.cs
index 7ec5555..df02015 100644
--- a/System/MainInterfacePanel/TaskModel.cs
+++ b/System/MainInterfacePanel/TaskModel.cs
@@ -135,7 +135,8 @@
     private int Times = 0;
     private int NeedWaitTime = 4;
     PackModel _playerPack;
-    PackModel playerPack {
+    PackModel playerPack
+    {
         get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
     }
 
@@ -197,8 +198,6 @@
         AutomaticityBool = true;
         TaskOverBool = false;
     }
-
-
 
     private void onStageLoadFinish()//鍦板浘鍒囨崲鏃惰皟鐢�
     {
@@ -311,7 +310,7 @@
 
         if (CrossServerUtility.IsCrossServer())
         {
-            var  sendInfo = new CC106_tagCMCrossNPCTalk();
+            var sendInfo = new CC106_tagCMCrossNPCTalk();
             sendInfo.ObjID = instanceId;
             sendInfo.NPCID = (uint)NPcID;
             sendInfo.PosX = (ushort)Posx;
@@ -328,17 +327,17 @@
         }
     }
 
-    public int GetLatestMainTaskId()
-    {
-        var taskId = 0;
-        foreach (var id in MainTaskDic.Keys)
-        {
-            if (id > taskId)
-            {
-                taskId = id;
-            }
-        }
-        return taskId;
+    public int GetLatestMainTaskId()
+    {
+        var taskId = 0;
+        foreach (var id in MainTaskDic.Keys)
+        {
+            if (id > taskId)
+            {
+                taskId = id;
+            }
+        }
+        return taskId;
     }
 
     void DefaultDialogue()//鍏充簬鎵撳紑榛樿瀵硅瘽鐣岄潰
@@ -363,39 +362,39 @@
         if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
         {
             return;
-        }
-
-        bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
+        }
 
-        var state = 0;
-        if (TryGetCustomTaskState(taskID, out state))
-        {
-            var config = StoryMissionsConfig.GetConfig(taskID, state);
-            if (config != null && NPCid == config.NpcID)
-            {
-                if (!WindowCenter.Instance.IsOpen<DialogueDuidanceWin>() && IsOpenMain
-                     && !WindowCenter.Instance.ExistAnyFullScreenOrMaskWin())
-                {
-                    WindowCenter.Instance.Close<MainInterfaceWin>();
-                    DialogueDuidanceWin.storyMissionId = config.id;
-                    WindowCenter.Instance.Open<DialogueDuidanceWin>();
-                }
-                return;
-            }
-        }
-        if (!WindowCenter.Instance.IsOpen<TaskBoxBGMWin>() && IsOpenMain)
-        {
-            WindowCenter.Instance.Close<MainInterfaceWin>();
-            WindowCenter.Instance.Open<TaskBoxBGMWin>();
-            return;
-        }
-        if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow))
-        {
-            if (!ModelCenter.Instance.GetModel<TeamModel>().teamPrepare.isPreparing)
-            {
-                RequestGetTaskAward("OK");
-            }
-        }
+        bool IsOpenMain = WindowCenter.Instance.IsOpen<MainInterfaceWin>();
+
+        var state = 0;
+        if (TryGetCustomTaskState(taskID, out state))
+        {
+            var config = StoryMissionsConfig.GetConfig(taskID, state);
+            if (config != null && NPCid == config.NpcID)
+            {
+                if (!WindowCenter.Instance.IsOpen<DialogueDuidanceWin>() && IsOpenMain
+                     && !WindowCenter.Instance.ExistAnyFullScreenOrMaskWin())
+                {
+                    WindowCenter.Instance.Close<MainInterfaceWin>();
+                    DialogueDuidanceWin.storyMissionId = config.id;
+                    WindowCenter.Instance.Open<DialogueDuidanceWin>();
+                }
+                return;
+            }
+        }
+        if (!WindowCenter.Instance.IsOpen<TaskBoxBGMWin>() && IsOpenMain)
+        {
+            WindowCenter.Instance.Close<MainInterfaceWin>();
+            WindowCenter.Instance.Open<TaskBoxBGMWin>();
+            return;
+        }
+        if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow))
+        {
+            if (!ModelCenter.Instance.GetModel<TeamModel>().teamPrepare.isPreparing)
+            {
+                RequestGetTaskAward("OK");
+            }
+        }
     }
 
 
@@ -409,19 +408,19 @@
 
     }
 
-    public bool TryGetCustomTaskState(int taskId, out int state)
-    {
-        state = 0;
-        if (ReplaceDic.ContainsKey(taskId))
-        {
-            var keyValue = ReplaceDic[taskId];
-            if (keyValue.ContainsKey("state"))
-            {
-                state = keyValue["state"];
-                return true;
-            }
-        }
-        return false;
+    public bool TryGetCustomTaskState(int taskId, out int state)
+    {
+        state = 0;
+        if (ReplaceDic.ContainsKey(taskId))
+        {
+            var keyValue = ReplaceDic[taskId];
+            if (keyValue.ContainsKey("state"))
+            {
+                state = keyValue["state"];
+                return true;
+            }
+        }
+        return false;
     }
 
     void AddMission(int MissionID, int MissionState, int DiscriptionIndex)//娣诲姞浠诲姟
@@ -538,10 +537,10 @@
                         {
                             MainTaskDic.Add(_taskID, allMissionDict[_taskID]);
                         }
-                        if (Event_MainlineTask != null)
-                        {
+                        if (Event_MainlineTask != null)
+                        {
                             Event_MainlineTask(_taskID, MissionState);
-                        }
+                        }
                     }
 
                 }
@@ -831,14 +830,33 @@
         }
     }
 
+    private List<int> m_NeedHideNpcList = new List<int>();
+
     public void Task0820(H0820_tagMissionDict info)//0820淇℃伅瀛楀吀
     {
+        m_NeedHideNpcList.Clear();
+        foreach (var _id in NPCShowDic.Keys)
+        {
+            if (NPCShowDic[_id] == 1)
+            {
+                var _npcConfig = NPCConfig.Get(_id);
+                if (_npcConfig.Show == 0)
+                {
+                    m_NeedHideNpcList.Add(_id);
+                }
+            }
+        }
+        foreach (var _id in m_NeedHideNpcList)
+        {
+            GA_NpcFunc.SetNpcFuncVisible(_id, false);
+            NPCShowDic[_id] = 0;
+        }
         Dictionary<string, int> dic = null;
         ReplaceDic.TryGetValue((int)info.MissionID, out dic);
         if (dic == null)
         {
             dic = new Dictionary<string, int>();
-            StorageNPCDic(info.DictKey, (int)info.DictValue);
+            StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue);
             dic.Add(info.DictKey, (int)info.DictValue);
             ReplaceDic.Add((int)info.MissionID, dic);
         }
@@ -846,7 +864,7 @@
         {
             if (dic.ContainsKey(info.DictKey))
             {
-                StorageNPCDic(info.DictKey, (int)info.DictValue);
+                StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue);
                 dic[info.DictKey] = (int)info.DictValue;
                 if (info.DictKey == "around_allcount")
                 {
@@ -865,7 +883,7 @@
             }
             else
             {
-                StorageNPCDic(info.DictKey, (int)info.DictValue);
+                StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue);
                 dic.Add(info.DictKey, (int)info.DictValue);
             }
         }
@@ -1265,8 +1283,10 @@
     }
 
     private PackModel m_PlayerBackModel;
-    private PackModel PlayerBackModel {
-        get {
+    private PackModel PlayerBackModel
+    {
+        get
+        {
             return m_PlayerBackModel ?? (m_PlayerBackModel = ModelCenter.Instance.GetModel<PackModel>());
         }
     }
@@ -1371,7 +1391,7 @@
         return 0;
     }
 
-    private void StorageNPCDic(string key, int Value)//鍏充簬NPC鐨勬樉闅�
+    private void StorageNPCDic(uint taskId, string key, int Value)//鍏充簬NPC鐨勬樉闅�
     {
         string[] str = key.Split('_');
         if (str[0] == "Show")
@@ -1380,16 +1400,48 @@
             if (NPCShowDic.ContainsKey(NPCid))
             {
                 NPCShowDic[NPCid] = Value;
-
             }
             else
             {
                 NPCShowDic.Add(NPCid, Value);
             }
+
+            ShowNpc((int)taskId, NPCid);
         }
     }
 
+    private void ShowNpc(int taskID, int Npcid = -1)
+    {
+        if (ReplaceDic.ContainsKey(taskID))
+        {
+            if (Npcid > 0)
+            {
+                if (Npcid != 0 && NPCShowDic.ContainsKey(Npcid))
+                {
+                    if (NPCShowDic[Npcid] == 0)
+                    {
+                        if (FaBaoNPCIdList.Contains(Npcid))
+                        {
+                            GA_NpcFunc.SetNpcFuncVisible(Npcid, false, 0.5f, (Vector3 _pos) =>
+                            {
+                                WindowCenter.Instance.Open<EffectToFaBaoWin>();
+                                UIeffectFabaoVec = _pos;
+                            }, 0.3f);
+                        }
+                        else
+                        {
+                            GA_NpcFunc.SetNpcFuncVisible(Npcid, false);
+                        }
 
+                    }
+                    else if (NPCShowDic[Npcid] == 1)
+                    {
+                        GA_NpcFunc.SetNpcFuncVisible(Npcid, true);
+                    }
+                }
+            }
+        }
+    }
 
     private void IsShowNpC(int _taskID)//鍏充簬NPC鐨勬樉闅�
     {
@@ -1581,22 +1633,22 @@
         else
         {
             IsGetOnBool = false;
-        }
-
-        if (TaskOverBool)
-        {
-            Times += 1;
-            if (Times >= NeedTime)
-            {
-                TaskOverBool = false;
-            }
-        }
-        else
-        {
-            if (Times != 0)
-            {
-                Times = 0;
-            }
+        }
+
+        if (TaskOverBool)
+        {
+            Times += 1;
+            if (Times >= NeedTime)
+            {
+                TaskOverBool = false;
+            }
+        }
+        else
+        {
+            if (Times != 0)
+            {
+                Times = 0;
+            }
         }
     }
 

--
Gitblit v1.8.0