Elin Decompiled Documentation EA 23.344.1 Nightly
Loading...
Searching...
No Matches
Element Class Reference
Inheritance diagram for Element:
EClass Act AttbMain AttbSpecial AttbWeapon Culture Feat Level Piety RaceBonus Resistance Skill

Classes

class  BonusInfo
 

Public Member Functions

virtual SourceElement.Row GetSource ()
 
virtual int GetSourcePotential (int v)
 
virtual Sprite GetSprite ()
 
int GetMaterialSourceValue (Thing t, int v)
 
virtual long GetSourceValue (long v, int lv, SourceValueType type)
 
virtual Sprite GetIcon (string suffix="")
 
bool IsActive (Card c)
 
int SortVal (bool charaSheet=false)
 
virtual bool CanLink (ElementContainer owner)
 
bool HasTag (string tag)
 
void SetImage (Image i)
 
virtual string GetDetail ()
 
bool IsFactionElement (Chara c)
 
int GetDNABonus (Chara c)
 
Element GetParent (Card c)
 
void WriteNote (UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
 
void WriteNoteWithRef (UINote n, ElementContainer owner, Action< UINote > onWriteNote, Element refEle)
 
void _WriteNote (UINote n, Chara c, Act act)
 
void AddHeaderAbility (UINote n)
 
void _WriteNote (UINote n, ElementContainer owner, Action< UINote > onWriteNote, bool isRef, bool addHeader=true)
 
void AddEncNote (UINote n, Card Card, ElementContainer.NoteMode mode=ElementContainer.NoteMode.Default, Func< Element, string, string > funcText=null, Action< UINote, Element > onAddNote=null)
 
virtual void OnWriteNote (UINote n, ElementContainer owner)
 
virtual void OnChangeValue ()
 
void CheckLevelBonus (ElementContainer owner, UINote n=null)
 
int GetSortVal (UIList.SortMode m)
 
virtual Act.Cost GetCost (Chara c)
 
virtual int GetPower (Card c)
 
virtual void SetTextValue (UIText text, bool shorten=false)
 
virtual bool IsPurchaseFeatReqMet (ElementContainer owner, int lv=-1)
 
virtual void WritePurchaseReq (UINote n, int lv=1)
 

Static Public Member Functions

static string GetName (string alias)
 
static SourceElement.Row Get (int id)
 
static Dictionary< int, int > GetElementMap (int[] list)
 
static Dictionary< int, int > GetElementMap (int[] list, Dictionary< int, int > map)
 
static SourceElement.Row GetRandomElement (int lv=1, bool useWeight=true)
 
static Element Create (int id, int v=0)
 
static Element Create (string id, int v=1)
 
static int GetId (string alias)
 
static int GetResistLv (int v)
 
static long GetResistDamage (long dmg, int v, int power=0)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Public Attributes

SourceElement.Row _source
 
int id
 
int vBase
 
int vExp
 
int vPotential
 
int vTempPotential
 
int vLink
 
int vSource
 
int vSourcePotential
 
ElementContainer owner
 

Static Public Attributes

const int Div = 5
 
static Element Void = new Element()
 
static int[] List_MainAttributes = new int[9] { 70, 72, 71, 77, 74, 75, 76, 73, 79 }
 
static int[] List_MainAttributesMajor = new int[8] { 70, 72, 71, 77, 74, 75, 76, 73 }
 
static int[] List_Body = new int[4] { 70, 72, 71, 77 }
 
static int[] List_Mind = new int[4] { 74, 75, 76, 73 }
 
static List< SourceElement.RowListElements = new List<SourceElement.Row>()
 
static List< SourceElement.RowListAttackElements = new List<SourceElement.Row>()
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

SourceElement.Row source [get]
 
virtual int DisplayValue [get]
 
virtual int MinValue [get]
 
int Value [get]
 
int ValueWithoutLink [get]
 
virtual int MinPotential [get]
 
int Potential [get]
 
virtual bool CanGainExp [get]
 
bool IsFlag [get]
 
virtual string Name [get]
 
virtual string FullName [get]
 
virtual int ExpToNext [get]
 
virtual bool UseExpMod [get]
 
virtual int CostTrain [get]
 
virtual int CostLearn [get]
 
virtual bool ShowXP [get]
 
virtual bool ShowMsgOnValueChanged [get]
 
virtual bool ShowValue [get]
 
virtual bool ShowPotential [get]
 
virtual bool UsePotential [get]
 
virtual bool PotentialAsStock [get]
 
virtual bool ShowRelativeAttribute [get]
 
virtual bool ShowBonuses [get]
 
virtual string ShortName [get]
 
bool IsGlobalElement [get]
 
bool IsFactionWideElement [get]
 
bool IsPartyWideElement [get]
 
virtual bool ShowEncNumber [get]
 
bool IsTrait [get]
 
bool IsFoodTrait [get]
 
bool IsFoodTraitMain [get]
 
bool IsMainAttribute [get]
 
Act act [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 92 of file ELEMENT.cs.

Member Function Documentation

◆ _WriteNote() [1/2]

void Element._WriteNote ( UINote  n,
Chara  c,
Act  act 
)
inline

Definition at line 643 of file ELEMENT.cs.

644 {
646 Act.Cost cost = e.GetCost(c);
647 int p = e.GetPower(c);
648 n.Space(6);
649 string text = source.GetText("textExtra");
650 if (!text.IsEmpty())
651 {
652 string[] array = text.Split(',');
653 foreach (string text2 in array)
654 {
655 if (text2.StartsWith("@"))
656 {
657 Condition condition = Condition.Create(text2.Replace("@", ""), p);
658 condition.owner = c;
659 if (condition is ConWeapon conWeapon)
660 {
661 conWeapon.cha = c.CHA;
662 }
663 if (!source.aliasRef.IsEmpty())
664 {
665 condition.SetElement(EClass.sources.elements.alias[source.aliasRef].id);
666 }
667 switch (act.id)
668 {
669 case 6902:
670 condition.SetRefVal(79, 268);
671 break;
672 case 8510:
673 case 8710:
674 condition.SetRefVal(79, (act.id == 8710) ? 222 : 221);
675 break;
676 }
677 n.AddText("_bullet".lang() + (condition.HasDuration ? "hintCon" : "hintCon2").lang(condition.Name, condition.EvaluateTurn(p).ToString() ?? "") + ((condition.HasDuration && condition.MaxDuration != 0 && condition.MaxDuration < 999) ? "hintCon3".lang(condition.MaxDuration.ToString() ?? "") : ""));
678 condition._WriteNote(n, asChild: true);
679 }
680 else
681 {
682 string text3 = text2.Replace("#calc", Calc()).Replace(";", ",");
683 if (!source.aliasRef.IsEmpty())
684 {
685 text3 = text3.Replace("#ele", EClass.sources.elements.alias[source.aliasRef].GetName().ToLower());
686 }
687 n.AddText("_bullet".lang() + text3);
688 }
689 }
690 }
691 if (source.tag.Contains("syncRide"))
692 {
693 n.AddText("_bullet".lang() + "hintSyncRide".lang());
694 }
695 if (source.tag.Contains("recovery"))
696 {
697 n.AddText("_bullet".lang() + "hintStaminaRecovery".lang());
698 }
699 if (source.tag.Contains("dontForget"))
700 {
701 n.AddText("_bullet".lang() + "hintDontForget".lang());
702 }
704 {
705 int i = id;
706 if (i != 8230 && i != 8232)
707 {
708 n.AddText("_bullet".lang() + "hintPartyAbility".lang());
709 }
710 }
711 if (!act.LocalAct)
712 {
713 n.Space();
714 n.AddText("isGlobalAct".lang());
715 }
716 if (cost.type == Act.CostType.None || cost.cost == 0 || act.owner is ElementContainerField)
717 {
718 return;
719 }
720 n.Space(4);
721 UIItem uIItem = n.AddExtra<UIItem>("costPrice");
722 int num = cost.cost;
723 if (cost.type == Act.CostType.MP)
724 {
725 if (c.Evalue(483) > 0)
726 {
727 num = cost.cost * 100 / (100 + (int)Mathf.Sqrt(c.Evalue(483) * 10) * 3);
728 }
729 if (c.IsPC && c.HasCondition<StanceManaCost>())
730 {
731 int num2 = c.Evalue(1657);
732 if (num2 > 0 && (vPotential >= 2 || c.ability.Has(act.id)))
733 {
734 num = num * (100 - num2 * 20) / 100;
735 }
736 }
737 }
738 string text4 = cost.cost.ToString() ?? "";
739 if (num != cost.cost)
740 {
741 text4 = num + " (" + text4 + ")";
742 }
743 uIItem.text1.SetText(text4, (((cost.type == Act.CostType.MP) ? c.mana.value : c.stamina.value) >= num) ? FontColor.Good : FontColor.Bad);
744 uIItem.image1.sprite = ((cost.type == Act.CostType.MP) ? EClass.core.refs.icons.mana : EClass.core.refs.icons.stamina);
745 uIItem.image1.SetNativeSize();
746 string Calc()
747 {
748 Dice dice = Dice.Create(e, c);
749 if (dice == null)
750 {
751 return p.ToString() ?? "";
752 }
753 return dice.ToString();
754 }
755 }
float Calc(float lhs)
FontColor
Definition: FontColor.cs:2
Definition: ACT.cs:62
CostType
Definition: ACT.cs:64
virtual bool LocalAct
Definition: ACT.cs:173
virtual bool HaveLongPressAction
Definition: ACT.cs:135
void SetElement(int id)
virtual bool HasDuration
virtual int MaxDuration
virtual string Name
override void _WriteNote(UINote n, bool asChild=false)
virtual int EvaluateTurn(int p)
void SetRefVal(int a, int b)
ElementContainerCard elements
Definition: Card.cs:42
int CHA
Definition: Card.cs:2417
int Evalue(int ele)
Definition: Card.cs:2704
bool Has(int id)
override bool IsPC
Definition: Chara.cs:630
bool HasCondition(string alias)
Definition: Chara.cs:10011
Stats stamina
Definition: Chara.cs:1205
CharaAbility ability
Definition: Chara.cs:428
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:47
Sprite mana
Definition: CoreRef.cs:127
Sprite stamina
Definition: CoreRef.cs:129
Icons icons
Definition: CoreRef.cs:358
CoreRef refs
Definition: Core.cs:51
Definition: Dice.cs:5
override string ToString()
Definition: Dice.cs:126
static Dice Create(Element ele, Card c)
Definition: Dice.cs:131
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static SourceManager sources
Definition: EClass.cs:43
Element GetOrCreateElement(Element ele)
int id
Definition: ELEMENT.cs:259
SourceElement.Row source
Definition: ELEMENT.cs:282
int vPotential
Definition: ELEMENT.cs:265
ElementContainer owner
Definition: ELEMENT.cs:275
virtual int GetPower(Card c)
Definition: ELEMENT.cs:1134
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1092
Act act
Definition: ELEMENT.cs:403
SourceElement elements
virtual int value
Definition: Stats.cs:56
Definition: UIItem.cs:5
Image image1
Definition: UIItem.cs:14
UIText text1
Definition: UIItem.cs:6
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62
void SetText(string s)
Definition: UIText.cs:163
Definition: ACT.cs:71
CostType type
Definition: ACT.cs:74
int cost
Definition: ACT.cs:72

References BaseCondition._WriteNote(), Chara.ability, act, UINote.AddText(), Calc(), Card.CHA, EClass.core, Act.Cost.cost, Dice.Create(), Condition.Create(), Card.elements, SourceManager.elements, BaseCondition.EvaluateTurn(), Card.Evalue(), GetCost(), ElementContainer.GetOrCreateElement(), GetPower(), CharaAbility.Has(), Chara.HasCondition(), BaseCondition.HasDuration, Act.HaveLongPressAction, CoreRef.icons, id, UIItem.image1, Chara.IsPC, Act.LocalAct, CoreRef.Icons.mana, BaseCondition.MaxDuration, BaseCondition.Name, owner, Core.refs, BaseCondition.SetElement(), BaseCondition.SetRefVal(), UIText.SetText(), source, EClass.sources, UINote.Space(), Chara.stamina, CoreRef.Icons.stamina, UIItem.text1, Dice.ToString(), Act.Cost.type, Stats.value, and vPotential.

Referenced by WidgetDate._Refresh(), Thing.WriteNote(), WriteNote(), and WriteNoteWithRef().

◆ _WriteNote() [2/2]

void Element._WriteNote ( UINote  n,
ElementContainer  owner,
Action< UINote onWriteNote,
bool  isRef,
bool  addHeader = true 
)
inline

Definition at line 764 of file ELEMENT.cs.

765 {
766 bool flag = this is FieldEffect && owner.Chara == null;
767 if (addHeader)
768 {
769 if (isRef)
770 {
771 UIText.globalSizeMod = -2;
772 n.AddHeader("prevElement".lang(FullName));
773 }
774 else if (this is Act && !flag)
775 {
777 n.Space(8);
778 }
779 else
780 {
781 n.AddHeader(FullName.ToTitleCase(wholeText: true));
782 }
783 }
784 string detail = GetDetail();
785 if (!detail.IsEmpty())
786 {
787 n.AddText("NoteText_flavor_element", detail);
788 n.Space(6);
789 }
790 int num = vLink;
791 if (owner.Chara != null && owner.Chara.IsPCFaction)
792 {
794 }
795 bool flag2 = ShowValue;
796 bool flag3 = ShowRelativeAttribute && !flag;
797 if (source.category == "landfeat")
798 {
799 flag2 = false;
800 flag3 = false;
801 }
802 if (!flag)
803 {
804 if (this is Act)
805 {
806 Act act = ACT.Create(source.id);
807 UIItem uIItem = n.AddItem("ItemAbility");
808 uIItem.text1.text = "vValue".lang(DisplayValue.ToString() ?? "", ValueWithoutLink + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num))));
809 uIItem.text2.text = act.TargetType.ToString().lang();
810 uIItem.text3.text = ((this is Spell && owner.Chara != null) ? (owner.Chara.CalcCastingChance(owner.GetOrCreateElement(act.source.id)) + "%") : "-") ?? "";
811 }
812 else if (flag2)
813 {
814 n.AddTopic("TopicLeft", "vCurrent".lang(), "vValue".lang(DisplayValue.ToString() ?? "", ValueWithoutLink + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num)))));
815 if (ShowPotential)
816 {
817 num = vTempPotential;
818 n.AddTopic("TopicLeft", "vPotential".lang(), "vValue".lang(Potential.ToString() ?? "", vPotential + vSourcePotential + MinPotential + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num)))));
819 }
821 }
822 }
823 if (flag3 && !source.aliasParent.IsEmpty())
824 {
825 Element element = Create(source.aliasParent);
826 UIItem uIItem2 = n.AddItem("ItemRelativeAttribute");
827 uIItem2.text1.SetText(element.Name);
828 element.SetImage(uIItem2.image1);
829 bool flag4 = source.lvFactor > 0 && this is Act;
830 uIItem2.text2.SetActive(flag4);
831 uIItem2.text3.SetActive(flag4);
832 if (flag4)
833 {
834 uIItem2.text2.SetText(GetPower(EClass.pc).ToString() ?? "");
835 }
836 bool flag5 = source.eleP != 50 && this is Act;
837 uIItem2.text4.SetActive(flag5);
838 uIItem2.Find("text5")?.SetActive(flag5);
839 if (flag5)
840 {
841 uIItem2.text4.SetText(source.eleP.ToString() ?? "");
842 }
843 }
844 OnWriteNote(n, owner);
846 {
847 n.AddTopic("TopicLeft", "Class:", GetType()?.ToString() ?? "");
848 n.AddTopic("TopicLeft", "vExp".lang(), vExp.ToString() ?? "");
849 n.AddTopic("TopicLeft", "vSource", vSource.ToString() ?? "");
850 n.AddTopic("TopicLeft", "vSourcePotential", vSourcePotential.ToString() ?? "");
851 n.AddTopic("TopicLeft", "vPotential", vPotential.ToString() ?? "");
852 n.AddTopic("TopicLeft", "Potential", Potential.ToString() ?? "");
853 }
855 onWriteNote?.Invoke(n);
856 if (ShowBonuses && owner.Chara != null)
857 {
858 BonusInfo bonusInfo = new BonusInfo();
859 bonusInfo.ele = this;
860 bonusInfo.n = n;
861 bonusInfo.c = owner.Chara;
862 bonusInfo.WriteNote();
863 }
864 UIText.globalSizeMod = 0;
865 }
Definition: ACT.cs:6
static Act Create(int id)
Definition: ACT.cs:36
virtual TargetType TargetType
Definition: ACT.cs:144
Faction faction
Definition: Chara.cs:431
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: Chara.cs:7722
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6505
override bool IsPCFaction
Definition: Chara.cs:689
bool showExtra
Definition: CoreDebug.cs:184
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
int Value(int ele)
virtual Chara Chara
virtual bool ShowPotential
Definition: ELEMENT.cs:341
virtual int DisplayValue
Definition: ELEMENT.cs:297
int ValueWithoutLink
Definition: ELEMENT.cs:303
int Potential
Definition: ELEMENT.cs:307
int vExp
Definition: ELEMENT.cs:263
int vTempPotential
Definition: ELEMENT.cs:267
virtual string FullName
Definition: ELEMENT.cs:315
void AddHeaderAbility(UINote n)
Definition: ELEMENT.cs:757
void SetImage(Image i)
Definition: ELEMENT.cs:487
void CheckLevelBonus(ElementContainer owner, UINote n=null)
Definition: ELEMENT.cs:1028
virtual bool ShowRelativeAttribute
Definition: ELEMENT.cs:347
virtual string Name
Definition: ELEMENT.cs:313
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1163
int vLink
Definition: ELEMENT.cs:269
virtual bool ShowBonuses
Definition: ELEMENT.cs:349
virtual bool PotentialAsStock
Definition: ELEMENT.cs:345
int vSource
Definition: ELEMENT.cs:271
int vSourcePotential
Definition: ELEMENT.cs:273
virtual void OnWriteNote(UINote n, ElementContainer owner)
Definition: ELEMENT.cs:1020
virtual string GetDetail()
Definition: ELEMENT.cs:497
virtual int MinPotential
Definition: ELEMENT.cs:305
virtual bool ShowValue
Definition: ELEMENT.cs:339
ElementContainerFaction charaElements
Definition: FACTION.cs:146
Definition: SPELL.cs:708
UIText text3
Definition: UIItem.cs:10
UIText text2
Definition: UIItem.cs:8
UIText text4
Definition: UIItem.cs:12
UIItem AddItem(string id)
Definition: UINote.cs:139
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIItem AddTopic(string id, string text, string value=null)
Definition: UINote.cs:144

