From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XMainClient/Buff/XBuffKill.cs | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Buff/XBuffKill.cs (limited to 'Client/Assets/Scripts/XMainClient/Buff/XBuffKill.cs') diff --git a/Client/Assets/Scripts/XMainClient/Buff/XBuffKill.cs b/Client/Assets/Scripts/XMainClient/Buff/XBuffKill.cs new file mode 100644 index 00000000..39338059 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Buff/XBuffKill.cs @@ -0,0 +1,45 @@ +using System; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XBuffKill : BuffEffect + { + public override XBuffEffectPrioriy Priority + { + get + { + return XBuffEffectPrioriy.BEP_Kill; + } + } + + public static bool TryCreate(BuffTable.RowData rowData, XBuff buff) + { + bool flag = rowData.Kill == 0; + bool result; + if (flag) + { + result = false; + } + else + { + buff.AddEffect(new XBuffKill()); + result = true; + } + return result; + } + + public override void OnAdd(XEntity entity, CombatEffectHelper pEffectHelper) + { + } + + public override void OnRemove(XEntity entity, bool IsReplaced) + { + bool flag = !IsReplaced && !entity.IsDead && !entity.Buffs.bLeavingScene && !entity.Buffs.bDestroying; + if (flag) + { + XSingleton.singleton.DeathDetect(entity, null, true); + } + } + } +} -- cgit v1.1-26-g67d0