From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs | 126 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 123 insertions(+), 3 deletions(-)
diff --git a/Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs b/Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs
index d02c2b9..6261f72 100644
--- a/Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs
+++ b/Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs
@@ -99,6 +99,8 @@
Dictionary<int, GameNetPackBasic> indexDict = new Dictionary<int, GameNetPackBasic>();
+ Dictionary<uint, HB427_tagSCUseSkill> skillDict = new Dictionary<uint, HB427_tagSCUseSkill>();
+
for (int i = 0; i < b421SeriesPackList.Count; i++)
{
var pack = b421SeriesPackList[i];
@@ -134,7 +136,41 @@
}
else
{
- indexDict.Add(i, pack);
+ if (pack is HB427_tagSCUseSkill skillPack)
+ {
+ // 澶勭悊鎶�鑳戒箣闂寸殑閾炬帴鍏崇郴
+ if (skillPack.RelatedSkillID > 0)
+ {
+ skillDict.TryGetValue(skillPack.RelatedSkillID, out var parentSkill);
+
+ if (parentSkill != null && skillPack.BattleType == 4)//4=瀛愭妧鑳�
+ {
+ parentSkill.subSkillList.Add(skillPack);
+ skillPack.parentSkill = parentSkill;
+ }
+ else
+ {
+ indexDict.Add(i, pack);
+ }
+ }
+ else
+ {
+ indexDict.Add(i, pack);
+ }
+
+ if (skillDict.ContainsKey(skillPack.SkillID))
+ {
+ skillDict[skillPack.SkillID] = skillPack;
+ }
+ else
+ {
+ skillDict.Add(skillPack.SkillID, skillPack);
+ }
+ }
+ else
+ {
+ indexDict.Add(i, pack);
+ }
}
}
@@ -200,6 +236,57 @@
{
battleField.PlayRecord(skillAction);
}
+ else
+ {
+ battleField.DistributeNextPackage();
+ }
+
+ }
+
+ public static SkillRecordAction CreateSkillAction(string guid, List<GameNetPackBasic> _packList)
+ {
+ BattleField battleField = BattleManager.Instance.GetBattleField(guid);
+
+ if (null == battleField)
+ {
+ Debug.LogError("BattleField not found for guid: " + guid);
+ return null;
+ }
+
+ while (_packList.Count > 0)
+ {
+ var pack = _packList[0];
+ _packList.RemoveAt(0);
+
+ if (pack is HB427_tagSCUseSkill)
+ {
+ _packList.Insert(0, pack);
+ break;
+ }
+ else if (pack is CustomHB426CombinePack)
+ {
+ Debug.LogError("鏃犳硶鎵惧埌Skill鍖咃紝鍏堝彂鐜颁簡宓屽鍖�");
+ return null;
+ }
+ else
+ {
+ // Debug.LogError("鍙戠幇闈濻kill鍖咃紝鍏堝垎鍙戞帀: " + pack.GetType().Name);
+ PackageRegedit.Distribute(pack);
+ }
+ }
+
+ HB427_tagSCUseSkill skill = _packList[0] as HB427_tagSCUseSkill;
+ _packList.RemoveAt(0);
+ if (null == skill)
+ {
+ Debug.LogError("No HB427_tagSCUseSkill found in packList.");
+ return null;
+ }
+
+ BattleObject _caster = battleField.battleObjMgr.GetBattleObject((int)skill.ObjID);
+
+ SkillRecordAction skillAction = new SkillRecordAction(battleField, _caster, skill, _packList);
+ return skillAction;
}
@@ -213,12 +300,45 @@
return null;
}
+ // 鏈嶅姟鍣ㄤ慨鏀逛簡 鐜板湪绗竴涓笉涓�瀹氭槸B427 涔熸湁鍙兘鏄疊428 鍏堟斁Buff
+ while (packList.Count > 0)
+ {
+ var pack = packList[0];
+ packList.RemoveAt(0);
+
+ if (pack is HB427_tagSCUseSkill)
+ {
+ packList.Insert(0, pack);
+ break;
+ }
+ else if (pack is CustomHB426CombinePack)
+ {
+ Debug.LogError("鏃犳硶鎵惧埌Skill鍖咃紝鍏堝彂鐜颁簡宓屽鍖�");
+ return null;
+ }
+ else
+ {
+ // Debug.LogError("鍙戠幇闈濻kill鍖咃紝鍏堝垎鍙戞帀: " + pack.GetType().Name);
+ PackageRegedit.Distribute(pack);
+ }
+ }
+
if (startTag.Tag.StartsWith("Skill_"))
{
+ if (packList.Count <= 0)
+ {
+ Debug.LogError("No HB427_tagSCUseSkill found in packList." + startTag.Tag);
+ return null;
+ }
HB427_tagSCUseSkill skill = packList[0] as HB427_tagSCUseSkill;
- packList.Remove(skill);
- BattleObject _caster = battleField.battleObjMgr.GetBattleObject((int)skill.ObjID);
+ packList.RemoveAt(0);
+ if (null == skill)
+ {
+ Debug.LogError("No HB427_tagSCUseSkill found in packList.");
+ return null;
+ }
+ BattleObject _caster = battleField.battleObjMgr.GetBattleObject((int)skill.ObjID);
// BattleDebug.LogError("_caster == null : " + (_caster == null) + " skill.ObjID : " + skill.ObjID);
SkillRecordAction skillAction = new SkillRecordAction(battleField, _caster, skill, packList);
--
Gitblit v1.8.0