From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/Buff/XBuffTriggerByDeath.cs | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByDeath.cs (limited to 'Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByDeath.cs') diff --git a/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByDeath.cs b/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByDeath.cs new file mode 100644 index 00000000..0d92508a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByDeath.cs @@ -0,0 +1,68 @@ +using System; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XBuffTriggerByDeath : XBuffTrigger + { + private int m_Type; + + private int m_Param0; + + private XEntity m_Entity; + + public XBuffTriggerByDeath(XBuff buff) : base(buff) + { + this.m_Type = base._GetTriggerParamInt(buff.BuffInfo, 0); + this.m_Param0 = base._GetTriggerParamInt(buff.BuffInfo, 1); + } + + public override void OnAdd(XEntity entity, CombatEffectHelper pEffectHelper) + { + base.OnAdd(entity, pEffectHelper); + this.m_Entity = entity; + } + + public override void OnRealDead(XRealDeadEventArgs e) + { + base.Trigger(); + } + + public override bool CheckTriggerCondition() + { + int type = this.m_Type; + if (type == 0) + { + bool flag = !XSingleton.singleton.SceneData.CanRevive; + if (!flag) + { + bool flag2 = this.m_Param0 == 1; + if (flag2) + { + XReviveDocument specificDocument = XDocuments.GetSpecificDocument(XReviveDocument.uuID); + bool flag3 = specificDocument.ReviveUsedTime >= specificDocument.ReviveMaxTime; + if (flag3) + { + goto IL_5D; + } + } + return true; + } + } + IL_5D: + return false; + } + + protected override void OnTrigger() + { + base.OnTrigger(); + int type = this.m_Type; + if (type == 0) + { + XSingleton.singleton.AddGreenLog("Trigger by death.", null, null, null, null, null); + XReviveDocument specificDocument = XDocuments.GetSpecificDocument(XReviveDocument.uuID); + specificDocument.SetAutoReviveData(this.m_Param0 == 1, 2f); + } + } + } +} -- cgit v1.1-26-g67d0