2using System.Collections.Generic;
10 public const int air = 763;
14 public const int rare = 751;
16 public const int cute = 752;
36 public const int lv = 1;
40 public const int d = 3;
48 public const int size = 12;
54 public const int heat = 16;
62 public const int fire = 21;
64 public const int cut = 22;
72 public const int cure = 26;
74 public const int race = 29;
80 public static readonly
int[]
IDS =
new int[36]
82 765, 763, 761, 751, 752, 753, 754, 755, 756, 759,
83 760, 762, 750, 0, 1, 2, 3, 5, 10, 11,
84 12, 13, 15, 16, 17, 18, 14, 21, 22, 23,
85 24, 25, 26, 29, 85, 20
114 n.
AddText(
"_bullet".lang() + text, col);
117 public void AddText(
int v,
string text,
string textBad =
null)
122 if (!textBad.IsEmpty() && v < 0)
152 num += orCreateElement.
Value;
156 AddText(num,
"equipment".lang());
181 if (element2 !=
null)
191 _ = ele.ValueWithoutLink +
total;
244 public static int[]
List_Body =
new int[4] { 70, 72, 71, 77 };
246 public static int[]
List_Mind =
new int[4] { 74, 75, 76, 73 };
322 return source.category !=
"attribute";
372 if (!
source.tag.Contains(
"primary"))
374 return source.tag.Contains(
"foodpot");
386 if (
source.category ==
"attribute")
388 return source.tag.Contains(
"primary");
423 if (
id == 2 || v < 0)
433 return Mathf.Min(v + t.
encLV * 10, 60);
435 return v * (100 + t.encLV * 10) / 100;
442 SourceValueType.Chara => v * (100 + (lv - 1 +
EClass.
rnd(lv / 2 + 1)) *
source.lvFactor / 10) / 100 +
EClass.
rnd(lv / 3) * source.lvFactor / 100,
443 SourceValueType.Fixed => v,
444 _ => v * ((source.encFactor == 0) ? 100 : (50 +
EClass.
rnd(100) +
EClass.
rnd((
int)Mathf.Sqrt(lv * 100)) *
source.encFactor / 100)) / 100,
448 public virtual Sprite
GetIcon(
string suffix =
"")
464 int num = ((source.sort != 0) ?
source.sort :
id);
475 return source.tag.Contains(tag);
490 return source.GetDetail();
503 if (value.
id ==
id && value.
Value > 0)
513 if (value2.
id ==
id && value2.
Value > 0)
524 if (!
source.aliasParent.IsEmpty())
533 Dictionary<int, int> dictionary =
new Dictionary<int, int>();
536 for (
int i = 0; i < list.Length / 2; i++)
538 dictionary[list[i * 2]] = list[i * 2 + 1];
544 public static Dictionary<int, int>
GetElementMap(
int[] list, Dictionary<int, int> map)
548 for (
int i = 0; i < list.Length / 2; i++)
550 map[list[i * 2]] = list[i * 2 + 1];
566 if (row.categorySub ==
"eleAttack" && row.chance > 0)
575 int num = 40 * (listElement.eleP - 100) / 100;
576 if (list.Count == 0 || num < lv)
578 list.Add(
new Tuple<SourceElement.Row, int>(listElement, num));
581 return (useWeight ? list.RandomItemWeighted((Tuple<SourceElement.Row, int> a) => 10000 / (100 + (lv - a.Item2) * 25)) : list.RandomItem()).Item1;
595 if (refEle.
Value > 0)
612 string text =
source.GetText(
"textExtra");
615 string[] array = text.Split(
',');
616 foreach (
string text2
in array)
618 if (text2.StartsWith(
"@"))
622 if (!
source.aliasRef.IsEmpty())
641 string text3 = text2.Replace(
"#calc", Calc());
642 if (!
source.aliasRef.IsEmpty())
646 n.
AddText(
"_bullet".lang() + text3);
650 if (
source.tag.Contains(
"syncRide"))
652 n.
AddText(
"_bullet".lang() +
"hintSyncRide".lang());
657 if (i != 8230 && i != 8232)
659 n.
AddText(
"_bullet".lang() +
"hintPartyAbility".lang());
665 n.
AddText(
"isGlobalAct".lang());
678 num = cost.cost * 100 / (100 + (int)Mathf.Sqrt(c.
Evalue(483) * 10) * 3);
682 int num2 = c.
Evalue(1657);
685 num = num * (100 - num2 * 20) / 100;
689 string text4 = cost.
cost.ToString() ??
"";
690 if (num != cost.
cost)
692 text4 = num +
" (" + text4 +
")";
696 uIItem.
image1.SetNativeSize();
711 uIItem.text2.text = ((
this is
Spell) ? (
vPotential.ToString() ??
"") :
"-");
721 UIText.globalSizeMod = -2;
724 else if (
this is
Act)
735 if (!detail.IsEmpty())
737 n.
AddText(
"NoteText_flavor_element", detail);
747 if (
source.category ==
"landfeat")
756 uIItem.text1.text =
"vValue".lang(
DisplayValue.ToString() ??
"",
ValueWithoutLink + ((num == 0) ?
"" : ((num > 0) ? (
" + " + num) : (
" - " + -num))));
770 if (flag2 && !
source.aliasParent.IsEmpty())
776 bool flag3 = source.lvFactor > 0 &&
this is
Act;
777 uIItem2.
text2.SetActive(flag3);
778 uIItem2.
text3.SetActive(flag3);
787 n.
AddTopic(
"TopicLeft",
"Class:", GetType()?.ToString() ??
"");
788 n.
AddTopic(
"TopicLeft",
"vExp".lang(),
vExp.ToString() ??
"");
795 onWriteNote?.Invoke(n);
799 bonusInfo.ele =
this;
804 UIText.globalSizeMod = 0;
818 bool flag =
source.tag.Contains(
"common");
819 string categorySub =
source.categorySub;
822 int num = Mathf.Abs(
Value);
824 bool flag5 =
Card !=
null &&
this is
Ability && (Card.IsWeapon || Card.category.slot == 35);
827 string[] textArray =
source.GetTextArray(
"textAlt");
828 int num2 = Mathf.Clamp(
Value / 10 + 1, (
Value < 0 || textArray.Length <= 2) ? 1 : 2, textArray.Length - 1);
829 text =
"altEnc".lang(textArray[0].IsEmpty(
Name), textArray[num2], EClass.debug.showExtra ? (
Value +
" " +
Name) :
"");
830 flag3 = num2 <= 1 || textArray.Length <= 2;
835 text =
"isProc".lang(
Name);
838 else if (categorySub ==
"resist" ||
this is
Feat)
840 text = (
"isResist" + (flag3 ?
"Neg" :
"")).lang(
Name);
842 else if (categorySub ==
"eleAttack")
844 text =
"isEleAttack".lang(
Name);
848 text =
source.GetText(
"textPhase");
853 bool flag6 = source.category ==
"skill" || (source.category ==
"attribute" && !
source.textPhase.IsEmpty());
854 bool flag7 = source.category ==
"enchant";
855 if (
source.tag.Contains(
"multiplier"))
857 flag6 = (flag7 =
false);
860 flag2 = !(flag6 || flag7);
861 text = (flag6 ?
"textEncSkill" : (flag7 ?
"textEncEnc" :
"textEnc")).lang(name, num + (
source.tag.Contains(
"ratio") ?
"%" :
""), ((
Value > 0) ?
"encIncrease" :
"encDecrease").lang());
870 if (!flag && !flag2 && !
source.tag.Contains(
"flag"))
872 text = text +
" [" +
"*".Repeat(Mathf.Clamp(num *
source.mtp / num4 + num3, 1, 5)) + ((num *
source.mtp / num4 + num3 > 5) ?
"+" :
"") +
"]";
876 text =
"(debug)" + text;
878 FontColor color = (flag ? FontColor.Default : (flag3 ? FontColor.Bad :
FontColor.Good));
892 if (
id == 2 &&
Value >= 0)
896 if (funcText !=
null)
898 text = funcText(
this, text);
909 foreach (
int key
in thing.
source.elementMap.Keys)
920 if (
id == thing.
GetInt(107))
931 uIItem.
image1.SetActive(enable:
true);
932 uIItem.image1.sprite = sprite;
936 onAddNote?.Invoke(n,
this);
943 uIItem2.button1.tooltip.onShowTooltip = delegate(
UITooltip t)
949 Image image = uIItem2.
image2;
970 bool flag = n ==
null;
971 string[] array = (
source.GetText(
"levelBonus", returnNull:
true) ??
source.levelBonus).Split(Environment.NewLine.ToCharArray());
976 string[] array2 = array;
977 foreach (
string obj
in array2)
979 string[] array3 = obj.Split(
',');
980 int lv = array3[0].ToInt();
995 string s = ((row !=
null) ? row.
GetName() : array3[1]);
1014 if (!
source.aliasParent.IsEmpty())
1037 result2.cost =
source.cost[0] * (100 + ((!
source.tag.Contains(
"noCostInc")) ? (num * 3) : 0)) / 100;
1042 result2.cost =
source.cost[0];
1046 result2.cost = Mathf.Min(c.
stamina.
max / 3 + 10, 30);
1059 result2.cost += num2 * 2;
1081 text2 +=
".".TagSize((
vExp / 10).ToString(
"D2") ??
"", 11);
1085 string text3 = ((
vLink > 0) ?
"+" :
"") +
vLink;
1110 element._source = row;
1141 if (power > 0 && num > 0)
1143 num = Mathf.Max(num - power, 0);
static Act Create(int id)
virtual TargetType TargetType
virtual bool HaveLongPressAction
int GetInt(int id, int? defaultInt=null)
override void _WriteNote(UINote n, bool asChild=false)
virtual int EvaluateTurn(int p)
ElementContainer elements
void SetRefVal(int a, int b)
ElementContainerCard elements
SourceMaterial.Row material
SocketData GetRuneEnc(int idEle)
ElementContainer tempElements
List< Condition > conditions
bool HasCondition(string alias)
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)
List< Sprite > spritesPotential
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 SourceElement.Row GetRandomElement(int lv=1, bool useWeight=true)
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)
void AddEncNote(UINote n, Card Card, ElementContainer.NoteMode mode=ElementContainer.NoteMode.Default, Func< Element, string, string > funcText=null, Action< UINote, Element > onAddNote=null)
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 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)