| | |
| | | // B4 10 回合制战斗 #tagCMTurnFight |
| | | |
| | | public class CB410_tagCMTurnFight : GameNetPackBasic { |
| | | public uint MapID; // 自定义地图ID,可用于绑定战斗地图场景功能(如主线关卡、主线boss、爬塔、竞技场等) |
| | | public uint MapID; // 自定义地图ID,可用于绑定战斗地图场景功能(如主线boss、爬塔、竞技场等) |
| | | public uint FuncLineID; // MapID对应的扩展值,如具体某个关卡等 |
| | | public byte TagType; // 目标类型,0-NPC阵容,1-玩家 |
| | | public uint TagID; // 目标类型对应的ID,如阵容ID或玩家ID |
| | | public uint TagID; // 目标类型对应的ID,如玩家ID |
| | | public byte ValueCount; |
| | | public uint[] ValueList; // 附加值列表,可选,具体含义由MapID决定 |
| | | public uint TagServerID; // 目标玩家所属区服ID,跨服PVP功能入口如果能取到就发 |
| | | |
| | | public CB410_tagCMTurnFight () { |
| | | combineCmd = (ushort)0x03FE; |
| | |
| | | WriteBytes (TagID, NetDataType.DWORD); |
| | | WriteBytes (ValueCount, NetDataType.BYTE); |
| | | WriteBytes (ValueList, NetDataType.DWORD, ValueCount); |
| | | WriteBytes (TagServerID, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
| | |
| | | protected Dictionary<string, Queue<GameNetPackBasic>> battleReportDict = new Dictionary<string, Queue<GameNetPackBasic>>(); |
| | | |
| | | protected Dictionary<string, List<ulong>> battlePackRelationList = new Dictionary<string, List<ulong>>(); |
| | | |
| | | |
| | | // 存储每个 guid 对应的结束状态包(HB420 State==4 等) |
| | | protected Dictionary<string, HB420_tagMCTurnFightState> battleEndPackDict = new Dictionary<string, HB420_tagMCTurnFightState>(); |
| | | |
| | |
| | | battleFields.Remove(guid); |
| | | battleReportDict.Remove(guid); |
| | | battlePackRelationList.Remove(guid); |
| | | |
| | | |
| | | // 清理结束包字典中的记录,防止内存泄漏或旧数据残留 |
| | | if (battleEndPackDict != null && battleEndPackDict.ContainsKey(guid)) |
| | | battleEndPackDict.Remove(guid); |
| | |
| | | //发进入战斗包 |
| | | private float lastTime = 0f; |
| | | private float turnCoolDown = 0.5f; // 冷却时间 |
| | | public void SendTurnFight(uint mapID, uint funcLineID = 0, byte tagType = 0, uint tagID = 0, uint[] valueList = null, bool showLoading = true) |
| | | public void SendTurnFight(uint mapID, uint funcLineID = 0, byte tagType = 0, uint tagID = 0, uint[] valueList = null, bool showLoading = true, uint tagServerID = 0) |
| | | { |
| | | // 连续频繁发包,触发提示 |
| | | float currentTime = Time.time; |
| | |
| | | pack.FuncLineID = funcLineID; |
| | | pack.TagType = tagType; |
| | | pack.TagID = tagID; |
| | | pack.TagServerID = tagServerID; |
| | | if (!valueList.IsNullOrEmpty()) |
| | | { |
| | | pack.ValueList = valueList; |
| | |
| | | 0, |
| | | 1, |
| | | targetMem.PlayerID, |
| | | new[] { (uint)defBaseAttrPer, 0u }); |
| | | new[] { (uint)defBaseAttrPer, 0u }, |
| | | true, |
| | | targetMem.ServerID); |
| | | CloseWindow(); |
| | | } |
| | | |