References act, UINote.AddHeader(), AddHeaderAbility(), UINote.AddItem(), UINote.AddText(), UINote.AddTopic(), Chara.CalcCastingChance(), ElementContainer.Chara, Faction.charaElements, CheckLevelBonus(), ACT.Create(), Create(), EClass.debug, DisplayValue, Chara.faction, FullName, GetDetail(), ElementContainer.GetOrCreateElement(), GetPower(), UIItem.image1, Chara.IsPCFaction, MinPotential, Name, OnWriteNote(), owner, EClass.pc, Potential, PotentialAsStock, SetImage(), UIText.SetText(), ShowBonuses, CoreDebug.showExtra, ShowPotential, ShowRelativeAttribute, ShowValue, source, UINote.Space(), Act.TargetType, UIItem.text1, UIItem.text2, UIItem.text3, UIItem.text4, ElementContainer.Value(), ValueWithoutLink, vExp, vLink, vPotential, vSource, vSourcePotential, vTempPotential, and Element.BonusInfo.WriteNote().

◆ AddEncNote()

void Element.AddEncNote ( UINote  n,
Card  Card,
ElementContainer::NoteMode  mode = ElementContainer::NoteMode::Default,
Func< Element, string, string >  funcText = null,
Action< UINote, Element onAddNote = null 
)
inline

