summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/Buff/XBuffTargetLifeAddAttack.cs
blob: 28993230b65122eeaff6e4abd8b8c6e26392d9ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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);
		}
	}
}