blob: 39b63517c59ed0b862a7c489c1b93133378be9de (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
using System;
using System.Collections.Generic;
using XUtliPoolLib;
namespace XMainClient
{
internal class XBuffTriggerByHit : XBuffTrigger
{
public override XBuffEffectPrioriy Priority
{
get
{
bool flag = this.m_Type == 3;
XBuffEffectPrioriy result;
if (flag)
{
result = XBuffEffectPrioriy.BEP_TriggerByHit_Death;
}
else
{
result = XBuffEffectPrioriy.BEP_TriggerByHit;
}
return result;
}
}
private int m_Type;
private HurtInfo m_RawInput;
private ProjectDamageResult m_Result;
private HashSet<uint> m_SpecifiedSkillsSet;
private int m_SpecifiedBuffID;
private double m_CriticalChangeRatio = 0.0;
public XBuffTriggerByHit(XBuff buff) : base(buff)
{
this.m_Type = base._GetTriggerParamInt(buff.BuffInfo, 0);
this.m_SpecifiedSkillsSet = buff.RelevantSkills;
int type = this.m_Type;
if (type != 2)
{
if (type == 5)
{
this.m_SpecifiedBuffID = base._GetTriggerParamInt(buff.BuffInfo, 1);
}
}
else
{
this.m_CriticalChangeRatio = Math.Max(0.0, 1.0 + (double)(base._GetTriggerParam(buff.BuffInfo, 1) / 100f));
}
}
public override bool CheckTriggerCondition()
{
bool flag = this.m_SpecifiedSkillsSet != null && (this.m_RawInput == null || !this.m_SpecifiedSkillsSet.Contains(this.m_RawInput.SkillID));
bool result;
if (flag)
{
result = false;
}
else
{
switch (this.m_Type)
{
case 0:
return true;
case 1:
{
bool flag2 = this.m_RawInput != null && base.Entity.SkillMgr != null && base.Entity.SkillMgr.IsPhysicalAttack(this.m_RawInput.SkillID);
if (flag2)
{
return true;
}
break;
}
case 2:
{
bool flag3 = (this.m_Result.Flag & XFastEnumIntEqualityComparer<DamageFlag>.ToInt(DamageFlag.DMGFLAG_CRITICAL)) != 0;
if (flag3)
{
return true;
}
break;
}
case 3:
{
bool isTargetDead = this.m_Result.IsTargetDead;
if (isTargetDead)
{
return true;
}
bool flag4 = this.m_RawInput != null && this.m_RawInput.Target != null && !this.m_RawInput.Target.Deprecated && this.m_RawInput.Target.Attributes != null;
if (flag4)
{
return this.m_RawInput.Target.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentHP_Basic) - this.m_Result.Value <= 0.0;
}
break;
}
case 5:
{
bool flag5 = this.m_RawInput != null && this.m_RawInput.Target != null && !this.m_RawInput.Target.Deprecated;
if (flag5)
{
XBuffComponent buffs = this.m_RawInput.Target.Buffs;
bool flag6 = buffs != null && buffs.GetBuffByID(this.m_SpecifiedBuffID) != null;
if (flag6)
{
base._SetTarget(this.m_RawInput.Target);
return true;
}
}
break;
}
}
result = false;
}
return result;
}
public override void OnCastDamage(HurtInfo rawInput, ProjectDamageResult result)
{
bool flag = rawInput.SkillID == 0u;
if (!flag)
{
this.m_RawInput = rawInput;
this.m_Result = result;
base.Trigger();
}
}
protected override void OnTrigger()
{
base.OnTrigger();
int type = this.m_Type;
if (type == 2)
{
bool flag = this.m_CriticalChangeRatio != 1.0;
if (flag)
{
this.m_Result.Value *= this.m_CriticalChangeRatio;
}
}
}
}
}
|