Definition at line 867 of file ELEMENT.cs.

868 {
869 string text = "";
870 switch (mode)
871 {
872 case ElementContainer.NoteMode.Domain:
873 n.AddText(Name, FontColor.Default);
874 return;
875 case ElementContainer.NoteMode.Default:
876 case ElementContainer.NoteMode.BonusTrait:
877 {
878 bool flag = source.tag.Contains("common");
879 string categorySub = source.categorySub;
880 bool flag2 = false;
881 bool flag3 = (source.tag.Contains("neg") ? (Value > 0) : (Value < 0));
882 int num = Mathf.Abs(Value);
883 bool flag4 = Card?.ShowFoodEnc ?? false;
884 bool flag5 = Card != null && this is Ability && (Card.IsWeapon || Card.IsThrownWeapon || Card.IsAmmo || Card.category.slot == 35);
885 if (IsTrait || (flag4 && IsFoodTrait))
886 {
887 string[] textArray = source.GetTextArray("textAlt");
888 int num2 = Mathf.Clamp(Value / 10 + 1, (Value < 0 || textArray.Length <= 2) ? 1 : 2, textArray.Length - 1);
889 text = "altEnc".lang(textArray[0].IsEmpty(Name), textArray[num2], EClass.debug.showExtra ? (Value + " " + Name) : "");
890 flag3 = num2 <= 1 || textArray.Length <= 2;
891 flag2 = true;
892 }
893 else if (flag5)
894 {
895 text = "isProc".lang(Name);
896 flag3 = false;
897 }
898 else if (categorySub == "resist" || this is Feat)
899 {
900 text = ("isResist" + (flag3 ? "Neg" : "")).lang(Name);
901 }
902 else if (categorySub == "eleAttack")
903 {
904 text = "isEleAttack".lang(Name);
905 }
906 else if (!source.textPhase.IsEmpty() && Value > 0)
907 {
908 text = source.GetText("textPhase");
909 }
910 else
911 {
912 string name = Name;
913 bool flag6 = source.category == "skill" || (source.category == "attribute" && !source.textPhase.IsEmpty());
914 bool flag7 = source.category == "enchant";
915 if (source.tag.Contains("multiplier"))
916 {
917 flag6 = (flag7 = false);
918 name = EClass.sources.elements.alias[source.aliasRef].GetName();
919 }
920 flag2 = !(flag6 || flag7);
921 text = (flag6 ? "textEncSkill" : (flag7 ? "textEncEnc" : "textEnc")).lang(name, num + (source.tag.Contains("ratio") ? "%" : ""), ((Value > 0) ? "encIncrease" : "encDecrease").lang());
922 }
923 int num3 = ((!(this is Resistance)) ? 1 : 0);
924 int num4 = 5;
925 if (id == 484)
926 {
927 num3 = 0;
928 num4 = 1;
929 }
930 if (!flag && !flag2 && !source.tag.Contains("flag"))
931 {
932 text = text + " [" + "*".Repeat(Mathf.Clamp(num * source.mtp / num4 + num3, 1, 5)) + ((num * source.mtp / num4 + num3 > 5) ? "+" : "") + "]";
933 }
934 if (HasTag("hidden") && mode != ElementContainer.NoteMode.BonusTrait)
935 {
936 text = "(debug)" + text;
937 }
938 FontColor color = (flag ? FontColor.Default : (flag3 ? FontColor.Bad : FontColor.Good));
939 if (IsGlobalElement)
940 {
941 text = text + " " + (IsFactionWideElement ? "_factionWide" : "_partyWide").lang();
942 if (!IsActive(Card))
943 {
944 return;
945 }
946 color = FontColor.Myth;
947 }
948 if (flag4 && IsFoodTrait && !IsFoodTraitMain)
949 {
950 color = FontColor.FoodMisc;
951 }
952 if (id == 2 && Value >= 0)
953 {
954 color = FontColor.FoodQuality;
955 }
956 if (id == 484 && owner != null && owner.Card != null && owner.Card.CountRune(countFree: false) >= owner.Card.MaxRune())
957 {
958 color = FontColor.Gray;
959 }
960 if (funcText != null)
961 {
962 text = funcText(this, text);
963 }
964 UIItem uIItem = n.AddText("NoteText_enc", text, color);
965 Sprite sprite = EClass.core.refs.icons.enc.enc;
966 Thing thing = Card?.Thing;
967 if (thing != null)
968 {
969 if (thing.material.HasEnc(id))
970 {
971 sprite = EClass.core.refs.icons.enc.mat;
972 }
973 foreach (int key in thing.source.elementMap.Keys)
974 {
975 if (key == id)
976 {
977 sprite = EClass.core.refs.icons.enc.card;
978 }
979 }
980 if (thing.ShowFoodEnc && IsFoodTrait)
981 {
983 }
984 if (id == thing.GetInt(107))
985 {
986 sprite = EClass.core.refs.icons.enc.cat;
987 }
988 if (thing.GetRuneEnc(id) != null)
989 {
990 sprite = EClass.core.refs.icons.enc.rune;
991 }
992 }
993 if ((bool)sprite)
994 {
995 uIItem.image1.SetActive(enable: true);
996 uIItem.image1.sprite = sprite;
997 }
998 uIItem.image2.SetActive(source.IsWeaponEnc || source.IsShieldEnc);
999 uIItem.image2.sprite = (source.IsWeaponEnc ? EClass.core.refs.icons.enc.weaponEnc : EClass.core.refs.icons.enc.shieldEnc);
1000 onAddNote?.Invoke(n, this);
1001 return;
1002 }
1003 }
1004 UIItem uIItem2 = n.AddTopic("TopicAttribute", Name, "".TagColor((ValueWithoutLink > 0) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad, ValueWithoutLink.ToString() ?? ""));
1005 if ((bool)uIItem2.button1)
1006 {
1007 uIItem2.button1.tooltip.onShowTooltip = delegate(UITooltip t)
1008 {
1010 };
1011 }
1012 SetImage(uIItem2.image1);
1013 Image image = uIItem2.image2;
1014 int value = (Potential - 80) / 20;
1015 image.enabled = Potential != 80;
1016 image.sprite = EClass.core.refs.spritesPotential[Mathf.Clamp(Mathf.Abs(value), 0, EClass.core.refs.spritesPotential.Count - 1)];
1017 image.color = ((Potential - 80 >= 0) ? Color.white : new Color(1f, 0.7f, 0.7f));
1018 }
Definition: Card.cs:11
int CountRune(bool countFree=true)
Definition: Card.cs:3821
SourceMaterial.Row material
Definition: Card.cs:2103
int MaxRune()
Definition: Card.cs:3837
SocketData GetRuneEnc(int idEle)
Definition: Card.cs:3806
virtual Thing Thing
Definition: Card.cs:2110
int GetInt(string id, int? defaultInt=null)
Definition: Card.cs:2567
bool ShowFoodEnc
Definition: Card.cs:2244
Sprite traitFood
Definition: CoreRef.cs:72
Sprite shieldEnc
Definition: CoreRef.cs:78
List< Sprite > spritesPotential
Definition: CoreRef.cs:378
virtual Card Card
bool HasTag(string tag)
Definition: ELEMENT.cs:482
int Value
Definition: ELEMENT.cs:301
bool IsFoodTrait
Definition: ELEMENT.cs:373
void WriteNote(UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
Definition: ELEMENT.cs:621
bool IsGlobalElement
Definition: ELEMENT.cs:354
bool IsTrait
Definition: ELEMENT.cs:371
bool IsFactionWideElement
Definition: ELEMENT.cs:365
bool IsFoodTraitMain
Definition: ELEMENT.cs:376
bool IsActive(Card c)
Definition: ELEMENT.cs:462
Definition: FEAT.cs:343
static SkinColorProfile CurrentColors
Definition: SkinManager.cs:84
Definition: Thing.cs:8
SourceThing.Row source
Definition: Thing.cs:11
Image image2
Definition: UIItem.cs:16
UIButton button1
Definition: UIItem.cs:18
UINote note
Definition: UITooltip.cs:21

References UINote.AddText(), UINote.AddTopic(), UIItem.button1, CoreRef.Icons.Enc.card, ElementContainer.Card, CoreRef.Icons.Enc.cat, Color, EClass.core, Card.CountRune(), SkinManager.CurrentColors, Card.elements, SourceManager.elements, CoreRef.Icons.Enc.enc, CoreRef.Icons.enc, Card.GetInt(), Card.GetRuneEnc(), HasTag(), CoreRef.icons, UIItem.image1, UIItem.image2, IsActive(), IsFactionWideElement, IsFoodTrait, IsFoodTraitMain, IsGlobalElement, IsTrait, CoreRef.Icons.Enc.mat, Card.material, Card.MaxRune(), Name, UITooltip.note, owner, EClass.pc, Potential, Core.refs, CoreRef.Icons.Enc.rune, SetImage(), CoreRef.Icons.Enc.shieldEnc, Card.ShowFoodEnc, source, Thing.source, EClass.sources, CoreRef.spritesPotential, SkinColorProfile.textBad, SkinColorProfile.textGood, Card.Thing, CoreRef.Icons.Enc.traitFood, Value, ValueWithoutLink, and WriteNote().

◆ AddHeaderAbility()

void Element.AddHeaderAbility ( UINote  n)
inline

Definition at line 757 of file ELEMENT.cs.

758 {
759 UIItem uIItem = n.AddHeader("HeaderAbility", FullName.ToTitleCase(wholeText: true), GetSprite());
760 uIItem.text2.text = ((this is Spell) ? (vPotential.ToString() ?? "") : "-");
761 (this as Act)?.SetImage(uIItem.image1);
762 }
virtual Sprite GetSprite()
Definition: ELEMENT.cs:425

References UINote.AddHeader(), FullName, GetSprite(), UIItem.image1, SetImage(), and vPotential.

Referenced by _WriteNote().

◆ CanLink()

virtual bool Element.CanLink ( ElementContainer  owner)
inlinevirtual

◆ CheckLevelBonus()

void Element.CheckLevelBonus ( ElementContainer  owner,
UINote  n = null 
)
inline

Definition at line 1028 of file ELEMENT.cs.

1029 {
1030 if (owner == null || source.levelBonus.IsEmpty())
1031 {
1032 return;
1033 }
1034 bool flag = n == null;
1035 string[] array = (source.GetText("levelBonus", returnNull: true) ?? source.levelBonus).Split(Environment.NewLine.ToCharArray());
1036 if (!flag)
1037 {
1038 n.Space(10);
1039 }
1040 string[] array2 = array;
1041 foreach (string obj in array2)
1042 {
1043 string[] array3 = obj.Split(',');
1044 int lv = array3[0].ToInt();
1045 SourceElement.Row row = (EClass.sources.elements.alias.ContainsKey(array3[1]) ? EClass.sources.elements.alias[array3[1]] : null);
1046 if (flag)
1047 {
1048 if (lv > ValueWithoutLink)
1049 {
1050 break;
1051 }
1052 if (row != null && !owner.Has(row.id) && owner is ElementContainerZone)
1053 {
1054 owner.Learn(row.id);
1055 }
1056 }
1057 else
1058 {
1059 string s = ((row != null) ? row.GetName() : array3[1]);
1060 n.AddText((" Lv " + lv).TagColor(FontColor.Topic) + " " + s.TagColorGoodBad(() => (row != null) ? owner.Has(row.id) : (lv <= ValueWithoutLink), () => false));
1061 }
1062 }
1063 if (!flag)
1064 {
1065 n.Space(4);
1066 }
1067 }
void Learn(int ele, int v=1)
bool Has(int ele)
override string GetName()

References SourceManager.elements, SourceElement.Row.GetName(), ElementContainer.Has(), SourceElement.Row.id, ElementContainer.Learn(), owner, source, EClass.sources, and ValueWithoutLink.

Referenced by _WriteNote(), and ElementContainer.ModBase().

◆ Create() [1/2]

◆ Create() [2/2]

static Element Element.Create ( string  id,
int  v = 1 
)
inlinestatic

Definition at line 1177 of file ELEMENT.cs.

1178 {
1179 return Create(EClass.sources.elements.alias[id].id, v);
1180 }

References Create(), SourceManager.elements, and EClass.sources.

◆ Get()

static SourceElement.Row Element.Get ( int  id)
inlinestatic

◆ GetCost()

virtual Act.Cost Element.GetCost ( Chara  c)
inlinevirtual

Definition at line 1092 of file ELEMENT.cs.

1093 {
1094 if (source.cost[0] == 0)
1095 {
1096 return new Act.Cost
1097 {
1098 type = Act.CostType.None
1099 };
1100 }
1101 Act.Cost result = default(Act.Cost);
1102 if (this is Spell)
1103 {
1104 result.type = Act.CostType.MP;
1105 int num = EClass.curve(Value, 50, 10);
1106 result.cost = source.cost[0] * (100 + ((!source.tag.Contains("noCostInc")) ? (num * 3) : 0)) / 100;
1107 }
1108 else
1109 {
1110 result.type = Act.CostType.SP;
1111 result.cost = source.cost[0];
1112 switch (source.id)
1113 {
1114 case 6020:
1115 result.cost = Mathf.Min(c.stamina.max / 3 + 10, 30);
1116 break;
1117 case 6663:
1118 case 6664:
1119 case 6665:
1120 {
1121 int num2 = -2 + c.body.CountWeapons();
1122 result.cost += num2 * 2;
1123 break;
1124 }
1125 }
1126 }
1127 if (!c.IsPC && result.cost > 2)
1128 {
1129 result.cost /= 2;
1130 }
1131 return result;
1132 }
int CountWeapons()
Definition: CharaBody.cs:589
CharaBody body
Definition: Chara.cs:94
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
virtual int max
Definition: Stats.cs:68

References Chara.body, Act.Cost.cost, CharaBody.CountWeapons(), EClass.curve(), Chara.IsPC, Stats.max, source, Chara.stamina, and Value.

Referenced by _WriteNote(), ElementContainer.GetSpellExp(), GoalCombat.TryUseAbility(), and Chara.UseAbility().

◆ GetDetail()

virtual string Element.GetDetail ( )
inlinevirtual

Definition at line 497 of file ELEMENT.cs.

498 {
499 return source.GetDetail();
500 }

References source.

Referenced by _WriteNote(), and ButtonElement.Refresh().

◆ GetDNABonus()

int Element.GetDNABonus ( Chara  c)
inline

Definition at line 531 of file ELEMENT.cs.

532 {
533 int num = 0;
534 foreach (BodySlot slot in c.body.slots)
535 {
536 if (slot.thing != null && slot.thing.c_DNA != null)
537 {
538 Element element = slot.thing.c_DNA.GetElement(id);
539 if (element != null)
540 {
541 num += element.Value;
542 }
543 }
544 }
545 if (c.c_genes != null)
546 {
547 foreach (DNA item in c.c_genes.items)
548 {
549 Element element2 = item.GetElement(id);
550 if (element2 != null)
551 {
552 num += element2.Value;
553 }
554 }
555 }
556 return num;
557 }
Thing thing
Definition: BodySlot.cs:8
CharaGenes c_genes
Definition: Card.cs:1897
DNA c_DNA
Definition: Card.cs:1933
List< BodySlot > slots
Definition: CharaBody.cs:8
List< DNA > items
Definition: CharaGenes.cs:7
Definition: DNA.cs:9
Element GetElement(int id)
Definition: DNA.cs:828

References Card.c_DNA, DNA.GetElement(), item, BodySlot.thing, and Value.

Referenced by Chara.ListAvailabeFeats(), and ActEffect.Proc().

◆ GetElementMap() [1/2]

static Dictionary< int, int > Element.GetElementMap ( int[]  list)
inlinestatic

Definition at line 568 of file ELEMENT.cs.

569 {
570 Dictionary<int, int> dictionary = new Dictionary<int, int>();
571 if (list != null)
572 {
573 for (int i = 0; i < list.Length / 2; i++)
574 {
575 dictionary[list[i * 2]] = list[i * 2 + 1];
576 }
577 }
578 return dictionary;
579 }

Referenced by SourceCard.AddRow(), SourceJob.OnInit(), SourceMaterial.OnInit(), and SourceRace.OnInit().

◆ GetElementMap() [2/2]

static Dictionary< int, int > Element.GetElementMap ( int[]  list,
Dictionary< int, int >  map 
)
inlinestatic

Definition at line 581 of file ELEMENT.cs.

582 {
583 if (list != null)
584 {
585 for (int i = 0; i < list.Length / 2; i++)
586 {
587 map[list[i * 2]] = list[i * 2 + 1];
588 }
589 }
590 return map;
591 }

◆ GetIcon()

virtual Sprite Element.GetIcon ( string  suffix = "")
inlinevirtual

Reimplemented in Feat, LandFeat, RaceBonus, and Resistance.

Definition at line 457 of file ELEMENT.cs.

458 {
459 return SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "ele_" + source.alias + suffix) ?? SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "ele_" + source.aliasParent + suffix) ?? SpriteSheet.Get("Media/Graphics/Icon/Element/icon_elements", "cat_" + source.category);
460 }
static Sprite Get(string id)
Definition: SpriteSheet.cs:28

