Browse Source

神识表修改

lzx 14 hours ago
parent
commit
640d4006c3

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

@@ -14,6 +14,7 @@
         6,
         6,
         7
         7
       ],
       ],
+      "DivineSenseGeneralProbability": 50,
       "ulockFunction": [
       "ulockFunction": [
         0
         0
       ],
       ],
@@ -32,6 +33,7 @@
         11,
         11,
         12
         12
       ],
       ],
+      "DivineSenseGeneralProbability": null,
       "ulockFunction": [
       "ulockFunction": [
         0
         0
       ],
       ],
@@ -50,6 +52,7 @@
         16,
         16,
         17
         17
       ],
       ],
+      "DivineSenseGeneralProbability": null,
       "ulockFunction": [
       "ulockFunction": [
         0
         0
       ],
       ],

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

@@ -0,0 +1,3 @@
+{
+  "configList": []
+}

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

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: B3oetS2rBy73X/qNX6mit8Gil/RWEbz5ja5Aof2w6JDVplPqnRr49lon2ox9
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -5,7 +5,7 @@
       "DetectEventCount": 3,
       "DetectEventCount": 3,
       "QualityBonusChance": 10,
       "QualityBonusChance": 10,
       "DivineSenseCount": 100,
       "DivineSenseCount": 100,
-      "DivineSenseCost": 5,
+      "DivineSenseCost": -1,
       "MinDivineSenseValue": 100
       "MinDivineSenseValue": 100
     }
     }
   ]
   ]

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

@@ -11,10 +11,8 @@
       "EventVlaue": [
       "EventVlaue": [
         2
         2
       ],
       ],
-      "BaseProbability": 50,
       "Description": null,
       "Description": null,
       "DialogueID": null,
       "DialogueID": null,
-      "associateVlaue": null,
       "RewardID": [
       "RewardID": [
         1001
         1001
       ],
       ],
@@ -34,10 +32,11 @@
       "EventVlaue": [
       "EventVlaue": [
         5
         5
       ],
       ],
-      "BaseProbability": 50,
       "Description": null,
       "Description": null,
       "DialogueID": 1,
       "DialogueID": 1,
-      "associateVlaue": 1,
+      "associateVlaue": [
+        1
+      ],
       "RewardID": [
       "RewardID": [
         1001
         1001
       ],
       ],

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

@@ -45,9 +45,21 @@ public int[] places;
 
 
 
 
 		/// <summary>
 		/// <summary>
-		///神识包含的事件列表
+		///神识场景事件列表
 		/// </summary>
 		/// </summary>
-public int[] DivineSenseEvent;
+public int[] DivineSenseGeneralEvent;
+
+
+		/// <summary>
+		///神识专用事件 优先刷
+		/// </summary>
+public int[] DivineSenseDedicatedEvent;
+
+
+		/// <summary>
+		///刷场景事件概率
+		/// </summary>
+public int DivineSenseGeneralProbability;
 
 
 
 
 		/// <summary>
 		/// <summary>

+ 1 - 1
Assets/Scripts/GameData/ExcelConfig/DialogueConfig.cs

@@ -39,7 +39,7 @@ public int[] DialogueOptionId;
 
 
 
 
 		/// <summary>
 		/// <summary>
-		///是否结束对话 如果有选项需要填这个字段,没有选项一句一句显示
+		///是否结束对话 如果有选项需要填这个字段
 		/// </summary>
 		/// </summary>
 public bool isEnd;
 public bool isEnd;
 
 

+ 1 - 7
Assets/Scripts/GameData/ExcelConfig/EventConfig.cs

@@ -50,12 +50,6 @@ public int[] EventConditionId;
 public int[] EventVlaue;
 public int[] EventVlaue;
 
 
 
 
-		/// <summary>
-		///触发事件的概率
-		/// </summary>
-public int BaseProbability;
-
-
 		/// <summary>
 		/// <summary>
 		///描述
 		///描述
 		/// </summary>
 		/// </summary>
@@ -71,7 +65,7 @@ public int DialogueID;
 		/// <summary>
 		/// <summary>
 		///特殊功能参数
 		///特殊功能参数
 		/// </summary>
 		/// </summary>
-public int associateVlaue;
+public int[] associateVlaue;
 
 
 
 
 		/// <summary>
 		/// <summary>

+ 20 - 71
Assets/Scripts/GameLogic/EventManager/EventManager.cs

@@ -6,6 +6,7 @@ using Excel2Json;
 using Fort23.UTool;
 using Fort23.UTool;
 using UnityEngine;
 using UnityEngine;
 using Utility;
 using Utility;
