Elin Decompiled Documentation EA 23.130 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 int GetSourceValue (int 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)
 
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)
 
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 int GetResistDamage (int dmg, int v, int power=0)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
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 84 of file ELEMENT.cs.

Member Function Documentation

◆ _WriteNote() [1/2]

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

Definition at line 602 of file ELEMENT.cs.

603 {
605 Act.Cost cost = e.GetCost(c);
606 int p = e.GetPower(c);
607 n.Space(6);
608 string text = source.GetText("textExtra");
609 if (!text.IsEmpty())
610 {
611 string[] array = text.Split(',');
612 foreach (string text2 in array)
613 {
614 if (text2.StartsWith("@"))
615 {
616 Condition condition = Condition.Create(text2.Replace("@", ""), p);
617 condition.owner = c;
618 if (!source.aliasRef.IsEmpty())
619 {
620 condition.SetElement(EClass.sources.elements.alias[source.aliasRef].id);
621 }
622 switch (act.id)
623 {
624 case 6902:
625 condition.SetRefVal(79, 267);
626 break;
627 case 8510:
628 case 8710:
629 condition.SetRefVal(79, (act.id == 8710) ? 222 : 221);
630 break;
631 }
632 n.AddText("_bullet".lang() + (condition.HasDuration ? "hintCon" : "hintCon2").lang(condition.Name, condition.EvaluateTurn(p).ToString() ?? ""));
633 condition._WriteNote(n, asChild: true);
634 }
635 else
636 {
637 string text3 = text2.Replace("#calc", Calc());
638 if (!source.aliasRef.IsEmpty())
639 {
640 text3 = text3.Replace("#ele", EClass.sources.elements.alias[source.aliasRef].GetName().ToLower());
641 }
642 n.AddText("_bullet".lang() + text3);
643 }
644 }
645 }
646 if (source.tag.Contains("syncRide"))
647 {
648 n.AddText("_bullet".lang() + "hintSyncRide".lang());
649 }
651 {
652 int i = id;
653 if (i != 8230 && i != 8232)
654 {
655 n.AddText("_bullet".lang() + "hintPartyAbility".lang());
656 }
657 }
658 if (!act.LocalAct)
659 {
660 n.Space();
661 n.AddText("isGlobalAct".lang());
662 }
663 if (cost.type == Act.CostType.None || cost.cost == 0)
664 {
665 return;
666 }
667 n.Space(4);
668 UIItem uIItem = n.AddExtra<UIItem>("costPrice");
669 int num = cost.cost;
670 if (cost.type == Act.CostType.MP)
671 {
672 if (c.Evalue(483) > 0)
673 {
674 num = cost.cost * 100 / (100 + (int)Mathf.Sqrt(c.Evalue(483) * 10) * 3);
675 }
676 if (c.IsPC && c.HasCondition<StanceManaCost>())
677 {
678 int num2 = c.Evalue(1657);
679 if (num2 > 0 && vPotential >= 2)
680 {
681 num = num * (100 - num2 * 20) / 100;
682 }
683 }
684 }
685 string text4 = cost.cost.ToString() ?? "";
686 if (num != cost.cost)
687 {
688 text4 = num + " (" + text4 + ")";
689 }
690 uIItem.text1.SetText(text4, (((cost.type == Act.CostType.MP) ? c.mana.value : c.stamina.value) >= num) ? FontColor.Good : FontColor.Bad);
691 uIItem.image1.sprite = ((cost.type == Act.CostType.MP) ? EClass.core.refs.icons.mana : EClass.core.refs.icons.stamina);
692 uIItem.image1.SetNativeSize();
693 string Calc()
694 {
695 Dice dice = Dice.Create(e, c);
696 if (dice == null)
697 {
698 return p.ToString() ?? "";
699 }
700 return dice.ToString();
701 }
702 }
FontColor
Definition: FontColor.cs:2
Definition: ACT.cs:62
CostType
Definition: ACT.cs:64
virtual bool LocalAct
Definition: ACT.cs:169
virtual bool HaveLongPressAction
Definition: ACT.cs:131
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:37
int Evalue(int ele)
Definition: Card.cs:2471
override bool IsPC
Definition: Chara.cs:602
bool HasCondition(string alias)
Definition: Chara.cs:8666
Stats stamina
Definition: Chara.cs:960
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
Sprite mana
Definition: CoreRef.cs:122
Sprite stamina
Definition: CoreRef.cs:124
Icons icons
Definition: CoreRef.cs:341
CoreRef refs
Definition: Core.cs:51
Definition: Dice.cs:4
override string ToString()
Definition: Dice.cs:91
static Dice Create(Element ele, Card c)
Definition: Dice.cs:96
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:42
Element GetOrCreateElement(Element ele)
int id
Definition: ELEMENT.cs:246
SourceElement.Row source
Definition: ELEMENT.cs:269
int vPotential
Definition: ELEMENT.cs:252
virtual int GetPower(Card c)
Definition: ELEMENT.cs:1065
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1019
Act act
Definition: ELEMENT.cs:390
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:159
Definition: ACT.cs:71
CostType type
Definition: ACT.cs:74
int cost
Definition: ACT.cs:72

