lzx 10 часов назад
Родитель
Сommit
0775e43d80

+ 3 - 0
Assets/Res/Config/BigMap.json

@@ -14,6 +14,9 @@
         6,
         7
       ],
+      "DivineSenseGeneralEvent": [
+        1
+      ],
       "DivineSenseGeneralProbability": 50,
       "ulockFunction": [
         0

+ 0 - 13
Assets/Res/Config/DialogueConfig.json

@@ -1,13 +0,0 @@
-{
-  "configList": [
-    {
-      "ID": 1,
-      "GroupId": 1,
-      "DialogueOptionId": [
-        1,
-        2
-      ],
-      "isEnd": false
-    }
-  ]
-}

+ 0 - 7
Assets/Res/Config/DialogueConfig.json.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: B3gavCz/Un0JlgBzjCYeqsEHPrV+NxCgcgoNdDdP/aLxIuF/qvmt5DKsPd96
-TextScriptImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 14
Assets/Res/Config/DialogueOptionConfig.json

@@ -1,14 +0,0 @@
-{
-  "configList": [
-    {
-      "ID": 1,
-      "LanguageId": 1,
-      "DialogueConfigID": 0
-    },
-    {
-      "ID": 2,
-      "LanguageId": 2,
-      "DialogueConfigID": 0
-    }
-  ]
-}

+ 0 - 7
Assets/Res/Config/DialogueOptionConfig.json.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: CiwY5nj4AH+56r0yiTBf0ROgm8K4Dd+UXRNplzGB0uUsydE5M9zSXv+lX9eT
-TextScriptImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 2 - 2
Assets/Res/Config/DivineSenseConfig.json

@@ -4,7 +4,7 @@
       "ID": 1,
       "DetectEventCount": 3,
       "QualityBonusChance": [
-        10.0,
+        100.0,
         10.0,
         10.0,
         10.0,
@@ -21,7 +21,7 @@
       "ID": 2,
       "DetectEventCount": 3,
       "QualityBonusChance": [
-        10.0,
+        100.0,
         10.0,
         10.0,
         10.0,

+ 87 - 12
Assets/Res/Config/EventConditionConfig.json

@@ -1,28 +1,103 @@
 {
   "configList": [
     {
-      "ID": 1,
-      "operation": 1
+      "ID": 1001,
+      "LanID": null,
+      "optionType": 1,
+      "optionPara1": [
+        1002,
+        1003
+      ]
     },
     {
-      "ID": 2,
-      "operation": 1
+      "ID": 1002,
+      "LanID": null,
+      "optionType": 2,
+      "optionPara1": [
+        702
+      ],
+      "PrizeIDs": [
+        1002
+      ],
+      "PrizeNums": [
+        100
+      ]
     },
     {
-      "ID": 11,
-      "operation": null
+      "ID": 1003,
+      "LanID": null,
+      "optionType": 3,
+      "PrizeIDs": [
+        1003
+      ],
+      "PrizeNums": [
+        50
+      ]
     },
     {
-      "ID": 12,
-      "operation": null
+      "ID": 1010,
+      "LanID": null,
+      "optionType": 1,
+      "optionPara1": [
+        1011,
+        1012
+      ]
     },
     {
-      "ID": 101,
-      "operation": null
+      "ID": 1011,
+      "LanID": null,
+      "optionType": 1,
+      "optionPara1": [
+        1014,
+        1015
+      ]
     },
     {
-      "ID": 102,
-      "operation": null
+      "ID": 1012,
+      "LanID": null,
+      "optionType": 5,
+      "optionPara1": [
+        1
+      ],
+      "optionPara2": [
+        1,
+        1
+      ],
+      "PrizeIDs": [
+        1016
+      ],
+      "PrizeNums": [
+        10
+      ]
+    },
+    {
+      "ID": 1014,
+      "LanID": null,
+      "optionType": 4,
+      "optionPara1": [
+        2
+      ],
+      "optionPara2": [
+        4,
+        150
+      ],
+      "PrizeIDs": [
+        1016
+      ],
+      "PrizeNums": [
+        200
+      ]
+    },
+    {
+      "ID": 1015,
+      "LanID": null,
+      "optionType": 3,
+      "PrizeIDs": [
+        1002
+      ],
+      "PrizeNums": [
+        1000
+      ]
     }
   ]
 }

+ 4 - 8
Assets/Res/Config/EventConfig.json

@@ -2,25 +2,22 @@
   "configList": [
     {
       "ID": 1,
-      "EventType": 1,
+      "EventType": 1001,
       "EventTriggerType": 1,
       "EventQuality": 1,
-      "EventCompleteCount": null,
       "EventConditionId": [
         2
       ],
       "EventVlaue": [
         2
       ],
-      "Description": null,
-      "DialogueID": null
+      "Description": null
     },
     {
       "ID": 2,
-      "EventType": 2,
-      "EventTriggerType": 1,
+      "EventType": 1010,
+      "EventTriggerType": 2,
       "EventQuality": 1,
-      "EventCompleteCount": null,
       "EventConditionId": [
         1
       ],
@@ -28,7 +25,6 @@
         5
       ],
       "Description": null,
-      "DialogueID": 1,
       "associateVlaue": [
         1
       ]

+ 0 - 50
Assets/Scripts/GameData/ExcelConfig/DialogueConfig.cs

@@ -1,50 +0,0 @@
-// Auto Generated Code By excel2json
-// Generate From Excel\DialogueConfig.xlsx. SheetName: DialogueConfig
-
-using System;
-using Fort23.GameData;
-
-namespace Excel2Json
-{
-	[Config(prefab = "DialogueConfig.json")]
-	public partial class DialogueConfigHolder : ConfigHolder<DialogueConfig>
	{
-	}
-
-
-	[Serializable]
-	public struct DialogueConfig : IConfig
	{
-		public int GetID() {return ID;} 
-		/// <summary>
-		///ID
-		/// </summary>
-public int ID;
-
-
-		/// <summary>
-		///对话组ID
-		/// </summary>
-public int GroupId;
-
-
-		/// <summary>
-		///内容ID
-		/// </summary>
-public int[] Content;
-
-
-		/// <summary>
-		///
-		/// </summary>
-public int[] DialogueOptionId;
-
-
-		/// <summary>
-		///是否结束对话 如果有选项需要填这个字段
-		/// </summary>
-public bool isEnd;
-
-
-	}
-
-}
-// End of Auto Generated Code

+ 0 - 11
Assets/Scripts/GameData/ExcelConfig/DialogueConfig.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: WSkc5iivUSgdHHQXWpffKVXiJMayk2qmo0883Ued0a47pmyFjx9nfgKXYg1L
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 38
Assets/Scripts/GameData/ExcelConfig/DialogueOptionConfig.cs

@@ -1,38 +0,0 @@
-// Auto Generated Code By excel2json
-// Generate From Excel\DialogueConfig.xlsx. SheetName: DialogueOptionConfig
-
-using System;
-using Fort23.GameData;
-
-namespace Excel2Json
-{
-	[Config(prefab = "DialogueOptionConfig.json")]
-	public partial class DialogueOptionConfigHolder : ConfigHolder<DialogueOptionConfig>
	{
-	}
-
-
-	[Serializable]
-	public struct DialogueOptionConfig : IConfig
	{
-		public int GetID() {return ID;} 
-		/// <summary>
-		///ID
-		/// </summary>
-public int ID;
-
-
-		/// <summary>
-		///选项文本
-		/// </summary>
-public int LanguageId;
-
-
-		/// <summary>
-		///下一节点ID 如果没有后续对话可以填0
-		/// </summary>
-public int DialogueConfigID;
-
-
-	}
-
-}
-// End of Auto Generated Code

+ 0 - 11
Assets/Scripts/GameData/ExcelConfig/DialogueOptionConfig.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: Cn9Ktnv8VX+YAbKlIVevrDIK05tDWrgRPlyD9dUG6uk+bFMXflGq6f6HOozb
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 38 - 2
Assets/Scripts/GameData/ExcelConfig/EventConditionConfig.cs

@@ -21,9 +21,45 @@ public int ID;
 
 
 		/// <summary>
-		///条件运算 1 =大于等于 2 =等于 3=小于等于
+		///文本语言表ID
 		/// </summary>
-public int operation;
+public int LanID;
+
+
+		/// <summary>
+		///事件类型 1=提供选项 2=进入战斗 3=直接获得奖励 4=条件判断后进入战斗 5=条件判断后获得奖励
+		/// </summary>
+public int optionType;
+
+
+		/// <summary>
+		///事件常量1 1=事件IDs 2=战斗ID 3= 4=条件类型s 5=条件类型s
+		/// </summary>
+public int[] optionPara1;
+
+
+		/// <summary>
+		///事件常量2 1=事件选择文本IDs 2= 3= 4=条件数值s 5=条件数值s
+		/// </summary>
+public int[] optionPara2;
+
+
+		/// <summary>
+		///事件结局奖励
+		/// </summary>
+public int[] PrizeIDs;
+
+
+		/// <summary>
+		///事件结局奖励数量
+		/// </summary>
+public int[] PrizeNums;
+
+
+		/// <summary>
+		///事件结局文本
+		/// </summary>
+public int[] ResultLanID;
 
 
 	}

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

@@ -21,13 +21,13 @@ public int ID;
 
 
 		/// <summary>
-		///事件类型: 1.获得奖励 2.触发战斗
+		///事件的起始ID
 		/// </summary>
 public int EventType;
 
 
 		/// <summary>
-		///触发事件类型: 1.场景事件 2.随机事件 3.通用事件
+		///触发事件类型: 1.循环事件 2.一次性事件
 		/// </summary>
 public int EventTriggerType;
 
@@ -38,12 +38,6 @@ public int EventTriggerType;
 public int EventQuality;
 
 
-		/// <summary>
-		///事件次数 -1无限
-		/// </summary>
-public int EventCompleteCount;
-
-
 		/// <summary>
 		///触发条件类型
 		/// </summary>
@@ -62,12 +56,6 @@ public int[] EventVlaue;
 public int Description;
 
 
-		/// <summary>
-		///对话ID
-		/// </summary>
-public int DialogueID;
-
-
 		/// <summary>
 		///特殊功能参数
 		/// </summary>

+ 9 - 10
Assets/Scripts/GameLogic/EventManager/EventManager.cs

@@ -32,7 +32,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
 
         // 获取通用事件
-        List<EventConfig> globalEvents = eventConfigs.Where(e => e.EventTriggerType == 3 && CanTriggerEvent(e.ID) && e.EventQuality == quality).ToList();
+        List<EventConfig> globalEvents = eventConfigs.Where(e => e.EventTriggerType == 1 && CanTriggerEvent(e.ID) && e.EventQuality == quality).ToList();
 
 
         //神识场景事件
@@ -46,7 +46,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
 
         var triggeredEvents = new List<EventConfig>();
-        for (int i = 0; i >= divineSenseConfig.DetectEventCount; i++)
+        for (int i = 0; i < divineSenseConfig.DetectEventCount; i++)
         {
             int randomValue1 = Random.Range(0, 101);
             //刷场景事件
@@ -57,7 +57,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
                 triggeredEvents.Add(candidateEvents[randomValue2]);
                 candidateEvents.RemoveAll(ew => ew.ID == candidateEvents[randomValue2].ID);
             }
-            else
+            else if (globalEvents.Count > 0)
             {
                 int randomValue2 = Random.Range(0, globalEvents.Count);
 
@@ -107,10 +107,10 @@ public class EventSystemManager : Singleton<EventSystemManager>
     public void TriggerEvent(EventConfig evt)
     {
         Debug.Log($"触发事件: {evt.Description} (ID: {evt.ID}, 品质: {evt.EventQuality})");
-        if (evt.DialogueID > 0)
-        {
-            // DialogueManager.Instance.StartDialogue(evt.DialogueID, evt.ID);
-        }
+        // if (evt.DialogueID > 0)
+        // {
+        // DialogueManager.Instance.StartDialogue(evt.DialogueID, evt.ID);
+        // }
 
         CompleteEvent(evt.ID);
     }
@@ -153,7 +153,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         }
 
 
-        return false;
+        return true;
     }
 
     /// <summary>
@@ -163,7 +163,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
     public void CompleteEvent(int eventID)
     {
         LogTool.Log($"完成任务{eventID}");
-        AccountFileInfo.EventData eventData =  AccountFileInfo.Instance.playerData.events.FirstOrDefault((e) => e.eventID == eventID);
+        AccountFileInfo.EventData eventData = AccountFileInfo.Instance.playerData.events.FirstOrDefault((e) => e.eventID == eventID);
         if (eventData == null)
         {
             eventData = new AccountFileInfo.EventData();
@@ -173,6 +173,5 @@ public class EventSystemManager : Singleton<EventSystemManager>
         eventData.completeCount++;
         AccountFileInfo.Instance.playerData.events.Add(eventData);
         AccountFileInfo.Instance.SavePlayerData();
-        
     }
 }

+ 1 - 0
Assets/Scripts/GameLogic/Player/PlayerManager.cs

@@ -30,6 +30,7 @@ public class PlayerManager : Singleton<PlayerManager>
         SetConfigs();
         AccountFileInfo.Instance.LoadPlayerData();
         InitGameData();
+        EventSystemManager.Instance.CustomInit();
     }
 
     private void SetConfigs()

+ 31 - 31
Assets/Scripts/GameUI/DialogueManager/DialogueManager.cs

@@ -17,14 +17,14 @@ public class DialogueManager : Singleton<DialogueManager>
     private int currentNodeID;
     private int currentEventID;
 
-    private List<DialogueConfig> dialogueConfigs;
-    private List<DialogueOptionConfig> dialogueOptionConfigs;
+    // private List<DialogueConfig> dialogueConfigs;
+    // private List<DialogueOptionConfig> dialogueOptionConfigs;
 
 
     public void CustomInit()
     {
-        dialogueConfigs = ConfigComponent.Instance.GetAll<DialogueConfig>().ToList();
-        dialogueOptionConfigs = ConfigComponent.Instance.GetAll<DialogueOptionConfig>().ToList();
+        // dialogueConfigs = ConfigComponent.Instance.GetAll<DialogueConfig>().ToList();
+        // dialogueOptionConfigs = ConfigComponent.Instance.GetAll<DialogueOptionConfig>().ToList();
     }
 
     /// <summary>
@@ -44,20 +44,20 @@ public class DialogueManager : Singleton<DialogueManager>
     private void ShowDialogue()
     {
         //找到当前对话组
-        var dialogueConfig = dialogueConfigs.Find(n =>
-            n.ID == currentDialogueID && n.GroupId == currentNodeID);
-        if (dialogueConfig.ID == 0)
-        {
-            EndDialogue();
-            return;
-        }
+        // var dialogueConfig = dialogueConfigs.Find(n =>
+        //     n.ID == currentDialogueID && n.GroupId == currentNodeID);
+        // if (dialogueConfig.ID == 0)
+        // {
+        //     EndDialogue();
+        //     return;
+        // }
 
 
         //todo 加载对话ui
-        DialoguePanel.OpenDialoguePanel(dialogueConfig.Content, null, ShowDialogueEventData.MessageShowType.Default, () =>
-        {
-
-        });
+        // DialoguePanel.OpenDialoguePanel(dialogueConfig.Content, null, ShowDialogueEventData.MessageShowType.Default, () =>
+        // {
+        //
+        // });
         currentNodeID++;
     }
 
@@ -67,22 +67,22 @@ public class DialogueManager : Singleton<DialogueManager>
     /// <param name="optionID">选项ID</param>
     public void SelectOption(int optionID)
     {
-        var option = dialogueOptionConfigs.Find(o => o.ID == optionID);
-        if (option.ID == 0)
-        {
-            EndDialogue();
-            return;
-        }
-
-        if (option.DialogueConfigID > 0)
-        {
-            currentNodeID = option.DialogueConfigID;
-            ShowDialogue();
-        }
-        else
-        {
-            EndDialogue();
-        }
+        // var option = dialogueOptionConfigs.Find(o => o.ID == optionID);
+        // if (option.ID == 0)
+        // {
+        //     EndDialogue();
+        //     return;
+        // }
+        //
+        // if (option.DialogueConfigID > 0)
+        // {
+        //     currentNodeID = option.DialogueConfigID;
+        //     ShowDialogue();
+        // }
+        // else
+        // {
+        //     EndDialogue();
+        // }
     }
 
     /// <summary>

BIN
Excel2Json/Excel/DialogueConfig.xlsx


BIN
Excel2Json/Excel/DivineSenseConfig.xlsx


BIN
Excel2Json/Excel/Maps.xlsx