From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/Buff/XBuffTriggerByBeHit.cs | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByBeHit.cs (limited to 'Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByBeHit.cs') diff --git a/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByBeHit.cs b/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByBeHit.cs new file mode 100644 index 00000000..6e71f72a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByBeHit.cs @@ -0,0 +1,75 @@ +using System; + +namespace XMainClient +{ + internal class XBuffTriggerByBeHit : XBuffTrigger + { + public override XBuffEffectPrioriy Priority + { + get + { + return XBuffEffectPrioriy.BEP_TriggerByBeHit; + } + } + + private int m_Type; + + private int m_Param0; + + private XEntity m_Entity; + + private HurtInfo m_RawInput; + + private ProjectDamageResult m_Result; + + public XBuffTriggerByBeHit(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 OnBuffEffect(HurtInfo rawInput, ProjectDamageResult result) + { + bool flag = rawInput.SkillID == 0u; + if (!flag) + { + this.m_RawInput = rawInput; + this.m_Result = result; + base.Trigger(); + } + } + + public override bool CheckTriggerCondition() + { + int type = this.m_Type; + if (type != 0) + { + if (type == 1) + { + bool flag = this.m_Result.Result != ProjectResultType.PJRES_IMMORTAL; + if (flag) + { + return false; + } + bool flag2 = this.m_Param0 != 0; + if (flag2) + { + XBuff buffByID = this.m_Entity.Buffs.GetBuffByID(this.m_Param0); + bool flag3 = buffByID == null; + if (flag3) + { + return false; + } + } + } + } + return true; + } + } +} -- cgit v1.1-26-g67d0