References BaseCondition._WriteNote(), act, UINote.AddText(), EClass.core, Act.Cost.cost, Dice.Create(), Condition.Create(), Card.elements, SourceManager.elements, BaseCondition.EvaluateTurn(), Card.Evalue(), GetCost(), ElementContainer.GetOrCreateElement(), GetPower(), Chara.HasCondition(), BaseCondition.HasDuration, Act.HaveLongPressAction, CoreRef.icons, id, UIItem.image1, Chara.IsPC, Act.LocalAct, CoreRef.Icons.mana, BaseCondition.Name, 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 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 711 of file ELEMENT.cs.

712 {
713 if (addHeader)
714 {
715 if (isRef)
716 {
717 UIText.globalSizeMod = -2;
718 n.AddHeader("prevElement".lang(FullName));
719 }
720 else if (this is Act)
721 {
723 n.Space(8);
724 }
725 else
726 {
727 n.AddHeader(FullName.ToTitleCase(wholeText: true));
728 }
729 }
730 string detail = GetDetail();
731 if (!detail.IsEmpty())
732 {
733 n.AddText("NoteText_flavor_element", detail);
734 n.Space(6);
735 }
736 int num = vLink;
737 if (owner.Chara != null && owner.Chara.IsPCFaction)
738 {
740 }
741 bool flag = ShowValue;
742 bool flag2 = ShowRelativeAttribute;
743 if (source.category == "landfeat")
744 {
745 flag = false;
746 flag2 = false;
747 }
748 if (this is Act)
749 {
750 Act act = ACT.Create(source.id);
751 UIItem uIItem = n.AddItem("ItemAbility");
752 uIItem.text1.text = "vValue".lang(DisplayValue.ToString() ?? "", ValueWithoutLink + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num))));
753 uIItem.text2.text = act.TargetType.ToString().lang();
754 uIItem.text3.text = ((this is Spell) ? (owner.Chara.CalcCastingChance(owner.GetOrCreateElement(act.source.id)) + "%") : "-") ?? "";
755 }
756 else if (flag)
757 {
758 n.AddTopic("TopicLeft", "vCurrent".lang(), "vValue".lang(DisplayValue.ToString() ?? "", ValueWithoutLink + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num)))));
759 if (ShowPotential)
760 {
761 num = vTempPotential;
762 n.AddTopic("TopicLeft", "vPotential".lang(), "vValue".lang(Potential.ToString() ?? "", vPotential + vSourcePotential + MinPotential + ((num == 0) ? "" : ((num > 0) ? (" + " + num) : (" - " + -num)))));
763 }
765 }
766 if (flag2 && !source.aliasParent.IsEmpty())
767 {
768 Element element = Create(source.aliasParent);
769 UIItem uIItem2 = n.AddItem("ItemRelativeAttribute");
770 uIItem2.text1.SetText(element.Name);
771 element.SetImage(uIItem2.image1);
772 bool flag3 = source.lvFactor > 0 && this is Act;
773 uIItem2.text2.SetActive(flag3);
774 uIItem2.text3.SetActive(flag3);
775 if (flag3)
776 {
777 uIItem2.text2.SetText(GetPower(EClass.pc).ToString() ?? "");
778 }
779 }
780 OnWriteNote(n, owner);
782 {
783 n.AddTopic("TopicLeft", "Class:", GetType()?.ToString() ?? "");
784 n.AddTopic("TopicLeft", "vExp".lang(), vExp.ToString() ?? "");
785 n.AddTopic("TopicLeft", "vSource", vSource.ToString() ?? "");
786 n.AddTopic("TopicLeft", "vSourcePotential", vSourcePotential.ToString() ?? "");
787 n.AddTopic("TopicLeft", "vPotential", vPotential.ToString() ?? "");
788 n.AddTopic("TopicLeft", "Potential", Potential.ToString() ?? "");
789 }
791 onWriteNote?.Invoke(n);
792 if (ShowBonuses && owner.Chara != null)
793 {
794 BonusInfo bonusInfo = new BonusInfo();
795 bonusInfo.ele = this;
796 bonusInfo.n = n;
797 bonusInfo.c = owner.Chara;
798 bonusInfo.WriteNote();
799 }
800 UIText.globalSizeMod = 0;
801 }
Definition: ACT.cs:6
static Act Create(int id)
Definition: ACT.cs:36
virtual TargetType TargetType
Definition: ACT.cs:140
Faction faction
Definition: Chara.cs:417
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: Chara.cs:6655
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:5593
override bool IsPCFaction
Definition: Chara.cs:661
bool showExtra
Definition: CoreDebug.cs:167
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
int Value(int ele)
virtual Chara Chara
virtual bool ShowPotential
Definition: ELEMENT.cs:328
virtual int DisplayValue
Definition: ELEMENT.cs:284
int ValueWithoutLink
Definition: ELEMENT.cs:290
int Potential
Definition: ELEMENT.cs:294
int vExp
Definition: ELEMENT.cs:250
ElementContainer owner
Definition: ELEMENT.cs:262
int vTempPotential
Definition: ELEMENT.cs:254
virtual string FullName
Definition: ELEMENT.cs:302
void AddHeaderAbility(UINote n)
Definition: ELEMENT.cs:704
void SetImage(Image i)
Definition: ELEMENT.cs:474
void CheckLevelBonus(ElementContainer owner, UINote n=null)
Definition: ELEMENT.cs:959
virtual bool ShowRelativeAttribute
Definition: ELEMENT.cs:334
virtual string Name
Definition: ELEMENT.cs:300
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1094
int vLink
Definition: ELEMENT.cs:256
virtual bool ShowBonuses
Definition: ELEMENT.cs:336
virtual bool PotentialAsStock
Definition: ELEMENT.cs:332
int vSource
Definition: ELEMENT.cs:258
int vSourcePotential
Definition: ELEMENT.cs:260
virtual void OnWriteNote(UINote n, ElementContainer owner)
Definition: ELEMENT.cs:951
virtual string GetDetail()
Definition: ELEMENT.cs:484
virtual int MinPotential
Definition: ELEMENT.cs:292
virtual bool ShowValue
Definition: ELEMENT.cs:326
ElementContainerFaction charaElements
Definition: FACTION.cs:144
Definition: SPELL.cs:517
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 803 of file ELEMENT.cs.

