Elin Decompiled Documentation EA 23.324 Nightly
Loading...
Searching...
No Matches
ElementContainerCard Class Reference
Inheritance diagram for ElementContainerCard:
ElementContainer EClass

Public Member Functions

void SetOwner (Card c, bool applyFeat)
 
override void OnLearn (int ele)
 
void CheckSkillActions ()
 
override void OnTrain (int ele)
 
override void OnModTempPotential (Element e, int v, int threshMsg)
 
override void OnLevelUp (Element e, int lastValue)
 
override void OnLevelDown (Element e, int lastValue)
 
override int ValueBonus (Element e)
 
- Public Member Functions inherited from ElementContainer
void ApplyElementMap (int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
 
void ApplyMaterialElementMap (Thing t, bool invert=false)
 
void ImportElementMap (Dictionary< int, int > map)
 
ElementContainer ImportElementMap (int[] ints)
 
void ApplyPotential (int mode=0)
 
int Value (int ele)
 
virtual int ValueBonus (Element e)
 
int ValueWithoutLink (int ele)
 
int ValueWithoutLink (string alias)
 
int GetFeatRef (int ele, int idx=0)
 
int Exp (int ele)
 
bool Has (int ele)
 
bool Has (SourceElement.Row row)
 
bool Has (string alias)
 
bool HasBase (int ele)
 
int Base (int ele)
 
void Learn (int ele, int v=1)
 
void Train (int ele, int a=10)
 
void ModExp (int ele, float a, bool chain=false)
 
virtual void OnLearn (int ele)
 
virtual void OnTrain (int ele)
 
virtual void OnLevelUp (Element e, int lastValue)
 
virtual void OnLevelDown (Element e, int lastValue)
 
Element SetBase (string alias, int v, int potential=0)
 
Element SetBase (int id, int v, int potential=0)
 
void SetTo (int id, int v)
 
void Remove (int id)
 
Element ModBase (int ele, int v)
 
virtual void OnChangeValue ()
 
Element ModPotential (int ele, int v)
 
Element ModTempPotential (int ele, int v, int threshMsg=0)
 
virtual void OnModTempPotential (Element e, int v, int threshMsg)
 
int GetSpellExp (Chara c, Element e, int costMod=100)
 
Element GetElement (string alias)
 
Element GetElement (int id)
 
Element CreateElement (int id)
 
Element GetOrCreateElement (Element ele)
 
Element GetOrCreateElement (string alias)
 
Element GetOrCreateElement (int id)
 
void SetParent (Card c)
 
void SetParent (ElementContainer newParent=null)
 
List< ElementListElements (Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
 
List< ElementListBestAttributes ()
 
List< ElementListBestSkills ()
 
List< ElementListGeneFeats ()
 
List< ElementListLearnable (Chara c)
 
List< ElementListRune ()
 
void CopyTo (ElementContainer container)
 
void AddNote (UINote n, Func< Element, bool > isValid=null, Action onAdd=null, NoteMode mode=NoteMode.Default, bool addRaceFeat=false, Func< Element, string, string > funcText=null, Action< UINote, Element > onAddNote=null)
 
void AddNoteAll (UINote n)
 

Public Attributes

Card owner
 
- Public Attributes inherited from ElementContainer
Dictionary< int, Elementdict = new Dictionary<int, Element>()
 
ElementContainer parent
 
List< int > list
 

Properties

override Card Card [get]
 
override Chara Chara [get]
 
override bool IsMeleeWeapon [get]
 
- Properties inherited from ElementContainer
virtual Card Card [get]
 
virtual Chara Chara [get]
 
virtual bool LimitLink [get]
 
virtual bool IsMeleeWeapon [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]
 

Additional Inherited Members

- Public Types inherited from ElementContainer
enum  NoteMode {
  Default , CharaMake , CharaMakeAttributes , Domain ,
  BonusTrait
}
 
- Static Public Member Functions inherited from ElementContainer
static int GetSortVal (Element a)
 
- 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)
 
- Static Public Attributes inherited from ElementContainer
const int sizeElement = 5
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 3 of file ElementContainerCard.cs.

Member Function Documentation

◆ CheckSkillActions()

void ElementContainerCard.CheckSkillActions ( )
inline

Definition at line 48 of file ElementContainerCard.cs.

49 {
50 if (owner.IsPC)
51 {
52 TryLearn(6608, 1274, 0);
53 TryLearn(6011, 281, 0);
54 TryLearn(6018, 226, 0);
55 TryLearn(6019, 227, 0);
56 TryLearn(6700, 1649, 0);
57 TryLearn(6720, 1657, 0);
58 TryLearn(6450, 132, 5);
59 TryLearn(6603, 6020, 20);
60 }
61 void TryLearn(int eleAction, int reqEle, int lqlv)
62 {
63 if (!HasBase(eleAction) && HasBase(reqEle) && GetElement(reqEle).ValueWithoutLink >= lqlv)
64 {
65 SetBase(eleAction, 1);
67 {
68 if (owner.IsPC)
69 {
71 }
72 owner.Say("learnSkill", Card, EClass.sources.elements.map[eleAction].GetName());
73 }
74 }
75 }
76 }
Definition: Card.cs:11
virtual bool IsPC
Definition: Card.cs:2197
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7272
bool IsGameStarted
Definition: Core.cs:87
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static SourceManager sources
Definition: EClass.cs:43
int ValueWithoutLink(int ele)
Element SetBase(string alias, int v, int potential=0)
bool HasBase(int ele)
Element GetElement(string alias)
static void Redraw()
SourceElement elements

References EClass.core, SourceManager.elements, ElementContainer.GetElement(), ElementContainer.HasBase(), Core.IsGameStarted, Card.IsPC, owner, LayerAbility.Redraw(), Card.Say(), ElementContainer.SetBase(), EClass.sources, and ElementContainer.ValueWithoutLink().

Referenced by OnLearn(), OnLevelUp(), Game.OnLoad(), and Player.OnStartNewGame().

◆ OnLearn()

override void ElementContainerCard.OnLearn ( int  ele)
inlinevirtual

Reimplemented from ElementContainer.

Definition at line 38 of file ElementContainerCard.cs.

39 {
41 {
42 SE.DingSkill2();
43 }
44 Msg.Say("learnSkill", Card, EClass.sources.elements.map[ele].GetName());
46 }
virtual bool IsPCFaction
Definition: Card.cs:2339
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58

References CheckSkillActions(), SourceManager.elements, Card.IsPCFaction, owner, Msg.Say(), and EClass.sources.

◆ OnLevelDown()

override void ElementContainerCard.OnLevelDown ( Element  e,
int  lastValue 
)
inlinevirtual

Reimplemented from ElementContainer.

Definition at line 150 of file ElementContainerCard.cs.

151 {
153 {
154 return;
155 }
156 _ = owner.IsPC;
157 if (!owner.isChara)
158 {
159 return;
160 }
162 {
164 string text = e.source.GetText("textDec", returnNull: true);
165 if (!text.IsEmpty())
166 {
167 Msg.Say(text, owner);
168 }
169 else
170 {
171 Msg.Say("dec_skill", owner, e.Name);
172 }
173 }
175 }
virtual Chara Chara
Definition: Card.cs:2122
virtual bool isChara
Definition: Card.cs:2135
override bool IsPCFaction
Definition: Chara.cs:689
void CalculateMaxStamina()
Definition: Chara.cs:2188
virtual bool ShowMsgOnValueChanged
Definition: ELEMENT.cs:335
SourceElement.Row source
Definition: ELEMENT.cs:280
virtual string Name
Definition: ELEMENT.cs:311
Color Negative
Definition: MsgColors.cs:15
static MsgColors colors
Definition: Msg.cs:20
static void SetColor()
Definition: Msg.cs:22

References Chara.CalculateMaxStamina(), Card.Chara, Msg.colors, Card.isChara, Card.IsPC, Chara.IsPCFaction, Element.Name, MsgColors.Negative, owner, Msg.Say(), Msg.SetColor(), Element.ShowMsgOnValueChanged, and Element.source.

◆ OnLevelUp()

override void ElementContainerCard.OnLevelUp ( Element  e,
int  lastValue 
)
inlinevirtual

Reimplemented from ElementContainer.

Definition at line 97 of file ElementContainerCard.cs.

98 {
100 {
101 return;
102 }
103 if (owner.IsPC)
104 {
105 if (e.id == 287)
106 {
107 EClass.player.flags.canComupWithFoodRecipe = true;
108 }
109 SE.DingSkill2();
110 }
111 if (owner.isChara)
112 {
114 {
116 {
118 {
120 string text = e.source.GetText("textInc", returnNull: true);
121 if (!text.IsEmpty())
122 {
123 owner.Say(text, owner);
124 }
125 else
126 {
127 owner.Say("ding_skill", owner, e.Name);
128 }
129 owner.pos.TalkWitnesses(owner.Chara, "ding_other", 4, WitnessType.ally, null, 4 + EClass.pc.party.members.Count);
130 }
131 if (owner.IsPCParty)
132 {
133 WidgetPopText.Say("popDing".lang(owner.IsPC ? "" : owner.Name, e.Name, lastValue.ToString() ?? "", e.ValueWithoutLink.ToString() ?? ""), FontColor.Good);
134 }
135 }
136 if (owner.Chara.homeBranch != null)
137 {
138 owner.Chara.homeBranch.Log("bDing", Card, e.Name, lastValue.ToString() ?? "", e.ValueWithoutLink.ToString() ?? "");
139 }
140 }
141 if (e is Skill)
142 {
143 owner.AddExp(10 + EClass.rnd(5));
144 }
146 }
148 }
FontColor
Definition: FontColor.cs:2
WitnessType
Definition: WitnessType.cs:2
virtual bool IsPCParty
Definition: Card.cs:2203
string Name
Definition: Card.cs:2191
Point pos
Definition: Card.cs:60
void AddExp(int a, bool applyMod=true)
Definition: Card.cs:3116
Party party
Definition: Chara.cs:43
bool IsInActiveZone
Definition: Chara.cs:885
FactionBranch homeBranch
Definition: Chara.cs:1113
static int rnd(long a)
Definition: EClass.cs:59
static Chara pc
Definition: EClass.cs:15
int ValueWithoutLink
Definition: ELEMENT.cs:301
int id
Definition: ELEMENT.cs:257
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
Color Ding
Definition: MsgColors.cs:11
List< Chara > members
Definition: Party.cs:19
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:820
Definition: SKILL.cs:294
static bool IsActive
Definition: VirtualDate.cs:13
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)

