diff options
| author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
|---|---|---|
| committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
| commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
| tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/Buff/XBuffChangeFightGroup.cs | |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/Buff/XBuffChangeFightGroup.cs')
| -rw-r--r-- | Client/Assets/Scripts/XMainClient/Buff/XBuffChangeFightGroup.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/Buff/XBuffChangeFightGroup.cs b/Client/Assets/Scripts/XMainClient/Buff/XBuffChangeFightGroup.cs new file mode 100644 index 00000000..05f571f0 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Buff/XBuffChangeFightGroup.cs @@ -0,0 +1,44 @@ +using System;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class XBuffChangeFightGroup : BuffEffect
+ {
+ private uint m_FightGroup;
+
+ private uint m_PreservedFightGroup;
+
+ public static bool TryCreate(BuffTable.RowData rowData, XBuff buff)
+ {
+ bool flag = rowData.ChangeFightGroup == -1;
+ bool result;
+ if (flag)
+ {
+ result = false;
+ }
+ else
+ {
+ buff.AddEffect(new XBuffChangeFightGroup(buff, (uint)rowData.ChangeFightGroup));
+ result = true;
+ }
+ return result;
+ }
+
+ public XBuffChangeFightGroup(XBuff buff, uint fightgroup)
+ {
+ this.m_FightGroup = fightgroup;
+ }
+
+ public override void OnAdd(XEntity entity, CombatEffectHelper pEffectHelper)
+ {
+ this.m_PreservedFightGroup = entity.Attributes.FightGroup;
+ entity.Attributes.OnFightGroupChange(this.m_FightGroup);
+ }
+
+ public override void OnRemove(XEntity entity, bool IsReplaced)
+ {
+ entity.Attributes.OnFightGroupChange(this.m_PreservedFightGroup);
+ }
+ }
+}
|