804 {
805 string text = "";
806 switch (mode)
807 {
808 case ElementContainer.NoteMode.Domain:
809 n.AddText(Name, FontColor.Default);
810 return;
811 case ElementContainer.NoteMode.Default:
812 case ElementContainer.NoteMode.BonusTrait:
813 {
814 bool flag = source.tag.Contains("common");
815 string categorySub = source.categorySub;
816 bool flag2 = false;
817 bool flag3 = (source.tag.Contains("neg") ? (Value > 0) : (Value < 0));
818 int num = Mathf.Abs(Value);
819 bool flag4 = Card?.ShowFoodEnc ?? false;
820 bool flag5 = Card != null && Card.IsWeapon && this is Ability;
821 if (IsTrait || (flag4 && IsFoodTrait))
822 {
823 string[] textArray = source.GetTextArray("textAlt");
824 int num2 = Mathf.Clamp(Value / 10 + 1, (Value < 0 || textArray.Length <= 2) ? 1 : 2, textArray.Length - 1);
825 text = "altEnc".lang(textArray[0].IsEmpty(Name), textArray[num2], EClass.debug.showExtra ? (Value + " " + Name) : "");
826 flag3 = num2 <= 1 || textArray.Length <= 2;
827 flag2 = true;
828 }
829 else if (flag5)
830 {
831 text = "isProc".lang(Name);
832 flag3 = false;
833 }
834 else if (categorySub == "resist")
835 {
836 text = ("isResist" + (flag3 ? "Neg" : "")).lang(Name);
837 }
838 else if (categorySub == "eleAttack")
839 {
840 text = "isEleAttack".lang(Name);
841 }
842 else if (!source.textPhase.IsEmpty() && Value > 0)
843 {
844 text = source.GetText("textPhase");
845 }
846 else
847 {
848 string name = Name;
849 bool flag6 = source.category == "skill" || (source.category == "attribute" && !source.textPhase.IsEmpty());
850 bool flag7 = source.category == "enchant";
851 if (source.tag.Contains("multiplier"))
852 {
853 flag6 = (flag7 = false);
854 name = EClass.sources.elements.alias[source.aliasRef].GetName();
855 }
856 flag2 = !(flag6 || flag7);
857 text = (flag6 ? "textEncSkill" : (flag7 ? "textEncEnc" : "textEnc")).lang(name, num + (source.tag.Contains("ratio") ? "%" : ""), ((Value > 0) ? "encIncrease" : "encDecrease").lang());
858 }
859 int num3 = ((!(this is Resistance)) ? 1 : 0);
860 int num4 = 5;
861 if (id == 484)
862 {
863 num3 = 0;
864 num4 = 1;
865 }
866 if (!flag && !flag2 && !source.tag.Contains("flag"))
867 {
868 text = text + " [" + "*".Repeat(Mathf.Clamp(num * source.mtp / num4 + num3, 1, 5)) + ((num * source.mtp / num4 + num3 > 5) ? "+" : "") + "]";
869 }
870 if (HasTag("hidden") && mode != ElementContainer.NoteMode.BonusTrait)
871 {
872 text = "(debug)" + text;
873 }
874 FontColor color = (flag ? FontColor.Default : (flag3 ? FontColor.Bad : FontColor.Good));
875 if (IsGlobalElement)
876 {
877 text = text + " " + (IsFactionWideElement ? "_factionWide" : "_partyWide").lang();
878 if (!IsActive(Card))
879 {
880 return;
881 }
882 color = FontColor.Myth;
883 }
884 if (flag4 && IsFoodTrait && !IsFoodTraitMain)
885 {
886 color = FontColor.FoodMisc;
887 }
888 if (id == 2 && Value >= 0)
889 {
890 color = FontColor.FoodQuality;
891 }
892 if (funcText != null)
893 {
894 text = funcText(this, text);
895 }
896 UIItem uIItem = n.AddText("NoteText_enc", text, color);
897 Sprite sprite = EClass.core.refs.icons.enc.enc;
898 Thing thing = Card?.Thing;
899 if (thing != null)
900 {
901 if (thing.material.HasEnc(id))
902 {
903 sprite = EClass.core.refs.icons.enc.mat;
904 }
905 foreach (int key in thing.source.elementMap.Keys)
906 {
907 if (key == id)
908 {
909 sprite = EClass.core.refs.icons.enc.card;
910 }
911 }
912 if (thing.ShowFoodEnc && IsFoodTrait)
913 {
915 }
916 if (id == thing.GetInt(107))
917 {
918 sprite = EClass.core.refs.icons.enc.cat;
919 }
920 if (thing.GetRuneEnc(id) != null)
921 {
922 sprite = EClass.core.refs.icons.enc.rune;
923 }
924 }
925 if ((bool)sprite)
926 {
927 uIItem.image1.SetActive(enable: true);
928 uIItem.image1.sprite = sprite;
929 }
930 uIItem.image2.SetActive(source.IsWeaponEnc);
931 onAddNote?.Invoke(n, this);
932 return;
933 }
934 }
935 UIItem uIItem2 = n.AddTopic("TopicAttribute", Name, "".TagColor((ValueWithoutLink > 0) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad, ValueWithoutLink.ToString() ?? ""));
936 if ((bool)uIItem2.button1)
937 {
938 uIItem2.button1.tooltip.onShowTooltip = delegate(UITooltip t)
939 {
941 };
942 }
943 SetImage(uIItem2.image1);
944 Image image = uIItem2.image2;
945 int value = (Potential - 80) / 20;
946 image.enabled = Potential != 80;
947 image.sprite = EClass.core.refs.spritesPotential[Mathf.Clamp(Mathf.Abs(value), 0, EClass.core.refs.spritesPotential.Count - 1)];
948 image.color = ((Potential - 80 >= 0) ? Color.white : new Color(1f, 0.7f, 0.7f));
949 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
Definition: Card.cs:11
SourceMaterial.Row material
Definition: Card.cs:1951
SocketData GetRuneEnc(int idEle)
Definition: Card.cs:3415
virtual Thing Thing
Definition: Card.cs:1958
bool ShowFoodEnc
Definition: Card.cs:2090
Sprite traitFood
Definition: CoreRef.cs:71
List< Sprite > spritesPotential
Definition: CoreRef.cs:361
bool HasTag(string tag)
Definition: ELEMENT.cs:469
int Value
Definition: ELEMENT.cs:288
bool IsFoodTrait
Definition: ELEMENT.cs:360
void WriteNote(UINote n, ElementContainer owner=null, Action< UINote > onWriteNote=null)
Definition: ELEMENT.cs:580
bool IsGlobalElement
Definition: ELEMENT.cs:341
bool IsTrait
Definition: ELEMENT.cs:358
bool IsFactionWideElement
Definition: ELEMENT.cs:352
bool IsFoodTraitMain
Definition: ELEMENT.cs:363
bool IsActive(Card c)
Definition: ELEMENT.cs:449
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, CoreRef.Icons.Enc.cat, Color, EClass.core, 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, Name, UITooltip.note, EClass.pc, Potential, Core.refs, CoreRef.Icons.Enc.rune, SetImage(), 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 704 of file ELEMENT.cs.

705 {
706 UIItem uIItem = n.AddHeader("HeaderAbility", FullName.ToTitleCase(wholeText: true), GetSprite());
707 uIItem.text2.text = ((this is Spell) ? (vPotential.ToString() ?? "") : "-");
708 (this as Act)?.SetImage(uIItem.image1);
709 }
virtual Sprite GetSprite()
Definition: ELEMENT.cs:412

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

960 {
961 if (owner == null || source.levelBonus.IsEmpty())
962 {
963 return;
964 }
965 bool flag = n == null;
966 string[] array = (source.GetText("levelBonus", returnNull: true) ?? source.levelBonus).Split(Environment.NewLine.ToCharArray());
967 if (!flag)
968 {
969 n.Space(10);
970 }
971 string[] array2 = array;
972 foreach (string obj in array2)
973 {
974 string[] array3 = obj.Split(',');
975 int lv = array3[0].ToInt();
976 SourceElement.Row row = (EClass.sources.elements.alias.ContainsKey(array3[1]) ? EClass.sources.elements.alias[array3[1]] : null);
977 if (flag)
978 {
979 if (lv > ValueWithoutLink)
980 {
981 break;
982 }
983 if (row != null && !owner.Has(row.id) && owner is ElementContainerZone)
984 {
985 owner.Learn(row.id);
986 }
987 }
988 else
989 {
990 string s = ((row != null) ? row.GetName() : array3[1]);
991 n.AddText((" Lv " + lv).TagColor(FontColor.Topic) + " " + s.TagColorGoodBad(() => (row != null) ? owner.Has(row.id) : (lv <= ValueWithoutLink), () => false));
992 }
993 }
994 if (!flag)
995 {
996 n.Space(4);
997 }
998 }
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 1108 of file ELEMENT.cs.

1109 {
1110 return Create(EClass.sources.elements.alias[id].id, v);
1111 }

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

1020 {
1021 if (source.cost[0] == 0)
1022 {
1023 Act.Cost result = default(Act.Cost);
1024 result.type = Act.CostType.None;
1025 return result;
1026 }
1027 Act.Cost result2 = default(Act.Cost);
1028 if (this is Spell)
1029 {
1030 result2.type = Act.CostType.MP;
1031 int num = EClass.curve(Value, 50, 10);
1032 result2.cost = source.cost[0] * (100 + ((!source.tag.Contains("noCostInc")) ? (num * 3) : 0)) / 100;
1033 }
1034 else
1035 {
1036 result2.type = Act.CostType.SP;
1037 result2.cost = source.cost[0];
1038 switch (source.id)
1039 {
1040 case 6020:
1041 result2.cost = c.stamina.max / 3 + 10;
1042 break;
1043 case 6664:
1044 {
1045 int num2 = -2;
1046 foreach (BodySlot slot in c.body.slots)
1047 {
1048 if (slot.thing != null && slot.thing.IsMeleeWeapon)
1049 {
1050 num2++;
1051 }
1052 }
1053 result2.cost += num2 * 2;
1054 break;
1055 }
1056 }
1057 }
1058 if (!c.IsPC && result2.cost > 2)
1059 {
1060 result2.cost /= 2;
1061 }
1062 return result2;
1063 }
Thing thing
Definition: BodySlot.cs:8
bool IsMeleeWeapon
Definition: Card.cs:2141
List< BodySlot > slots
Definition: CharaBody.cs:8
CharaBody body
Definition: Chara.cs:94
static int curve(int a, int start, int step, int rate=75)
Definition: EClass.cs:63

References Chara.body, Act.Cost.cost, EClass.curve(), Card.IsMeleeWeapon, Chara.IsPC, CharaBody.slots, source, BodySlot.thing, and Value.

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

◆ GetDetail()

virtual string Element.GetDetail ( )
inlinevirtual

Definition at line 484 of file ELEMENT.cs.

485 {
486 return source.GetDetail();
487 }

References source.

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

◆ GetElementMap() [1/2]

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

Definition at line 527 of file ELEMENT.cs.

528 {
529 Dictionary<int, int> dictionary = new Dictionary<int, int>();
530 if (list != null)
531 {
532 for (int i = 0; i < list.Length / 2; i++)
533 {
534 dictionary[list[i * 2]] = list[i * 2 + 1];
535 }
536 }
537 return dictionary;
538 }

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

541 {
542 if (list != null)
543 {
544 for (int i = 0; i < list.Length / 2; i++)
545 {
546 map[list[i * 2]] = list[i * 2 + 1];
547 }
548 }
549 return map;
550 }

◆ GetIcon()

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

Reimplemented in Feat, LandFeat, RaceBonus, and Resistance.

Definition at line 444 of file ELEMENT.cs.

445 {
446 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);
447 }
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 1113 of file ELEMENT.cs.

