summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/Buff/XBuffTriggerByDeath.cs
blob: 0d92508a34481b7b1a38c0dcdb4504e57643d2c3 (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
58
59
60
61
62
63
64
65
66
67
68
using System;
using XUtliPoolLib;

namespace XMainClient
{
	internal class XBuffTriggerByDeath : XBuffTrigger
	{
		private int m_Type;

		private int m_Param0;

		private XEntity m_Entity;

		public XBuffTriggerByDeath(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 OnRealDead(XRealDeadEventArgs e)
		{
			base.Trigger();
		}

		public override bool CheckTriggerCondition()
		{
			int type = this.m_Type;
			if (type == 0)
			{
				bool flag = !XSingleton<XScene>.singleton.SceneData.CanRevive;
				if (!flag)
				{
					bool flag2 = this.m_Param0 == 1;
					if (flag2)
					{
						XReviveDocument specificDocument = XDocuments.GetSpecificDocument<XReviveDocument>(XReviveDocument.uuID);
						bool flag3 = specificDocument.ReviveUsedTime >= specificDocument.ReviveMaxTime;
						if (flag3)
						{
							goto IL_5D;
						}
					}
					return true;
				}
			}
			IL_5D:
			return false;
		}

		protected override void OnTrigger()
		{
			base.OnTrigger();
			int type = this.m_Type;
			if (type == 0)
			{
				XSingleton<XDebug>.singleton.AddGreenLog("Trigger by death.", null, null, null, null, null);
				XReviveDocument specificDocument = XDocuments.GetSpecificDocument<XReviveDocument>(XReviveDocument.uuID);
				specificDocument.SetAutoReviveData(this.m_Param0 == 1, 2f);
			}
		}
	}
}