References Card.AddExp(), Chara.CalculateMaxStamina(), Card.Chara, CheckSkillActions(), Msg.colors, MsgColors.Ding, Chara.homeBranch, Element.id, VirtualDate.IsActive, Card.isChara, Chara.IsInActiveZone, Card.IsPC, Chara.IsPCFaction, Card.IsPCParty, FactionBranch.Log(), Party.members, Card.Name, Element.Name, owner, Chara.party, EClass.pc, Card.pos, EClass.rnd(), Card.Say(), WidgetPopText.Say(), Msg.SetColor(), Element.ShowMsgOnValueChanged, Element.source, Point.TalkWitnesses(), and Element.ValueWithoutLink.

◆ OnModTempPotential()

override void ElementContainerCard.OnModTempPotential ( Element  e,
int  v,
int  threshMsg 
)
inlinevirtual

Reimplemented from ElementContainer.

Definition at line 83 of file ElementContainerCard.cs.

84 {
85 if ((threshMsg == 0 || Mathf.Abs(v) >= threshMsg) && v != 0)
86 {
87 string lang = ((v > 0) ? "potentialInc" : "potentialDec");
88 if (owner.IsPCFaction && v > 0)
89 {
90 owner.PlaySound("ding_potential");
91 }
92 Msg.SetColor((v > 0) ? "positive" : "negative");
93 owner.Say(lang, owner, e.Name.ToLower());
94 }
95 }
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6594