1114 {
1115 return EClass.sources.elements.alias[alias].id;
1116 }

References SourceManager.elements, and EClass.sources.

◆ GetMaterialSourceValue()

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

Definition at line 417 of file ELEMENT.cs.

418 {
419 if (id == 2 || v < 0)
420 {
421 return v;
422 }
423 if (IsTrait)
424 {
425 if (t.IsFurniture)
426 {
427 return v;
428 }
429 return Mathf.Min(v + t.encLV * 10, 60);
430 }
431 return v * (100 + t.encLV * 10) / 100;
432 }
bool IsFurniture
Definition: Card.cs:2151
int encLV
Definition: Card.cs:310

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

Referenced by ElementContainer.ApplyMaterialElementMap().

◆ GetName()

static string Element.GetName ( string  alias)
inlinestatic

Definition at line 392 of file ELEMENT.cs.

393 {
394 return EClass.sources.elements.alias[alias].GetName();
395 }

References SourceManager.elements, and EClass.sources.

Referenced by TaskChopWood.OnCreateProgress().

◆ GetParent()

Element Element.GetParent ( Card  c)
inline

Definition at line 518 of file ELEMENT.cs.

519 {
520 if (!source.aliasParent.IsEmpty())
521 {
522 return c.elements.GetOrCreateElement(source.aliasParent);
523 }
524 return null;
525 }

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