+using Random = UnityEngine.Random;
 
 
 public class EventSystemManager : Singleton<EventSystemManager>
 public class EventSystemManager : Singleton<EventSystemManager>
 {
 {
@@ -24,96 +25,44 @@ public class EventSystemManager : Singleton<EventSystemManager>
         BigMap bigMap = ConfigComponent.Instance.Get<BigMap>(bigMapId);
         BigMap bigMap = ConfigComponent.Instance.Get<BigMap>(bigMapId);
         DivineSenseConfig divineSenseConfig = ConfigComponent.Instance.Get<DivineSenseConfig>(1);
         DivineSenseConfig divineSenseConfig = ConfigComponent.Instance.Get<DivineSenseConfig>(1);
 
 
+
         // 选择神识区间
         // 选择神识区间
         DivineSenseIntervalConfig interval = SelectInterval(200);
         DivineSenseIntervalConfig interval = SelectInterval(200);
 
 
         // 获取通用事件
         // 获取通用事件
         List<EventConfig> globalEvents = eventConfigs
         List<EventConfig> globalEvents = eventConfigs
-            .Where(e => e.EventTriggerType == 3 && CanTriggerEvent(e.ID) &&
-                        interval.EventQualities.Contains(e.EventQuality))
+            .Where(e => e.EventTriggerType == 3 && CanTriggerEvent(e.ID))
             .ToList();
             .ToList();
 
 
 
 
-        //获取特定事件
-        var eventIDs = bigMap.DivineSenseEvent.ToList();
-        List<EventConfig> candidateEvents = eventConfigs
-            .Where(e => eventIDs.Contains(e.ID) && CanTriggerEvent(e.ID))
-            .ToList();
-        candidateEvents.AddRange(globalEvents);
+        //神识场景事件
+        List<EventConfig> candidateEvents = eventConfigs.Where(e => bigMap.DivineSenseGeneralEvent.Contains(e.ID) && CanTriggerEvent(e.ID)).ToList();
 
 
-        if (candidateEvents.Count == 0)
+        if (candidateEvents.Count == 0 && globalEvents.Count == 0)
         {
         {
             LogTool.Warning("没有可以刷新的任务");
             LogTool.Warning("没有可以刷新的任务");
             return;
             return;
         }
         }
 
 
-        // 计算高品质事件加成
-        float qualityBonusMultiplier = divineSenseConfig.QualityBonusChance *
-                                       Mathf.Floor((200 - divineSenseConfig.MinDivineSenseValue) /
-                                                   divineSenseConfig.DivineSenseCount);
-
-
-        // 获得全部权重
-        var eventWeights = new List<(EventConfig Event, int Weight)>();
-        float totalProbability = candidateEvents.Sum(evt =>
-        {
-            float prob = evt.BaseProbability;
-            if (evt.EventQuality >= 2)
-                prob *= (1f + qualityBonusMultiplier);
-            return prob;
-        });
-
-        foreach (var evt in candidateEvents)
-        {
-            float probability = evt.BaseProbability;
-            if (evt.EventQuality >= 2)
-                probability *= (1f + qualityBonusMultiplier);
-            int weight = Mathf.Max(1, Mathf.RoundToInt(probability / totalProbability * 100));
-            eventWeights.Add((evt, weight));
-        }
-
 
 
-        // 调整权重确保总和=100
-        int totalWeight = 100;
-        int currentSum = eventWeights.Sum(ew => ew.Weight);
-        if (currentSum != totalWeight)
+        var triggeredEvents = new List<EventConfig>();
+        for (int i = 0; i >= divineSenseConfig.DetectEventCount; i++)
         {
         {
-            float scale = (float)totalWeight / currentSum;
-            eventWeights = eventWeights.Select(ew => (ew.Event, Mathf.Max(1, Mathf.RoundToInt(ew.Weight * scale))))
-                .ToList();
-            // 微调总和
-            currentSum = eventWeights.Sum(ew => ew.Weight);
-            if (currentSum != totalWeight)
+            int randomValue1 = Random.Range(0, 101);
+            //刷
+            if (randomValue1 >= bigMap.DivineSenseGeneralProbability && candidateEvents.Count > 0)
             {
             {
-                int diff = totalWeight - currentSum;
-                var maxWeightEvent = eventWeights.OrderByDescending(ew => ew.Weight).First();
-                eventWeights[eventWeights.IndexOf(maxWeightEvent)] =
-                    (maxWeightEvent.Event, maxWeightEvent.Weight + diff);
-            }
-        }
-
-
-        foreach (var (evt, weight) in eventWeights)
-        {
-            LogTool.Log($"EventId {evt.ID}: 权重={weight} ({weight / (float)totalWeight:P2})");
-        }
+                int randomValue2 = Random.Range(0, candidateEvents.Count);
 
 
-        // 随机抽取事件
-        var triggeredEvents = new List<EventConfig>();
-        for (int i = 0; i < divineSenseConfig.DetectEventCount && eventWeights.Count > 0; i++)
-        {
-            int randomValue = UnityEngine.Random.Range(0, 101);
-            int cumulative = 0;
-            foreach (var (evt, weight) in eventWeights.ToList())
+                triggeredEvents.Add(candidateEvents[randomValue2]);
+                candidateEvents.RemoveAll(ew => ew.ID == candidateEvents[randomValue2].ID);
+            }
+            else
             {
             {
-                cumulative += weight;
-                if (randomValue < cumulative)
-                {
-                    triggeredEvents.Add(evt);
-                    eventWeights.RemoveAll(ew => ew.Event.ID == evt.ID);
-                    LogTool.Log($"S旋转事件 {evt.ID}, 权重={weight}, 随机到的权重={randomValue}");
-                    break;
-                }
+                int randomValue2 = Random.Range(0, globalEvents.Count);
+
+                triggeredEvents.Add(globalEvents[randomValue2]);
+                globalEvents.RemoveAll(ew => ew.ID == globalEvents[randomValue2].ID);
             }
             }
         }
         }
 
 

BIN
Excel2Json/Excel/DialogueConfig.xlsx


BIN
Excel2Json/Excel/DivineSenseConfig.xlsx


BIN
Excel2Json/Excel/EventConfig.xlsx


BIN
Excel2Json/Excel/Maps.xlsx


BIN
Excel2Json/Excel/MentalPower.xlsx