References SpriteSheet.Get(), and source.

Referenced by WidgetStatsBar.Add(), ButtonElement.SetGrid(), and SetImage().

◆ GetId()

static int Element.GetId ( string  alias)
inlinestatic

Definition at line 1182 of file ELEMENT.cs.

1183 {
1184 return EClass.sources.elements.alias[alias].id;
1185 }

References SourceManager.elements, and EClass.sources.

Referenced by ActEffect.Proc().

◆ GetMaterialSourceValue()

int Element.GetMaterialSourceValue ( Thing  t,
int  v 
)
inline

Definition at line 430 of file ELEMENT.cs.

431 {
432 if (id == 2 || v < 0)
433 {
434 return v;
435 }
436 if (IsTrait)
437 {
438 if (t.IsFurniture)
439 {
440 return v;
441 }
442 return Mathf.Min(v + t.encLV * 10, 60);
443 }
444 return v * (100 + t.encLV * 10) / 100;
445 }
bool IsFurniture
Definition: Card.cs:2305
int encLV
Definition: Card.cs:329

References Card.encLV, Card.IsFurniture, and IsTrait.

Referenced by ElementContainer.ApplyMaterialElementMap().

◆ GetName()

static string Element.GetName ( string  alias)
inlinestatic

Definition at line 405 of file ELEMENT.cs.

