From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../PTC/Process/Process_PtcG2C_SkillResult.cs | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/PTC/Process/Process_PtcG2C_SkillResult.cs (limited to 'Client/Assets/Scripts/XMainClient/PTC/Process/Process_PtcG2C_SkillResult.cs') diff --git a/Client/Assets/Scripts/XMainClient/PTC/Process/Process_PtcG2C_SkillResult.cs b/Client/Assets/Scripts/XMainClient/PTC/Process/Process_PtcG2C_SkillResult.cs new file mode 100644 index 00000000..a1f344e5 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/PTC/Process/Process_PtcG2C_SkillResult.cs @@ -0,0 +1,71 @@ +using System; +using KKSG; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class Process_PtcG2C_SkillResult + { + public static void Process(PtcG2C_SkillResult roPtc) + { + XEntity entity = XSingleton.singleton.GetEntity(roPtc.Data.FirerID); + bool flag = entity == null; + if (!flag) + { + bool bulletIDSpecified = roPtc.Data.BulletIDSpecified; + if (bulletIDSpecified) + { + XBulletMgr.KeyOfBullet id = new XBulletMgr.KeyOfBullet(entity.ID, roPtc.Data.BulletID, roPtc.Data.BulletExtraIDSpecified ? roPtc.Data.BulletExtraID : 0UL); + XBullet bullet = XSingleton.singleton.GetBullet(id); + bool flag2 = bullet == null; + if (flag2) + { + XSingleton.singleton.Cache(id); + } + else + { + bullet.OnResult(null); + } + } + for (int i = 0; i < roPtc.Data.TargetList.Count; i++) + { + XEntity entity2 = XSingleton.singleton.GetEntity(roPtc.Data.TargetList[i].UnitID); + bool flag3 = !XEntity.ValideEntity(entity2); + if (!flag3) + { + TargetHurtInfo targetHurtInfo = roPtc.Data.TargetList[i]; + ProjectDamageResult data = XDataPool.GetData(); + data.Accept = true; + data.Result = (ProjectResultType)targetHurtInfo.Result.Result; + data.Value = targetHurtInfo.Result.Value; + data.Flag = targetHurtInfo.Result.Flag; + data.Type = (DamageType)targetHurtInfo.Result.DamageType; + data.ElementType = (DamageElement)targetHurtInfo.Result.ElementType; + data.IsTargetDead = targetHurtInfo.Result.IsTargetDead; + data.Caster = roPtc.Data.FirerID; + data.ComboCount = targetHurtInfo.Result.ComboCount; + XSkillCore skill = entity.SkillMgr.GetSkill(roPtc.Data.SkillID); + bool flag4 = skill == null || skill.Soul.Hit.Count <= (int)roPtc.Data.PIndex; + if (flag4) + { + bool flag5 = skill == null; + if (flag5) + { + XSingleton.singleton.AddErrorLog("skill ", roPtc.Data.SkillID.ToString(), " is not found by ", entity.Name, null, null); + } + else + { + XSingleton.singleton.AddErrorLog("skill ", skill.Soul.Name, "'s hit point is not matched by ", entity.Name, null, null); + } + } + else + { + XSkill.SkillResult_TakeEffect(entity, entity2, data, skill.Soul.Hit[(int)roPtc.Data.PIndex], Vector3.forward, XStrickenResponse.Cease, true, 1f, Vector3.zero); + } + } + } + } + } + } +} -- cgit v1.1-26-g67d0