References Card.IsPCFaction, Element.Name, owner, Card.PlaySound(), Card.Say(), and Msg.SetColor().

◆ OnTrain()

override void ElementContainerCard.OnTrain ( int  ele)
inlinevirtual

Reimplemented from ElementContainer.

Definition at line 78 of file ElementContainerCard.cs.

79 {
80 Msg.Say("trainSkill", Card, EClass.sources.elements.map[ele].GetName());
81 }

References SourceManager.elements, Msg.Say(), and EClass.sources.

◆ SetOwner()

void ElementContainerCard.SetOwner ( Card  c,
bool  applyFeat 
)
inline

Definition at line 23 of file ElementContainerCard.cs.

24 {
25 owner = c;
26 SourceValueType sourceValueType = ((c.IsEquipmentOrRangedOrAmmo && c.rarity < Rarity.Artifact && !c.isReplica) ? SourceValueType.EquipmentRandom : SourceValueType.Fixed);
27 if (c.sourceCard.ContainsTag("fixedElement"))
28 {
29 sourceValueType = SourceValueType.Fixed;
30 }
31 if (c.sourceCard.ContainsTag("randomElement"))
32 {
33 sourceValueType = SourceValueType.EquipmentRandom;
34 }
35 ApplyElementMap(c.uid, sourceValueType, c.sourceCard.elementMap, (sourceValueType != SourceValueType.EquipmentRandom) ? 1 : c.LV, invert: false, applyFeat);
36 }
SourceValueType
Dictionary< int, int > elementMap
Definition: CardRow.cs:43
int uid
Definition: Card.cs:125
virtual CardRow sourceCard
Definition: Card.cs:2183
bool isReplica
Definition: Card.cs:701
int LV
Definition: Card.cs:389
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
bool ContainsTag(string _tag)
Definition: RenderRow.cs:148