406 {
407 return EClass.sources.elements.alias[alias].GetName();
408 }

References SourceManager.elements, and EClass.sources.

Referenced by TaskChopWood.OnCreateProgress().

◆ GetParent()

Element Element.GetParent ( Card  c)
inline

Definition at line 559 of file ELEMENT.cs.

560 {
561 if (!source.aliasParent.IsEmpty())
562 {
563 return c.elements.GetOrCreateElement(source.aliasParent);
564 }
565 return null;
566 }

References Card.elements, ElementContainer.GetOrCreateElement(), and source.

Referenced by ElementContainer.ModExp(), and AttackProcess.Prepare().

◆ GetPower()

virtual int Element.GetPower ( Card  c)
inlinevirtual

Reimplemented in Ability.

Definition at line 1134 of file ELEMENT.cs.

1135 {
1136 return 100;
1137 }

Referenced by _WriteNote(), Dice.Create(), Act.Perform(), StanceSongEnd.TickSong(), GoalCombat.TryUseAbility(), and Chara.UseAbility().

◆ GetRandomElement()

static SourceElement.Row Element.GetRandomElement ( int  lv = 1,
bool  useWeight = true 
)
inlinestatic

Definition at line 593 of file ELEMENT.cs.

594 {
595 if (lv > 100)
596 {
597 lv = 100;
598 }
599 if (ListElements.Count == 0)
600 {
601 foreach (SourceElement.Row row in EClass.sources.elements.rows)
602 {
603 if (row.categorySub == "eleAttack" && row.chance > 0)
604 {
605 ListElements.Add(row);
606 }
607 }
608 }
609 List<Tuple<SourceElement.Row, int>> list = new List<Tuple<SourceElement.Row, int>>();
610 foreach (SourceElement.Row listElement in ListElements)
611 {
612 int num = 40 * (listElement.eleP - 100) / 100;
613 if (list.Count == 0 || num < lv)
614 {
615 list.Add(new Tuple<SourceElement.Row, int>(listElement, num));
616 }
617 }
618 return (useWeight ? list.RandomItemWeighted((Tuple<SourceElement.Row, int> a) => 10000 / (100 + (lv - a.Item2) * 25)) : list.RandomItem()).Item1;
619 }
static List< SourceElement.Row > ListElements
Definition: ELEMENT.cs:277

References SourceManager.elements, ListElements, and EClass.sources.

Referenced by Thing.OnCreate(), and TraitToolRangeCane.OnCreate().

◆ GetResistDamage()

static long Element.GetResistDamage ( long  dmg,
int  v,
int  power = 0 
)
inlinestatic

Definition at line 1201 of file ELEMENT.cs.

1202 {
1203 int num = GetResistLv(v);
1204 if (power > 0 && num > 0)
1205 {
1206 num = Mathf.Max(num - power, 0);
1207 }
1208 if (num >= 4)
1209 {
1210 return 0L;
1211 }
1212 return num switch
1213 {
1214 3 => dmg / 4,
1215 2 => dmg / 3,
1216 1 => dmg / 2,
1217 0 => dmg,
1218 -1 => dmg * 3 / 2,
1219 -2 => dmg * 2,
1220 _ => dmg * 2,
1221 };
1222 }
static int GetResistLv(int v)
Definition: ELEMENT.cs:1187

References GetResistLv().

Referenced by Card.DamageHP().

◆ GetResistLv()

static int Element.GetResistLv ( int  v)
inlinestatic

Definition at line 1187 of file ELEMENT.cs.

1188 {
1189 int num = v / 5;
1190 if (num < -2)
1191 {
1192 num = -2;
1193 }
1194 if (num > 4)
1195 {
1196 num = 4;
1197 }
1198 return num;
1199 }

Referenced by GetResistDamage(), Card.ResistLv(), and ButtonElement.SetGrid().

◆ GetSortVal()

int Element.GetSortVal ( UIList::SortMode  m)
inline

Definition at line 1069 of file ELEMENT.cs.

1070 {
1071 switch (m)
1072 {
1073 case UIList.SortMode.ByCategory:
1074 return source.id + ((!source.aliasParent.IsEmpty()) ? (EClass.sources.elements.alias[source.aliasParent].id * 10000) : 0);
1075 case UIList.SortMode.ByNumber:
1076 return -vPotential * 10000 + source.id;
1077 case UIList.SortMode.ByElementParent:
1078 if (!source.aliasParent.IsEmpty())
1079 {
1080 return EClass.sources.elements.alias[source.aliasParent].sort;
1081 }
1082 return id;
1083 default:
1084 if (source.sort == 0)
1085 {
1086 return source.id;
1087 }
1088 return source.sort;
1089 }
1090 }
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27

References SourceManager.elements, id, source, EClass.sources, and vPotential.

