From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/Buff/XBuffTriggerByCombo.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByCombo.cs (limited to 'Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByCombo.cs') diff --git a/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByCombo.cs b/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByCombo.cs new file mode 100644 index 00000000..46871868 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByCombo.cs @@ -0,0 +1,32 @@ +using System; + +namespace XMainClient +{ + internal class XBuffTriggerByCombo : XBuffTrigger + { + private uint m_Base; + + private uint m_Count; + + public XBuffTriggerByCombo(XBuff buff) : base(buff) + { + this.m_Base = (uint)base._GetTriggerParamInt(buff.BuffInfo, 0); + bool flag = this.m_Base == 0u; + if (flag) + { + this.m_Base = 1u; + } + } + + public override bool CheckTriggerCondition() + { + return this.m_Count != 0u && this.m_Count % this.m_Base == 0u; + } + + public override void OnComboChange(uint comboCount) + { + this.m_Count = comboCount; + base.Trigger(); + } + } +} -- cgit v1.1-26-g67d0