浏览代码

神识事件修改

lzx 1 月之前
父节点
当前提交
74ef691090

+ 92 - 12
Assets/Res/Config/EventConfig.json

@@ -2,7 +2,13 @@
   "configList": [
     {
       "ID": 1,
-      "EventBeginId": 1001,
+      "EventLinksId": [
+        1001,
+        1002,
+        1003,
+        1004,
+        1005
+      ],
       "EventTriggerType": 1,
       "EventType": 1,
       "EventQuality": 1,
@@ -16,7 +22,15 @@
     },
     {
       "ID": 2,
-      "EventBeginId": 1010,
+      "EventLinksId": [
+        1010,
+        1011,
+        1012,
+        1013,
+        1014,
+        1015,
+        1016
+      ],
       "EventTriggerType": 1,
       "EventType": 1,
       "EventQuality": 1,
@@ -30,7 +44,15 @@
     },
     {
       "ID": 3,
-      "EventBeginId": 1020,
+      "EventLinksId": [
+        1020,
+        1021,
+        1022,
+        1023,
+        1024,
+        1025,
+        1026
+      ],
       "EventTriggerType": 3,
       "EventType": 1,
       "EventQuality": 1,
@@ -44,7 +66,9 @@
     },
     {
       "ID": 4,
-      "EventBeginId": 1030,
+      "EventLinksId": [
+        1030
+      ],
       "EventTriggerType": 1,
       "EventType": 2,
       "EventQuality": 1,
@@ -58,7 +82,9 @@
     },
     {
       "ID": 5,
-      "EventBeginId": 1040,
+      "EventLinksId": [
+        1040
+      ],
       "EventTriggerType": 1,
       "EventType": 2,
       "EventQuality": 1,
@@ -72,7 +98,9 @@
     },
     {
       "ID": 6,
-      "EventBeginId": 1050,
+      "EventLinksId": [
+        1050
+      ],
       "EventTriggerType": 1,
       "EventType": 2,
       "EventQuality": 1,
@@ -86,7 +114,9 @@
     },
     {
       "ID": 7,
-      "EventBeginId": 1060,
+      "EventLinksId": [
+        1060
+      ],
       "EventTriggerType": 1,
       "EventType": 2,
       "EventQuality": 1,
@@ -100,7 +130,9 @@
     },
     {
       "ID": 11,
-      "EventBeginId": 10001,
+      "EventLinksId": [
+        10001
+      ],
       "EventTriggerType": 2,
       "EventType": 1,
       "EventQuality": 1,
@@ -108,7 +140,9 @@
     },
     {
       "ID": 12,
-      "EventBeginId": 10003,
+      "EventLinksId": [
+        10003
+      ],
       "EventTriggerType": 2,
       "EventType": 1,
       "EventQuality": 1,
@@ -116,7 +150,9 @@
     },
     {
       "ID": 13,
-      "EventBeginId": 10004,
+      "EventLinksId": [
+        10004
+      ],
       "EventTriggerType": 2,
       "EventType": 1,
       "EventQuality": 1,
@@ -124,7 +160,9 @@
     },
     {
       "ID": 14,
-      "EventBeginId": 10005,
+      "EventLinksId": [
+        10005
+      ],
       "EventTriggerType": 2,
       "EventType": 1,
       "EventQuality": 1,
@@ -132,11 +170,53 @@
     },
     {
       "ID": 15,
-      "EventBeginId": 10006,
+      "EventLinksId": [
+        10006
+      ],
       "EventTriggerType": 2,
       "EventType": 1,
       "EventQuality": 1,
       "Description": null
+    },
+    {
+      "ID": 10001,
+      "EventLinksId": [
+        100001
+      ],
+      "EventTriggerType": 4,
+      "EventType": 1,
+      "EventQuality": 1,
+      "Description": 1906
+    },
+    {
+      "ID": 10002,
+      "EventLinksId": [
+        100002
+      ],
+      "EventTriggerType": 4,
+      "EventType": 1,
+      "EventQuality": 1,
+      "Description": 1907
+    },
+    {
+      "ID": 10003,
+      "EventLinksId": [
+        100003
+      ],
+      "EventTriggerType": 4,
+      "EventType": 1,
+      "EventQuality": 1,
+      "Description": 1908
+    },
+    {
+      "ID": 10004,
+      "EventLinksId": [
+        100004
+      ],
+      "EventTriggerType": 4,
+      "EventType": 1,
+      "EventQuality": 1,
+      "Description": 1909
     }
   ]
 }

+ 166 - 23
Assets/Res/Config/EventConditionConfig.json → Assets/Res/Config/EventLinkConfig.json