Referenced by ElementContainer.AddNote(), WindowCharaMini.Refresh(), LayerHome.RefreshFeat(), WindowChara.RefreshSkill(), and LayerAbility.SelectGroup().

◆ GetSource()

virtual SourceElement.Row Element.GetSource ( )
inlinevirtual

Definition at line 415 of file ELEMENT.cs.

416 {
417 return EClass.sources.elements.alias.TryGetValue(GetType().ToString());
418 }

References SourceManager.elements, and EClass.sources.

◆ GetSourcePotential()

virtual int Element.GetSourcePotential ( int  v)
inlinevirtual

Reimplemented in Skill.

Definition at line 420 of file ELEMENT.cs.

421 {
422 return 0;
423 }

Referenced by ElementContainer.ApplyElementMap().

◆ GetSourceValue()

virtual long Element.GetSourceValue ( long  v,
int  lv,
SourceValueType  type 
)
inlinevirtual

Reimplemented in Ability.

Definition at line 447 of file ELEMENT.cs.

448 {
449 return type switch
450 {
451 SourceValueType.Chara => v * (100 + (lv - 1 + EClass.rnd(lv / 2 + 1)) * source.lvFactor / 10) / 100 + (long)EClass.rnd(lv / 3) * (long)source.lvFactor / 100,
452 SourceValueType.Fixed => v,
453 _ => v * ((source.encFactor == 0) ? 100 : (50 + EClass.rnd(100) + (long)EClass.rnd((int)Mathf.Sqrt(lv * 100)) * (long)source.encFactor / 100)) / 100,
454 };
455 }
SourceValueType
static int rnd(long a)
Definition: EClass.cs:59

References EClass.rnd(), and source.

Referenced by ElementContainer.ApplyElementMap().

◆ GetSprite()

virtual Sprite Element.GetSprite ( )
inlinevirtual

Reimplemented in Act.

Definition at line 425 of file ELEMENT.cs.

426 {
427 return null;
428 }

Referenced by AddHeaderAbility().

◆ HasTag()

◆ IsActive()

bool Element.IsActive ( Card  c)
inline

Definition at line 462 of file ELEMENT.cs.

463 {
464 if (IsGlobalElement && c != null && !c.c_idDeity.IsEmpty() && c.c_idDeity != EClass.pc.idFaith)
465 {
466 return false;
467 }
468 return Value != 0;
469 }
string c_idDeity
Definition: Card.cs:1621
string idFaith
Definition: Chara.cs:235

References Card.c_idDeity, Chara.idFaith, IsGlobalElement, EClass.pc, and Value.

Referenced by AddEncNote().

◆ IsFactionElement()

bool Element.IsFactionElement ( Chara  c)
inline

Definition at line 502 of file ELEMENT.cs.

503 {
504 if (c == null)
505 {
506 return false;
507 }
508 if (c.IsPCFaction)
509 {
510 foreach (Element value in EClass.pc.faction.charaElements.dict.Values)
511 {
512 if (value.id == id && value.Value > 0)
513 {
514 return true;
515 }
516 }
517 }
518 if (c.faithElements != null)
519 {
520 foreach (Element value2 in c.faithElements.dict.Values)
521 {
522 if (value2.id == id && value2.Value > 0)
523 {
524 return true;
525 }
526 }
527 }
528 return false;
529 }
ElementContainer faithElements
Definition: Chara.cs:38
Dictionary< int, Element > dict

References Faction.charaElements, ElementContainer.dict, Chara.faction, Chara.faithElements, id, Chara.IsPCFaction, EClass.pc, and Value.

Referenced by ButtonElement.Refresh(), WindowChara.RefreshSkill(), and ButtonElement.SetGrid().

◆ IsPurchaseFeatReqMet()

virtual bool Element.IsPurchaseFeatReqMet ( ElementContainer  owner,
int  lv = -1 
)
inlinevirtual

Reimplemented in Feat.

Definition at line 1154 of file ELEMENT.cs.

1155 {
1156 return false;
1157 }

Referenced by ButtonElement.Refresh(), and WriteNoteWithRef().

◆ OnChangeValue()

virtual void Element.OnChangeValue ( )
inlinevirtual

Reimplemented in Ability, AttbMain, and Skill.

Definition at line 1024 of file ELEMENT.cs.

1025 {
1026 }

Referenced by ElementContainer.ModBase(), ElementContainer.ModLink(), and ElementContainer.SetBase().

◆ OnWriteNote()

virtual void Element.OnWriteNote ( UINote  n,
ElementContainer  owner 
)
inlinevirtual

Reimplemented in Feat, and RaceBonus.

Definition at line 1020 of file ELEMENT.cs.

1021 {
1022 }

Referenced by _WriteNote().

◆ SetImage()

void Element.SetImage ( Image  i)
inline

Definition at line 487 of file ELEMENT.cs.

488 {
489 Sprite icon = GetIcon();
490 if ((bool)icon)
491 {
492 i.sprite = icon;
493 i.SetNativeSize();
494 }
495 }
virtual Sprite GetIcon(string suffix="")
Definition: ELEMENT.cs:457

References GetIcon().

Referenced by _WriteNote(), AddEncNote(), AddHeaderAbility(), and ButtonElement.Refresh().

◆ SetTextValue()

virtual void Element.SetTextValue ( UIText  text,
bool  shorten = false 
)
inlinevirtual

Reimplemented in Resistance.

Definition at line 1139 of file ELEMENT.cs.

1140 {
1141 string text2 = DisplayValue.ToString() ?? "";
1142 if (ShowXP)
1143 {
1144 text2 += ".".TagSize((vExp / 10).ToString("D2") ?? "", 11);
1145 }
1146 if (vLink != 0)
1147 {
1148 string text3 = ((vLink > 0) ? "+" : "") + (shorten ? vLink.ToShortNumber() : ((object)vLink));
1149 text2 = "<color=" + ((DisplayValue > ValueWithoutLink) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad).ToHex() + ">" + text2 + (" (" + text3 + ")").TagSize(13) + "</color>";
1150 }
1151 text.text = text2;
1152 }
virtual bool ShowXP
Definition: ELEMENT.cs:326

References SkinManager.CurrentColors, DisplayValue, ShowXP, SkinColorProfile.textBad, SkinColorProfile.textGood, ValueWithoutLink, vExp, and vLink.

Referenced by ButtonElement.Refresh().

◆ SortVal()

int Element.SortVal ( bool  charaSheet = false)
inline

Definition at line 471 of file ELEMENT.cs.

472 {
473 int num = ((source.sort != 0) ? source.sort : id);
474 return (IsFlag ? 100000 : 0) + ((!charaSheet && IsGlobalElement) ? (-1000000) : 0) + (((IsFoodTrait || IsTrait) && owner != null && owner.Card != null && owner.Card.ShowFoodEnc) ? 10000 : 0) + num;
475 }
bool IsFlag
Definition: ELEMENT.cs:311

References ElementContainer.Card, IsFlag, IsFoodTrait, IsGlobalElement, IsTrait, owner, Card.ShowFoodEnc, and source.

Referenced by ElementContainer.AddNote(), AI_Torture.CreateProgress(), and TaskDump.Run().

◆ WriteNote()

void Element.WriteNote ( UINote  n,
ElementContainer  owner = null,
Action< UINote onWriteNote = null 
)
inline

Definition at line 621 of file ELEMENT.cs.

622 {
623 n.Clear();
624 _WriteNote(n, owner, onWriteNote, isRef: false);
625 n.Build();
626 }
void _WriteNote(UINote n, Chara c, Act act)
Definition: ELEMENT.cs:643
void Clear()
Definition: UINote.cs:35
void Build()
Definition: UINote.cs:49

References _WriteNote(), UINote.Build(), UINote.Clear(), and owner.

Referenced by WidgetDate._Refresh(), AddEncNote(), ButtonElement.Refresh(), ItemCulture.Refresh(), ButtonAbility.SetAct(), ItemGachaResult.SetChara(), UICardInfo.SetElement(), ButtonElement.SetGrid(), and Policy.WriteNote().

◆ WriteNoteWithRef()

void Element.WriteNoteWithRef ( UINote  n,
ElementContainer  owner,
Action< UINote onWriteNote,
Element  refEle 
)
inline

Definition at line 628 of file ELEMENT.cs.

629 {
630 n.Clear();
631 _WriteNote(n, owner, onWriteNote, isRef: false);
632 if (refEle.Value > 0)
633 {
634 refEle._WriteNote(n, owner, onWriteNote, isRef: true);
635 }
637 {
639 }
640 n.Build();
641 }
virtual void WritePurchaseReq(UINote n, int lv=1)
Definition: ELEMENT.cs:1159
virtual bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
Definition: ELEMENT.cs:1154