References ElementContainer.ApplyElementMap(), RenderRow.ContainsTag(), CardRow.elementMap, Card.isReplica, Card.LV, owner, Card.sourceCard, and Card.uid.

Referenced by Card._OnDeserialized(), and Card.Create().

◆ ValueBonus()

override int ElementContainerCard.ValueBonus ( Element  e)
inlinevirtual

Reimplemented from ElementContainer.

Definition at line 177 of file ElementContainerCard.cs.

178 {
179 if (EClass.game == null)
180 {
181 return 0;
182 }
183 int num = 0;
185 {
187 if (element != null)
188 {
189 num += element.Value;
190 }
191 if (owner.IsPCParty)
192 {
193 int id = e.id;
194 if ((id == 70 || (uint)(id - 72) <= 1u) && EClass.game.activeZone != null)
195 {
196 int num2 = 0;
197 foreach (Chara member in EClass.pc.party.members)
198 {
199 if (member.Evalue(1419) > 0)
200 {
201 num2 += member.Evalue(1419);
202 }
203 }
204 if (num2 > 0)
205 {
206 int num3 = 0;
207 foreach (Chara chara in EClass._map.charas)
208 {
209 if (chara.IsHostile(EClass.pc))
210 {
211 num3++;
212 }
213 }
214 if (num3 > 0)
215 {
216 num += Mathf.Max(1, (e.ValueWithoutLink + e.vLink) * (int)Mathf.Clamp(4f + Mathf.Sqrt(num3) * (float)num2 * 2f, 5f, 30f) / 100);
217 }
218 }
219 }
220 }
221 if (e.id == 78)
222 {
223 num += EClass.player.CountKeyItem("lucky_coin") * 2;
224 if (Chara != null && Chara.Evalue(663) > 0)
225 {
226 num = num * 2 + (e.ValueWithoutLink + e.vLink);
227 }
228 }
229 if (e.id != 664 && (owner.Chara.IsMachine || owner.id == "android"))
230 {
231 int num4 = owner.Evalue(664);
232 if (num4 > 0)
233 {
234 switch (e.id)
235 {
236 case 64:
237 case 65:
238 num += (e.ValueWithoutLink + e.vLink) * num4 / 2 / 100;
239 break;
240 case 79:
241 num += (e.ValueWithoutLink + e.vLink) * num4 / 100;
242 break;
243 }
244 }
245 }
246 }
247 if (!e.source.aliasMtp.IsEmpty())
248 {
249 int num5 = owner.Evalue(e.source.aliasMtp);
250 if (num5 != 0)
251 {
252 num += (e.ValueWithoutLink + e.vLink) * num5 / 100;
253 }
254 }
255 return num;
256 }
bool IsPCFactionOrMinion
Definition: Card.cs:2342
string id
Definition: Card.cs:36
int Evalue(int ele)
Definition: Card.cs:2704
Definition: Chara.cs:10
Faction faction
Definition: Chara.cs:431
bool IsMachine
Definition: Chara.cs:950
bool IsHostile()
Definition: Chara.cs:6849
static Game game
Definition: EClass.cs:9
static Map _map
Definition: EClass.cs:19
static Player player
Definition: EClass.cs:13
int Value
Definition: ELEMENT.cs:299
int vLink
Definition: ELEMENT.cs:267
ElementContainerFaction charaElements
Definition: FACTION.cs:146
Zone activeZone
Definition: Game.cs:252
List< Chara > charas
Definition: Map.cs:81
int CountKeyItem(string alias)
Definition: Player.cs:2240

References EClass._map, Game.activeZone, Card.Chara, Faction.charaElements, Map.charas, Player.CountKeyItem(), Card.Evalue(), Chara.faction, EClass.game, ElementContainer.GetElement(), Card.id, Element.id, Chara.IsHostile(), Chara.IsMachine, Card.IsPCFactionOrMinion, Card.IsPCParty, Party.members, owner, Chara.party, EClass.pc, EClass.player, Element.source, Element.Value, Element.ValueWithoutLink, and Element.vLink.

Member Data Documentation

◆ owner

Card ElementContainerCard.owner

Property Documentation

◆ Card

override Card ElementContainerCard.Card
get

Definition at line 7 of file ElementContainerCard.cs.

◆ Chara

override Chara ElementContainerCard.Chara
get

Definition at line 9 of file ElementContainerCard.cs.

◆ IsMeleeWeapon

override bool ElementContainerCard.IsMeleeWeapon
get

Definition at line 11 of file ElementContainerCard.cs.

12 {
13 get
14 {
15 if (Card.category.slot == 35)
16 {
17 return Card.category.skill != 0;
18 }
19 return false;
20 }
21 }
SourceCategory.Row category
Definition: Card.cs:2101

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