Elin Decompiled Documentation EA 23.295 Stable Patch 2
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)
 
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 88 of file ELEMENT.cs.

Member Function Documentation

◆ _WriteNote() [1/2]

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

Definition at line 611 of file ELEMENT.cs.

612 {
614 Act.Cost cost = e.GetCost(c);
615 int p = e.GetPower(c);
616 n.Space(6);
617 string text = source.GetText("textExtra");
618 if (!text.IsEmpty())
619 {
620 string[] array = text.Split(',');
621 foreach (string text2 in array)
622 {
623 if (text2.StartsWith("@"))
624 {
625 Condition condition = Condition.Create(text2.Replace("@", ""), p);
626 condition.owner = c;
627 if (!source.aliasRef.IsEmpty())
628 {
629 condition.SetElement(EClass.sources.elements.alias[source.aliasRef].id);
630 }
631 switch (act.id)
632 {
633 case 6902:
634 condition.SetRefVal(79, 268);
635 break;
636 case 8510:
637 case 8710:
638 condition.SetRefVal(79, (act.id == 8710) ? 222 : 221);
639 break;
640 }
641 n.AddText("_bullet".lang() + (condition.HasDuration ? "hintCon" : "hintCon2").lang(condition.Name, condition.EvaluateTurn(p).ToString() ?? ""));
642 condition._WriteNote(n, asChild: true);
643 }
644 else
645 {
646 string text3 = text2.Replace("#calc", Calc()).Replace(";", ",");
647 if (!source.aliasRef.IsEmpty())
648 {
649 text3 = text3.Replace("#ele", EClass.sources.elements.alias[source.aliasRef].GetName().ToLower());
650 }
651 n.AddText("_bullet".lang() + text3);
652 }
653 }
654 }
655 if (source.tag.Contains("syncRide"))
656 {
657 n.AddText("_bullet".lang() + "hintSyncRide".lang());
658 }
659 if (EClass.pc.HasElement(1274) && source.tag.Contains("dontForget"))
660 {
661 n.AddText("_bullet".lang() + "hintDontForget".lang());
662 }
664 {
665 int i = id;
666 if (i != 8230 && i != 8232)
667 {
668 n.AddText("_bullet".lang() + "hintPartyAbility".lang());
669 }
670 }
671 if (!act.LocalAct)
672 {
673 n.Space();
674 n.AddText("isGlobalAct".lang());
675 }
676 if (cost.type == Act.CostType.None || cost.cost == 0 || act.owner is ElementContainerField)
677 {
678 return;
679 }
680 n.Space(4);
681 UIItem uIItem = n.AddExtra<UIItem>("costPrice");
682 int num = cost.cost;
683 if (cost.type == Act.CostType.MP)
684 {
685 if (c.Evalue(483) > 0)
686 {
687 num = cost.cost * 100 / (100 + (int)Mathf.Sqrt(c.Evalue(483) * 10) * 3);
688 }
689 if (c.IsPC && c.HasCondition<StanceManaCost>())
690 {
691 int num2 = c.Evalue(1657);
692 if (num2 > 0 && (vPotential >= 2 || c.ability.Has(act.id)))
693 {
694 num = num * (100 - num2 * 20) / 100;
695 }
696 }
697 }
698 string text4 = cost.cost.ToString() ?? "";
699 if (num != cost.cost)
700 {
701 text4 = num + " (" + text4 + ")";
702 }
703 uIItem.text1.SetText(text4, (((cost.type == Act.CostType.MP) ? c.mana.value : c.stamina.value) >= num) ? FontColor.Good : FontColor.Bad);
704 uIItem.image1.sprite = ((cost.type == Act.CostType.MP) ? EClass.core.refs.icons.mana : EClass.core.refs.icons.stamina);
705 uIItem.image1.SetNativeSize();
706 string Calc()
707 {
708 Dice dice = Dice.Create(e, c);
709 if (dice == null)
710 {
711 return p.ToString() ?? "";
712 }
713 return dice.ToString();
714 }
715 }
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 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 Evalue(int ele)
Definition: Card.cs:2611
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6168
bool Has(int id)
override bool IsPC
Definition: Chara.cs:626
bool HasCondition(string alias)
Definition: Chara.cs:9639
Stats stamina
Definition: Chara.cs:1172
CharaAbility ability
Definition: Chara.cs:426
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
Sprite mana
Definition: CoreRef.cs:124
Sprite stamina
Definition: CoreRef.cs:126
Icons icons
Definition: CoreRef.cs:355
CoreRef refs
Definition: Core.cs:51
Definition: Dice.cs:5
override string ToString()
Definition: Dice.cs:115
static Dice Create(Element ele, Card c)
Definition: Dice.cs:120
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static SourceManager sources
Definition: EClass.cs:43
static Chara pc
Definition: EClass.cs:15
Element GetOrCreateElement(Element ele)
int id
Definition: ELEMENT.cs:255
SourceElement.Row source
Definition: ELEMENT.cs:278
int vPotential
Definition: ELEMENT.cs:261
ElementContainer owner
Definition: ELEMENT.cs:271
virtual int GetPower(Card c)
Definition: ELEMENT.cs:1086
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1045
Act act
Definition: ELEMENT.cs:399
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(), 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, Card.HasElement(), Act.HaveLongPressAction, CoreRef.icons, id, UIItem.image1, Chara.IsPC, Act.LocalAct, CoreRef.Icons.mana, BaseCondition.Name, owner, EClass.pc, 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 724 of file ELEMENT.cs.

