2using System.Collections.Generic;
8 public const int rare = 751;
10 public const int cute = 752;
32 public const int d = 3;
34 public const int lv = 1;
44 public const int size = 12;
50 public const int heat = 16;
58 public const int fire = 21;
60 public const int cut = 22;
68 public const int cure = 26;
70 public const int race = 29;
76 public static readonly
int[]
IDS =
new int[34]
78 751, 752, 753, 754, 755, 756, 760, 761, 762, 750,
79 759, 0, 3, 1, 2, 5, 10, 11, 12, 13,
80 14, 16, 17, 18, 15, 21, 22, 23, 24, 25,
110 n.
AddText(
"_bullet".lang() + text, col);
113 public void AddText(
int v,
string text,
string textBad =
null)
118 if (!textBad.IsEmpty() && v < 0)
148 num += orCreateElement.
Value;
152 AddText(num,
"equipment".lang());
177 if (element2 !=
null)
187 _ = ele.ValueWithoutLink +
total;
211 if (!
c.
race.IsMachine && !(
c.
id ==
"android"))
240 public static int[]
List_Body =
new int[4] { 70, 72, 71, 77 };
242 public static int[]
List_Mind =
new int[4] { 74, 75, 76, 73 };
318 return source.category !=
"attribute";
368 if (!
source.tag.Contains(
"primary"))
370 return source.tag.Contains(
"foodpot");
382 if (
source.category ==
"attribute")
384 return source.tag.Contains(
"primary");
419 if (
id == 2 || v < 0)
429 return Mathf.Min(v + t.
encLV * 10, 60);
431 return v * (100 + t.encLV * 10) / 100;
438 SourceValueType.Chara => v * (100 + (lv - 1 +
EClass.
rnd(lv / 2 + 1)) *
source.lvFactor / 10) / 100 +
EClass.
rnd(lv / 3) * source.lvFactor / 100,
439 SourceValueType.Fixed => v,
440 _ => v * ((source.encFactor == 0) ? 100 : (50 +
EClass.
rnd(100) +
EClass.
rnd((
int)Mathf.Sqrt(lv * 100)) *
source.encFactor / 100)) / 100,
444 public virtual Sprite
GetIcon(
string suffix =
"")
460 int num = ((source.sort != 0) ?
source.sort :
id);
471 return source.tag.Contains(tag);
486 return source.GetDetail();
499 if (value.
id ==
id && value.
Value > 0)
509 if (value2.
id ==
id && value2.
Value > 0)
520 if (!
source.aliasParent.IsEmpty())
529 Dictionary<int, int> dictionary =
new Dictionary<int, int>();
532 for (
int i = 0; i < list.Length / 2; i++)
534 dictionary[list[i * 2]] = list[i * 2 + 1];
540 public static Dictionary<int, int>
GetElementMap(
int[] list, Dictionary<int, int> map)
544 for (
int i = 0; i < list.Length / 2; i++)
546 map[list[i * 2]] = list[i * 2 + 1];
562 if (row.categorySub ==
"eleAttack" && row.chance > 0)
571 int num = 40 * (listElement.eleP - 100) / 100;
572 if (list.Count == 0 || num < lv)
574 list.Add(
new Tuple<SourceElement.Row, int>(listElement, num));
577 return list.RandomItemWeighted((Tuple<SourceElement.Row, int> a) => 10000 / (100 + (lv - a.Item2) * 25)).Item1;
591 if (refEle.
Value > 0)
608 string text =
source.GetText(
"textExtra");
611 string[] array = text.Split(
',');
612 foreach (
string text2
in array)
614 if (text2.StartsWith(
"@"))
618 if (!
source.aliasRef.IsEmpty())
637 string text3 = text2.Replace(
"#calc", Calc());
638 if (!
source.aliasRef.IsEmpty())
642 n.
AddText(
"_bullet".lang() + text3);
646 if (
source.tag.Contains(
"syncRide"))
648 n.
AddText(
"_bullet".lang() +
"hintSyncRide".lang());
653 if (i != 8230 && i != 8232)
655 n.
AddText(
"_bullet".lang() +
"hintPartyAbility".lang());
661 n.
AddText(
"isGlobalAct".lang());
674 num = cost.cost * 100 / (100 + (int)Mathf.Sqrt(c.
Evalue(483) * 10) * 3);
678 int num2 = c.
Evalue(1657);
681 num = num * (100 - num2 * 20) / 100;
685 string text4 = cost.
cost.ToString() ??
"";
686 if (num != cost.
cost)
688 text4 = num +
" (" + text4 +
")";
692 uIItem.
image1.SetNativeSize();
707 uIItem.text2.text = ((
this is
Spell) ? (
vPotential.ToString() ??
"") :
"-");
717 UIText.globalSizeMod = -2;
720 else if (
this is
Act)
731 if (!detail.IsEmpty())
733 n.
AddText(
"NoteText_flavor_element", detail);
743 if (
source.category ==
"landfeat")
752 uIItem.text1.text =
"vValue".lang(
DisplayValue.ToString() ??
"",
ValueWithoutLink + ((num == 0) ?
"" : ((num > 0) ? (
" + " + num) : (
" - " + -num))));
766 if (flag2 && !
source.aliasParent.IsEmpty())
772 bool flag3 = source.lvFactor > 0 &&
this is
Act;
773 uIItem2.
text2.SetActive(flag3);
774 uIItem2.
text3.SetActive(flag3);
783 n.
AddTopic(
"TopicLeft",
"Class:", GetType()?.ToString() ??
"");
784 n.
AddTopic(
"TopicLeft",
"vExp".lang(),
vExp.ToString() ??
"");
791 onWriteNote?.Invoke(n);
795 bonusInfo.ele =
this;
800 UIText.globalSizeMod = 0;
814 bool flag =
source.tag.Contains(
"common");
815 string categorySub =
source.categorySub;
818 int num = Mathf.Abs(
Value);
820 bool flag5 =
Card !=
null && Card.IsWeapon &&
this is
Ability;
823 string[] textArray =
source.GetTextArray(
"textAlt");
824 int num2 = Mathf.Clamp(
Value / 10 + 1, (
Value < 0 || textArray.Length <= 2) ? 1 : 2, textArray.Length - 1);
825 text =
"altEnc".lang(textArray[0].IsEmpty(
Name), textArray[num2], EClass.debug.showExtra ? (
Value +
" " +
Name) :
"");
826 flag3 = num2 <= 1 || textArray.Length <= 2;
831 text =
"isProc".lang(
Name);
834 else if (categorySub ==
"resist")
836 text = (
"isResist" + (flag3 ?
"Neg" :
"")).lang(
Name);
838 else if (categorySub ==
"eleAttack")
840 text =
"isEleAttack".lang(
Name);
844 text =
source.GetText(
"textPhase");
849 bool flag6 = source.category ==
"skill" || (source.category ==
"attribute" && !
source.textPhase.IsEmpty());
850 bool flag7 = source.category ==
"enchant";
851 if (
source.tag.Contains(
"multiplier"))
853 flag6 = (flag7 =
false);
856 flag2 = !(flag6 || flag7);
857 text = (flag6 ?
"textEncSkill" : (flag7 ?
"textEncEnc" :
"textEnc")).lang(name, num + (
source.tag.Contains(
"ratio") ?
"%" :
""), ((
Value > 0) ?
"encIncrease" :
"encDecrease").lang());
866 if (!flag && !flag2 && !
source.tag.Contains(
"flag"))
868 text = text +
" [" +
"*".Repeat(Mathf.Clamp(num *
source.mtp / num4 + num3, 1, 5)) + ((num *
source.mtp / num4 + num3 > 5) ?
"+" :
"") +
"]";
872 text =
"(debug)" + text;
874 FontColor color = (flag ? FontColor.Default : (flag3 ? FontColor.Bad :
FontColor.Good));
888 if (
id == 2 &&
Value >= 0)
892 if (funcText !=
null)
894 text = funcText(
this, text);
905 foreach (
int key
in thing.
source.elementMap.Keys)
916 if (
id == thing.
GetInt(107))
927 uIItem.
image1.SetActive(enable:
true);
928 uIItem.image1.sprite = sprite;
931 onAddNote?.Invoke(n,
this);
938 uIItem2.button1.tooltip.onShowTooltip = delegate(
UITooltip t)
944 Image image = uIItem2.
image2;
965 bool flag = n ==
null;
966 string[] array = (
source.GetText(
"levelBonus", returnNull:
true) ??
source.levelBonus).Split(Environment.NewLine.ToCharArray());
971 string[] array2 = array;
972 foreach (
string obj
in array2)
974 string[] array3 = obj.Split(
',');
975 int lv = array3[0].ToInt();
990 string s = ((row !=
null) ? row.
GetName() : array3[1]);
1009 if (!
source.aliasParent.IsEmpty())
1032 result2.cost =
source.cost[0] * (100 + ((!
source.tag.Contains(
"noCostInc")) ? (num * 3) : 0)) / 100;
1037 result2.cost =
source.cost[0];
1041 result2.cost = c.stamina.max / 3 + 10;
1053 result2.cost += num2 * 2;
1075 text2 +=
".".TagSize((
vExp / 10).ToString(
"D2") ??
"", 11);
1079 string text3 = ((
vLink > 0) ?
"+" :
"") +
vLink;
1104 element._source = row;
1135 if (power > 0 && num > 0)
1137 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 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 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)