public override void BuildPacket() { this.PushIntoStack(processList.Count > 0 ? processList[processList.Count - 1].Version : 0); this.PushIntoStack(processList.Count); foreach (var process in processList) { DataStruct ds = new DataStruct(); ds.PushIntoStack((short)isWin); ds.PushIntoStack(process.WinObtainNum); ds.PushIntoStack(process.FailObtainNum); ds.PushIntoStack(process.ProcessContainer.AttackList.Count); foreach (CombatEmbattle combatEmbattle in process.ProcessContainer.AttackList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(combatEmbattle.GeneralID); dsItem.PushIntoStack(combatEmbattle.GeneralName.ToNotNullString()); dsItem.PushIntoStack(combatEmbattle.HeadID.ToNotNullString()); dsItem.PushIntoStack(combatEmbattle.Position.ToShort()); dsItem.PushIntoStack(combatEmbattle.LiveNum); dsItem.PushIntoStack(combatEmbattle.LiveMaxNum); dsItem.PushIntoStack(combatEmbattle.MomentumNum); dsItem.PushIntoStack(combatEmbattle.MaxMomentumNum); dsItem.PushIntoStack(combatEmbattle.AbilityID); dsItem.PushIntoStack(combatEmbattle.GeneralLv); dsItem.PushIntoStack(combatEmbattle.IsWait ? (short)1 : (short)0); ds.PushIntoStack(dsItem); } //防方阵形 ds.PushIntoStack(process.ProcessContainer.DefenseList.Count); foreach (CombatEmbattle combatEmbattle in process.ProcessContainer.DefenseList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(combatEmbattle.GeneralID); dsItem.PushIntoStack(combatEmbattle.GeneralName.ToNotNullString()); dsItem.PushIntoStack(combatEmbattle.HeadID.ToNotNullString()); dsItem.PushIntoStack(combatEmbattle.Position.ToShort()); dsItem.PushIntoStack(combatEmbattle.LiveNum); dsItem.PushIntoStack(combatEmbattle.LiveMaxNum); dsItem.PushIntoStack(combatEmbattle.MomentumNum); dsItem.PushIntoStack(combatEmbattle.MaxMomentumNum); dsItem.PushIntoStack(combatEmbattle.AbilityID); dsItem.PushIntoStack(combatEmbattle.GeneralLv); dsItem.PushIntoStack(combatEmbattle.IsWait ? (short)1 : (short)0); ds.PushIntoStack(dsItem); } //战斗过程 ds.PushIntoStack(process.ProcessContainer.ProcessList.Count); foreach (CombatProcess combatProcess in process.ProcessContainer.ProcessList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack(combatProcess.GeneralID); dsItem.PushIntoStack(combatProcess.LiveNum); dsItem.PushIntoStack(combatProcess.Momentum); dsItem.PushIntoStack(combatProcess.AttackTaget.ToShort()); dsItem.PushIntoStack(combatProcess.AttackUnit.ToShort()); dsItem.PushIntoStack(combatProcess.AbilityProperty.ToShort()); dsItem.PushIntoStack(combatProcess.AttStatus.ToShort()); dsItem.PushIntoStack(combatProcess.DamageNum); dsItem.PushIntoStack(combatProcess.AttEffectID.ToNotNullString()); dsItem.PushIntoStack(combatProcess.TargetEffectID.ToNotNullString()); dsItem.PushIntoStack(combatProcess.IsMove.ToShort()); dsItem.PushIntoStack(combatProcess.Position.ToShort()); dsItem.PushIntoStack(combatProcess.Role.ToShort()); dsItem.PushIntoStack(combatProcess.DamageStatusList.Count); foreach (AbilityEffectStatus effectStatus in combatProcess.DamageStatusList) { DataStruct dsItem2 = new DataStruct(); dsItem2.PushIntoStack(effectStatus.AbilityType.ToShort()); dsItem2.PushIntoStack(effectStatus.DamageNum); dsItem2.PushIntoStack(effectStatus.IsIncrease ? 1 : 0); dsItem.PushIntoStack(dsItem2); } dsItem.PushIntoStack(combatProcess.TargetList.Count); foreach (TargetProcess targetProcess in combatProcess.TargetList) { DataStruct dsItem1 = new DataStruct(); dsItem1.PushIntoStack(targetProcess.GeneralID); dsItem1.PushIntoStack(targetProcess.LiveNum); dsItem1.PushIntoStack(targetProcess.Momentum); dsItem1.PushIntoStack(targetProcess.DamageNum); dsItem1.PushIntoStack(targetProcess.IsShanBi.ToShort()); dsItem1.PushIntoStack(targetProcess.IsGeDang.ToShort()); dsItem1.PushIntoStack(targetProcess.IsBack.ToShort()); dsItem1.PushIntoStack(targetProcess.IsMove.ToShort()); dsItem1.PushIntoStack(targetProcess.BackDamageNum); dsItem1.PushIntoStack(targetProcess.TargetStatus.ToShort()); dsItem1.PushIntoStack(targetProcess.Position.ToShort()); dsItem1.PushIntoStack(targetProcess.Role.ToShort()); //目标中招效果 dsItem1.PushIntoStack(targetProcess.DamageStatusList.Count); foreach (AbilityEffectStatus effectStatus in targetProcess.DamageStatusList) { DataStruct dsItem12 = new DataStruct(); dsItem12.PushIntoStack(effectStatus.AbilityType.ToShort()); dsItem12.PushIntoStack(effectStatus.IsIncrease ? 1 : 0); dsItem1.PushIntoStack(dsItem12); } dsItem1.PushIntoStack(targetProcess.IsBaoji.ToShort()); dsItem1.PushIntoStack(targetProcess.TrumpStatusList.Count); foreach (var item in targetProcess.TrumpStatusList) { DataStruct dsItem13 = new DataStruct(); dsItem13.PushIntoStack(item.AbilityID); dsItem13.PushIntoStack(item.Num); dsItem1.PushIntoStack(dsItem13); } dsItem.PushIntoStack(dsItem1); } dsItem.PushIntoStack(combatProcess.TrumpStatusList.Count); foreach (var item in combatProcess.TrumpStatusList) { DataStruct dsItem14 = new DataStruct(); dsItem14.PushIntoStack(item.AbilityID); dsItem14.PushIntoStack(item.Num); dsItem.PushIntoStack(dsItem14); } ds.PushIntoStack(dsItem); } PushIntoStack(ds); } PushIntoStack(status.ToShort()); }