725 {
726 bool flag = this is FieldEffect && owner.Chara == null;
727 if (addHeader)
728 {
729 if (isRef)
730 {
731 UIText.globalSizeMod = -2;
732 n.AddHeader("prevElement".lang(FullName));
733 }
734 else if (this is Act && !flag)
735 {
737 n.Space(8);
738 }
739 else
740 {
741 n.AddHeader(FullName.ToTitleCase(wholeText: true));
742 }
743 }
744 string detail = GetDetail();
745 if (!detail.IsEmpty())
746 {
747 n.AddText("NoteText_flavor_element", detail);
748 n.Space(6);
749 }
750 int num = vLink;
751 if (owner.Chara != null && owner.Chara.IsPCFaction)
752 {
754 }
755 bool flag2 = ShowValue;
756 bool flag3 = ShowRelativeAttribute && !flag;
757 if (source.category == "landfeat")
758 {
759 flag2 = false;
760 flag3 = false;
761 }
762 if (!flag)
763 {
764 if (this is Act)
765 {
766 Act act = ACT.Create(source.id);
767 UIItem uIItem = n.AddItem("ItemAbility");
768 uIItem.text1.text = "vValue".lang(DisplayValue.ToString() ?? "", ValueWithoutLink + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num))));
769 uIItem.text2.text = act.TargetType.ToString().lang();
770 uIItem.text3.text = ((this is Spell && owner.Chara != null) ? (owner.Chara.CalcCastingChance(owner.GetOrCreateElement(act.source.id)) + "%") : "-") ?? "";
771 }
772 else if (flag2)
773 {
774 n.AddTopic("TopicLeft", "vCurrent".lang(), "vValue".lang(DisplayValue.ToString() ?? "", ValueWithoutLink + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num)))));
775 if (ShowPotential)
776 {
777 num = vTempPotential;
778 n.AddTopic("TopicLeft", "vPotential".lang(), "vValue".lang(Potential.ToString() ?? "", vPotential + vSourcePotential + MinPotential + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num)))));
779 }
781 }
782 }
783 if (flag3 && !source.aliasParent.IsEmpty())
784 {
785 Element element = Create(source.aliasParent);
786 UIItem uIItem2 = n.AddItem("ItemRelativeAttribute");
787 uIItem2.text1.SetText(element.Name);
788 element.SetImage(uIItem2.image1);
789 bool flag4 = source.lvFactor > 0 && this is Act;
790 uIItem2.text2.SetActive(flag4);
791 uIItem2.text3.SetActive(flag4);
792 if (flag4)
793 {
794 uIItem2.text2.SetText(GetPower(EClass.pc).ToString() ?? "");
795 }
796 }
797 OnWriteNote(n, owner);
799 {
800 n.AddTopic("TopicLeft", "Class:", GetType()?.ToString() ?? "");
801 n.AddTopic("TopicLeft", "vExp".lang(), vExp.ToString() ?? "");
802 n.AddTopic("TopicLeft", "vSource", vSource.ToString() ?? "");
803 n.AddTopic("TopicLeft", "vSourcePotential", vSourcePotential.ToString() ?? "");
804 n.AddTopic("TopicLeft", "vPotential", vPotential.ToString() ?? "");
805 n.AddTopic("TopicLeft", "Potential", Potential.ToString() ?? "");
806 }
808 onWriteNote?.Invoke(n);
809 if (ShowBonuses && owner.Chara != null)
810 {
811 BonusInfo bonusInfo = new BonusInfo();
812 bonusInfo.ele = this;
813 bonusInfo.n = n;
814 bonusInfo.c = owner.Chara;
815 bonusInfo.WriteNote();
816 }
817 UIText.globalSizeMod = 0;
818 }
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:429
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: Chara.cs:7467
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6276
override bool IsPCFaction
Definition: Chara.cs:685
bool showExtra
Definition: CoreDebug.cs:168
static CoreDebug debug
Definition: EClass.cs:49
int Value(int ele)
virtual Chara Chara
virtual bool ShowPotential
Definition: ELEMENT.cs:337
virtual int DisplayValue
Definition: ELEMENT.cs:293
int ValueWithoutLink
Definition: ELEMENT.cs:299
int Potential
Definition: ELEMENT.cs:303
int vExp
Definition: ELEMENT.cs:259
int vTempPotential
Definition: ELEMENT.cs:263
virtual string FullName
Definition: ELEMENT.cs:311
void AddHeaderAbility(UINote n)
Definition: ELEMENT.cs:717
void SetImage(Image i)
Definition: ELEMENT.cs:483
void CheckLevelBonus(ElementContainer owner, UINote n=null)
Definition: ELEMENT.cs:981
virtual bool ShowRelativeAttribute
Definition: ELEMENT.cs:343
virtual string Name
Definition: ELEMENT.cs:309
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1115
int vLink
Definition: ELEMENT.cs:265
virtual bool ShowBonuses
Definition: ELEMENT.cs:345
virtual bool PotentialAsStock
Definition: ELEMENT.cs:341
int vSource
Definition: ELEMENT.cs:267
int vSourcePotential
Definition: ELEMENT.cs:269
virtual void OnWriteNote(UINote n, ElementContainer owner)
Definition: ELEMENT.cs:973
virtual string GetDetail()
Definition: ELEMENT.cs:493
virtual int MinPotential
Definition: ELEMENT.cs:301
virtual bool ShowValue
Definition: ELEMENT.cs:335
ElementContainerFaction charaElements
Definition: FACTION.cs:146
Definition: SPELL.cs:626
UIText text3
Definition: UIItem.cs:10
UIText text2
Definition: UIItem.cs:8
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, 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 820 of file ELEMENT.cs.