References _WriteNote(), UINote.Build(), UINote.Clear(), IsPurchaseFeatReqMet(), owner, Value, ElementContainer.Value(), and WritePurchaseReq().

Referenced by ButtonElement.Refresh().

◆ WritePurchaseReq()

virtual void Element.WritePurchaseReq ( UINote  n,
int  lv = 1 
)
inlinevirtual

Reimplemented in Feat.

Definition at line 1159 of file ELEMENT.cs.

1160 {
1161 }

Referenced by WriteNoteWithRef().

Member Data Documentation

◆ _source

SourceElement.Row Element._source

Definition at line 257 of file ELEMENT.cs.

◆ Div

const int Element.Div = 5
static

Definition at line 245 of file ELEMENT.cs.

◆ id

int Element.id

Definition at line 259 of file ELEMENT.cs.

Referenced by TraitAltar._OnOffer(), BaseCondition._WriteNote(), _WriteNote(), DamageTextRenderer.Add(), Feat.Apply(), Chara.ApplyDeathPenalty(), Card.ApplyElementEffect(), ElementContainer.ApplyMaterialElementMap(), GrowSystem.ApplySeed(), ActMelee.Attack(), Thing.CanAutoFire(), Thing.CanStackTo(), TraitAmmo.CanStackTo(), RecipeManager.ComeUpWithRecipe(), TraitCrafter.Craft(), RecipeCard.Craft(), Dice.Create(), Create(), Chara.Cuddle(), Card.DamageHP(), CoreDebug.Fix_EtherDisease(), Chara.GainAbility(), Get(), GoalAutoCombat.GetAbilities(), Card.GetBestAttribute(), DNA.GetBodySlot(), DNA.GetInvalidAction(), DNA.GetInvalidFeat(), ElementContainer.GetOrCreateElement(), Recipe.GetQualityBonus(), RecipeManager.GetRecipeLearnState(), ElementContainer.GetSortVal(), GetSortVal(), RecipeSource.GetSPCost(), Act.GetText(), Chara.GiveGift(), IsFactionElement(), ReligionEarth.IsFaithElement(), ReligionElement.IsFaithElement(), ReligionHarvest.IsFaithElement(), ReligionHealing.IsFaithElement(), ReligionMachine.IsFaithElement(), ReligionMoonShadow.IsFaithElement(), ReligionStrife.IsFaithElement(), ReligionWind.IsFaithElement(), Chara.ListAvailabeFeats(), ElementContainer.ListBestAttributes(), ElementContainer.ListBestSkills(), ElementContainer.ListElements(), CraftUtil.MakeBloodSample(), Card.MakeFoodFrom(), TraitSeed.MakeSeed(), CraftUtil.MixIngredients(), ElementContainer.ModBase(), ElementContainer.ModExp(), CraftUtil.ModRandomFoodEnc(), Chara.ModTempElement(), FactionBranch.OnClaimZone(), TaskDrawWater.OnCreateProgress(), TaskPourWater.OnCreateProgress(), TraitDrinkMilkMother.OnDrink(), ElementContainerFaction.OnEquip(), ElementContainerCard.OnLevelUp(), TaskCraft.OnProgress(), TaskCraft.OnProgressComplete(), Religion.OnReforge(), ElementContainer.OnSerializing(), FactionBranch.OnUnclaimZone(), ElementContainerFaction.OnUnequip(), ConStrife.OnWriteNote(), ResearchPlan.ParseReward(), Act.Perform(), AttackProcess.Perform(), ActEffect.Proc(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), FoodEffect.ProcNutrition(), FoodEffect.ProcTrait(), ButtonElement.Refresh(), UICharaMaker.Refresh(), WidgetStatsBar.Refresh(), WindowCharaMini.Refresh(), WindowChara.RefreshSkill(), AI_Idle.Run(), AI_PlayMusic.Run(), LayerAbility.SelectGroup(), ElementContainer.SetBase(), ButtonElement.SetGrid(), Card.SetLv(), Chara.SetMutation(), ElementContainer.SetParent(), Card.SetTier(), ElementContainer.SetTo(), Chara.ShouldEquip(), ButtonAbility.SpecialHoldAction(), BaseSong< T >.Tick(), WidgetTracker.Toggle(), CalcPlat.Train(), GoalCombat.TryAddAbility(), Thing.TryLickEnchant(), GoalCombat.TryRemoveAbility(), HotItemAct.TrySetAct(), TraitCatalyst.TrySetHeldAct(), Chara.TryUpgrade(), GoalCombat.TryUseAbility(), FactionBranch.Upgrade(), Chara.UseAbility(), ElementContainerCard.ValueBonus(), CraftUtil.WrapIngredient(), Element.BonusInfo.WriteNote(), and Thing.WriteNote().

◆ List_Body

int [] Element.List_Body = new int[4] { 70, 72, 71, 77 }
static

Definition at line 253 of file ELEMENT.cs.

Referenced by Chara.CureTempElements(), and Chara.DamageTempElements().

◆ List_MainAttributes

int [] Element.List_MainAttributes = new int[9] { 70, 72, 71, 77, 74, 75, 76, 73, 79 }
static

Definition at line 249 of file ELEMENT.cs.

Referenced by ActEffect.Proc().

◆ List_MainAttributesMajor

int [] Element.List_MainAttributesMajor = new int[8] { 70, 72, 71, 77, 74, 75, 76, 73 }
static

Definition at line 251 of file ELEMENT.cs.

Referenced by Card.GetBestAttribute(), WindowCharaMini.Refresh(), and Chara.TryUpgrade().

◆ List_Mind

int [] Element.List_Mind = new int[4] { 74, 75, 76, 73 }
static

◆ ListAttackElements

List<SourceElement.Row> Element.ListAttackElements = new List<SourceElement.Row>()
static

Definition at line 279 of file ELEMENT.cs.

Referenced by SourceManager.Init().

◆ ListElements

List<SourceElement.Row> Element.ListElements = new List<SourceElement.Row>()
static

Definition at line 277 of file ELEMENT.cs.

Referenced by Chara.GetFavWeaponSkill(), and GetRandomElement().

◆ owner

◆ vBase

◆ vExp

◆ vLink

◆ Void

◆ vPotential

◆ vSource

◆ vSourcePotential

int Element.vSourcePotential

Definition at line 273 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ vTempPotential

Property Documentation

◆ act

◆ CanGainExp

virtual bool Element.CanGainExp
get

Definition at line 309 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp().

◆ CostLearn

virtual int Element.CostLearn
get

◆ CostTrain

virtual int Element.CostTrain
get

Definition at line 321 of file ELEMENT.cs.

Referenced by CalcPlat.Train().

◆ DisplayValue

virtual int Element.DisplayValue
get

◆ ExpToNext

virtual int Element.ExpToNext
get

Definition at line 317 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp(), and Thing.WriteNote().

◆ FullName

virtual string Element.FullName
get

Definition at line 315 of file ELEMENT.cs.

Referenced by _WriteNote(), AddHeaderAbility(), and ButtonElement.Refresh().

◆ IsFactionWideElement

bool Element.IsFactionWideElement
get

Definition at line 365 of file ELEMENT.cs.

Referenced by AddEncNote().

◆ IsFlag

bool Element.IsFlag
get

◆ IsFoodTrait

◆ IsFoodTraitMain

bool Element.IsFoodTraitMain
get

Definition at line 375 of file ELEMENT.cs.

376 {
377 get
378 {
379 if (IsFoodTrait)
380 {
381 if (!source.tag.Contains("primary"))
382 {
383 return source.tag.Contains("foodpot");
384 }
385 return true;
386 }
387 return false;
388 }
389 }

Referenced by AddEncNote(), CraftUtil.GetBloodText(), CraftUtil.GetFoodScore(), ElementContainer.GetSortVal(), Thing.ListLimitedValidTraits(), Thing.ListValidTraits(), CraftUtil.MixIngredients(), and CraftUtil.WrapIngredient().

◆ IsGlobalElement

bool Element.IsGlobalElement
get

Definition at line 353 of file ELEMENT.cs.

354 {
355 get
356 {
357 if (vExp != -1)
358 {
359 return vExp == -2;
360 }
361 return true;
362 }
363 }

Referenced by AddEncNote(), Card.HasGlobalElement(), IsActive(), ElementContainerFaction.OnEquip(), ElementContainerFaction.OnUnequip(), AttackProcess.Perform(), ButtonElement.SetGrid(), SortVal(), Element.BonusInfo.WriteNote(), and Thing.WriteNote().

◆ IsMainAttribute

bool Element.IsMainAttribute
get

Definition at line 391 of file ELEMENT.cs.

392 {
393 get
394 {
395 if (source.category == "attribute")
396 {
397 return source.tag.Contains("primary");
398 }
399 return false;
400 }
401 }