1066 {
1067 return 100;
1068 }

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

◆ GetRandomElement()

static SourceElement.Row Element.GetRandomElement ( int  lv = 1)
inlinestatic

Definition at line 552 of file ELEMENT.cs.

553 {
554 if (lv > 100)
555 {
556 lv = 100;
557 }
558 if (ListElements.Count == 0)
559 {
560 foreach (SourceElement.Row row in EClass.sources.elements.rows)
561 {
562 if (row.categorySub == "eleAttack" && row.chance > 0)
563 {
564 ListElements.Add(row);
565 }
566 }
567 }
568 List<Tuple<SourceElement.Row, int>> list = new List<Tuple<SourceElement.Row, int>>();
569 foreach (SourceElement.Row listElement in ListElements)
570 {
571 int num = 40 * (listElement.eleP - 100) / 100;
572 if (list.Count == 0 || num < lv)
573 {
574 list.Add(new Tuple<SourceElement.Row, int>(listElement, num));
575 }
576 }
577 return list.RandomItemWeighted((Tuple<SourceElement.Row, int> a) => 10000 / (100 + (lv - a.Item2) * 25)).Item1;
578 }
static List< SourceElement.Row > ListElements
Definition: ELEMENT.cs:264

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

Referenced by TraitToolRangeCane.OnCreate().

◆ GetResistDamage()

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

Definition at line 1132 of file ELEMENT.cs.

1133 {
1134 int num = GetResistLv(v);
1135 if (power > 0 && num > 0)
1136 {
1137 num = Mathf.Max(num - power, 0);
1138 }
1139 if (num >= 4)
1140 {
1141 return 0;
1142 }
1143 return num switch
1144 {
1145 3 => dmg / 4,
1146 2 => dmg / 3,
1147 1 => dmg / 2,
1148 0 => dmg,
1149 -1 => dmg * 3 / 2,
1150 -2 => dmg * 2,
1151 _ => dmg * 2,
1152 };
1153 }
static int GetResistLv(int v)
Definition: ELEMENT.cs:1118

References GetResistLv().

Referenced by Card.DamageHP().

◆ GetResistLv()

static int Element.GetResistLv ( int  v)
inlinestatic

Definition at line 1118 of file ELEMENT.cs.

1119 {
1120 int num = v / 5;
1121 if (num < -2)
1122 {
1123 num = -2;
1124 }
1125 if (num > 4)
1126 {
1127 num = 4;
1128 }
1129 return num;
1130 }

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

