From 08b00213a00357937510bbcaeaa890e1a84ae572 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期日, 28 四月 2019 22:21:19 +0800
Subject: [PATCH] 382 任务控制NPC显隐逻辑修改

---
 System/MainInterfacePanel/TaskModel.cs |  133 ++++++++++++++++++++++++-------------------
 1 files changed, 74 insertions(+), 59 deletions(-)

diff --git a/System/MainInterfacePanel/TaskModel.cs b/System/MainInterfacePanel/TaskModel.cs
index 9a9ed39..e52b5d1 100644
--- a/System/MainInterfacePanel/TaskModel.cs
+++ b/System/MainInterfacePanel/TaskModel.cs
@@ -246,10 +246,10 @@
                 currentMissionState = MissionState;
             }
             //浠欑洘浠诲姟瀹屾垚
-            if ((pytaskM.type == 12||pytaskM.type == 14) && TaskAllocation.Instance.FairyAuAllNumber() >= FairyAuTaskCount_Day)
-            {
-                Event_FairyAuTask();
-                return;
+            if ((pytaskM.type == 12 || pytaskM.type == 14) && TaskAllocation.Instance.FairyAuAllNumber() >= FairyAuTaskCount_Day)
+            {
+                Event_FairyAuTask();
+                return;
             }
 
 
@@ -1365,12 +1365,12 @@
             yield return WaitingForSecondConst.WaitMS800;//缂撳啿涓�绉掑啀杩涜
         }
 
-        if (MainTaskDic.ContainsKey(_taskID))//涓荤嚎绛夊緟琛ㄧ幇
-        {
-            if (taskWait.wait)
-            {
-                yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime);
-            }
+        if (MainTaskDic.ContainsKey(_taskID))//涓荤嚎绛夊緟琛ㄧ幇
+        {
+            if (taskWait.wait)
+            {
+                yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime);
+            }
         }
 
         if (GA_Hero.s_MapSwitching)
@@ -1392,9 +1392,9 @@
     {
         foreach (string key in _Dic.Keys)
         {
-            if (key.Equals("Show_{visit_npc_id}"))
-            {
-                continue;
+            if (key.Equals("Show_{visit_npc_id}"))
+            {
+                continue;
             }
             string[] str = key.Split('_');
             if (str[0] == "Show")
@@ -1405,27 +1405,42 @@
         return 0;
     }
 
+    private int CacheNpcID = 0;
+
     private void StorageNPCDic(uint taskId, string key, int Value)//鍏充簬NPC鐨勬樉闅�
     {
-        if (key.Equals("Show_{visit_npc_id}"))
-        {
-            m_ShowNpcCache[(int)taskId] = Value;
-            return;
+        if (key.Equals("Show_{visit_npc_id}"))
+        {
+            m_ShowNpcCache[(int)taskId] = Value;
+            if (CacheNpcID != 0)
+            {
+                Task0820(new H0820_tagMissionDict()
+                {
+                    MissionID = taskId,
+                    DictKey = "Show_" + CacheNpcID,
+                    DictValue = (uint)m_ShowNpcCache[(int)taskId],
+                });
+                m_ShowNpcCache.Remove(CacheNpcID);
+                CacheNpcID = 0;
+            }
+            return;
         }
 
-        if (key.Equals("visit_npc_id"))
-        {
-            if (m_ShowNpcCache.ContainsKey((int)taskId))
-            {
-                Task0820(new H0820_tagMissionDict()
-                {
-                    MissionID = taskId,
-                    DictKey = "Show_" + Value,
-                    DictValue = (uint)m_ShowNpcCache[(int)taskId],
-                });
-                m_ShowNpcCache.Remove((int)taskId);
-            }
-            return;
+        if (key.Equals("visit_npc_id"))
+        {
+            CacheNpcID = Value;
+            if (m_ShowNpcCache.ContainsKey((int)taskId))
+            {
+                Task0820(new H0820_tagMissionDict()
+                {
+                    MissionID = taskId,
+                    DictKey = "Show_" + CacheNpcID,
+                    DictValue = (uint)m_ShowNpcCache[(int)taskId],
+                });
+                m_ShowNpcCache.Remove((int)taskId);
+                CacheNpcID = 0;
+            }
+            return;
         }
 
         string[] str = key.Split('_');
@@ -1717,36 +1732,36 @@
         }
     }
 
-    public class TaskWait
-    {
-        public bool wait
-        {
-            get
-            {
-                foreach (var key in taskWaits.Keys)
-                {
-                    if ((TimeUtility.ServerNow - taskWaits[key]).TotalSeconds < 1f)
-                    {
-                        return true;
-                    }
-                }
-                return false;
-            }
-        }
-
-        Dictionary<TaskWaitType, DateTime> taskWaits = new Dictionary<TaskWaitType, DateTime>();
-
-        public void Push(TaskWaitType type)
-        {
-            taskWaits[type] = TimeUtility.ServerNow;
-        }
+    public class TaskWait
+    {
+        public bool wait
+        {
+            get
+            {
+                foreach (var key in taskWaits.Keys)
+                {
+                    if ((TimeUtility.ServerNow - taskWaits[key]).TotalSeconds < 1f)
+                    {
+                        return true;
+                    }
+                }
+                return false;
+            }
+        }
+
+        Dictionary<TaskWaitType, DateTime> taskWaits = new Dictionary<TaskWaitType, DateTime>();
+
+        public void Push(TaskWaitType type)
+        {
+            taskWaits[type] = TimeUtility.ServerNow;
+        }
     }
 
-    public enum TaskWaitType
-    {
-        TaskComplete,
-        LevelUp,
-        TreasureProgress,
-        BetterEquip,
+    public enum TaskWaitType
+    {
+        TaskComplete,
+        LevelUp,
+        TreasureProgress,
+        BetterEquip,
     }
 }

--
Gitblit v1.8.0