Referenced by Chara.ApplyDeathPenalty(), and FoodEffect.ProcNutrition().

◆ IsPartyWideElement

bool Element.IsPartyWideElement
get

Definition at line 367 of file ELEMENT.cs.

◆ IsTrait

◆ MinPotential

virtual int Element.MinPotential
get

Definition at line 305 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ MinValue

virtual int Element.MinValue
get

Definition at line 299 of file ELEMENT.cs.

◆ Name

◆ Potential

int Element.Potential
get

Definition at line 307 of file ELEMENT.cs.

Referenced by _WriteNote(), AddEncNote(), ElementContainer.ModExp(), and ButtonElement.Refresh().

◆ PotentialAsStock

virtual bool Element.PotentialAsStock
get

Definition at line 345 of file ELEMENT.cs.

Referenced by _WriteNote(), LayerAbility.SelectGroup(), and Chara.UseAbility().

◆ ShortName

virtual string Element.ShortName
get

Definition at line 351 of file ELEMENT.cs.

Referenced by ButtonElement.SetGrid().

◆ ShowBonuses

virtual bool Element.ShowBonuses
get

Definition at line 349 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowEncNumber

virtual bool Element.ShowEncNumber
get

Definition at line 369 of file ELEMENT.cs.

◆ ShowMsgOnValueChanged

virtual bool Element.ShowMsgOnValueChanged
get

Definition at line 337 of file ELEMENT.cs.

Referenced by ElementContainerCard.OnLevelDown(), and ElementContainerCard.OnLevelUp().

◆ ShowPotential

virtual bool Element.ShowPotential
get

Definition at line 341 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowRelativeAttribute

virtual bool Element.ShowRelativeAttribute
get

Definition at line 347 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowValue

virtual bool Element.ShowValue
get

Definition at line 339 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowXP

virtual bool Element.ShowXP
get

Definition at line 325 of file ELEMENT.cs.

326 {
327 get
328 {
330 {
331 return source.category != "attribute";
332 }
333 return true;
334 }
335 }

Referenced by WidgetTracker.Refresh(), and SetTextValue().

◆ source

SourceElement.Row Element.source
get

Definition at line 281 of file ELEMENT.cs.

282 {
283 get
284 {
286 if (row == null)
287 {
288 SourceElement.Row obj = ((id == 0) ? GetSource() : Get(id)) ?? EClass.sources.elements.rows[0];
289 SourceElement.Row row2 = obj;
290 _source = obj;
291 row = row2;
292 }
293 return row;
294 }
295 }
virtual SourceElement.Row GetSource()
Definition: ELEMENT.cs:415
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:410
SourceElement.Row _source
Definition: ELEMENT.cs:257

Referenced by BaseCondition._WriteNote(), _WriteNote(), AddEncNote(), ElementContainer.AddNoteAll(), UICharaMaker.AddWeaponSkill(), Feat.Apply(), ElementContainer.ApplyElementMap(), ElementContainer.ApplyMaterialElementMap(), GoalAutoCombat.BuildAbilityList(), Chara.CalcCastingChance(), DNA.CalcSlot(), Chara.CalculateMaxStamina(), CheckLevelBonus(), TraitCrafter.Craft(), RecipeCard.Craft(), Dice.Create(), Player.CreateEquip(), ActEffect.DamageEle(), Card.DamageHP(), Player.DreamSpell(), ZonePreEnterEncounter.Execute(), CoreDebug.Fix_EtherDisease(), DamageTextRenderer.Flush(), Chara.GainAbility(), CraftUtil.GetBloodText(), DNA.GetBodySlot(), GetCost(), AIAct.GetCurrentActionText(), Check.GetDC(), GetDetail(), Chara.GetFavWeaponSkill(), Check.GetFinalDC(), FactionBranch.GetHearthIncome(), GetIcon(), DNA.GetInvalidAction(), DNA.GetInvalidFeat(), CardRow.GetName(), Chara.GetName(), GetParent(), ElementContainer.GetSortVal(), GetSortVal(), GetSourceValue(), ElementContainer.GetSpellExp(), FactionBranch.GetTechUpgradeCost(), Card.GetValue(), HasTag(), TraitFoodEggFertilized.Incubate(), ReligionCustom.IsFaithElement(), CalcPlat.Learn(), Chara.ListAvailabeFeats(), ElementContainer.ListBestSkills(), ElementContainer.ListGeneFeats(), ElementContainer.ListRune(), Card.MakeFoodFrom(), DNA.MakeSlimeFood(), Thing.MatchEncSearch(), Chara.ModCorruption(), ElementContainer.ModExp(), Chara.MutateRandom(), TraitDrinkMilkMother.OnDrink(), ElementContainerCard.OnLevelDown(), ElementContainerCard.OnLevelUp(), ConStrife.OnWriteNote(), Act.Perform(), AttackProcess.Perform(), AttackProcess.PlayRangedAnime(), ActEffect.Proc(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), FoodEffect.ProcNutrition(), ButtonElement.Refresh(), CharaAbility.Refresh(), UICharaMaker.Refresh(), WindowCharaMini.Refresh(), Card.RefreshColor(), LayerHome.RefreshFeat(), WindowChara.RefreshSkill(), WindowChara.RefreshStatic(), DNA.Relicize(), DNA.ReplaceBodySlot(), AI_Eat.Run(), AI_Idle.Run(), AI_PlayMusic.Run(), LayerAbility.SelectGroup(), ButtonAbility.SetAct(), Chara.SetFeat(), Card.SetLv(), Chara.SetMainElement(), UIFactionInfo.SetZone(), SortVal(), ButtonAbility.SpecialHoldAction(), CalcPlat.Train(), HotItemAct.TrySetAct(), TraitCatalyst.TrySetHeldAct(), ButtonAbility.TryUse(), GoalCombat.TryUseAbility(), FactionBranch.Upgrade(), Chara.UseAbility(), ElementContainerCard.ValueBonus(), Element.BonusInfo.WriteNote(), Thing.WriteNote(), and DNA.WriteNote().

◆ UseExpMod

virtual bool Element.UseExpMod
get

Definition at line 319 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp().

◆ UsePotential

virtual bool Element.UsePotential
get

Definition at line 343 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp().

◆ Value

int Element.Value
get

Definition at line 301 of file ELEMENT.cs.

Referenced by TraitAltar._OnOffer(), BaseCondition._WriteNote(), Chara.AddCondition(), AddEncNote(), ElementContainer.AddNote(), Feat.Apply(), GrowSystem.ApplySeed(), Chara.CalcCastingChance(), Thing.CanStackTo(), CraftUtil.GetBloodText(), GetCost(), Check.GetDC(), GetDNABonus(), Chara.GetFavWeaponSkill(), Check.GetFinalDC(), CraftUtil.GetFoodScore(), AttackProcess.GetRocketPower(), Recipe.GetSortVal(), ElementContainer.GetSortVal(), RecipeSource.GetSPCost(), IsActive(), IsFactionElement(), ElementContainer.ListElements(), Thing.ListLimitedValidTraits(), Thing.ListValidTraits(), CraftUtil.MakeBloodSample(), Card.MakeFoodFrom(), TraitSeed.MakeSeed(), Thing.MatchEncSearch(), CraftUtil.MixIngredients(), Chara.ModCorruption(), CraftUtil.ModRandomFoodEnc(), Chara.MutateRandom(), TraitPotionAlchemy.OnCrafted(), ElementContainerFaction.OnEquip(), ElementContainerFaction.OnUnequip(), ConStrife.OnWriteNote(), ResearchPlan.ParseReward(), AttackProcess.Perform(), AttackProcess.Prepare(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), FoodEffect.ProcNutrition(), FoodEffect.ProcTrait(), ButtonElement.Refresh(), WidgetStatsBar.Refresh(), WidgetTracker.Refresh(), WindowCharaMini.Refresh(), LayerHome.RefreshFeat(), UIRecipeInfo.RefreshList(), WindowChara.RefreshSkill(), ElementContainer.Remove(), AI_PlayMusic.Run(), LayerAbility.SelectGroup(), ItemGachaResult.SetChara(), Chara.SetFeat(), ButtonElement.SetGrid(), Chara.SetMutation(), Recipe.SetTextDifficulty(), Card.SetTier(), Chara.ShouldEquip(), Recipe.TryGetFirstTimeBonus(), GoalCombat.TryUseAbility(), Chara.UseAbility(), ElementContainer.Value(), ElementContainerCard.ValueBonus(), CraftUtil.WrapIngredient(), Element.BonusInfo.WriteNote(), Thing.WriteNote(), DNA.WriteNote(), WriteNoteWithRef(), Feat.WritePurchaseReq(), and Recipe.WriteReqSkill().

◆ ValueWithoutLink


The documentation for this class was generated from the following file: