2using System.Collections.Generic;
9 public int[]
_ints =
new int[5];
69 return (
_ints[4] & 2) != 0;
81 return (
_ints[4] & 4) != 0;
91 public virtual string Name => base.source.GetText();
99 public virtual bool HasDuration => base.source.duration !=
"-1";
111 public virtual bool UseElements => base.source.elements.Length != 0;
115 public virtual int P2 => 0;
196 return g.Evaluate((base.source.phase.LastItem() == 0) ? 0f : ((
float)
phase / (
float)base.source.phase.LastItem()));
210 if (base.source.elements.Length != 0)
212 for (
int i = 0; i < base.source.elements.Length; i += 2)
227 string text = base.source.elements[i];
232 else if (text ==
"ele")
247 if (base.source.nullify.Length == 0)
262 if (base.source.nullify.Length == 0)
266 string[] nullify = base.source.nullify;
267 foreach (
string text
in nullify)
269 if (c.source.alias == text)
294 if (!base.source.effect[0].IsEmpty())
298 owner.
PlaySound((base.source.effect.Length >= 2) ? base.source.effect[1] : base.source.effect[0]);
304 if (base.source.effect.Length >= 3)
306 if (!base.source.effect[2].IsEmpty())
310 owner.
PlaySound((base.source.effect.Length >= 4) ? base.source.effect[3] : base.source.effect[2]);
332 if (base.source.strPhase.Length == 0)
336 return base.source.strPhase[
GetPhase()] ==
"#";
341 return base.source.phase[Mathf.Clamp(
value, 0, 99) / 10];
346 bool flag = (base.source.invert ? (!inc) : inc);
347 string[] array = (inc ? base.source.GetText(
"textPhase") : base.source.GetText(
"textPhase2")).Split(Environment.NewLine.ToCharArray());
348 if (array.Length >
phase && !array[
phase].IsEmpty())
354 else if (!base.source.invert && flag)
358 else if (base.source.invert && !flag)
369 string[] textArray = base.source.GetTextArray(
"strPhase");
370 if (textArray.Length == 0)
374 return textArray[
phase].IsEmpty(
"");
381 public void Mod(
int a,
bool force =
false)
410 return Mathf.Max(1, base.source.duration.Calc(p, 0,
P2));
420 if (base.source.defenseAttb.IsEmpty())
428 return c.elements.GetOrCreateElement(base.source.defenseAttb[0]);
433 List<string> list =
new List<string>();
435 if (defenseAttribute !=
null)
437 list.Add(
"hintDefenseAttb".lang(defenseAttribute.
Name.ToTitleCase()));
440 string[] nullify = base.source.nullify;
441 foreach (
string key
in nullify)
445 for (
int j = 0; j < base.source.elements.Length; j += 2)
450 list.Add(e.
Name.TagColorGoodBad(() => e.
Value >= 0));
458 list.Add(
"modValue".lang(e.
Name, ((e.
Value < 0) ?
"" :
"+") + e.
Value + (e.
source.tag.Contains(
"ratio") ?
"%" :
"")).TagColorGoodBad(() => e.
Value >= 0));
469 foreach (
string item in list)
471 n.AddText(
"_bullet".lang() +
item);
virtual void OnChangePhase(int lastPhase, int newPhase)
virtual ElementContainer GetElementContainer()
virtual void OnWriteNote(List< string > list)
virtual bool CanStack(Condition c)
virtual void OnStartOrStack()
virtual void OnValueChanged()
virtual bool ShouldRefresh
virtual RendererReplacer GetRendererReplacer()
override string GetText()
virtual bool PreventRegen
virtual void PlayEffect()
virtual int EvaluatePower(int p)
virtual bool CanManualRemove
virtual int GainResistFactor
virtual BaseNotification CreateNotification()
virtual bool TryMove(Point p)
override void _WriteNote(UINote n, bool asChild=false)
virtual string RefString1
SourceElement.Row GetElementSource(int i)
override Color GetColor(Gradient g)
virtual bool AllowMultipleInstance
Element GetDefenseAttribute(Chara c=null)
virtual int EvaluateTurn(int p)
override string GetPhaseStr()
bool TryNullify(Condition c)
virtual Color GetSpriteColor()
void Mod(int a, bool force=false)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
SourceElement.Row sourceElement
virtual bool ShouldOverride(Condition c)
virtual void PlayEndEffect()
ElementContainer elements
void SetRefVal(int a, int b)
override string ToString()
virtual void OnBeforeStart()
virtual ConditionType Type
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void Say(string lang, string ref1=null, string ref2=null)
List< Condition > conditions
static SourceManager sources
static GameSetting setting
Element SetBase(string alias, int v, int potential=0)
static Element Create(int id, int v=0)
UD_String_ElementRef elements