瀏覽代碼

修改事件触发

lzx 3 周之前
父節點
當前提交
cdc42e3869

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

@@ -3,10 +3,10 @@
     {
       "ID": 1,
       "QualityBonusChance": [
-        400.0,
-        300.0,
-        200.0,
-        100.0,
+        1000.0,
+        0.0,
+        0.0,
+        0.0,
         0.0,
         0.0
       ],

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

@@ -1,5 +1,5 @@
 // Auto Generated Code By excel2json
-// Generate From Excel\HeroPowerUp.xlsx. SheetName: MonsterPowerUpConfig
+// Generate From Excel\MonsterPowerUp.xlsx. SheetName: MonsterPowerUpConfig
 
 using System;
 using Fort23.GameData;

+ 4 - 2
Assets/Scripts/GameLogic/EventManager/DialogueManager.cs

@@ -40,7 +40,9 @@ public class DialogueManager : Singleton<DialogueManager>
     {
         currentDialogueID = dialogueID;
 
-        EventSystemManager.Instance.CurrentEventList.curStep = currentDialogueID;
+        //神识探索的事件记录步骤
+        if (EventSystemManager.Instance.CurrentEventList != null)
+            EventSystemManager.Instance.CurrentEventList.curStep = currentDialogueID;
 
         AccountFileInfo.Instance.SavePlayerData();
 
@@ -129,7 +131,7 @@ public class DialogueManager : Singleton<DialogueManager>
         }
 
         //如果有下一个对话id 走下一个id
-        if (dialogueConfig.ResultOptions == null || dialogueConfig.ResultOptions.Length == 0)
+        if (dialogueConfig.ResultOptions != null && dialogueConfig.ResultOptions.Length > 0)
         {
             if (dialogueConfig.optionType == 2)
             {

+ 5 - 3
Assets/Scripts/GameLogic/EventManager/EventSystemManager.cs

@@ -74,7 +74,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         BigMap bigMap = ConfigComponent.Instance.Get<BigMap>(bigMapId);
         DivineSenseConfig divineSenseConfig = ConfigComponent.Instance.Get<DivineSenseConfig>(AccountFileInfo.Instance.playerData.divineSenseLevel);
 
-        List<int> qualitys = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+        List<int> qualitys = new List<int>() { 1, 2, 3, 4, 5, 6 };
 
         //先掉落出品质
         int quality = UtilTools.GetRandomByWeight(qualitys, divineSenseConfig.QualityBonusChance);
@@ -173,6 +173,8 @@ public class EventSystemManager : Singleton<EventSystemManager>
             dialogueID = evt.curStep;
         }
 
+        CurrentEventList = evt;
+
         DialogueManager.Instance.StartDialogue(dialogueID, eventConfig.ID, () => { CompleteEvent(); });
     }
 
@@ -240,7 +242,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
 
         AccountFileInfo.Instance.SavePlayerData();
 
-        EventManager.Instance.Dispatch(CustomEventType.CompleteEvent, null);
+        // EventManager.Instance.Dispatch(CustomEventType.CompleteEvent, null);
     }
 
     /// <summary>
@@ -264,7 +266,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
             AccountFileInfo.Instance.playerData.senceExplorationProgress += 5;
 
 
-        AccountFileInfo.Instance.playerData.eventList.RemoveAll(el => el.eventID == CurrentEventList.eventID);
+        AccountFileInfo.Instance.playerData.eventList.Remove(CurrentEventList);
         AccountFileInfo.Instance.SavePlayerData();
 
         EventManager.Instance.Dispatch(CustomEventType.CompleteEvent, null);

+ 19 - 19
Assets/Scripts/GameLogic/Player/AccountFileInfo.cs

@@ -29,21 +29,21 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
     {
         //地图探索进度
         public int senceExplorationProgress;
-        
+
         public int divineSenseLevel = 1;
-        
+
         public int divineSensePoint = 0;
-        
+
         public int divineSenseexp = 0;
-        
+
         public List<EventData> events = new List<EventData>();
-        
+
         public List<EventList> eventList = new List<EventList>();
-        
-        
+
+
         public List<ItemData> ItemListData = new List<ItemData>();
 
-      
+
         /// <summary>
         /// 关卡进度
         /// </summary>
@@ -68,20 +68,23 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         // /// </summary>
         // public List<HeroData> HeroListInBackDatas = new List<HeroData>();
     }
-    
+
+    [System.Serializable]
     public class EventData
     {
-        public int eventID ;
+        public int eventID;
+
         //完成cishu
         public int completeCount = 0;
     }
-    
+
     /// <summary>
     /// 刷出来的事件列表
     /// </summary>
+    [System.Serializable]
     public class EventList
     {
-        public int eventID ;
+        public int eventID;
 
         public int curStep;
     }
@@ -143,7 +146,6 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
 
     private int lastHeroIdx = 0;
 
-  
 
     private int lastItemIdx = 0;
 
@@ -298,19 +300,18 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
     public void ClearInitPlayerData()
     {
         ItemData coin = new ItemData(GlobalParam.Item_Coin_ID, 0);
-        
+
         ItemData diamond = new ItemData(GlobalParam.Item_Diamond_ID);
-        
+
         ItemData heroExp = new ItemData(GlobalParam.Item_HeroExp_ID, 0);
-        
+
         playerData.ItemListData.Add(coin);
         playerData.ItemListData.Add(diamond);
         playerData.ItemListData.Add(heroExp);
-        
+
         // BagController.Instance.AddCoin(10000);
 
 
-       
         // playerData.HeroListData.Add(heroData2);
         // playerData.HeroListData.Add(heroData3);
         // playerData.HeroListData.Add(heroData4);
@@ -329,7 +330,6 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         /// 英雄等级
         /// </summary>
         public int heroPowerId;
-        
     }
 
     [System.Serializable]

+ 6 - 5
Assets/Scripts/GameUI/UI/MainPanel/MainPanel.cs

@@ -67,6 +67,7 @@ namespace Fort23.Mono
                 return;
       
             AccountFileInfo.Instance.playerData.eventList.AddRange(eventLists);
+            AccountFileInfo.Instance.SavePlayerData();
             CreatShengShiEvent();
         }
 
@@ -89,11 +90,11 @@ namespace Fort23.Mono
         {
             if (Input.GetKeyDown(KeyCode.Y))
             {
-                // EventSystemManager.Instance.DetectRandomEvents();
-                CombatDrive.Instance.LoadLevelBattleCombat(100001, delegate(bool isWin)
-                {
-                    LogTool.Log("战斗完成"+isWin);
-                });
+                EventSystemManager.Instance.DetectRandomEvents();
+                // CombatDrive.Instance.LoadLevelBattleCombat(100001, delegate(bool isWin)
+                // {
+                //     LogTool.Log("战斗完成"+isWin);
+                // });
             }
         }
 

二進制
Excel2Json/Excel/DivineSenseConfig.xlsx