summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XArtifactEffectInfo.cs
blob: 86eefad6cfa1888216d585188da3cef48a555a76 (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
150
151
152
153
154
155
156
157
158
159
160
161
using System;
using System.Collections.Generic;
using XUtliPoolLib;

namespace XMainClient
{
	internal struct XArtifactEffectInfo
	{
		public uint EffectId
		{
			get
			{
				return this.m_effectId;
			}
			set
			{
				this.m_effectId = value;
			}
		}

		public uint BaseProf
		{
			get
			{
				return this.m_baseProf;
			}
		}

		public List<XArtifactBuffInfo> BuffInfoList
		{
			get
			{
				return this.m_buffInfoList;
			}
			set
			{
				this.m_buffInfoList = value;
			}
		}

		public bool IsValid
		{
			get
			{
				return this.m_isValid;
			}
			set
			{
				this.m_isValid = value;
			}
		}

		private uint m_effectId;

		private uint m_baseProf;

		private List<XArtifactBuffInfo> m_buffInfoList;

		private List<string> m_allVaules;

		private bool m_isValid;

		public void Init()
		{
			this.m_effectId = 0u;
			this.m_isValid = true;
			bool flag = this.m_buffInfoList == null;
			if (flag)
			{
				this.m_buffInfoList = new List<XArtifactBuffInfo>();
			}
			else
			{
				this.m_buffInfoList.Clear();
			}
		}

		public void SetBaseProf(uint effectId)
		{
			EffectDesTable.RowData byEffectID = ArtifactDocument.EffectDesTab.GetByEffectID(this.EffectId);
			bool flag = byEffectID != null;
			if (flag)
			{
				this.m_baseProf = (uint)byEffectID.BaseProf;
			}
			else
			{
				this.m_baseProf = 0u;
			}
		}

		public List<string> GetValues()
		{
			bool flag = this.m_allVaules == null;
			if (flag)
			{
				this.m_allVaules = new List<string>();
			}
			else
			{
				this.m_allVaules.Clear();
			}
			bool flag2 = this.m_buffInfoList == null;
			List<string> allVaules;
			if (flag2)
			{
				allVaules = this.m_allVaules;
			}
			else
			{
				EffectDesTable.RowData byEffectID = ArtifactDocument.EffectDesTab.GetByEffectID(this.EffectId);
				float[] array = null;
				string[] array2 = null;
				bool flag3 = byEffectID != null;
				if (flag3)
				{
					array = byEffectID.ParamCoefficient;
					array2 = byEffectID.ColorDes;
				}
				for (int i = 0; i < this.m_buffInfoList.Count; i++)
				{
					bool flag4 = this.m_buffInfoList[i].Values == null;
					if (!flag4)
					{
						for (int j = 0; j < this.m_buffInfoList[i].Values.Count; j++)
						{
							bool flag5 = array != null && array.Length > j;
							if (flag5)
							{
								float num = Math.Abs((float)this.m_buffInfoList[i].Values[j] * array[j]);
								bool flag6 = array2 != null && array2.Length > j;
								if (flag6)
								{
									this.m_allVaules.Add(string.Format("[{0}]{1}[-]", array2[j], num.ToString("f1")));
								}
								else
								{
									this.m_allVaules.Add(num.ToString("f1"));
								}
							}
							else
							{
								bool flag7 = array2 != null && array2.Length > j;
								if (flag7)
								{
									this.m_allVaules.Add(string.Format("[{0}]{1}[-]", array2[j], this.m_buffInfoList[i].Values[j].ToString("f1")));
								}
								else
								{
									this.m_allVaules.Add(this.m_buffInfoList[i].Values[j].ToString("f1"));
								}
							}
						}
					}
				}
				allVaules = this.m_allVaules;
			}
			return allVaules;
		}
	}
}