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/XBuffTargetLifeAddAttack.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/Buff/XBuffTargetLifeAddAttack.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/Buff/XBuffTargetLifeAddAttack.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/Buff/XBuffTargetLifeAddAttack.cs b/Client/Assets/Scripts/XMainClient/Buff/XBuffTargetLifeAddAttack.cs new file mode 100644 index 00000000..28993230 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Buff/XBuffTargetLifeAddAttack.cs @@ -0,0 +1,57 @@ +using System;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class XBuffTargetLifeAddAttack : BuffEffect
+ {
+ public override XBuffEffectPrioriy Priority
+ {
+ get
+ {
+ return XBuffEffectPrioriy.BEP_TargetLifeAddAttack;
+ }
+ }
+
+ private XPieceWiseDataMgr m_Data = new XPieceWiseDataMgr();
+
+ private XEntity _entity;
+
+ public static bool TryCreate(BuffTable.RowData rowData, XBuff buff)
+ {
+ bool flag = rowData.TargetLifeAddAttack.Count == 0;
+ bool result;
+ if (flag)
+ {
+ result = false;
+ }
+ else
+ {
+ buff.AddEffect(new XBuffTargetLifeAddAttack(ref rowData.TargetLifeAddAttack));
+ result = true;
+ }
+ return result;
+ }
+
+ public XBuffTargetLifeAddAttack(ref SeqListRef<float> reducePecents)
+ {
+ this.m_Data.SetRange(0.0, 0.0, 1.0, 0.0);
+ this.m_Data.Init(ref reducePecents);
+ }
+
+ public override void OnAdd(XEntity entity, CombatEffectHelper pEffectHelper)
+ {
+ this._entity = entity;
+ }
+
+ public override void OnRemove(XEntity entity, bool IsReplaced)
+ {
+ }
+
+ public override void OnCastDamage(HurtInfo rawInput, ProjectDamageResult result)
+ {
+ double hppercent = rawInput.Target.Attributes.HPPercent;
+ result.Value *= 1.0 + this.m_Data.GetData(hppercent);
+ }
+ }
+}
|