Elin Modding Docs Doc
Loading...
Searching...
No Matches
Stats.cs
1using System;
2using UnityEngine;
3
4// Token: 0x020002AB RID: 683
5public class Stats : BaseStats
6{
7 // Token: 0x06001629 RID: 5673 RVA: 0x000959B8 File Offset: 0x00093BB8
8 public override int GetValue()
9 {
10 return this.value;
11 }
12
13 // Token: 0x1700062B RID: 1579
14 // (get) Token: 0x0600162A RID: 5674 RVA: 0x000959C0 File Offset: 0x00093BC0
15 // (set) Token: 0x0600162B RID: 5675 RVA: 0x000959CF File Offset: 0x00093BCF
16 public virtual int value
17 {
18 get
19 {
20 return this.raw[this.rawIndex];
21 }
22 set
23 {
24 this.raw[this.rawIndex] = value;
25 }
26 }
27
28 // Token: 0x1700062C RID: 1580
29 // (get) Token: 0x0600162C RID: 5676 RVA: 0x000959DF File Offset: 0x00093BDF
30 // (set) Token: 0x0600162D RID: 5677 RVA: 0x000959E3 File Offset: 0x00093BE3
31 public virtual int max
32 {
33 get
34 {
35 return 100;
36 }
37 set
38 {
39 }
40 }
41
42 // Token: 0x1700062D RID: 1581
43 // (get) Token: 0x0600162E RID: 5678 RVA: 0x000959E5 File Offset: 0x00093BE5
44 public string name
45 {
46 get
47 {
48 return base.source.GetText("name", false);
49 }
50 }
51
52 // Token: 0x1700062E RID: 1582
53 // (get) Token: 0x0600162F RID: 5679 RVA: 0x000959F8 File Offset: 0x00093BF8
54 public virtual bool TrackPhaseChange
55 {
56 get
57 {
58 return false;
59 }
60 }
61
62 // Token: 0x1700062F RID: 1583
63 // (get) Token: 0x06001630 RID: 5680 RVA: 0x000959FB File Offset: 0x00093BFB
64 public virtual int min
65 {
66 get
67 {
68 return 0;
69 }
70 }
71
72 // Token: 0x06001631 RID: 5681 RVA: 0x00095A00 File Offset: 0x00093C00
73 public override string ToString()
74 {
75 return string.Concat(new string[]
76 {
77 this.name,
78 " ",
79 this.value.ToString(),
80 " ",
81 this.GetPhase().ToString()
82 });
83 }
84
85 // Token: 0x06001632 RID: 5682 RVA: 0x00095A54 File Offset: 0x00093C54
86 public override string GetText()
87 {
88 string text = base.source.GetTextArray("strPhase")[this.GetPhase()];
89 if (!(text == "#"))
90 {
91 return text;
92 }
93 return "";
94 }
95
96 // Token: 0x06001633 RID: 5683 RVA: 0x00095A8D File Offset: 0x00093C8D
97 public override Color GetColor(Gradient g)
98 {
99 return g.Evaluate((float)this.value / (float)this.max);
100 }
101
102 // Token: 0x06001634 RID: 5684 RVA: 0x00095AA4 File Offset: 0x00093CA4
103 public Stats Set(int[] _raw, int _rawIndex, Chara _CC)
104 {
105 this.raw = _raw;
106 this.rawIndex = _rawIndex;
107 BaseStats.CC = _CC;
108 return this;
109 }
110
111 // Token: 0x06001635 RID: 5685 RVA: 0x00095ABB File Offset: 0x00093CBB
112 public override int GetPhase()
113 {
114 return base.source.phase[(int)Mathf.Clamp(10f * (float)this.value / (float)this.max, 0f, 9f)];
115 }
116
117 // Token: 0x06001636 RID: 5686 RVA: 0x00095AEE File Offset: 0x00093CEE
118 public virtual void Set(int a)
119 {
120 this.value = a;
121 if (this.value < this.min)
122 {
123 this.value = this.min;
124 return;
125 }
126 if (this.value > this.max)
127 {
128 this.value = this.max;
129 }
130 }
131
132 // Token: 0x06001637 RID: 5687 RVA: 0x00095B2C File Offset: 0x00093D2C
133 public virtual void Mod(int a)
134 {
135 if (BaseStats.CC.IsAgent)
136 {
137 return;
138 }
139 if (this.TrackPhaseChange)
140 {
141 int phase = this.GetPhase();
142 this.value += a;
143 if (this.value < this.min)
144 {
145 this.value = this.min;
146 }
147 else if (this.value > this.max)
148 {
149 this.value = this.max;
150 }
151 int phase2 = this.GetPhase();
152 if (phase2 != phase)
153 {
154 this.OnChangePhase(phase2, phase);
155 return;
156 }
157 }
158 else
159 {
160 this.value += a;
161 if (this.value < this.min)
162 {
163 this.value = this.min;
164 return;
165 }
166 if (this.value > this.max)
167 {
168 this.value = this.max;
169 }
170 }
171 }
172
173 // Token: 0x06001638 RID: 5688 RVA: 0x00095BF0 File Offset: 0x00093DF0
174 public virtual void OnChangePhase(int phase, int lastPhase)
175 {
176 bool flag = phase > lastPhase;
177 if (base.source.invert)
178 {
179 flag = !flag;
180 }
181 string[] array = (flag ? base.source.GetText("textPhase", false) : base.source.GetText("textPhase2", false)).Split(Environment.NewLine.ToCharArray());
182 if (array.Length <= phase)
183 {
184 return;
185 }
186 if (flag)
187 {
188 Msg.SetColor("negative");
189 }
190 BaseStats.CC.Say(array[phase].Split('|', StringSplitOptions.None).RandomItem<string>(), BaseStats.CC, null, null);
191 if (BaseStats.CC.ShouldShowMsg)
192 {
193 base.PopText();
194 }
195 }
196
197 // Token: 0x04001046 RID: 4166
198 public static StatsHunger Hunger = new StatsHunger
199 {
200 id = 0
201 };
202
203 // Token: 0x04001047 RID: 4167
204 public static StatsBurden Burden = new StatsBurden
205 {
206 id = 1
207 };
208
209 // Token: 0x04001048 RID: 4168
210 public static StatsStamina Stamina = new StatsStamina
211 {
212 id = 3
213 };
214
215 // Token: 0x04001049 RID: 4169
216 public static StatsSleepiness Sleepiness = new StatsSleepiness
217 {
218 id = 4
219 };
220
221 // Token: 0x0400104A RID: 4170
222 public static Stats Depression = new Stats
223 {
224 id = 5
225 };
226
227 // Token: 0x0400104B RID: 4171
228 public static Stats Bladder = new Stats
229 {
230 id = 6
231 };
232
233 // Token: 0x0400104C RID: 4172
234 public static Stats Hygiene = new Stats
235 {
236 id = 7
237 };
238
239 // Token: 0x0400104D RID: 4173
240 public static StatsMana Mana = new StatsMana
241 {
242 id = 8
243 };
244
245 // Token: 0x0400104E RID: 4174
246 public static StatsSAN SAN = new StatsSAN
247 {
248 id = 13
249 };
250
251 // Token: 0x0400104F RID: 4175
252 public int rawIndex;
253
254 // Token: 0x04001050 RID: 4176
255 public int[] raw;
256}
Definition Chara.cs:12
Definition Msg.cs:7
Definition Stats.cs:6