◆ GetSortVal()

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

Definition at line 1000 of file ELEMENT.cs.

1001 {
1002 switch (m)
1003 {
1004 case UIList.SortMode.ByCategory:
1005 return source.id + ((!source.aliasParent.IsEmpty()) ? (EClass.sources.elements.alias[source.aliasParent].id * 10000) : 0);
1006 case UIList.SortMode.ByNumber:
1007 return -vPotential * 10000 + source.id;
1008 case UIList.SortMode.ByElementParent:
1009 if (!source.aliasParent.IsEmpty())
1010 {
1011 return EClass.sources.elements.alias[source.aliasParent].sort;
1012 }
1013 return id;
1014 default:
1015 return source.id;
1016 }
1017 }
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 402 of file ELEMENT.cs.

403 {
404 return EClass.sources.elements.alias.TryGetValue(GetType().ToString());
405 }

References SourceManager.elements, and EClass.sources.

◆ GetSourcePotential()

virtual int Element.GetSourcePotential ( int  v)
inlinevirtual

Reimplemented in Skill.

Definition at line 407 of file ELEMENT.cs.

408 {
409 return 0;
410 }

Referenced by ElementContainer.ApplyElementMap().

◆ GetSourceValue()

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

Reimplemented in Ability.

Definition at line 434 of file ELEMENT.cs.

435 {
436 return type switch
437 {
438 SourceValueType.Chara => v * (100 + (lv - 1 + EClass.rnd(lv / 2 + 1)) * source.lvFactor / 10) / 100 + EClass.rnd(lv / 3) * source.lvFactor / 100,
439 SourceValueType.Fixed => v,
440 _ => v * ((source.encFactor == 0) ? 100 : (50 + EClass.rnd(100) + EClass.rnd((int)Mathf.Sqrt(lv * 100)) * source.encFactor / 100)) / 100,
441 };
442 }
static int rnd(int a)
Definition: EClass.cs:58

References EClass.rnd(), and source.

Referenced by ElementContainer.ApplyElementMap().

◆ GetSprite()

virtual Sprite Element.GetSprite ( )
inlinevirtual

Reimplemented in Act.

Definition at line 412 of file ELEMENT.cs.

413 {
414 return null;
415 }

Referenced by AddHeaderAbility().

◆ HasTag()

◆ IsActive()

bool Element.IsActive ( Card  c)
inline

Definition at line 449 of file ELEMENT.cs.

450 {
451 if (IsGlobalElement && c != null && !c.c_idDeity.IsEmpty() && c.c_idDeity != EClass.pc.idFaith)
452 {
453 return false;
454 }
455 return Value != 0;
456 }
string c_idDeity
Definition: Card.cs:1505
string idFaith
Definition: Chara.cs:221

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

Referenced by AddEncNote().

◆ IsFactionElement()

bool Element.IsFactionElement ( Chara  c)
inline

Definition at line 489 of file ELEMENT.cs.

490 {
491 if (c == null)
492 {
493 return false;
494 }
495 if (c.IsPCFaction)
496 {
497 foreach (Element value in EClass.pc.faction.charaElements.dict.Values)
498 {
499 if (value.id == id && value.Value > 0)
500 {
501 return true;
502 }
503 }
504 }
505 if (c.faithElements != null)
506 {
507 foreach (Element value2 in c.faithElements.dict.Values)
508 {
509 if (value2.id == id && value2.Value > 0)
510 {
511 return true;
512 }
513 }
514 }
515 return false;
516 }
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 1085 of file ELEMENT.cs.

1086 {
1087 return false;
1088 }

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

◆ OnChangeValue()

virtual void Element.OnChangeValue ( )
inlinevirtual

Reimplemented in Ability, AttbMain, and Skill.

Definition at line 955 of file ELEMENT.cs.

956 {
957 }

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

952 {
953 }

Referenced by _WriteNote().

◆ SetImage()

void Element.SetImage ( Image  i)
inline

Definition at line 474 of file ELEMENT.cs.

475 {
476 Sprite icon = GetIcon();
477 if ((bool)icon)
478 {
479 i.sprite = icon;
480 i.SetNativeSize();
481 }
482 }
virtual Sprite GetIcon(string suffix="")
Definition: ELEMENT.cs:444

References GetIcon().

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

◆ SetTextValue()

virtual void Element.SetTextValue ( UIText  text)
inlinevirtual

Reimplemented in Resistance.

Definition at line 1070 of file ELEMENT.cs.

1071 {
1072 string text2 = DisplayValue.ToString() ?? "";
1073 if (ShowXP)
1074 {
1075 text2 += ".".TagSize((vExp / 10).ToString("D2") ?? "", 11);
1076 }
1077 if (vLink != 0)
1078 {
1079 string text3 = ((vLink > 0) ? "+" : "") + vLink;
1080 text2 = "<color=" + ((DisplayValue > ValueWithoutLink) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad).ToHex() + ">" + text2 + (" (" + text3 + ")").TagSize(13) + "</color>";
1081 }
1082 text.text = text2;
1083 }
virtual bool ShowXP
Definition: ELEMENT.cs:313

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