@@ -2,18 +2,23 @@
   "configList": [
     {
       "ID": 100,
+      "conciseEventMessage": null,
       "LanID": [
         216
       ],
       "ConditionType": null,
-      "optionType": null
+      "finishCount": null,
+      "optionType": null,
+      "ResultType": null
     },
     {
       "ID": 1001,
+      "conciseEventMessage": null,
       "LanID": [
         177
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 1,
       "optionPara1": [
         1002,
@@ -22,21 +27,25 @@
       "optionPara2": [
         198,
         199
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1002,
+      "conciseEventMessage": null,
       "LanID": [
         178
       ],
-      "ConditionType": 4,
+      "ConditionType": 1,
       "ConditionPara": [
-        1
+        1001
       ],
+      "finishCount": 10,
       "optionType": 2,
       "optionPara1": [
         100001
       ],
+      "ResultType": 2,
       "ResultOptions": [
         1004,
         100
@@ -44,37 +53,44 @@
     },
     {
       "ID": 1003,
+      "conciseEventMessage": null,
       "LanID": [
         179
       ],
-      "ConditionType": 4,
+      "ConditionType": 1,
       "ConditionPara": [
-        3
+        1002
       ],
+      "finishCount": 10,
       "optionType": 1,
       "optionPara1": [
         1005
       ],
       "optionPara2": [
         200
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1004,
+      "conciseEventMessage": null,
       "LanID": [
         180
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1002
       ],
       "PrizeNums": [
         100
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1005,
+      "conciseEventMessage": null,
       "LanID": [
         181
       ],
@@ -82,20 +98,24 @@
       "ConditionPara": [
         10
       ],
+      "finishCount": 1,
       "optionType": 3,
       "PrizeIDs": [
         1001
       ],
       "PrizeNums": [
         50
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1010,
+      "conciseEventMessage": null,
       "LanID": [
         182
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 1,
       "optionPara1": [
         1011,
@@ -104,14 +124,17 @@
       "optionPara2": [
         201,
         202
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1011,
+      "conciseEventMessage": null,
       "LanID": [
         183
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 1,
       "optionPara1": [
         1014,
@@ -120,33 +143,40 @@
       "optionPara2": [
         203,
         204
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1012,
+      "conciseEventMessage": null,
       "LanID": [
         184,
         187
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1001
       ],
       "PrizeNums": [
         10
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1014,
+      "conciseEventMessage": null,
       "LanID": [
         185
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 2,
       "optionPara1": [
         100002
       ],
+      "ResultType": 2,
       "ResultOptions": [
         1016,
         100
@@ -154,39 +184,47 @@
     },
     {
       "ID": 1015,
+      "conciseEventMessage": null,
       "LanID": [
         186,
         189
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1003
       ],
       "PrizeNums": [
         1000
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1016,
+      "conciseEventMessage": null,
       "LanID": [
         188
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": null,
       "PrizeIDs": [
         1001
       ],
       "PrizeNums": [
         200
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1020,
+      "conciseEventMessage": null,
       "LanID": [
         190
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 1,
       "optionPara1": [
         1021,
@@ -195,14 +233,17 @@
       "optionPara2": [
         201,
         202
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1021,
+      "conciseEventMessage": null,
       "LanID": [
         191
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 2,
       "optionPara1": [
         100003
@@ -213,6 +254,7 @@
       "PrizeNums": [
         100
       ],
+      "ResultType": 2,
       "ResultOptions": [
         1026,
         100
@@ -220,10 +262,12 @@
     },
     {
       "ID": 1022,
+      "conciseEventMessage": null,
       "LanID": [
         192
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1002
@@ -231,17 +275,20 @@
       "PrizeNums": [
         10
       ],
+      "ResultType": 1,
       "ResultOptions": [
         1016
       ]
     },
     {
       "ID": 1024,
+      "conciseEventMessage": null,
       "LanID": [
         193,
         196
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 2,
       "optionPara1": [
         100004
@@ -252,6 +299,7 @@
       "PrizeNums": [
         100
       ],
+      "ResultType": 2,
       "ResultOptions": [
         1016,
         100
@@ -259,11 +307,13 @@
     },
     {
       "ID": 1025,
+      "conciseEventMessage": null,
       "LanID": [
         194,
         197
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1002
@@ -271,16 +321,19 @@
       "PrizeNums": [
         1000
       ],
+      "ResultType": 1,
       "ResultOptions": [
         1002
       ]
     },
     {
       "ID": 1026,
+      "conciseEventMessage": null,
       "LanID": [
         207
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 1,
       "optionPara1": [
         1024,
@@ -289,42 +342,51 @@
       "optionPara2": [
         205,
         206
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1030,
+      "conciseEventMessage": null,
       "LanID": [
         221
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1002
       ],
       "PrizeNums": [
         10
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1040,
+      "conciseEventMessage": null,
       "LanID": [
         222
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1002
       ],
       "PrizeNums": [
         10
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1050,
+      "conciseEventMessage": null,
       "LanID": [
         223
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1002,
@@ -333,26 +395,33 @@
       "PrizeNums": [
         10,
         20
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 1060,
+      "conciseEventMessage": null,
       "LanID": [
         224
       ],
       "ConditionType": null,
-      "optionType": null
+      "finishCount": null,
+      "optionType": null,
+      "ResultType": null
     },
     {
       "ID": 10001,
+      "conciseEventMessage": null,
       "LanID": [
         208
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 2,
       "optionPara1": [
         100001
       ],
+      "ResultType": 2,
       "ResultOptions": [
         10002,
         100
@@ -360,36 +429,43 @@
     },
     {
       "ID": 10002,
+      "conciseEventMessage": null,
       "LanID": [
         209
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1003
       ],
       "PrizeNums": [
         3000
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 10003,
+      "conciseEventMessage": null,
       "LanID": [
         210,
         211,
         1903
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1005
       ],
       "PrizeNums": [
         500
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 10004,
+      "conciseEventMessage": null,
       "LanID": [
         212,
         213,
@@ -397,24 +473,29 @@
         215
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 3,
       "PrizeIDs": [
         1006
       ],
       "PrizeNums": [
         500
-      ]
+      ],
+      "ResultType": null
     },
     {
       "ID": 10005,
+      "conciseEventMessage": null,
       "LanID": [
         1901
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 2,
       "optionPara1": [
         100002
       ],
+      "ResultType": 2,
       "ResultOptions": [
         10002,
         100
@@ -422,18 +503,80 @@
     },
     {
       "ID": 10006,
+      "conciseEventMessage": null,
       "LanID": [
         1902
       ],
       "ConditionType": null,
+      "finishCount": null,
       "optionType": 2,
       "optionPara1": [
         100003
       ],
+      "ResultType": 2,
       "ResultOptions": [
         10002,
         100
       ]
+    },
+    {
+      "ID": 100001,
+      "conciseEventMessage": 1910,
+      "LanID": [
+        1914
+      ],
+      "ConditionType": null,
+      "finishCount": 1,
+      "optionType": null,
+      "ResultType": 3,
+      "ResultOptions": [
+        10002
+      ]
+    },
+    {
+      "ID": 100002,
+      "conciseEventMessage": 1911,
+      "ConditionType": 5,
+      "ConditionPara": [
+        100001
+      ],
+      "finishCount": 1,
+      "optionType": 2,
+      "optionPara1": [
+        100001
+      ],
+      "ResultType": 3,
+      "ResultOptions": [
+        10003
+      ]
+    },
+    {
+      "ID": 100003,
+      "conciseEventMessage": 1912,
+      "ConditionType": 6,
+      "ConditionPara": [
+        1001
+      ],
+      "finishCount": 1,
+      "optionType": 4,
+      "optionPara1": [
+        100004
+      ],
+      "ResultType": 3,
+      "ResultOptions": [
+        10004
+      ]
+    },
+    {
+      "ID": 100004,
+      "conciseEventMessage": 1913,
+      "ConditionType": 3,
+      "ConditionPara": [
+        10
+      ],
+      "finishCount": 1,
+      "optionType": null,
+      "ResultType": null
     }
   ]
 }

+ 1 - 1
Assets/Res/Config/EventConditionConfig.json.meta → Assets/Res/Config/EventLinkConfig.json.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: ByhK43mqB3rviyN3a2SgkOzNP/n71UkJZhczbeAcUf+pctv3aitXpDv2/U1s
+guid: CCkXtnuqAn7uP+7lsswfZGMEjKndohYSUJMC472BUWGUU7mfjalLv6KCKwjU
 TextScriptImporter:
   externalObjects: {}
   userData: 

+ 2 - 2
Assets/Scripts/GameData/ExcelConfig/EventConfig.cs

@@ -23,11 +23,11 @@ public int ID;
 		/// <summary>
 		///事件的起始ID
 		/// </summary>
-public int EventBeginId;
+public int[] EventLinksId;
 
 
 		/// <summary>
-		///触发事件类型: 1.通用事件 2.挂机事件 3.地图专用事件
+		///触发事件类型: 1.通用事件 2.挂机事件 3.地图专用事件 4.主线任务
 		/// </summary>
 public int EventTriggerType;
 

+ 25 - 7
Assets/Scripts/GameData/ExcelConfig/EventConditionConfig.cs → Assets/Scripts/GameData/ExcelConfig/EventLinkConfig.cs

@@ -1,18 +1,18 @@
 // Auto Generated Code By excel2json
-// Generate From Excel\EventConfig.xlsx. SheetName: EventConditionConfig
+// Generate From Excel\EventConfig.xlsx. SheetName: EventLinkConfig
 
 using System;
 using Fort23.GameData;
 
 namespace Excel2Json
 {
-	[Config(prefab = "EventConditionConfig.json")]
-	public partial class EventConditionConfigHolder : ConfigHolder<EventConditionConfig>
	{
+	[Config(prefab = "EventLinkConfig.json")]
+	public partial class EventLinkConfigHolder : ConfigHolder<EventLinkConfig>
	{
 	}
 
 
 	[Serializable]
-	public struct EventConditionConfig : IConfig
	{
+	public struct EventLinkConfig : IConfig
	{
 		public int GetID() {return ID;} 
 		/// <summary>
 		///条件ID
@@ -20,6 +20,12 @@ namespace Excel2Json
 public int ID;
 
 
+		/// <summary>
+		///事件描述
+		/// </summary>
+public int conciseEventMessage;
+
+
 		/// <summary>
 		///文本语言表ID
 		/// </summary>
@@ -39,13 +45,19 @@ public int[] ConditionPara;
 
 
 		/// <summary>
-		///事件类型 1=提供选项 2=进入战斗 3=获得奖励
+		///条件完成次数
+		/// </summary>
+public int finishCount;
+
+
+		/// <summary>
+		///事件类型 1=提供选项 2=进入战斗 3=获得奖励 4=触发下一个事件
 		/// </summary>
 public int optionType;
 
 
 		/// <summary>
-		///事件常量1 1=事件IDs 2=战斗ID 3=
+		///事件常量1 1=事件IDs 2=战斗ID 3= 4=eventConfigID
 		/// </summary>
 public int[] optionPara1;
 
@@ -69,7 +81,13 @@ public int[] PrizeNums;
 
 
 		/// <summary>
-		///事件结局后提供的选项 战斗:胜利/失败转事件ID
+		///事件结束类型 1:跳转事件 2:根据战斗解锁跳转事件 3.触发新事件
+		/// </summary>
+public int ResultType;
+
+
+		/// <summary>
+		///事件结局后提供的选项 1.EventConditionId 2.胜利id;失败id 3.EventConfigId
 		/// </summary>
 public int[] ResultOptions;
 

+ 1 - 1
Assets/Scripts/GameData/ExcelConfig/EventConditionConfig.cs.meta → Assets/Scripts/GameData/ExcelConfig/EventLinkConfig.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: DHMf4H+uAHJlLYrnxIfgX+FkNw/BLu5Y3W+3/ASQGV3v3Sd0X3DNJ76ObE5l
+guid: WStOsyypAS5MRfKzK/6DHE/FZk3Dq9HnM9aos6ET60meZ2f7XZI7hN/wX2Wn
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

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

@@ -10,6 +10,7 @@ using Fort23.UTool;
 using GameLogic.Bag;
 using GameLogic.Hero;
 using UnityEngine;
+using UnityEngine.Serialization;
 using Utility;
 #if UNITY_WEIXINMINIGAME
 using WeChatWASM;
@@ -60,9 +61,22 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         public int divineSensePoint = 0;
 
         public int divineSenseexp = 0;
+        
+        
+        /// <summary>
+        /// 事件链数据
+        /// </summary>
+        public List<EventLinkData> eventLinkDatas = new List<EventLinkData>();
 
-        public List<EventData> events = new List<EventData>();
+        /// <summary>
+        /// 完成的事件
+        /// </summary>
+        public List<EventList> completeEvents = new List<EventList>();
 
+        /// <summary>
+        /// 背包里的事件
+        /// 
+        /// </summary>
         public List<EventList> eventList = new List<EventList>();
 
 
@@ -154,6 +168,21 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         //完成cishu
         public int completeCount = 0;
     }
+    
+    /// <summary>
+    /// 刷出来的事件列表
+    /// </summary>
+    [System.Serializable]
+    public class EventLinkData
+    {
+        public int eventLinkId;
+        
+        public int eventId;
+
+        
+        public int fishCount;
+    }
+    
 
     /// <summary>
     /// 刷出来的事件列表

+ 42 - 26
Assets/Scripts/GameUI/EventManager/DialogueManager.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using Common.Utility.CombatEvent;
 using Core.Event.Event;
 using Excel2Json;
@@ -21,10 +22,6 @@ public class DialogueManager : Singleton<DialogueManager>
     private Action onCancel;
     private EventConfig eventConfig;
 
- 
-
- 
-
 
     /// <summary>
     /// 开始对话
@@ -43,27 +40,36 @@ public class DialogueManager : Singleton<DialogueManager>
         {
             PlayDialogue(dialogueID);
         }
+
+        // EndDialogue1();
     }
 
     private void PlayDialogue(int dialogueID)
     {
         currentDialogueID = dialogueID;
+        if (!EventSystemManager.Instance.IsEvenkLinkComplete(currentDialogueID))
+        {
+            onCancel?.Invoke();
+            return;
+        }
+
 
         //神识探索的事件记录步骤
         if (EventSystemManager.Instance.CurrentEventList != null)
             EventSystemManager.Instance.CurrentEventList.curStep = currentDialogueID;
 
-        AccountFileInfo.Instance.SavePlayerData();
-
 
         // 找到当前对话组
-        var dialogueConfig = ConfigComponent.Instance.Get<EventConditionConfig>(dialogueID);
+        var dialogueConfig = ConfigComponent.Instance.Get<EventLinkConfig>(dialogueID);
         if (dialogueConfig.ID == 0)
         {
             EndDialogue();
             return;
         }
 
+
+        AccountFileInfo.Instance.SavePlayerData();
+
         //挂机事件 弹出简单气泡对话
         if (eventConfig.EventTriggerType != 2)
         {
@@ -78,7 +84,7 @@ public class DialogueManager : Singleton<DialogueManager>
 
     public void FishDialogue(int? selectedOptionID)
     {
-        if (selectedOptionID.HasValue && selectedOptionID.Value!= -1)
+        if (selectedOptionID.HasValue && selectedOptionID.Value != -1)
         {
             // 玩家选择了选项,处理结果
             SelectOption(selectedOptionID.Value);
@@ -108,8 +114,9 @@ public class DialogueManager : Singleton<DialogueManager>
     /// </summary>
     private async void EndDialogue1()
     {
-        EventConditionConfig dialogueConfig = ConfigComponent.Instance.Get<EventConditionConfig>(currentDialogueID);
+        EventLinkConfig dialogueConfig = ConfigComponent.Instance.Get<EventLinkConfig>(currentDialogueID);
         bool isCombatWin = false;
+
         switch (dialogueConfig.optionType)
         {
             //选项在这里不处理 在ui层处理 所有这里不是走到1 直接return
@@ -121,7 +128,7 @@ public class DialogueManager : Singleton<DialogueManager>
             case 2:
                 LogTool.Log("对话结束,进入战斗");
                 //不是一次性事件弹出boss界面
-                if (eventConfig.EventTriggerType !=2)
+                if (eventConfig.EventTriggerType != 2)
                 {
                     bool relust = await BossInfoPanel.OpenPanel(dialogueConfig.optionPara1[0]);
                     if (relust)
@@ -180,7 +187,7 @@ public class DialogueManager : Singleton<DialogueManager>
                 await OpenRewardsPanel(eventConfig.ID, itemInfos);
                 LogTool.Log("对话结束,获得奖励");
                 break;
-            
+
             //任务检测
             case 4:
 
@@ -189,15 +196,20 @@ public class DialogueManager : Singleton<DialogueManager>
                 {
                     return;
                 }
-                
+
                 break;
         }
 
-        //如果有下一个对话id 走下一个id
-        if (dialogueConfig.ResultOptions != null && dialogueConfig.ResultOptions.Length > 0)
+
+        switch (dialogueConfig.ResultType)
         {
-            if (dialogueConfig.optionType == 2)
-            {
+            //直接走下一个id
+            case 1:
+                PlayDialogue(dialogueConfig.ResultOptions[0]);
+                break;
+
+            //根据战斗结果判断走哪一个事件id
+            case 2:
                 if (isCombatWin)
                 {
                     PlayDialogue(dialogueConfig.ResultOptions[0]);
@@ -206,15 +218,18 @@ public class DialogueManager : Singleton<DialogueManager>
                 {
                     PlayDialogue(dialogueConfig.ResultOptions[1]);
                 }
-            }
-            else
-            {
-                PlayDialogue(dialogueConfig.ResultOptions[0]);
-            }
-        }
-        else
-        {
-            EndDialogue();
+
+                break;
+            //触发新的事件 eventConfigId
+            case 3:
+
+
+                EndDialogue();
+                break;
+            //结束事件
+            default:
+                EndDialogue();
+                break;
         }
     }
 
@@ -226,12 +241,13 @@ public class DialogueManager : Singleton<DialogueManager>
     {
         onDialogueComplete?.Invoke();
     }
+
     public async CTask OpenRewardsPanel(int eventId, List<ItemInfo> rewardsDic, Action onClose = null, int titleId = 0)
     {
         EventConfig eventConfig = ConfigComponent.Instance.Get<EventConfig>(eventId);
         if (eventConfig.EventTriggerType == 2)
         {
-            Vector3 worldPos =CombatDrive.Instance.CombatController.playerHeroEntity.combatHeroGameObject.hpTransform.position;
+            Vector3 worldPos = CombatDrive.Instance.CombatController.playerHeroEntity.combatHeroGameObject.hpTransform.position;
 
             worldPos.y += 0.5f;
             await ShowItemNumberCom.Open(worldPos, rewardsDic[0]);

+ 2 - 2
Assets/Scripts/GameUI/EventManager/EventHelper.cs

@@ -9,12 +9,12 @@ public static class EventHelper
     public static string GetTaskMessage(int eventConfigId)
     {
         string result = String.Empty;
-        EventConditionConfig eventCondition = ConfigComponent.Instance.Get<EventConditionConfig>(eventConfigId);
+        EventLinkConfig eventCondition = ConfigComponent.Instance.Get<EventLinkConfig>(eventConfigId);
         switch (eventCondition.ConditionType)
         {
             case 1:
                 ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(eventCondition.ConditionPara[0]);
-                result = $"需要拥有{LanguageManager.Instance.Text(itemConfig.itemName)}{eventCondition.ConditionPara[1]}个";
+                result = $"需要拥有{LanguageManager.Instance.Text(itemConfig.itemName)}{eventCondition.finishCount}个";
                 break;
             case 2:
                 break;

+ 193 - 25
Assets/Scripts/GameUI/EventManager/EventSystemManager.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using Common.Utility.CombatEvent;
 using Core.Language;
 using Excel2Json;
 using Fort23.Core;
@@ -37,6 +38,20 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
         StaticUpdater.Instance.AddRenderUpdateCallBack(Update);
         EventManager.Instance.AddEventListener(CustomEventType.DetectRandomEvent, RenfenceRandomEvent);
+        EventManager.Instance.AddEventListener(CustomEventType.ItemUpdate, ItemUpdate);
+        EventManager.Instance.AddEventListener(CustomEventType.JingJieUpgrade, JingJieUpgrade);
+    }
+
+    private void JingJieUpgrade(IEventData e)
+    {
+        CeekEventCompletes(3, 0);
+    }
+
+    private void ItemUpdate(IEventData e)
+    {
+        ItemUpdateData data = e as ItemUpdateData;
+        CeekEventCompletes(1, data.ItemInfo.itemID);
+        CeekEventCompletes(6, data.ItemInfo.itemID);
     }
 
     private void RenfenceRandomEvent(IEventData e)
@@ -115,6 +130,19 @@ public class EventSystemManager : Singleton<EventSystemManager>
     }
 
 
+    private bool BagIsEvent(int eventID)
+    {
+        foreach (var eventList in AccountFileInfo.Instance.playerData.eventList)
+        {
+            if (eventList.eventID == eventID)
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
     private List<EventConfig> DetectEvents(int bigMapId, int eventCount)
     {
         BigMap bigMap = ConfigComponent.Instance.Get<BigMap>(bigMapId);
@@ -132,11 +160,11 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
 
             // 获取通用事件
-            List<EventConfig> globalEvents = eventConfigs.Where(e => e.EventTriggerType == 1 && CanTriggerEvent(e.ID) && e.EventQuality == quality).ToList();
+            List<EventConfig> globalEvents = eventConfigs.Where(e => e.EventTriggerType == 1 && CanTriggerEvent(e.ID) && e.EventQuality == quality && !BagIsEvent(e.ID)).ToList();
 
 
             //神识场景事件
-            List<EventConfig> candidateEvents = eventConfigs.Where(e => bigMap.DivineSenseGeneralEvent.Contains(e.ID) && CanTriggerEvent(e.ID) && e.EventQuality == quality).ToList();
+            List<EventConfig> candidateEvents = eventConfigs.Where(e => bigMap.DivineSenseGeneralEvent.Contains(e.ID) && CanTriggerEvent(e.ID) && e.EventQuality == quality && !BagIsEvent(e.ID)).ToList();
 
             if (candidateEvents.Count == 0 && globalEvents.Count == 0)
             {
@@ -208,7 +236,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         LogTool.Log($"触发事件: {evt.Description} (ID: {evt.ID}, 品质: {evt.EventQuality})");
         CombatDrive.Instance.CombatController.ChangeState(CombatController.idle);
 
-        DialogueManager.Instance.StartDialogue(evt.EventBeginId, evt.ID, () => { CompleteEvent(evt.ID); });
+        DialogueManager.Instance.StartDialogue(evt.EventLinksId[0], evt.ID, () => { CompleteEvent(evt.ID); });
     }
 
     /// <summary>
@@ -227,13 +255,34 @@ public class EventSystemManager : Singleton<EventSystemManager>
         int dialogueID = 0;
         if (evt.curStep == 0)
         {
-            dialogueID = eventConfig.EventBeginId;
+            dialogueID = eventConfig.EventLinksId[0];
+
+            foreach (var i in eventConfig.EventLinksId)
+            {
+                AccountFileInfo.EventLinkData eventLinkData = AccountFileInfo.Instance.playerData.eventLinkDatas.FirstOrDefault(el => el.eventLinkId == i);
+
+                if (eventLinkData == null)
+                {
+                    eventLinkData = new AccountFileInfo.EventLinkData();
+                    eventLinkData.eventId = evt.eventID;
+                    eventLinkData.eventLinkId = i;
+                    AccountFileInfo.Instance.playerData.eventLinkDatas.Add(eventLinkData);
+                }
+
+                eventLinkData.fishCount = 0;
+                EventSystemManager.Instance.CeekTaskComplete(eventLinkData.eventLinkId, 1, 0);
+                EventSystemManager.Instance.CeekTaskComplete(eventLinkData.eventLinkId, 3, 0);
+            }
+
+
+            AccountFileInfo.Instance.SavePlayerData();
         }
         else
         {
             dialogueID = evt.curStep;
         }
 
+
         CurrentEventList = evt;
         CombatDrive.Instance.CombatController.ChangeState(CombatController.idle);
         DialogueManager.Instance.StartDialogue(dialogueID, eventConfig.ID, () =>
@@ -248,6 +297,108 @@ public class EventSystemManager : Singleton<EventSystemManager>
         await cTask;
     }
 
+
+    //任务是否完成
+    public bool IsEvenkLinkComplete(int eventLinkId)
+    {
+        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;
+        }
+
+        return false;
+    }
+
+    public void CeekEventCompletes(int type, int value)
+    {
+        foreach (var playerDataEventLinkData in AccountFileInfo.Instance.playerData.eventLinkDatas)
+        {
+            CeekTaskComplete(playerDataEventLinkData.eventLinkId, type, value);
+        }
+    }
+
+    public void CeekTaskComplete(int eventLiknId, int type, int value)
+    {
+        //任务完成了跳过检测
+        if (IsEvenkLinkComplete(eventLiknId))
+            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)
+                {
+                    eventLinkData.fishCount++;
+
+                    if (IsEvenkLinkComplete(eventLiknId))
+                    {
+                        CompleteEvent(eventLiknId);
+                    }
+                }
+
+                break;
+
+            //获得道具
+            case 6:
+                if (eventLinkConfig.ConditionType == 5 && eventLinkConfig.ConditionPara[0] == value)
+                {
+                    eventLinkData.fishCount++;
+
+                    if (IsEvenkLinkComplete(eventLiknId))
+                    {
+                        CompleteEvent(eventLinkData);
+                    }
+                }
+
+                break;
+        }
+
+
+        AccountFileInfo.Instance.SavePlayerData();
+    }
+
+    private void CompleteTask(object taskID)
+    {
+    }
+
+
     /// <summary>
     /// 检查事件是否满足触发条件。
     /// </summary>
@@ -275,6 +426,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         if (conditionid == 0)
             return true;
 
+
         //道具id判断
         if (conditionid == 1)
         {
@@ -297,28 +449,22 @@ public class EventSystemManager : Singleton<EventSystemManager>
     /// 完成事件
     /// </summary>
     /// <param name="eventID">事件ID</param>
-    public void CompleteEvent(int eventID)
+    public void CompleteEvent(int evtId)
     {
         isTriggerEvent = false;
-        LogTool.Log($"完成事件{eventID}");
-        AccountFileInfo.EventData eventData = AccountFileInfo.Instance.playerData.events.FirstOrDefault((e) => e.eventID == eventID);
-        if (eventData == null)
-        {
-            eventData = new AccountFileInfo.EventData();
-            eventData.eventID = eventID;
-        }
+        LogTool.Log($"完成挂机事件{evtId}");
+
 
-        eventData.completeCount++;
-        AccountFileInfo.Instance.playerData.events.Add(eventData);
+        AccountFileInfo.EventList eventList = new AccountFileInfo.EventList();
+        eventList.eventID = evtId;
+        AccountFileInfo.Instance.playerData.completeEvents.Add(eventList);
 
         if (AccountFileInfo.Instance.playerData.senceExplorationProgress < 100)
-            AccountFileInfo.Instance.playerData.senceExplorationProgress += 5;
+            AccountFileInfo.Instance.playerData.senceExplorationProgress += 1;
 
 
         AccountFileInfo.Instance.SavePlayerData();
         CombatDrive.Instance.CombatController.ChangeState(CombatController.update);
-
-        // EventManager.Instance.Dispatch(CustomEventType.CompleteEvent, null);
     }
 
     /// <summary>
@@ -329,15 +475,8 @@ public class EventSystemManager : Singleton<EventSystemManager>
     {
         this.isTriggerEvent = isTriggerEvent;
         LogTool.Log($"完成事件{eventList.eventID}");
-        AccountFileInfo.EventData eventData = AccountFileInfo.Instance.playerData.events.FirstOrDefault((e) => e.eventID == eventList.eventID);
-        if (eventData == null)
-        {
-            eventData = new AccountFileInfo.EventData();
-            eventData.eventID = eventList.eventID;
-        }
 
-        eventData.completeCount++;
-        AccountFileInfo.Instance.playerData.events.Add(eventData);
+        AccountFileInfo.Instance.playerData.completeEvents.Add(eventList);
 
         if (AccountFileInfo.Instance.playerData.senceExplorationProgress < 100)
             AccountFileInfo.Instance.playerData.senceExplorationProgress += 1;
@@ -352,6 +491,35 @@ public class EventSystemManager : Singleton<EventSystemManager>
         onCompleteCallback = null;
     }
 
+    /// <summary>
+    /// 完成事件
+    /// </summary>
+    /// <param name="eventID">事件ID</param>
+    public void CompleteEvent(AccountFileInfo.EventLinkData eventLinkData)
+    {
+        AccountFileInfo.EventList eventList = new AccountFileInfo.EventList();
+        eventList.eventID = eventLinkData.eventId;
+        AccountFileInfo.Instance.playerData.completeEvents.Add(eventList);
+
+        if (AccountFileInfo.Instance.playerData.senceExplorationProgress < 100)
+            AccountFileInfo.Instance.playerData.senceExplorationProgress += 1;
+
+
+        AccountFileInfo.Instance.playerData.eventList.Remove(eventList);
+
+        EventLinkConfig eventLinkConfig = ConfigComponent.Instance.Get<EventLinkConfig>(eventLinkData.eventLinkId);
+        if (eventLinkConfig.ResultType == 3)
+        {
+            //触发新事件
+            //弹出任务完成ui
+        }
+
+        AccountFileInfo.Instance.SavePlayerData();
+
+        EventManager.Instance.Dispatch(CustomEventType.CompleteEvent, null);
+        CombatDrive.Instance.CombatController.ChangeState(CombatController.update);
+    }
+
     /// <summary>
     /// 取消事件
     /// </summary>

+ 1 - 1
Assets/Scripts/GameUI/UI/CombatPanel/ShengShiEventWidget.cs

@@ -43,7 +43,7 @@ namespace Fort23.Mono
             randomEventConfig = ConfigComponent.Instance.Get<EventConfig>(eventList.eventID);
             Text_Name.text = LanguageManager.Instance.Text(randomEventConfig.Description);
 
-            EventConditionConfig conditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(randomEventConfig.EventBeginId);
+            EventLinkConfig conditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(randomEventConfig.EventLinksId[0]);
             string desc = LanguageManager.Instance.Text(conditionConfig.LanID[0]);
             if (desc.Length > 8)
             {

+ 2 - 2
Assets/Scripts/GameUI/UI/DialoguePanel/DialogueBubblePanel.cs

@@ -25,7 +25,7 @@ namespace Fort23.Mono
         private bool _isUpdate;
         private bool _isShowNextButton;
 
-        private EventConditionConfig eventConditionConfig;
+        private EventLinkConfig eventConditionConfig;
         private bool _skipTyping;
         private bool _isShowingOptions;
 
@@ -87,7 +87,7 @@ namespace Fort23.Mono
         public void ShowPanel(int id,
             Action<int?> finish)
         {
-            eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(id);
+            eventConditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(id);
 
             this.dialogueMessaga = eventConditionConfig.LanID;
             this.finish = finish;

+ 4 - 4
Assets/Scripts/GameUI/UI/DialoguePanel/DialogueOptionWidget.cs

@@ -11,7 +11,7 @@ namespace Fort23.Mono
     [UIBinding(prefab = "DialogueOptionWidget")]
     public partial class DialogueOptionWidget : UIComponent
     {
-        public EventConditionConfig eventConditionConfig;
+        public EventLinkConfig eventConditionConfig;
         private Action<DialogueOptionWidget> callback;
         public int type;
 
@@ -36,13 +36,13 @@ namespace Fort23.Mono
         public void CustomInit(int id, int mainOpid, Action<DialogueOptionWidget> callback)
         {
             type = 1;
-            eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(id);
-            var mainEventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(mainOpid);
+            eventConditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(id);
+            var mainEventConditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(mainOpid);
             int index = mainEventConditionConfig.optionPara1.ToList().IndexOf(eventConditionConfig.ID);
             Text_desc.text = LanguageManager.Instance.Text(mainEventConditionConfig.optionPara2[index]);
             this.callback = callback;
 
-            if (!EventSystemManager.Instance.CheckCondition(eventConditionConfig.ConditionType, eventConditionConfig.ConditionPara))
+            if (!EventSystemManager.Instance.IsEvenkLinkComplete(eventConditionConfig.ID))
             {
                 transform.Gray();
             }

+ 4 - 4
Assets/Scripts/GameUI/UI/DialoguePanel/DialoguePanel.cs

@@ -25,7 +25,7 @@ namespace Fort23.Mono
         private bool _isUpdate;
         private bool _isShowNextButton;
         private string[] showIconName;
-        private EventConditionConfig eventConditionConfig;
+        private EventLinkConfig eventConditionConfig;
         private bool _skipTyping;
         private bool _isShowingOptions;
 
@@ -122,7 +122,7 @@ namespace Fort23.Mono
             ShowDialogueEventData.MessageShowType messageShowType,
             Action<int?> finish)
         {
-            eventConditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(id);
+            eventConditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(id);
             showIconName = icon;
             this.dialogueMessaga = eventConditionConfig.LanID;
             this.messageShowType = messageShowType;
@@ -164,7 +164,7 @@ namespace Fort23.Mono
                 {
                     if (eventConditionConfig.ID != 0 && eventConditionConfig.ConditionType != 0)
                     {
-                        if (!EventSystemManager.Instance.CheckCondition(eventConditionConfig.ConditionType, eventConditionConfig.ConditionPara))
+                        if (!EventSystemManager.Instance.IsEvenkLinkComplete(eventConditionConfig.ID))
                         {
                             TipMessagePanel.OpenTipMessagePanel(EventHelper.GetTaskMessage(eventConditionConfig.ID));
                             return;
@@ -244,7 +244,7 @@ namespace Fort23.Mono
             int selectedOptionID = obj.eventConditionConfig.ID;
             if (obj.eventConditionConfig.ID != 0 && obj.eventConditionConfig.ConditionType != 0)
             {
-                if (!EventSystemManager.Instance.CheckCondition(obj.eventConditionConfig.ConditionType, obj.eventConditionConfig.ConditionPara))
+                if (!EventSystemManager.Instance.IsEvenkLinkComplete(selectedOptionID))
                 {
                     TipMessagePanel.OpenTipMessagePanel(EventHelper.GetTaskMessage(selectedOptionID));
                     return;

+ 1 - 1
Assets/Scripts/GameUI/UI/DivineSence/ShengShiEventWidgetType2.cs

@@ -39,7 +39,7 @@ namespace Fort23.Mono
 			this.eventList = eventList;
 			randomEventConfig = ConfigComponent.Instance.Get<EventConfig>(eventList.eventID);
 			Text_EventName.text = LanguageManager.Instance.Text(randomEventConfig.Description);
-			EventConditionConfig conditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(randomEventConfig.EventBeginId);
+			EventLinkConfig conditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(randomEventConfig.EventLinksId[0]);
 			Text_EventDesc.text = LanguageManager.Instance.Text(conditionConfig.LanID[0]);
 
 		}

+ 1 - 1
Assets/Scripts/GameUI/UI/DivineSence/ShengShiEventWidgetType3.cs

@@ -49,7 +49,7 @@ namespace Fort23.Mono
             this.eventList = eventList;
             randomEventConfig = ConfigComponent.Instance.Get<EventConfig>(eventList.eventID);
             Text_EventName.text = LanguageManager.Instance.Text(randomEventConfig.Description);
-            EventConditionConfig conditionConfig = ConfigComponent.Instance.Get<EventConditionConfig>(randomEventConfig.EventBeginId);
+            EventLinkConfig conditionConfig = ConfigComponent.Instance.Get<EventLinkConfig>(randomEventConfig.EventLinksId[0]);
             Text_EventDesc.text = LanguageManager.Instance.Text(conditionConfig.LanID[0]);
 
             if (conditionConfig.optionType == 3)

文件差异内容过多而无法显示
+ 0 - 0
Assets/StreamingAssets/assetConfig.txt


二进制
Excel2Json/Excel/EventConfig.xlsx


二进制
Excel2Json/Excel/Task.xlsx


部分文件因为文件数量过多而无法显示