8 public override int GetValue()
16 public virtual int value
20 return this.raw[this.rawIndex];
24 this.raw[this.rawIndex] = value;
31 public virtual int max
48 return base.source.GetText(
"name",
false);
54 public virtual bool TrackPhaseChange
64 public virtual int min
73 public override string ToString()
75 return string.Concat(
new string[]
79 this.value.ToString(),
81 this.GetPhase().ToString()
86 public override string GetText()
88 string text = base.source.GetTextArray(
"strPhase")[this.GetPhase()];
97 public override Color GetColor(Gradient g)
99 return g.Evaluate((
float)this.value / (
float)this.max);
103 public Stats Set(
int[] _raw,
int _rawIndex,
Chara _CC)
106 this.rawIndex = _rawIndex;
112 public override int GetPhase()
114 return base.source.phase[(int)Mathf.Clamp(10f * (
float)
this.value / (
float)
this.max, 0f, 9f)];
118 public virtual void Set(
int a)
121 if (this.value < this.min)
123 this.value = this.min;
126 if (this.value > this.max)
128 this.value = this.max;
133 public virtual void Mod(
int a)
139 if (this.TrackPhaseChange)
141 int phase = this.GetPhase();
143 if (this.value < this.min)
145 this.value = this.min;
147 else if (this.value > this.max)
149 this.value = this.max;
151 int phase2 = this.GetPhase();
154 this.OnChangePhase(phase2, phase);
161 if (this.value < this.min)
163 this.value = this.min;
166 if (this.value > this.max)
168 this.value = this.max;
174 public virtual void OnChangePhase(
int phase,
int lastPhase)
176 bool flag = phase > lastPhase;
177 if (base.source.invert)
181 string[] array = (flag ? base.source.GetText(
"textPhase",
false) : base.source.GetText(
"textPhase2",
false)).Split(Environment.NewLine.ToCharArray());
182 if (array.Length <= phase)
188 Msg.SetColor(
"negative");
190 BaseStats.CC.Say(array[phase].Split(
'|', StringSplitOptions.None).RandomItem<
string>(),
BaseStats.CC,
null,
null);