459 {
460 int num = ((source.sort != 0) ? source.sort : id);
461 return (IsFlag ? 100000 : 0) + ((!charaSheet && IsGlobalElement) ? (-1000000) : 0) + (((IsFoodTrait || IsTrait) && owner != null && owner.Card != null && owner.Card.ShowFoodEnc) ? 10000 : 0) + num;
462 }
virtual Card Card
bool IsFlag
Definition: ELEMENT.cs:298

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

581 {
582 n.Clear();
583 _WriteNote(n, owner, onWriteNote, isRef: false);
584 n.Build();
585 }
void _WriteNote(UINote n, Chara c, Act act)
Definition: ELEMENT.cs:602
void Clear()
Definition: UINote.cs:35
void Build()
Definition: UINote.cs:49

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

Referenced by 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 587 of file ELEMENT.cs.

588 {
589 n.Clear();
590 _WriteNote(n, owner, onWriteNote, isRef: false);
591 if (refEle.Value > 0)
592 {
593 refEle._WriteNote(n, owner, onWriteNote, isRef: true);
594 }
596 {
598 }
599 n.Build();
600 }
virtual void WritePurchaseReq(UINote n, int lv=1)
Definition: ELEMENT.cs:1090
virtual bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
Definition: ELEMENT.cs:1085

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

1091 {
1092 }

Referenced by WriteNoteWithRef().

Member Data Documentation

◆ _source

SourceElement.Row Element._source

Definition at line 244 of file ELEMENT.cs.

◆ Div

const int Element.Div = 5
static

Definition at line 232 of file ELEMENT.cs.

◆ id

int Element.id

Definition at line 246 of file ELEMENT.cs.

Referenced by TraitAltar._OnOffer(), BaseCondition._WriteNote(), _WriteNote(), DamageTextRenderer.Add(), Feat.Apply(), Chara.ApplyDeathPenalty(), ElementContainer.ApplyMaterialElementMap(), GrowSystem.ApplySeed(), ActMelee.Attack(), Thing.CanAutoFire(), RecipeManager.CanCeomUpWithRecipe(), Thing.CanStackTo(), TraitAmmo.CanStackTo(), RecipeManager.ComeUpWithRecipe(), TraitCrafter.Craft(), RecipeCard.Craft(), Dice.Create(), Create(), Card.DamageHP(), CoreDebug.Fix_EtherDisease(), Chara.GainAbility(), DNA.Generate(), Get(), GoalAutoCombat.GetAbilities(), Card.GetBestAttribute(), DNA.GetInvalidAction(), DNA.GetInvalidFeat(), ElementContainer.GetOrCreateElement(), Recipe.GetQualityBonus(), ElementContainer.GetSortVal(), GetSortVal(), RecipeSource.GetSPCost(), Act.GetText(), Chara.GiveGift(), IsFactionElement(), Chara.ListAvailabeFeats(), ElementContainer.ListBestAttributes(), ElementContainer.ListBestSkills(), ElementContainer.ListElements(), 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(), ElementContainerFaction.OnUnequip(), ResearchPlan.ParseReward(), Act.Perform(), AttackProcess.Perform(), FoodEffect.Proc(), ActEffect.Proc(), ActEffect.ProcAt(), FoodEffect.ProcTrait(), Religion.Reforge(), ButtonElement.Refresh(), UICharaMaker.Refresh(), WidgetStatsBar.Refresh(), WindowCharaMini.Refresh(), WindowChara.RefreshSkill(), AI_Idle.Run(), LayerAbility.SelectGroup(), ElementContainer.SetBase(), ButtonElement.SetGrid(), Card.SetLv(), ElementContainer.SetParent(), Card.SetTier(), ElementContainer.SetTo(), ButtonAbility.SpecialHoldAction(), WidgetTracker.Toggle(), CalcPlat.Train(), Thing.TryLickEnchant(), HotItemAct.TrySetAct(), Chara.TryUpgrade(), GoalCombat.TryUseAbility(), FactionBranch.Upgrade(), Chara.UseAbility(), ElementContainerCard.ValueBonus(), Element.BonusInfo.WriteNote(), and Thing.WriteNote().

◆ List_Body

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

◆ List_MainAttributes

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

Definition at line 236 of file ELEMENT.cs.

◆ List_MainAttributesMajor

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

Definition at line 238 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 266 of file ELEMENT.cs.

Referenced by SourceManager.Init().

◆ ListElements

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

Definition at line 264 of file ELEMENT.cs.

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

◆ owner

◆ vBase

◆ vExp

◆ vLink

◆ Void

◆ vPotential

◆ vSource

◆ vSourcePotential

int Element.vSourcePotential

Definition at line 260 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ vTempPotential

Property Documentation

◆ act

◆ CanGainExp

virtual bool Element.CanGainExp
get

Definition at line 296 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp().

◆ CostLearn

virtual int Element.CostLearn
get

◆ CostTrain

virtual int Element.CostTrain
get

Definition at line 308 of file ELEMENT.cs.

Referenced by CalcPlat.Train().

◆ DisplayValue

virtual int Element.DisplayValue
get

◆ ExpToNext

virtual int Element.ExpToNext
get

Definition at line 304 of file ELEMENT.cs.

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

◆ FullName

virtual string Element.FullName
get

Definition at line 302 of file ELEMENT.cs.

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

◆ IsFactionWideElement

bool Element.IsFactionWideElement
get

Definition at line 352 of file ELEMENT.cs.

Referenced by AddEncNote().

◆ IsFlag

bool Element.IsFlag
get

Definition at line 298 of file ELEMENT.cs.

Referenced by WindowChara.RefreshSkill(), and SortVal().

