2using System.Collections.Generic;
8 public const int rare = 751;
10 public const int cute = 752;
28 public const int lv = 1;
30 public const int d = 3;
38 public const int size = 12;
44 public const int heat = 16;
52 public const int fire = 21;
54 public const int cut = 22;
62 public const int cure = 26;
64 public const int race = 29;
70 public static readonly
int[]
IDS =
new int[31]
72 751, 752, 753, 754, 755, 756, 759, 750, 0, 2,
73 1, 3, 5, 10, 11, 12, 13, 14, 16, 17,
74 18, 15, 21, 22, 23, 24, 25, 26, 29, 85,
104 n.
AddText(
"_bullet".lang() + text, col);
107 public void AddText(
int v,
string text,
string textBad =
null)
112 if (!textBad.IsEmpty() && v < 0)
142 num += orCreateElement.
Value;
146 AddText(num,
"equipment".lang());
171 if (element2 !=
null)
181 _ = ele.ValueWithoutLink +
total;
205 if (!
c.
race.IsMachine && !(
c.
id ==
"android"))
234 public static int[]
List_Body =
new int[4] { 70, 72, 71, 77 };
236 public static int[]
List_Mind =
new int[4] { 74, 75, 76, 73 };
312 return source.category !=
"attribute";
362 if (!
source.tag.Contains(
"primary"))
364 return source.tag.Contains(
"foodpot");
376 if (
source.category ==
"attribute")
378 return source.tag.Contains(
"primary");
413 if (
id == 2 || v < 0)
423 return Mathf.Min(v + t.
encLV * 10, 60);
425 return v * (100 + t.encLV * 10) / 100;
432 SourceValueType.Chara => v * (100 + (lv - 1 +
EClass.
rnd(lv / 2 + 1)) *
source.lvFactor / 10) / 100 +
EClass.
rnd(lv / 3) * source.lvFactor / 100,
433 SourceValueType.Fixed => v,
434 _ => v * ((source.encFactor == 0) ? 100 : (50 +
EClass.
rnd(100) +
EClass.
rnd((
int)Mathf.Sqrt(lv * 100)) *
source.encFactor / 100)) / 100,
438 public virtual Sprite
GetIcon(
string suffix =
"")
454 int num = ((source.sort != 0) ?
source.sort :
id);
465 return source.tag.Contains(tag);
480 return source.GetDetail();
493 if (value.
id ==
id && value.
Value > 0)
503 if (value2.
id ==
id && value2.
Value > 0)
514 if (!
source.aliasParent.IsEmpty())
523 Dictionary<int, int> dictionary =
new Dictionary<int, int>();
526 for (
int i = 0; i < list.Length / 2; i++)
528 dictionary[list[i * 2]] = list[i * 2 + 1];
534 public static Dictionary<int, int>
GetElementMap(
int[] list, Dictionary<int, int> map)
538 for (
int i = 0; i < list.Length / 2; i++)
540 map[list[i * 2]] = list[i * 2 + 1];
556 if (row.categorySub ==
"eleAttack" && row.chance > 0)
565 int num = 40 * (listElement.eleP - 100) / 100;
566 if (list.Count == 0 || num < lv)
568 list.Add(
new Tuple<SourceElement.Row, int>(listElement, num));
571 return list.RandomItemWeighted((Tuple<SourceElement.Row, int> a) => 10000 / (100 + (lv - a.Item2) * 25)).Item1;
585 if (refEle.
Value > 0)
602 string text =
source.GetText(
"textExtra");
605 string[] array = text.Split(
',');
606 foreach (
string text2
in array)
608 if (text2.StartsWith(
"@"))
612 if (!
source.aliasRef.IsEmpty())
631 string text3 = text2.Replace(
"#calc", Calc());
632 if (!
source.aliasRef.IsEmpty())
636 n.
AddText(
"_bullet".lang() + text3);
640 if (
source.tag.Contains(
"syncRide"))
642 n.
AddText(
"_bullet".lang() +
"hintSyncRide".lang());
647 if (i != 8230 && i != 8232)
649 n.
AddText(
"_bullet".lang() +
"hintPartyAbility".lang());
655 n.
AddText(
"isGlobalAct".lang());
657 if (cost.
type != 0 && cost.
cost != 0)
664 num = cost.cost * 100 / (100 + (int)Mathf.Sqrt(c.
Evalue(483) * 10) * 3);
666 string text4 = cost.
cost.ToString() ??
"";
667 if (num != cost.
cost)
669 text4 = num +
" (" + text4 +
")";
673 uIItem.
image1.SetNativeSize();
689 uIItem.text2.text = ((
this is
Spell) ? (
vPotential.ToString() ??
"") :
"-");
699 UIText.globalSizeMod = -2;
702 else if (
this is
Act)
713 if (!detail.IsEmpty())
715 n.
AddText(
"NoteText_flavor_element", detail);
725 if (
source.category ==
"landfeat")
734 uIItem.text1.text =
"vValue".lang(
DisplayValue.ToString() ??
"",
ValueWithoutLink + ((num == 0) ?
"" : ((num > 0) ? (
" + " + num) : (
" - " + -num))));
748 if (flag2 && !
source.aliasParent.IsEmpty())
754 bool flag3 = source.lvFactor > 0 &&
this is
Act;
755 uIItem2.
text2.SetActive(flag3);
756 uIItem2.
text3.SetActive(flag3);
765 n.
AddTopic(
"TopicLeft",
"Class:", GetType()?.ToString() ??
"");
766 n.
AddTopic(
"TopicLeft",
"vExp".lang(),
vExp.ToString() ??
"");
773 onWriteNote?.Invoke(n);
777 bonusInfo.ele =
this;
782 UIText.globalSizeMod = 0;
799 bool flag = n ==
null;
800 string[] array = (
source.GetText(
"levelBonus", returnNull:
true) ??
source.levelBonus).Split(Environment.NewLine.ToCharArray());
805 string[] array2 = array;
806 foreach (
string obj
in array2)
808 string[] array3 = obj.Split(
',');
809 int lv = array3[0].ToInt();
824 string s = ((row !=
null) ? row.
GetName() : array3[1]);
843 if (!
source.aliasParent.IsEmpty())
866 result2.cost =
source.cost[0] * (100 + ((!
source.tag.Contains(
"noCostInc")) ? (num * 3) : 0)) / 100;
871 result2.cost =
source.cost[0];
874 result2.cost = c.stamina.max / 3 + 10;
894 text2 +=
".".TagSize((
vExp / 10).ToString(
"D2") ??
"", 11);
898 string text3 = ((
vLink > 0) ?
"+" :
"") +
vLink;
923 element._source = row;
932 public static int GetId(
string alias)
959 return resistLv
switch
static Act Create(int id)
virtual TargetType TargetType
virtual bool HaveLongPressAction
override void _WriteNote(UINote n, bool asChild=false)
virtual int EvaluateTurn(int p)
ElementContainer elements
void SetRefVal(int a, int b)
ElementContainerCard elements
ElementContainer tempElements
List< Condition > conditions
int CalcCastingChance(Element e, int num=1)
override bool IsPCFaction
ElementContainer faithElements
void RefreshSpeed(Element.BonusInfo info=null)
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
override string ToString()
static Dice Create(Element ele, Card c)
static int curve(int a, int start, int step, int rate=75)
static SourceManager sources
static readonly int[] IDS
Dictionary< int, Element > dict
void Learn(int ele, int v=1)
virtual int ValueBonus(Element e)
Element GetOrCreateElement(Element ele)
Element GetElement(string alias)
void AddText(string text, FontColor col=FontColor.Warning)
void AddFix(int v, string text)
void AddText(int v, string text, string textBad=null)
bool IsFactionElement(Chara c)
virtual bool ShowPotential
virtual bool ShowMsgOnValueChanged
virtual Sprite GetSprite()
virtual void OnChangeValue()
static Element Create(string id, int v=1)
static int GetResistDamage(int dmg, int v, int power=0)
int GetMaterialSourceValue(Thing t, int v)
virtual SourceElement.Row GetSource()
virtual void WritePurchaseReq(UINote n, int lv=1)
virtual int GetSourceValue(int v, int lv, SourceValueType type)
virtual bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
void _WriteNote(UINote n, Chara c, Act act)
static SourceElement.Row Get(int id)
virtual int GetSourcePotential(int v)
virtual Sprite GetIcon(string suffix="")
static int GetResistLv(int v)
static List< SourceElement.Row > ListAttackElements
static int[] List_MainAttributes
static int GetId(string alias)
void AddHeaderAbility(UINote n)
static Dictionary< int, int > GetElementMap(int[] list, Dictionary< int, int > map)
int GetSortVal(UIList.SortMode m)
virtual int GetPower(Card c)
void CheckLevelBonus(ElementContainer owner, UINote n=null)
virtual bool ShowRelativeAttribute
void WriteNoteWithRef(UINote n, ElementContainer owner, Action< UINote > onWriteNote, Element refEle)
virtual void SetTextValue(UIText text)
static Dictionary< int, int > GetElementMap(int[] list)
static Element Create(int id, int v=0)
virtual bool CanLink(ElementContainer owner)
virtual Act.Cost GetCost(Chara c)
virtual bool ShowEncNumber
static string GetName(string alias)
static SourceElement.Row GetRandomElement(int lv=1)
static List< SourceElement.Row > ListElements
virtual bool PotentialAsStock
void WriteNote(UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
virtual bool UsePotential
void _WriteNote(UINote n, ElementContainer owner, Action< UINote > onWriteNote, bool isRef, bool addHeader=true)
bool IsFactionWideElement
virtual void OnWriteNote(UINote n, ElementContainer owner)
virtual string GetDetail()
Element GetParent(Card c)
SourceElement.Row _source
static int[] List_MainAttributesMajor
int SortVal(bool charaSheet=false)
ElementContainerFaction charaElements
int CountKeyItem(string alias)
static SkinColorProfile CurrentColors
override string GetName()
static Sprite Get(string id)
UIItem AddItem(string id)
UIItem AddHeader(string text, Sprite sprite=null)
UIItem AddTopic(string id, string text, string value=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
void Space(int sizeY=0, int sizeX=1)