Parcourir la source

事件条件修改监听,添加分组条件检测

lzx il y a 18 heures
Parent
commit
4573358204

+ 9 - 4
Assets/Res/Config/EventConditionConfig.json

@@ -2,7 +2,8 @@
   "configList": [
     {
       "ID": 1,
-      "message": null,
+      "message": 2078,
+      "Operation": null,
       "ConditionType": 1,
       "ConditionPara": [
         1001
@@ -11,7 +12,8 @@
     },
     {
       "ID": 2,
-      "message": null,
+      "message": 2079,
+      "Operation": null,
       "ConditionType": 3,
       "ConditionPara": [
         10
@@ -20,7 +22,8 @@
     },
     {
       "ID": 3,
-      "message": null,
+      "message": 2080,
+      "Operation": null,
       "ConditionType": 5,
       "ConditionPara": [
         100001
@@ -29,7 +32,8 @@
     },
     {
       "ID": 4,
-      "message": null,
+      "message": 2081,
+      "Operation": null,
       "ConditionType": 6,
       "ConditionPara": [
         1002
@@ -39,6 +43,7 @@
     {
       "ID": 5,
       "message": null,
+      "Operation": null,
       "ConditionType": null,
       "finishCount": null
     }

+ 4 - 0
Assets/Res/Config/EventLinkConfig.json

@@ -512,6 +512,10 @@
         1914
       ],
       "NPCID": null,
+      "ConditionId": [
+        3,
+        4
+      ],
       "optionType": null,
       "ResultType": 3,
       "ResultOptions": [

+ 4 - 4
Assets/Res/Config/LanguageChineseConfig.json

@@ -8310,19 +8310,19 @@
     },
     {
       "ID": 2078,
-      "txt": "0"
+      "txt": "拥有金币{0}/{1}"
     },
     {
       "ID": 2079,
-      "txt": "0"
+      "txt": "达到境界{0}/{1}"
     },
     {
       "ID": 2080,
-      "txt": "0"
+      "txt": "击杀魔休{0}/{1}"
     },
     {
       "ID": 2081,
-      "txt": "0"
+      "txt": "获得钻石{0}/{1}"
     },
     {
       "ID": 2082,

+ 6 - 0
Assets/Scripts/GameData/ExcelConfig/EventConditionConfig.cs

@@ -26,6 +26,12 @@ public int ID;
 public int message;
 
 
+		/// <summary>
+		///与0 或1
+		/// </summary>
+public int Operation;
+
+
 		/// <summary>
 		///条件判断类型
 		/// </summary>

+ 30 - 4
Assets/Scripts/GameLogic/Player/AccountFileInfo.cs

@@ -88,10 +88,15 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         public List<FaBaoData> AllFaBaoDatas = new List<FaBaoData>();
 
 
-        /// <summary>
-        /// 事件链数据
-        /// </summary>
-        public List<EventLinkData> eventLinkDatas = new List<EventLinkData>();
+        // /// <summary>
+        // /// 事件链数据
+        // /// </summary>
+        // public List<EventLinkData> eventLinkDatas = new List<EventLinkData>();
+        
+        // /// <summary>
+        // /// 
+        // /// </summary>
+        // public List<EventConditionData> eventConditionDatas = new List<EventConditionData>();
 
         /// <summary>
         /// 完成的事件
@@ -232,6 +237,25 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
 
         public int eventId;
 
+        /// <summary>
+        /// 事件监听列表
+        /// </summary>
+        public List<EventConditionData> eventConditions = new List<EventConditionData>();
+
+    }
+
+
+    /// <summary>
+    /// 刷出来的事件列表
+    /// </summary>
+    [System.Serializable]
+    public class EventConditionData
+    {
+     
+     
+
+        public int eventId;
+        public int eventCondition;
 
         public int fishCount;
     }
@@ -245,6 +269,8 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
     {
         public int eventID;
 
+       public List<EventLinkData> eventLinks = new List<EventLinkData>();
+
         public int curStep;
     }
 

+ 29 - 14
Assets/Scripts/GameUI/EventManager/DialogueManager.cs

@@ -23,13 +23,15 @@ public class DialogueManager : Singleton<DialogueManager>
     private Action onCancel;
     private EventConfig eventConfig;
 
+    private AccountFileInfo.EventList CurrentEventList;
 
     /// <summary>
     /// 开始对话
     /// </summary>
-    public void StartDialogue(int dialogueID, int eventId, Action onComplete = null, Action onCancel = null)
+    public void StartDialogue(AccountFileInfo.EventList CurrentEventList, int dialogueID, int eventId, Action onComplete = null, Action onCancel = null)
     {
         this.onCancel = onCancel;
+        this.CurrentEventList = CurrentEventList;
         currentDialogueID = dialogueID;
         onDialogueComplete = onComplete;
         eventConfig = ConfigComponent.Instance.Get<EventConfig>(eventId);
@@ -50,11 +52,21 @@ public class DialogueManager : Singleton<DialogueManager>
         currentDialogueID = dialogueID;
         // 找到当前对话组
         var dialogueConfig = ConfigComponent.Instance.Get<EventLinkConfig>(dialogueID);
-
-        // if (!EventSystemManager.Instance.IsEvenkLinkComplete(currentDialogueID) && dialogueConfig.optionType == 2 && !(dialogueConfig.ConditionType == 5 && dialogueConfig.ConditionPara[0] == dialogueConfig.optionPara1[0]))
+        var eventLinkDatas = CurrentEventList.eventLinks.FirstOrDefault(el => el.eventLinkId == dialogueID);
+        // CeekEventGroupComplete.
+        if (!EventSystemManager.Instance.CeekEventGroupComplete(eventLinkDatas.eventConditions))
+        {
+            onCancel?.Invoke();
+            return;
+        }
+        
+        // foreach (var eventConditionData in eventLinkDatas.eventConditions)
         // {
-        //     onCancel?.Invoke();
-        //     return;
+        //     if (!EventSystemManager.Instance.IsEvenkLinkComplete(eventConditionData))
+        //     {
+        //         TipMessagePanel.OpenTipMessagePanel(EventHelper.GetTaskMessage(eventConditionData));
+        //       
+        //     }
         // }
 
 
@@ -83,7 +95,7 @@ public class DialogueManager : Singleton<DialogueManager>
                 if (AccountFileInfo.Instance.playerData.daoYouDatas.FirstOrDefault(dy => dy.id == eventNpc.DaoyouID) == null)
                 {
                     AccountFileInfo.DaoYouData daoYouData = new AccountFileInfo.DaoYouData();
-                    daoYouData.id =eventNpc.DaoyouID;
+                    daoYouData.id = eventNpc.DaoyouID;
                     daoYouData.favorabilityLv = 1;
                     daoYouData.emotion = Random.Range(1, 4);
                     daoYouData.emotionTime = TimeHelper.ClientNow();
@@ -91,8 +103,6 @@ public class DialogueManager : Singleton<DialogueManager>
                     AccountFileInfo.Instance.playerData.daoYouDatas.Add(daoYouData);
                     AccountFileInfo.Instance.SavePlayerData();
                 }
-                
-            
             }
         }
 
@@ -104,7 +114,7 @@ public class DialogueManager : Singleton<DialogueManager>
         {
             if (dialogueConfig.LanID != null)
             {
-                DialoguePanel.OpenDialoguePanel(dialogueConfig.ID, null, ShowDialogueEventData.MessageShowType.Verbatim,
+                DialoguePanel.OpenDialoguePanel(CurrentEventList, dialogueConfig.ID, null, ShowDialogueEventData.MessageShowType.Verbatim,
                     FishDialogue);
             }
             else
@@ -170,7 +180,7 @@ public class DialogueManager : Singleton<DialogueManager>
                     if (relust)
                     {
                         CTask cTask = CTask.Create();
-                        CombatDrive.Instance.LoadLevelBattleCombat(dialogueConfig.optionPara1[0],true,
+                        CombatDrive.Instance.LoadLevelBattleCombat(dialogueConfig.optionPara1[0], true,
                             delegate(bool isWin)
                             {
                                 LogTool.Log("战斗完成" + isWin);
@@ -189,7 +199,7 @@ public class DialogueManager : Singleton<DialogueManager>
                 else
                 {
                     CTask cTask = CTask.Create();
-                    CombatDrive.Instance.LoadLevelBattleCombat(dialogueConfig.optionPara1[0],false,
+                    CombatDrive.Instance.LoadLevelBattleCombat(dialogueConfig.optionPara1[0], false,
                         delegate(bool isWin)
                         {
                             LogTool.Log("战斗完成" + isWin);
@@ -229,10 +239,15 @@ public class DialogueManager : Singleton<DialogueManager>
             //     break;
         }
 
-        if (!EventSystemManager.Instance.IsEvenkLinkComplete(currentDialogueID))
+        AccountFileInfo.EventLinkData eventLinkData = CurrentEventList.eventLinks.FirstOrDefault(el => el.eventLinkId == currentDialogueID);
+
+        foreach (var eventConditionData in eventLinkData.eventConditions)
         {
-            onCancel?.Invoke();
-            return;
+            if (!EventSystemManager.Instance.IsEvenkLinkComplete(eventConditionData))
+            {
+                onCancel?.Invoke();
+                return;
+            }
         }
 
 

+ 24 - 22
Assets/Scripts/GameUI/EventManager/EventHelper.cs

@@ -7,46 +7,48 @@ using Fort23.UTool;
 
 public static class EventHelper
 {
-    public static string GetTaskMessage(int eventConfigId)
+    public static string GetTaskMessage(AccountFileInfo.EventConditionData eventConditionData)
     {
         string result = String.Empty;
-        EventLinkConfig eventCondition = ConfigComponent.Instance.Get<EventLinkConfig>(eventConfigId);
-        AccountFileInfo.EventLinkData eventLinkData =
-            AccountFileInfo.Instance.playerData.eventLinkDatas.FirstOrDefault(e => e.eventLinkId == eventConfigId);
+        EventConditionConfig eventCondition = ConfigComponent.Instance.Get<EventConditionConfig>(eventConditionData.eventCondition);
+        // AccountFileInfo.EventLinkData eventLinkData =
+        //     AccountFileInfo.Instance.playerData.eventLinkDatas.FirstOrDefault(e => e.eventLinkId == eventConfigId);
 
-        int fishCount = eventLinkData == null ? 0 : eventLinkData.fishCount;
+        // int fishCount = eventCondition == null ? 0 : eventLinkData.fishCount;
+
+        result = LanguageManager.Instance.Text(eventCondition.message, eventConditionData.fishCount, eventCondition.finishCount);
         // switch (eventCondition.ConditionType)
         // {
         //     case 1:
-        //         ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(eventCondition.ConditionPara[0]);
-        //         result =
-        //             $"需要拥有{LanguageManager.Instance.Text(itemConfig.itemName)} {fishCount}/{eventCondition.finishCount}";
+        //         // ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(eventCondition.ConditionPara[0]);
+        //         // result =
+        //         //     $"需要拥有{LanguageManager.Instance.Text(itemConfig.itemName)} {fishCount}/{eventCondition.finishCount}";
         //         // result = LanguageManager.Instance.Text(eventCondition.conciseEventMessage,fishCount, eventCondition.finishCount.ToString() + "个");
         //
         //         break;
         //     case 3:
-        //         HeroPowerUpConfig heroPowerUpConfig =
-        //             ConfigComponent.Instance.Get<HeroPowerUpConfig>(eventCondition.ConditionPara[0]);
-        //         string jingjie = LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[0]) +
-        //                          LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[1]) +
-        //                          LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[2]);
-        //
-        //         result =
-        //             $"需要达到境界{jingjie}";
+        //         // HeroPowerUpConfig heroPowerUpConfig =
+        //         //     ConfigComponent.Instance.Get<HeroPowerUpConfig>(eventCondition.ConditionPara[0]);
+        //         // string jingjie = LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[0]) +
+        //         //                  LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[1]) +
+        //         //                  LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[2]);
+        //         //
+        //         // result =
+        //         //     $"需要达到境界{jingjie}";
         //         // result = LanguageManager.Instance.Text(eventCondition.conciseEventMessage, jingjie);
         //         break;
         //
         //     case 5:
         //         // result = LanguageManager.Instance.Text(eventCondition.conciseEventMessage, fishCount.ToString(), eventCondition.finishCount.ToString());
-        //         result =
-        //             $"需要完成战斗{eventCondition.ConditionPara[0]} {fishCount}/{eventCondition.finishCount}";
+        //         // result =
+        //         //     $"需要完成战斗{eventCondition.ConditionPara[0]} {fishCount}/{eventCondition.finishCount}";
         //         break;
         //     case 6:
         //
-        //         ItemConfig itemConfig1 = ConfigComponent.Instance.Get<ItemConfig>(eventCondition.ConditionPara[0]);
-        //         // result = LanguageManager.Instance.Text(eventCondition.conciseEventMessage, fishCount.ToString(), eventCondition.finishCount.ToString());
-        //         result =
-        //             $"需要获得{LanguageManager.Instance.Text(itemConfig1.itemName)} {fishCount}/{eventCondition.finishCount}";
+        //         // ItemConfig itemConfig1 = ConfigComponent.Instance.Get<ItemConfig>(eventCondition.ConditionPara[0]);
+        //         // // result = LanguageManager.Instance.Text(eventCondition.conciseEventMessage, fishCount.ToString(), eventCondition.finishCount.ToString());
+        //         // result =
+        //         //     $"需要获得{LanguageManager.Instance.Text(itemConfig1.itemName)} {fishCount}/{eventCondition.finishCount}";
         //         break;
         //     default:
         //         // result =LanguageManager.Instance.Text(eventCondition.conciseEventMessage);

+ 144 - 88
Assets/Scripts/GameUI/EventManager/EventSystemManager.cs

@@ -31,11 +31,18 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
     Action onCompleteCallback;
 
+    // public Map<int, AccountFileInfo.EventConditionData> EventConditionDataMap = new Map<int, AccountFileInfo.EventConditionData>();
+
     public void CustomInit()
     {
         eventConfigs = ConfigComponent.Instance.GetAll<EventConfig>().ToList();
         divineSenseConfigs = ConfigComponent.Instance.GetAll<DivineSenseConfig>().ToList();
 
+        // foreach (var playerDataEventConditionData in AccountFileInfo.Instance.playerData.eventConditionDatas)
+        // {
+        //     EventConditionDataMap.Add(playerDataEventConditionData.guid, playerDataEventConditionData);
+        // }
+
         StaticUpdater.Instance.AddRenderUpdateCallBack(Update);
         EventManager.Instance.AddEventListener(CustomEventType.DetectRandomEvent, RenfenceRandomEvent);
         EventManager.Instance.AddEventListener(CustomEventType.AddItem, ItemUpdate);
@@ -90,7 +97,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         int maxCount = heroPowerUpConfig.ShenshiMax / PlayerManager.Instance.gameConstantConfig.DetectEventCount;
         count = count + AccountFileInfo.Instance.playerData.eventList.Count > maxCount ? maxCount - AccountFileInfo.Instance.playerData.eventList.Count : count;
 
-     
+
         EventManager.Instance.Dispatch(CustomEventType.DivineSensePointChange, null);
         // 神识升级逻辑
         UpDivinesense();
@@ -100,10 +107,10 @@ public class EventSystemManager : Singleton<EventSystemManager>
             return default;
 
         //扣除神识值 增加神识经验
-        int xiaoHao =  eventConfigs.Count * PlayerManager.Instance.gameConstantConfig.DetectEventCount;
+        int xiaoHao = eventConfigs.Count * PlayerManager.Instance.gameConstantConfig.DetectEventCount;
         AccountFileInfo.Instance.playerData.divineSenseexp += xiaoHao;
         AccountFileInfo.Instance.playerData.divineSensePoint -= xiaoHao;
-        
+
         AccountFileInfo.Instance.playerData.eventList.AddRange(eventConfigs);
         AccountFileInfo.Instance.SavePlayerData();
         return eventConfigs;
@@ -268,20 +275,28 @@ public class EventSystemManager : Singleton<EventSystemManager>
         {
             foreach (var i in eventConfig.EventLinksId)
             {
-                AccountFileInfo.EventLinkData eventLinkData = AccountFileInfo.Instance.playerData.eventLinkDatas.FirstOrDefault(el => el.eventLinkId == i);
+                EventLinkConfig eventLinkConfig = ConfigComponent.Instance.Get<EventLinkConfig>(i);
 
-                if (eventLinkData == null)
+                AccountFileInfo.EventLinkData eventLinkData = new AccountFileInfo.EventLinkData();
+                eventLinkData.eventId = eventID;
+                eventLinkData.eventLinkId = i;
+                if (eventLinkConfig.ConditionId != null)
                 {
-                    eventLinkData = new AccountFileInfo.EventLinkData();
-                    eventLinkData.eventId = eventList.eventID;
-                    eventLinkData.eventLinkId = i;
-                    AccountFileInfo.Instance.playerData.eventLinkDatas.Add(eventLinkData);
+                    foreach (var i1 in eventLinkConfig.ConditionId)
+                    {
+                        AccountFileInfo.EventConditionData eventConditionData = new AccountFileInfo.EventConditionData();
+                        eventConditionData.eventId = eventList.eventID;
+                        eventConditionData.eventCondition = i1;
+                        // AccountFileInfo.Instance.playerData.eventConditionDatas.Add(eventConditionData);
+                        eventLinkData.eventConditions.Add(eventConditionData);
+
+                        //初始化先检测一些条件
+                        CeekTaskComplete(eventConditionData, 1, null);
+                        CeekTaskComplete(eventConditionData, 3, null);
+                    }
                 }
 
-                eventLinkData.fishCount = 0;
-                //初始化先检测一些条件
-                CeekTaskComplete(eventLinkData.eventLinkId, 1, null);
-                CeekTaskComplete(eventLinkData.eventLinkId, 3, null);
+                eventList.eventLinks.Add(eventLinkData);
             }
         }
 
@@ -326,7 +341,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         LogTool.Log($"触发事件: {evt.EventName} (ID: {evt.ID}, 品质: {evt.EventQuality})");
         CombatDrive.Instance.CombatController.ChangeState(CombatController.idle);
 
-        DialogueManager.Instance.StartDialogue(evt.EventLinksId[0], evt.ID, () => { CompleteEvent(evt.ID); });
+        DialogueManager.Instance.StartDialogue(null, evt.EventLinksId[0], evt.ID, () => { CompleteEvent(evt.ID); });
     }
 
     /// <summary>
@@ -355,7 +370,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
         CurrentEventList = evt;
         CombatDrive.Instance.CombatController.ChangeState(CombatController.idle);
-        DialogueManager.Instance.StartDialogue(dialogueID, eventConfig.ID, () =>
+        DialogueManager.Instance.StartDialogue(CurrentEventList, dialogueID, eventConfig.ID, () =>
         {
             CompleteEvent(CurrentEventList);
             cTask.SetResult();
@@ -369,97 +384,138 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
 
     //任务是否完成
-    public bool IsEvenkLinkComplete(int eventLinkId)
+    public bool IsEvenkLinkComplete(AccountFileInfo.EventConditionData eventCondition)
     {
-        EventLinkConfig eventLinkConfig = ConfigComponent.Instance.Get<EventLinkConfig>(eventLinkId);
-        // if (eventLinkConfig.ConditionType == 0)
-        //     return true;
-        //
-        // AccountFileInfo.EventLinkData eventLinkData = AccountFileInfo.Instance.playerData.eventLinkDatas.FirstOrDefault(el => el.eventLinkId == eventLinkId);
-        //
-        // if (eventLinkData != null)
-        // {
-        //     return eventLinkData.fishCount >= eventLinkConfig.finishCount;
-        // }
+        EventConditionConfig eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(eventCondition.eventCondition);
+
+        if (eventCondition != null)
+        {
+            return eventCondition.fishCount >= eventConditionConfig.finishCount;
+        }
+
+        return false;
+    }
+
+    public bool CeekEventGroupComplete(List<AccountFileInfo.EventConditionData> eventConditions)
+    {
+        Map<int, List<AccountFileInfo.EventConditionData>> eventConditionDataGroup = new Map<int, List<AccountFileInfo.EventConditionData>>();
+
+        foreach (var eventConditionData in eventConditions)
+        {
+            EventConditionConfig eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(eventConditionData.eventCondition);
+            if (!eventConditionDataGroup.ContainsKey(eventConditionConfig.Operation))
+            {
+                eventConditionDataGroup.Add(eventConditionConfig.Operation, new List<AccountFileInfo.EventConditionData>());
+            }
+
+            eventConditionDataGroup[eventConditionConfig.Operation].Add(eventConditionData);
+        }
+
+
+        bool isUlock = true;
+        foreach (var keyValuePair in eventConditionDataGroup)
+        {
+            isUlock = true;
+            foreach (var eventConditionData in keyValuePair.Value)
+            {
+                if (!IsEvenkLinkComplete(eventConditionData))
+                {
+                    isUlock = false;
+                }
+            }
+
+            if (isUlock)
+            {
+                return isUlock;
+            }
+
+         
+        }
 
         return false;
     }
 
     public void CeekEventCompletes(int type, int[] value)
     {
-        foreach (var playerDataEventLinkData in AccountFileInfo.Instance.playerData.eventLinkDatas)
+        foreach (var playerDataEventLinkData in AccountFileInfo.Instance.playerData.eventList)
         {
-            CeekTaskComplete(playerDataEventLinkData.eventLinkId, type, value);
+            foreach (var eventLinkData in playerDataEventLinkData.eventLinks)
+            {
+                foreach (var eventConditionData in eventLinkData.eventConditions)
+                {
+                    CeekTaskComplete(eventConditionData, type, value);
+                }
+            }
         }
 
         EventManager.Instance.Dispatch(CustomEventType.RemoveEvent, null);
     }
 
-    public void CeekTaskComplete(int eventLiknId, int type, int[] value)
+    public void CeekTaskComplete(AccountFileInfo.EventConditionData conditionData, int type, int[] value)
     {
-        //任务完成了跳过检测
-        if (IsEvenkLinkComplete(eventLiknId))
+        EventConditionConfig eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(conditionData.eventCondition);
+
+
+        if (IsEvenkLinkComplete(conditionData))
             return;
-        AccountFileInfo.EventLinkData eventLinkData = AccountFileInfo.Instance.playerData.eventLinkDatas.FirstOrDefault(el => el.eventLinkId == eventLiknId);
 
-        EventLinkConfig eventLinkConfig = ConfigComponent.Instance.Get<EventLinkConfig>(eventLiknId);
         switch (type)
         {
-            // //检测背包道具
-            // case 1:
-            //     if (eventLinkConfig.ConditionType == 1)
-            //     {
-            //         eventLinkData.fishCount += (int)PlayerManager.Instance.BagController.GetItemCount(eventLinkConfig.ConditionPara[0]);
-            //
-            //         if (IsEvenkLinkComplete(eventLiknId))
-            //         {
-            //             CompleteTask(eventLiknId);
-            //         }
-            //     }
-            //
-            //     break;
-            //
-            // //境界检测
-            // case 3:
-            //     if (eventLinkConfig.ConditionType == 3 && PlayerManager.Instance.myHero.powerUpConfig.ID >= eventLinkConfig.ConditionPara[0])
-            //     {
-            //         eventLinkData.fishCount++;
-            //
-            //         if (IsEvenkLinkComplete(eventLiknId))
-            //         {
-            //             CompleteTask(eventLiknId);
-            //         }
-            //     }
-            //
-            //     break;
-            //
-            // //战斗胜利
-            // case 5:
-            //     if (eventLinkConfig.ConditionType == 5 && eventLinkConfig.ConditionPara[0] == value[0])
-            //     {
-            //         eventLinkData.fishCount++;
-            //
-            //         if (IsEvenkLinkComplete(eventLiknId))
-            //         {
-            //             CompleteEvent(eventLiknId);
-            //         }
-            //     }
-            //
-            //     break;
-            //
-            // //获得道具
-            // case 6:
-            //     if (eventLinkConfig.ConditionType == 6 && eventLinkConfig.ConditionPara[0] == value[0])
-            //     {
-            //         eventLinkData.fishCount += value[1];
-            //
-            //         if (IsEvenkLinkComplete(eventLiknId))
-            //         {
-            //             CompleteEvent(eventLinkData);
-            //         }
-            //     }
-            //
-            //     break;
+            //检测背包道具
+            case 1:
+                if (eventConditionConfig.ConditionType == 1)
+                {
+                    conditionData.fishCount += (int)PlayerManager.Instance.BagController.GetItemCount(eventConditionConfig.ConditionPara[0]);
+
+                    if (IsEvenkLinkComplete(conditionData))
+                    {
+                        // CompleteTask(conditionData.guid);
+                    }
+                }
+
+                break;
+
+            //境界检测
+            case 3:
+                if (eventConditionConfig.ConditionType == 3 && PlayerManager.Instance.myHero.powerUpConfig.ID >= eventConditionConfig.ConditionPara[0])
+                {
+                    conditionData.fishCount++;
+
+                    if (IsEvenkLinkComplete(conditionData))
+                    {
+                        // CompleteTask(conditionData.guid);
+                    }
+                }
+
+                break;
+
+            //战斗胜利
+            case 5:
+                if (eventConditionConfig.ConditionType == 5 && eventConditionConfig.ConditionPara[0] == value[0])
+                {
+                    conditionData.fishCount++;
+
+                    if (IsEvenkLinkComplete(conditionData))
+                    {
+                        // CompleteEvent(conditionData.guid);
+                    }
+                }
+
+                break;
+
+            //获得道具
+            case 6:
+                if (eventConditionConfig.ConditionType == 6 && eventConditionConfig.ConditionPara[0] == value[0])
+                {
+                    conditionData.fishCount += value[1];
+
+                    if (IsEvenkLinkComplete(conditionData))
+                    {
+                        // CompleteEvent(conditionData.guid);
+                    }
+                }
+
+                break;
         }
 
 

+ 16 - 2
Assets/Scripts/GameUI/UI/DialoguePanel/DialogueOptionWidget.cs

@@ -33,7 +33,7 @@ namespace Fort23.Mono
         }
 
 
-        public void CustomInit(int id, int mainOpid, Action<DialogueOptionWidget> callback)
+        public void CustomInit(AccountFileInfo.EventLinkData eventLinkData, int id, int mainOpid, Action<DialogueOptionWidget> callback)
         {
             type = 1;
             eventConditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(id);
@@ -42,7 +42,21 @@ namespace Fort23.Mono
             Text_desc.text = LanguageManager.Instance.Text(mainEventConditionConfig.optionPara2[index]);
             this.callback = callback;
 
-            if (!EventSystemManager.Instance.IsEvenkLinkComplete(eventConditionConfig.ID))
+            // bool isUlock = true;
+            // foreach (var eventConditionData in eventLinkData.eventConditions)
+            // {
+            //     if (!EventSystemManager.Instance.CeekEventGroupComplete(eventLinkData.eventConditions))
+            //     {
+            //         onCancel?.Invoke();
+            //         return;
+            //     }
+            //     if (!EventSystemManager.Instance.IsEvenkLinkComplete(eventConditionData))
+            //     {
+            //         isUlock = false;
+            //     }
+            // }
+
+            if (!EventSystemManager.Instance.CeekEventGroupComplete(eventLinkData.eventConditions))
             {
                 transform.Gray();
             }

+ 26 - 12
Assets/Scripts/GameUI/UI/DialoguePanel/DialoguePanel.cs

@@ -5,6 +5,7 @@ using Excel2Json;
 using Fort23.UTool;
 using UnityEngine;
 using System;
+using System.Linq;
 using Fort23.Core;
 using UnityEngine.UI;
 
@@ -29,14 +30,18 @@ namespace Fort23.Mono
         private bool _skipTyping;
         private bool _isShowingOptions;
 
+        private AccountFileInfo.EventList CurrentEventList;
+
+        private AccountFileInfo.EventLinkData _eventLinkData;
+
         private int type;
 
-        public static async void OpenDialoguePanel(int id, string[] icon,
+        public static async void OpenDialoguePanel(AccountFileInfo.EventList CurrentEventList,int id, string[] icon,
             ShowDialogueEventData.MessageShowType messageShowType,
             Action<int?> finish)
         {
             DialoguePanel dialoguePanel = await UIManager.Instance.LoadAndOpenPanel<DialoguePanel>(null, UILayer.Top);
-            dialoguePanel.ShowPanel(id, icon, messageShowType, finish);
+            dialoguePanel.ShowPanel(CurrentEventList,id, icon, messageShowType, finish);
         }
 
 
@@ -118,11 +123,13 @@ namespace Fort23.Mono
             }
         }
 
-        public void ShowPanel(int id, string[] icon,
+        public void ShowPanel(AccountFileInfo.EventList CurrentEventList,int id, string[] icon,
             ShowDialogueEventData.MessageShowType messageShowType,
             Action<int?> finish)
         {
+            this.CurrentEventList = CurrentEventList;
             eventConditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(id);
+            _eventLinkData = CurrentEventList.eventLinks.FirstOrDefault(el => el.eventLinkId == id);
             showIconName = icon;
             this.dialogueMessaga = eventConditionConfig.LanID;
             this.messageShowType = messageShowType;
@@ -162,14 +169,19 @@ namespace Fort23.Mono
                 }
                 else
                 {
-                    // if (eventConditionConfig.ID != 0 && eventConditionConfig.ConditionType != 0)
-                    // {
-                    //     if (!EventSystemManager.Instance.IsEvenkLinkComplete(eventConditionConfig.ID))
-                    //     {
-                    //         TipMessagePanel.OpenTipMessagePanel(EventHelper.GetTaskMessage(eventConditionConfig.ID));
-                    //         return;
-                    //     }
-                    // }
+                    if (eventConditionConfig.ID != 0 && _eventLinkData.eventConditions.Count > 0)
+                    {
+                        foreach (var eventConditionData in _eventLinkData.eventConditions)
+                        {
+                            if (!EventSystemManager.Instance.IsEvenkLinkComplete(eventConditionData))
+                            {
+                                TipMessagePanel.OpenTipMessagePanel(EventHelper.GetTaskMessage(eventConditionData));
+                                return;
+                            }
+                        }
+
+                     
+                    }
 
 
                     // 无选项,关闭面板,返回 null
@@ -223,7 +235,7 @@ namespace Fort23.Mono
 
                     DialogueOptionWidget dialogueOptionWidget =
                         await UIManager.Instance.CreateGComponent<DialogueOptionWidget>(null, OptionRoot);
-                    dialogueOptionWidget.CustomInit(op, eventConditionConfig.ID, SelectOption);
+                    dialogueOptionWidget.CustomInit(_eventLinkData,op, eventConditionConfig.ID, SelectOption);
                 }
             }
 
@@ -317,6 +329,8 @@ namespace Fort23.Mono
             _skipTyping = false;
             index = 0;
             eventConditionConfig = default;
+            _eventLinkData = null;
+            CurrentEventList = null;
             _currShowMessage = null;
             dialogueMessaga = null; 
             base.Close();

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
Assets/StreamingAssets/assetConfig.txt


BIN
Excel2Json/Excel/EventConfig.xlsx


BIN
Excel2Json/Excel/Language.xlsx


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff