20 this._ints[0] = value;
35 this._ints[1] = value;
50 this._ints[2] = value;
65 this._ints[3] = value;
72 public bool givenByPcParty
76 return (this._ints[4] & 2) != 0;
80 this._ints[4] = (value ? (this._ints[4] | 2) : (this._ints[4] & -3));
91 return (this._ints[4] & 4) != 0;
95 this._ints[4] = (value ? (this._ints[4] | 4) : (this._ints[4] & -5));
101 public override Chara Owner
111 public virtual string Name
115 return base.source.GetText(
"name",
false);
120 public virtual bool CanStack(
Condition c)
127 public virtual bool IsToggle
137 public virtual bool WillOverride
147 public virtual bool AllowMultipleInstance
157 public virtual bool ConsumeTurn
167 public virtual bool PreventRegen
177 public virtual bool ShouldRefresh
187 public virtual bool CancelAI
191 return this.ConsumeTurn;
197 public virtual bool TimeBased
207 public virtual bool SyncRide
216 public virtual bool TryMove(
Point p)
223 public virtual int GainResistFactor
227 return base.source.gainRes;
233 public virtual int P2
247 return EClass.sources.elements.map[this.refVal];
253 public virtual bool IsElemental
263 public virtual string RefString1
267 if (!this.IsElemental)
271 return this.sourceElement.GetName().ToLower();
276 public void SetElement(
int id)
282 public void SetRefVal(
int a,
int b)
289 public virtual Color GetSpriteColor()
291 if (!this.IsElemental)
295 return EClass.setting.elements[
EClass.sources.elements.map[this.refVal].alias].colorSprite;
299 public override string ToString()
301 return string.Concat(
new string[]
305 this.value.ToString(),
307 this.phase.ToString()
312 public override string GetText()
314 if (!this.IsNullPhase())
316 return this.GetPhaseStr();
322 public override int GetValue()
328 public override Color GetColor(Gradient g)
330 return g.Evaluate((base.source.phase.LastItem<
int>() == 0) ? 0f : ((
float)
this.phase / (
float)base.source.phase.LastItem<
int>()));
334 public virtual void SetOwner(
Chara _owner,
bool onDeserialize =
false)
337 this.phase = this.GetPhase();
338 if (this.EmoIcon > this.owner.emoIcon)
340 this.owner.emoIcon = this.EmoIcon;
342 if (base.source.elements.Length != 0)
345 for (
int i = 0; i < base.source.elements.Length; i += 2)
347 this.elements.SetBase(this.GetElementSource(i).
id, base.source.elements[i + 1].Calc(
this.power, 0,
this.P2), 0);
349 this.elements.SetParent(this.owner);
356 string text = base.source.elements[i];
359 text = this.sourceElement.aliasRef;
361 else if (text ==
"ele")
363 text = this.sourceElement.alias;
365 return EClass.sources.elements.alias[text];
371 this.OnBeforeStart();
375 this.OnStartOrStack();
377 if (base.source.nullify.Length != 0)
379 for (
int i = this.owner.conditions.Count - 1; i >= 0; i--)
381 if (this.TryNullify(this.owner.conditions[i]))
383 this.owner.conditions[i].Kill(
false);
392 if (base.source.nullify.Length == 0)
396 foreach (
string b
in base.source.nullify)
398 if (c.source.alias == b)
400 this.owner.Say(
"nullify", this.owner, this.Name.ToLower(), c.Name.ToLower());
408 public virtual void OnBeforeStart()
413 public virtual void OnStart()
418 public virtual void OnStartOrStack()
423 public virtual void PlayEffect()
429 if (base.source.effect.Length != 0)
431 if (!base.source.effect[0].IsEmpty())
433 this.owner.PlayEffect(base.source.effect[0],
true, 0f,
default(Vector3));
435 this.owner.PlaySound((base.source.effect.Length >= 2) ? base.source.effect[1] : base.source.effect[0], 1f,
true);
440 public virtual void PlayEndEffect()
442 if (base.source.effect.Length >= 3)
444 if (!base.source.effect[2].IsEmpty())
446 this.owner.PlayEffect(base.source.effect[2],
true, 0f,
default(Vector3));
448 this.owner.PlaySound((base.source.effect.Length >= 4) ? base.source.effect[3] : base.source.effect[2], 1f,
true);
453 public virtual void OnRefresh()
458 public void SetPhase()
460 int num = this.GetPhase();
461 if (this.phase != num)
463 int num2 = this.phase;
465 this.PhaseMsg(num > num2);
466 this.OnChangePhase(num2, num);
471 public bool IsNullPhase()
473 return base.source.strPhase.Length != 0 && base.source.strPhase[this.GetPhase()] ==
"#";
477 public override int GetPhase()
479 return base.source.phase[Mathf.Clamp(this.value, 0, 99) / 10];
483 public void PhaseMsg(
bool inc)
485 bool flag = base.source.invert ? (!inc) : inc;
486 string[] array = (inc ? base.source.GetText(
"textPhase",
false) : base.source.GetText(
"textPhase2",
false)).Split(Environment.NewLine.ToCharArray());
487 if (array.Length <=
this.phase || array[
this.phase].IsEmpty())
491 if (this.Type == ConditionType.Stance)
495 else if (!base.source.invert && flag)
497 Msg.SetColor(
"negative");
499 else if (base.source.invert && !flag)
501 Msg.SetColor(
"positive");
504 this.owner.Say(array[this.phase].Split(
'|', StringSplitOptions.None).RandomItem<
string>(),
this.owner,
this.RefString1,
null);
508 public override string GetPhaseStr()
510 string[] textArray = base.source.GetTextArray(
"strPhase");
511 if (textArray.Length == 0)
515 return textArray[this.phase].IsEmpty(
"");
519 public virtual void Tick()
524 public void Mod(
int a,
bool force =
false)
526 if (this.isPerfume && !force)
536 this.OnValueChanged();
540 public virtual void OnValueChanged()
545 public virtual void OnChangePhase(
int lastPhase,
int newPhase)
550 public virtual void OnRemoved()
556 public virtual bool CanManualRemove
565 public virtual int EvaluatePower(
int p)
571 public virtual int EvaluateTurn(
int p)
573 return Mathf.Max(1, base.source.duration.Calc(p, 0,
this.P2));
585 if (base.source.defenseAttb.IsEmpty())
591 return Element.Create(base.source.defenseAttb[0], 1);
593 return c.elements.GetOrCreateElement(base.source.defenseAttb[0]);
597 public override void _WriteNote(UINote n,
bool asChild =
false)
599 List<string> list =
new List<string>();
600 Element defenseAttribute = this.GetDefenseAttribute(
null);
601 if (defenseAttribute !=
null)
603 list.Add(
"hintDefenseAttb".lang(defenseAttribute.Name.ToTitleCase(
false),
null,
null,
null,
null));
605 this.OnWriteNote(list);
606 foreach (
string key
in base.source.nullify)
608 list.Add(
"hintNullify".lang(
EClass.sources.stats.alias[key].GetName(),
null,
null,
null,
null));
610 for (
int j = 0; j < base.source.elements.Length; j += 2)
612 Element element =
Element.Create(this.GetElementSource(j).
id, base.source.elements[j + 1].Calc(
this.power, 0,
this.P2));
613 list.Add(
"modValue".lang(element.Name, ((element.Value < 0) ?
"" :
"+") + element.Value.ToString(),
null,
null,
null));
621 foreach (
string str
in list)
623 n.AddText(
"_bullet".lang() + str, FontColor.DontChange);
629 public virtual void OnWriteNote(List<string> list)
641 public int[] _ints =
new int[5];
644 public int phase = -1;