From cec8b67d82c2c2c1662d55c818c4a46bcc0487db Mon Sep 17 00:00:00 2001 From: yyl <yyl> Date: 星期一, 25 八月 2025 17:36:02 +0800 Subject: [PATCH] 125 【战斗】战斗系统 战斗技能 --- Main/System/Battle/BattleManager.cs | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs index 6ca51aa..3749ba5 100644 --- a/Main/System/Battle/BattleManager.cs +++ b/Main/System/Battle/BattleManager.cs @@ -168,7 +168,7 @@ Debug.LogWarning($"杩炵画绌烘垬鏂楃墖娈靛皝鍖呮鏁帮細{continousEmptyCount}"); if (continousEmptyCount >= MaxContinousEmptyCount) { - Debug.LogError("杩炵画澶氭娌℃湁鎴樻枟鐗囨灏佸寘锛岃嚜鍔ㄥ洖鍩庝紤鎭紒"); + BattleDebug.LogError("杩炵画澶氭娌℃湁鎴樻枟鐗囨灏佸寘锛岃嚜鍔ㄥ洖鍩庝紤鎭紒"); MainFightRequest(0); // 0-鍋滄鎴樻枟鍥炲煄 continousEmptyCount = 0; packQueue.Clear(); @@ -191,21 +191,32 @@ { if (packQueue.Count > 0) { - GameNetPackBasic pack = packQueue.Dequeue(); + GameNetPackBasic pack = packQueue.Peek(); + + bool dequeue = false; if (pack is CustomHB426CombinePack) { CustomHB426CombinePack combinePack = pack as CustomHB426CombinePack; + packQueue.Dequeue(); combinePack.Distribute(); } else if (pack is CustomB421ActionPack) { CustomB421ActionPack actionPack = pack as CustomB421ActionPack; - actionPack.Distribute(); + + dequeue = !actionPack.Distribute(); } else { + BattleDebug.LogError("distribute pack " + pack.GetType().Name); + packQueue.Dequeue(); PackageRegedit.Distribute(pack); + } + + if (dequeue && packQueue.Count > 0) + { + packQueue.Dequeue(); } return true; @@ -287,17 +298,22 @@ if (!battleReportDict.TryGetValue(guid, out queue)) { - Debug.LogError("DistributeNextReportPackage could not find queue for guid : " + guid); + BattleDebug.LogError("DistributeNextReportPackage could not find queue for guid : " + guid); return; } - PackageRegedit.Distribute(queue.Dequeue()); + var pack = queue.Dequeue(); + BattleDebug.LogError("distribute pack " + pack.GetType().Name); + + PackageRegedit.Distribute(pack); if (queue.Count <= 0) { battleReportDict.Remove(guid); battlePackRelationList.Remove(guid); } + + BattleDebug.LogError("BattlePackage count is " + queue.Count); } #endregion @@ -307,7 +323,7 @@ if (battleFields.TryGetValue(guid, out battleField)) { - Debug.LogError("鎴樺満宸插瓨鍦� 鍏堣繘琛岄攢姣�"); + BattleDebug.LogError("鎴樺満宸插瓨鍦� 鍏堣繘琛岄攢姣�"); battleField.Destroy(); } @@ -331,7 +347,7 @@ { if (battleField == null) { - Debug.LogError("DestroyBattleField called with null battleField"); + BattleDebug.LogError("DestroyBattleField called with null battleField"); return; } -- Gitblit v1.8.0