◆ IsFoodTrait

◆ IsFoodTraitMain

bool Element.IsFoodTraitMain
get

Definition at line 362 of file ELEMENT.cs.

363 {
364 get
365 {
366 if (IsFoodTrait)
367 {
368 if (!source.tag.Contains("primary"))
369 {
370 return source.tag.Contains("foodpot");
371 }
372 return true;
373 }
374 return false;
375 }
376 }

Referenced by AddEncNote(), ElementContainer.GetSortVal(), Thing.ListLimitedValidTraits(), Thing.ListValidTraits(), CraftUtil.MixIngredients(), and Thing.WriteNote().

◆ IsGlobalElement

bool Element.IsGlobalElement
get

Definition at line 340 of file ELEMENT.cs.

341 {
342 get
343 {
344 if (vExp != -1)
345 {
346 return vExp == -2;
347 }
348 return true;
349 }
350 }

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

◆ IsMainAttribute

bool Element.IsMainAttribute
get

Definition at line 378 of file ELEMENT.cs.

379 {
380 get
381 {
382 if (source.category == "attribute")
383 {
384 return source.tag.Contains("primary");
385 }
386 return false;
387 }
388 }

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

◆ IsPartyWideElement

bool Element.IsPartyWideElement
get

Definition at line 354 of file ELEMENT.cs.

◆ IsTrait

◆ MinPotential

virtual int Element.MinPotential
get

Definition at line 292 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ MinValue

virtual int Element.MinValue
get

Definition at line 286 of file ELEMENT.cs.

◆ Name

◆ Potential

int Element.Potential
get

Definition at line 294 of file ELEMENT.cs.

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

◆ PotentialAsStock

virtual bool Element.PotentialAsStock
get

Definition at line 332 of file ELEMENT.cs.

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

◆ ShortName

virtual string Element.ShortName
get

Definition at line 338 of file ELEMENT.cs.

Referenced by ButtonElement.SetGrid().

◆ ShowBonuses

virtual bool Element.ShowBonuses
get

Definition at line 336 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowEncNumber

virtual bool Element.ShowEncNumber
get

Definition at line 356 of file ELEMENT.cs.

◆ ShowMsgOnValueChanged

virtual bool Element.ShowMsgOnValueChanged
get

Definition at line 324 of file ELEMENT.cs.

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

◆ ShowPotential

virtual bool Element.ShowPotential
get

Definition at line 328 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowRelativeAttribute

virtual bool Element.ShowRelativeAttribute
get

Definition at line 334 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowValue

virtual bool Element.ShowValue
get

Definition at line 326 of file ELEMENT.cs.

Referenced by _WriteNote().

◆ ShowXP

virtual bool Element.ShowXP
get

Definition at line 312 of file ELEMENT.cs.

313 {
314 get
315 {
317 {
318 return source.category != "attribute";
319 }
320 return true;
321 }
322 }

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

◆ source

SourceElement.Row Element.source
get

Definition at line 268 of file ELEMENT.cs.

269 {
270 get
271 {
273 if (row == null)
274 {
275 SourceElement.Row obj = ((id == 0) ? GetSource() : Get(id)) ?? EClass.sources.elements.rows[0];
276 SourceElement.Row row2 = obj;
277 _source = obj;
278 row = row2;
279 }
280 return row;
281 }
282 }
virtual SourceElement.Row GetSource()
Definition: ELEMENT.cs:402
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:397
SourceElement.Row _source
Definition: ELEMENT.cs:244

Referenced by _WriteNote(), AddEncNote(), ElementContainer.AddNoteAll(), Feat.Apply(), ElementContainer.ApplyElementMap(), ElementContainer.ApplyMaterialElementMap(), GoalAutoCombat.BuildAbilityList(), Chara.CalcCastingChance(), DNA.CalcSlot(), Chara.CalculateMaxStamina(), CheckLevelBonus(), RecipeCard.Craft(), Dice.Create(), Player.CreateEquip(), ActEffect.DamageEle(), Card.DamageHP(), Player.DreamSpell(), ZonePreEnterEncounter.Execute(), CoreDebug.Fix_EtherDisease(), DamageTextRenderer.Flush(), Chara.GainAbility(), DNA.Generate(), 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(), Thing.MatchEncSearch(), Chara.ModCorruption(), ElementContainer.ModExp(), Chara.MutateRandom(), TraitDrinkMilkMother.OnDrink(), ElementContainerCard.OnLevelDown(), ElementContainerCard.OnLevelUp(), Act.Perform(), AttackProcess.Perform(), AttackProcess.PlayRangedAnime(), FoodEffect.Proc(), ActEffect.ProcAt(), ButtonElement.Refresh(), CharaAbility.Refresh(), UICharaMaker.Refresh(), WindowCharaMini.Refresh(), Card.RefreshColor(), LayerHome.RefreshFeat(), WindowChara.RefreshSkill(), WindowChara.RefreshStatic(), AI_Eat.Run(), AI_Idle.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(), DNA.WriteNote(), and Thing.WriteNote().

◆ UseExpMod

virtual bool Element.UseExpMod
get

Definition at line 306 of file ELEMENT.cs.

Referenced by ElementContainer.ModExp().

◆ UsePotential

virtual bool Element.UsePotential
get

Definition at line 330 of file ELEMENT.cs.

◆ Value

int Element.Value
get

Definition at line 288 of file ELEMENT.cs.

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

◆ ValueWithoutLink


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