821 {
822 string text = "";
823 switch (mode)
824 {
825 case ElementContainer.NoteMode.Domain:
826 n.AddText(Name, FontColor.Default);
827 return;
828 case ElementContainer.NoteMode.Default:
829 case ElementContainer.NoteMode.BonusTrait:
830 {
831 bool flag = source.tag.Contains("common");
832 string categorySub = source.categorySub;
833 bool flag2 = false;
834 bool flag3 = (source.tag.Contains("neg") ? (Value > 0) : (Value < 0));
835 int num = Mathf.Abs(Value);
836 bool flag4 = Card?.ShowFoodEnc ?? false;
837 bool flag5 = Card != null && this is Ability && (Card.IsWeapon || Card.IsThrownWeapon || Card.IsAmmo || Card.category.slot == 35);
838 if (IsTrait || (flag4 && IsFoodTrait))
839 {
840 string[] textArray = source.GetTextArray("textAlt");
841 int num2 = Mathf.Clamp(Value / 10 + 1, (Value < 0 || textArray.Length <= 2) ? 1 : 2, textArray.Length - 1);
842 text = "altEnc".lang(textArray[0].IsEmpty(Name), textArray[num2], EClass.debug.showExtra ? (Value + " " + Name) : "");
843 flag3 = num2 <= 1 || textArray.Length <= 2;
844 flag2 = true;
845 }
846 else if (flag5)
847 {
848 text = "isProc".lang(Name);
849 flag3 = false;
850 }
851 else if (categorySub == "resist" || this is Feat)
852 {
853 text = ("isResist" + (flag3 ? "Neg" : "")).lang(Name);
854 }
855 else if (categorySub == "eleAttack")
856 {
857 text = "isEleAttack".lang(Name);
858 }
859 else if (!source.textPhase.IsEmpty() && Value > 0)
860 {
861 text = source.GetText("textPhase");
862 }
863 else
864 {
865 string name = Name;
866 bool flag6 = source.category == "skill" || (source.category == "attribute" && !source.textPhase.IsEmpty());
867 bool flag7 = source.category == "enchant";
868 if (source.tag.Contains("multiplier"))
869 {
870 flag6 = (flag7 = false);
871 name = EClass.sources.elements.alias[source.aliasRef].GetName();
872 }
873 flag2 = !(flag6 || flag7);
874 text = (flag6 ? "textEncSkill" : (flag7 ? "textEncEnc" : "textEnc")).lang(name, num + (source.tag.Contains("ratio") ? "%" : ""), ((Value > 0) ? "encIncrease" : "encDecrease").lang());
875 }
876 int num3 = ((!(this is Resistance)) ? 1 : 0);
877 int num4 = 5;
878 if (id == 484)
879 {
880 num3 = 0;
881 num4 = 1;
882 }
883 if (!flag && !flag2 && !source.tag.Contains("flag"))
884 {
885 text = text + " [" + "*".Repeat(Mathf.Clamp(num * source.mtp / num4 + num3, 1, 5)) + ((num * source.mtp / num4 + num3 > 5) ? "+" : "") + "]";
886 }
887 if (HasTag("hidden") && mode != ElementContainer.NoteMode.BonusTrait)
888 {
889 text = "(debug)" + text;
890 }
891 FontColor color = (flag ? FontColor.Default : (flag3 ? FontColor.Bad : FontColor.Good));
892 if (IsGlobalElement)
893 {
894 text = text + " " + (IsFactionWideElement ? "_factionWide" : "_partyWide").lang();
895 if (!IsActive(Card))
896 {
897 return;
898 }
899 color = FontColor.Myth;
900 }
901 if (flag4 && IsFoodTrait && !IsFoodTraitMain)
902 {
903 color = FontColor.FoodMisc;
904 }
905 if (id == 2 && Value >= 0)
906 {
907 color = FontColor.FoodQuality;
908 }
909 if (id == 484 && owner != null && owner.Card != null && owner.Card.CountRune(countFree: false) >= owner.Card.MaxRune())
910 {
911 color = FontColor.Gray;
912 }
913 if (funcText != null)
914 {
915 text = funcText(this, text);
916 }
917 UIItem uIItem = n.AddText("NoteText_enc", text, color);
918 Sprite sprite = EClass.core.refs.icons.enc.enc;
919 Thing thing = Card?.Thing;
920 if (thing != null)
921 {
922 if (thing.material.HasEnc(id))
923 {
924 sprite = EClass.core.refs.icons.enc.mat;
925 }
926 foreach (int key in thing.source.elementMap.Keys)
927 {
928 if (key == id)
929 {
930 sprite = EClass.core.refs.icons.enc.card;
931 }
932 }
933 if (thing.ShowFoodEnc && IsFoodTrait)
934 {
936 }
937 if (id == thing.GetInt(107))
938 {
939 sprite = EClass.core.refs.icons.enc.cat;
940 }
941 if (thing.GetRuneEnc(id) != null)
942 {
943 sprite = EClass.core.refs.icons.enc.rune;
944 }
945 }
946 if ((bool)sprite)
947 {
948 uIItem.image1.SetActive(enable: true);
949 uIItem.image1.sprite = sprite;
950 }
951 uIItem.image2.SetActive(source.IsWeaponEnc || source.IsShieldEnc);
952 uIItem.image2.sprite = (source.IsWeaponEnc ? EClass.core.refs.icons.enc.weaponEnc : EClass.core.refs.icons.enc.shieldEnc);
953 onAddNote?.Invoke(n, this);
954 return;
955 }
956 }
957 UIItem uIItem2 = n.AddTopic("TopicAttribute", Name, "".TagColor((ValueWithoutLink > 0) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad, ValueWithoutLink.ToString() ?? ""));
958 if ((bool)uIItem2.button1)
959 {
960 uIItem2.button1.tooltip.onShowTooltip = delegate(UITooltip t)
961 {
963 };
964 }
965 SetImage(uIItem2.image1);
966 Image image = uIItem2.image2;
967 int value = (Potential - 80) / 20;
968 image.enabled = Potential != 80;
969 image.sprite = EClass.core.refs.spritesPotential[Mathf.Clamp(Mathf.Abs(value), 0, EClass.core.refs.spritesPotential.Count - 1)];
970 image.color = ((Potential - 80 >= 0) ? Color.white : new Color(1f, 0.7f, 0.7f));
971 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
Definition: Card.cs:11
int CountRune(bool countFree=true)
Definition: Card.cs:3722
SourceMaterial.Row material
Definition: Card.cs:2089
int MaxRune()
Definition: Card.cs:3738
SocketData GetRuneEnc(int idEle)
Definition: Card.cs:3707
virtual Thing Thing
Definition: Card.cs:2096
bool ShowFoodEnc
Definition: Card.cs:2230
Sprite traitFood
Definition: CoreRef.cs:71
Sprite shieldEnc
Definition: CoreRef.cs:77
List< Sprite > spritesPotential
Definition: CoreRef.cs:375
virtual Card Card
bool HasTag(string tag)
Definition: ELEMENT.cs:478
int Value
Definition: ELEMENT.cs:297
bool IsFoodTrait
Definition: ELEMENT.cs:369
void WriteNote(UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
Definition: ELEMENT.cs:589
bool IsGlobalElement
Definition: ELEMENT.cs:350
bool IsTrait
Definition: ELEMENT.cs:367
bool IsFactionWideElement
Definition: ELEMENT.cs:361
bool IsFoodTraitMain
Definition: ELEMENT.cs:372
bool IsActive(Card c)
Definition: ELEMENT.cs:458
Definition: FEAT.cs:324
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, BaseCard.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 717 of file ELEMENT.cs.

718 {
719 UIItem uIItem = n.AddHeader("HeaderAbility", FullName.ToTitleCase(wholeText: true), GetSprite());
720 uIItem.text2.text = ((this is Spell) ? (vPotential.ToString() ?? "") : "-");
721 (this as Act)?.SetImage(uIItem.image1);
722 }
virtual Sprite GetSprite()
Definition: ELEMENT.cs:421

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 981 of file ELEMENT.cs.

982 {
983 if (owner == null || source.levelBonus.IsEmpty())
984 {
985 return;
986 }
987 bool flag = n == null;
988 string[] array = (source.GetText("levelBonus", returnNull: true) ?? source.levelBonus).Split(Environment.NewLine.ToCharArray());
989 if (!flag)
990 {
991 n.Space(10);
992 }
993 string[] array2 = array;
994 foreach (string obj in array2)
995 {
996 string[] array3 = obj.Split(',');
997 int lv = array3[0].ToInt();
998 SourceElement.Row row = (EClass.sources.elements.alias.ContainsKey(array3[1]) ? EClass.sources.elements.alias[array3[1]] : null);
999 if (flag)
1000 {
1001 if (lv > ValueWithoutLink)
1002 {
1003 break;
1004 }
1005 if (row != null && !owner.Has(row.id) && owner is ElementContainerZone)
1006 {
1007 owner.Learn(row.id);
1008 }
1009 }
1010 else
1011 {
1012 string s = ((row != null) ? row.GetName() : array3[1]);
1013 n.AddText((" Lv " + lv).TagColor(FontColor.Topic) + " " + s.TagColorGoodBad(() => (row != null) ? owner.Has(row.id) : (lv <= ValueWithoutLink), () => false));
1014 }
1015 }
1016 if (!flag)
1017 {
1018 n.Space(4);
1019 }
1020 }
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 1129 of file ELEMENT.cs.

1130 {
1131 return Create(EClass.sources.elements.alias[id].id, v);
1132 }

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 1045 of file ELEMENT.cs.

1046 {
1047 if (source.cost[0] == 0)
1048 {
1049 Act.Cost result = default(Act.Cost);
1050 result.type = Act.CostType.None;
1051 return result;
1052 }
1053 Act.Cost result2 = default(Act.Cost);
1054 if (this is Spell)
1055 {
1056 result2.type = Act.CostType.MP;
1057 int num = EClass.curve(Value, 50, 10);
1058 result2.cost = source.cost[0] * (100 + ((!source.tag.Contains("noCostInc")) ? (num * 3) : 0)) / 100;
1059 }
1060 else
1061 {
1062 result2.type = Act.CostType.SP;
1063 result2.cost = source.cost[0];
1064 switch (source.id)
1065 {
1066 case 6020:
1067 result2.cost = Mathf.Min(c.stamina.max / 3 + 10, 30);
1068 break;
1069 case 6663:
1070 case 6664:
1071 case 6665:
1072 {
1073 int num2 = -2 + c.body.CountWeapons();
1074 result2.cost += num2 * 2;
1075 break;
1076 }
1077 }
1078 }
1079 if (!c.IsPC && result2.cost > 2)
1080 {
1081 result2.cost /= 2;
1082 }
1083 return result2;
1084 }
int CountWeapons()
Definition: CharaBody.cs:560
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 493 of file ELEMENT.cs.

494 {
495 return source.GetDetail();
496 }

References source.

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

◆ GetElementMap() [1/2]

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

Definition at line 536 of file ELEMENT.cs.

537 {
538 Dictionary<int, int> dictionary = new Dictionary<int, int>();
539 if (list != null)
540 {
541 for (int i = 0; i < list.Length / 2; i++)
542 {
543 dictionary[list[i * 2]] = list[i * 2 + 1];
544 }
545 }
546 return dictionary;
547 }

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 549 of file ELEMENT.cs.

550 {
551 if (list != null)
552 {
553 for (int i = 0; i < list.Length / 2; i++)
554 {
555 map[list[i * 2]] = list[i * 2 + 1];
556 }
557 }
558 return map;
559 }

◆ GetIcon()

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

Reimplemented in Feat, LandFeat, RaceBonus, and Resistance.

Definition at line 453 of file ELEMENT.cs.

454 {
455 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);
456 }
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 1134 of file ELEMENT.cs.

1135 {
1136 return EClass.sources.elements.alias[alias].id;
1137 }

References SourceManager.elements, and EClass.sources.

Referenced by ActEffect.Proc().

◆ GetMaterialSourceValue()

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

Definition at line 426 of file ELEMENT.cs.

427 {
428 if (id == 2 || v < 0)
429 {
430 return v;
431 }
432 if (IsTrait)
433 {
434 if (t.IsFurniture)
435 {
436 return v;
437 }
438 return Mathf.Min(v + t.encLV * 10, 60);
439 }
440 return v * (100 + t.encLV * 10) / 100;
441 }
bool IsFurniture
Definition: Card.cs:2291
int encLV
Definition: Card.cs:327

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

Referenced by ElementContainer.ApplyMaterialElementMap().

◆ GetName()

static string Element.GetName ( string  alias)
inlinestatic

Definition at line 401 of file ELEMENT.cs.

402 {
403 return EClass.sources.elements.alias[alias].GetName();
404 }

References SourceManager.elements, and EClass.sources.

Referenced by TaskChopWood.OnCreateProgress().

◆ GetParent()

Element Element.GetParent ( Card  c)
inline

Definition at line 527 of file ELEMENT.cs.

528 {
529 if (!source.aliasParent.IsEmpty())
530 {
531 return c.elements.GetOrCreateElement(source.aliasParent);
532 }
533 return null;
534 }

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 1086 of file ELEMENT.cs.

1087 {
1088 return 100;
1089 }

Referenced by _WriteNote(), Dice.Create(), Act.Perform(), and Chara.UseAbility().

◆ GetRandomElement()

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

Definition at line 561 of file ELEMENT.cs.

562 {
563 if (lv > 100)
564 {
565 lv = 100;
566 }
567 if (ListElements.Count == 0)
568 {
569 foreach (SourceElement.Row row in EClass.sources.elements.rows)
570 {
571 if (row.categorySub == "eleAttack" && row.chance > 0)
572 {
573 ListElements.Add(row);
574 }
575 }
576 }
577 List<Tuple<SourceElement.Row, int>> list = new List<Tuple<SourceElement.Row, int>>();
578 foreach (SourceElement.Row listElement in ListElements)
579 {
580 int num = 40 * (listElement.eleP - 100) / 100;
581 if (list.Count == 0 || num < lv)
582 {
583 list.Add(new Tuple<SourceElement.Row, int>(listElement, num));
584 }
585 }
586 return (useWeight ? list.RandomItemWeighted((Tuple<SourceElement.Row, int> a) => 10000 / (100 + (lv - a.Item2) * 25)) : list.RandomItem()).Item1;
587 }
static List< SourceElement.Row > ListElements
Definition: ELEMENT.cs:273

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 1153 of file ELEMENT.cs.

1154 {
1155 int num = GetResistLv(v);
1156 if (power > 0 && num > 0)
1157 {
1158 num = Mathf.Max(num - power, 0);
1159 }
1160 if (num >= 4)
1161 {
1162 return 0L;
1163 }
1164 return num switch
1165 {
1166 3 => dmg / 4,
1167 2 => dmg / 3,
1168 1 => dmg / 2,
1169 0 => dmg,
1170 -1 => dmg * 3 / 2,
1171 -2 => dmg * 2,
1172 _ => dmg * 2,
1173 };
1174 }
static int GetResistLv(int v)
Definition: ELEMENT.cs:1139

References GetResistLv().

Referenced by Card.DamageHP().

◆ GetResistLv()

static int Element.GetResistLv ( int  v)
inlinestatic

Definition at line 1139 of file ELEMENT.cs.

1140 {
1141 int num = v / 5;
1142 if (num < -2)
1143 {
1144 num = -2;
1145 }
1146 if (num > 4)
1147 {
1148 num = 4;
1149 }
1150 return num;
1151 }

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

◆ GetSortVal()

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

Definition at line 1022 of file ELEMENT.cs.

1023 {
1024 switch (m)
1025 {
1026 case UIList.SortMode.ByCategory:
1027 return source.id + ((!source.aliasParent.IsEmpty()) ? (EClass.sources.elements.alias[source.aliasParent].id * 10000) : 0);
1028 case UIList.SortMode.ByNumber:
1029 return -vPotential * 10000 + source.id;
1030 case UIList.SortMode.ByElementParent:
1031 if (!source.aliasParent.IsEmpty())
1032 {
1033 return EClass.sources.elements.alias[source.aliasParent].sort;
1034 }
1035 return id;
1036 default:
1037 if (source.sort == 0)
1038 {
1039 return source.id;
1040 }
1041 return source.sort;
1042 }
1043 }
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 411 of file ELEMENT.cs.

412 {
413 return EClass.sources.elements.alias.TryGetValue(GetType().ToString());
414 }

References SourceManager.elements, and EClass.sources.

◆ GetSourcePotential()

virtual int Element.GetSourcePotential ( int  v)
inlinevirtual

Reimplemented in Skill.

Definition at line 416 of file ELEMENT.cs.

417 {
418 return 0;
419 }

Referenced by ElementContainer.ApplyElementMap().

◆ GetSourceValue()

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

Reimplemented in Ability.

Definition at line 443 of file ELEMENT.cs.

444 {
445 return type switch
446 {
447 SourceValueType.Chara => v * (100 + (lv - 1 + EClass.rnd(lv / 2 + 1)) * source.lvFactor / 10) / 100 + (long)EClass.rnd(lv / 3) * (long)source.lvFactor / 100,
448 SourceValueType.Fixed => v,
449 _ => v * ((source.encFactor == 0) ? 100 : (50 + EClass.rnd(100) + (long)EClass.rnd((int)Mathf.Sqrt(lv * 100)) * (long)source.encFactor / 100)) / 100,
450 };
451 }
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 421 of file ELEMENT.cs.

422 {
423 return null;
424 }

Referenced by AddHeaderAbility().

◆ HasTag()

◆ IsActive()

bool Element.IsActive ( Card  c)
inline

Definition at line 458 of file ELEMENT.cs.

459 {
460 if (IsGlobalElement && c != null && !c.c_idDeity.IsEmpty() && c.c_idDeity != EClass.pc.idFaith)
461 {
462 return false;
463 }
464 return Value != 0;
465 }
string c_idDeity
Definition: Card.cs:1607
string idFaith
Definition: Chara.cs:233

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

Referenced by AddEncNote().

◆ IsFactionElement()

bool Element.IsFactionElement ( Chara  c)
inline

Definition at line 498 of file ELEMENT.cs.

499 {
500 if (c == null)
501 {
502 return false;
503 }
504 if (c.IsPCFaction)
505 {
506 foreach (Element value in EClass.pc.faction.charaElements.dict.Values)
507 {
508 if (value.id == id && value.Value > 0)
509 {
510 return true;
511 }
512 }
513 }
514 if (c.faithElements != null)
515 {
516 foreach (Element value2 in c.faithElements.dict.Values)
517 {
518 if (value2.id == id && value2.Value > 0)
519 {
520 return true;
521 }
522 }
523 }
524 return false;
525 }
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 1106 of file ELEMENT.cs.

1107 {
1108 return false;
1109 }

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

◆ OnChangeValue()

virtual void Element.OnChangeValue ( )
inlinevirtual

Reimplemented in Ability, AttbMain, and Skill.

Definition at line 977 of file ELEMENT.cs.

978 {
979 }

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 973 of file ELEMENT.cs.

974 {
975 }

Referenced by _WriteNote().

◆ SetImage()

void Element.SetImage ( Image  i)
inline

Definition at line 483 of file ELEMENT.cs.

484 {
485 Sprite icon = GetIcon();
486 if ((bool)icon)
487 {
488 i.sprite = icon;
489 i.SetNativeSize();
490 }
491 }
virtual Sprite GetIcon(string suffix="")
Definition: ELEMENT.cs:453

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 1091 of file ELEMENT.cs.

1092 {
1093 string text2 = DisplayValue.ToString() ?? "";
1094 if (ShowXP)
1095 {
1096 text2 += ".".TagSize((vExp / 10).ToString("D2") ?? "", 11);
1097 }
1098 if (vLink != 0)
1099 {
1100 string text3 = ((vLink > 0) ? "+" : "") + (shorten ? vLink.ToShortNumber() : ((object)vLink));
1101 text2 = "<color=" + ((DisplayValue > ValueWithoutLink) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad).ToHex() + ">" + text2 + (" (" + text3 + ")").TagSize(13) + "</color>";
1102 }
1103 text.text = text2;
1104 }
virtual bool ShowXP
Definition: ELEMENT.cs:322

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 467 of file ELEMENT.cs.

468 {
469 int num = ((source.sort != 0) ? source.sort : id);
470 return (IsFlag ? 100000 : 0) + ((!charaSheet && IsGlobalElement) ? (-1000000) : 0) + (((IsFoodTrait || IsTrait) && owner != null && owner.Card != null && owner.Card.ShowFoodEnc) ? 10000 : 0) + num;
471 }
bool IsFlag
Definition: ELEMENT.cs:307

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 589 of file ELEMENT.cs.

590 {
591 n.Clear();
592 _WriteNote(n, owner, onWriteNote, isRef: false);
593 n.Build();
594 }
void _WriteNote(UINote n, Chara c, Act act)
Definition: ELEMENT.cs:611
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 596 of file ELEMENT.cs.

597 {
598 n.Clear();
599 _WriteNote(n, owner, onWriteNote, isRef: false);
600 if (refEle.Value > 0)
601 {
602 refEle._WriteNote(n, owner, onWriteNote, isRef: true);
603 }
605 {
607 }
608 n.Build();
609 }
virtual void WritePurchaseReq(UINote n, int lv=1)
Definition: ELEMENT.cs:1111
virtual bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
Definition: ELEMENT.cs:1106

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 1111 of file ELEMENT.cs.

1112 {
1113 }

Referenced by WriteNoteWithRef().

Member Data Documentation

◆ _source

SourceElement.Row Element._source

Definition at line 253 of file ELEMENT.cs.

◆ Div

const int Element.Div = 5
static

Definition at line 241 of file ELEMENT.cs.

◆ id

int Element.id

Definition at line 255 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(), DNA.Generate(), Get(), GoalAutoCombat.GetAbilities(), Card.GetBestAttribute(), DNA.GetInvalidAction(), DNA.GetInvalidFeat(), ElementContainer.GetOrCreateElement(), Recipe.GetQualityBonus(), RecipeManager.GetRecipeLearnState(), ElementContainer.GetSortVal(), GetSortVal(), RecipeSource.GetSPCost(), Act.GetText(), Chara.GiveGift(), IsFactionElement(), 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(), ElementContainer.OnSerializing(), FactionBranch.OnUnclaimZone(), ElementContainerFaction.OnUnequip(), ConStrife.OnWriteNote(), ResearchPlan.ParseReward(), Act.Perform(), AttackProcess.Perform(), FoodEffect.Proc(), ActEffect.Proc(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), FoodEffect.ProcTrait(), Religion.Reforge(), 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.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 249 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 245 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 247 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 275 of file ELEMENT.cs.

Referenced by SourceManager.Init().

◆ ListElements

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

Definition at line 273 of file ELEMENT.cs.

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

◆ owner

◆ vBase

◆ vExp

◆ vLink

◆ Void

◆ vPotential

◆ vSource

◆ vSourcePotential

int Element.vSourcePotential

Definition at line 269 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ vTempPotential

Property Documentation

◆ act

◆ CanGainExp

virtual bool Element.CanGainExp
get

Definition at line 305 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp().

◆ CostLearn

virtual int Element.CostLearn
get

◆ CostTrain

virtual int Element.CostTrain
get

Definition at line 317 of file ELEMENT.cs.

Referenced by CalcPlat.Train().

◆ DisplayValue

virtual int Element.DisplayValue
get

◆ ExpToNext

virtual int Element.ExpToNext
get

Definition at line 313 of file ELEMENT.cs.

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

◆ FullName

virtual string Element.FullName
get

Definition at line 311 of file ELEMENT.cs.

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

◆ IsFactionWideElement

bool Element.IsFactionWideElement
get

Definition at line 361 of file ELEMENT.cs.

Referenced by AddEncNote().

◆ IsFlag

bool Element.IsFlag
get

◆ IsFoodTrait

◆ IsFoodTraitMain

bool Element.IsFoodTraitMain
get

Definition at line 371 of file ELEMENT.cs.

372 {
373 get
374 {
375 if (IsFoodTrait)
376 {
377 if (!source.tag.Contains("primary"))
378 {
379 return source.tag.Contains("foodpot");
380 }
381 return true;
382 }
383 return false;
384 }
385 }

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 349 of file ELEMENT.cs.

350 {
351 get
352 {
353 if (vExp != -1)
354 {
355 return vExp == -2;
356 }
357 return true;
358 }
359 }

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

◆ IsMainAttribute

bool Element.IsMainAttribute
get

Definition at line 387 of file ELEMENT.cs.

388 {
389 get
390 {
391 if (source.category == "attribute")
392 {
393 return source.tag.Contains("primary");
394 }
395 return false;
396 }
397 }

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

◆ IsPartyWideElement

bool Element.IsPartyWideElement
get

Definition at line 363 of file ELEMENT.cs.

◆ IsTrait

◆ MinPotential

virtual int Element.MinPotential
get

Definition at line 301 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ MinValue

virtual int Element.MinValue
get

Definition at line 295 of file ELEMENT.cs.

◆ Name

◆ Potential

int Element.Potential
get

Definition at line 303 of file ELEMENT.cs.

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

◆ PotentialAsStock

virtual bool Element.PotentialAsStock
get

Definition at line 341 of file ELEMENT.cs.

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

◆ ShortName

virtual string Element.ShortName
get

Definition at line 347 of file ELEMENT.cs.

Referenced by ButtonElement.SetGrid().

◆ ShowBonuses

virtual bool Element.ShowBonuses
get

Definition at line 345 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowEncNumber

virtual bool Element.ShowEncNumber
get

Definition at line 365 of file ELEMENT.cs.

◆ ShowMsgOnValueChanged

virtual bool Element.ShowMsgOnValueChanged
get

Definition at line 333 of file ELEMENT.cs.

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

◆ ShowPotential

virtual bool Element.ShowPotential
get

Definition at line 337 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowRelativeAttribute

virtual bool Element.ShowRelativeAttribute
get

Definition at line 343 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowValue

virtual bool Element.ShowValue
get

Definition at line 335 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowXP

virtual bool Element.ShowXP
get

Definition at line 321 of file ELEMENT.cs.

322 {
323 get
324 {
326 {
327 return source.category != "attribute";
328 }
329 return true;
330 }
331 }

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

◆ source

SourceElement.Row Element.source
get

Definition at line 277 of file ELEMENT.cs.

278 {
279 get
280 {
282 if (row == null)
283 {
284 SourceElement.Row obj = ((id == 0) ? GetSource() : Get(id)) ?? EClass.sources.elements.rows[0];
285 SourceElement.Row row2 = obj;
286 _source = obj;
287 row = row2;
288 }
289 return row;
290 }
291 }
virtual SourceElement.Row GetSource()
Definition: ELEMENT.cs:411
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:406
SourceElement.Row _source
Definition: ELEMENT.cs:253

Referenced by BaseCondition._WriteNote(), _WriteNote(), AddEncNote(), ElementContainer.AddNoteAll(), 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(), DNA.Generate(), CraftUtil.GetBloodText(), 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(), 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(), FoodEffect.Proc(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), ButtonElement.Refresh(), CharaAbility.Refresh(), UICharaMaker.Refresh(), WindowCharaMini.Refresh(), Card.RefreshColor(), LayerHome.RefreshFeat(), WindowChara.RefreshSkill(), WindowChara.RefreshStatic(), AI_Eat.Run(), AI_Idle.Run(), AI_PlayMusic.Run(), LayerAbility.SelectGroup(), ButtonAbility.SetAct(), Chara.SetFeat(), 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 315 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp().

◆ UsePotential

virtual bool Element.UsePotential
get

Definition at line 339 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp().

◆ Value

int Element.Value
get

Definition at line 297 of file ELEMENT.cs.

Referenced by TraitAltar._OnOffer(), BaseCondition._WriteNote(), Chara.AddCondition(), AddEncNote(), ElementContainer.AddNote(), Feat.Apply(), GrowSystem.ApplySeed(), Chara.CalcCastingChance(), CraftUtil.GetBloodText(), GetCost(), Check.GetDC(), 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(), FoodEffect.Proc(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), 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(), WriteNoteWithRef(), Feat.WritePurchaseReq(), and Recipe.WriteReqSkill().

◆ ValueWithoutLink


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