Elin Decompiled Documentation EA 23.130 Nightly
Loading...
Searching...
No Matches
ElementContainer.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Runtime.Serialization;
5using Newtonsoft.Json;
6using UnityEngine;
7
8public class ElementContainer : EClass
9{
10 public enum NoteMode
11 {
12 Default,
15 Domain,
17 }
18
19 public Dictionary<int, Element> dict = new Dictionary<int, Element>();
20
22
23 public const int sizeElement = 5;
24
25 [JsonProperty(PropertyName = "A")]
26 public List<int> list;
27
28 public virtual Card Card => null;
29
30 public virtual Chara Chara => null;
31
32 public virtual bool IsMeleeWeapon => false;
33
35 private void OnSerializing(StreamingContext context)
36 {
37 list = new List<int>();
38 foreach (Element value in dict.Values)
39 {
40 if (value.vBase != 0 || value.vExp != 0 || value.vPotential != 0 || value.vTempPotential != 0)
41 {
42 list.AddRange(new int[5] { value.id, value.vBase, value.vExp, value.vPotential, value.vTempPotential });
43 }
44 }
45 if (list.Count == 0)
46 {
47 list = null;
48 }
49 }
50
52 private void OnDeserialized(StreamingContext context)
53 {
54 if (list == null)
55 {
56 return;
57 }
58 for (int i = 0; i < list.Count; i += 5)
59 {
60 Element orCreateElement = GetOrCreateElement(list[i]);
61 if (orCreateElement != null)
62 {
63 orCreateElement.vBase += list[i + 1];
64 orCreateElement.vExp += list[i + 2];
65 orCreateElement.vPotential += list[i + 3];
66 orCreateElement.vTempPotential = list[i + 4];
67 orCreateElement.owner = this;
68 }
69 }
70 }
71
72 public void ApplyElementMap(int uid, SourceValueType type, Dictionary<int, int> map, int lv, bool invert = false, bool applyFeat = false)
73 {
74 int num = ((!invert) ? 1 : (-1));
75 Rand.SetSeed(uid);
76 foreach (KeyValuePair<int, int> item in map)
77 {
78 Element orCreateElement = GetOrCreateElement(item.Key);
79 int value = item.Value;
80 if (value != 0)
81 {
82 if (orCreateElement.source.category == "skill")
83 {
84 orCreateElement.vSourcePotential += orCreateElement.GetSourcePotential(value) * num;
85 }
86 int num2 = orCreateElement.GetSourceValue(value, lv, type) * num;
87 orCreateElement.vSource += num2;
88 if (applyFeat && orCreateElement is Feat)
89 {
90 (orCreateElement as Feat).Apply(num2, this);
91 }
92 }
93 }
94 Rand.SetSeed();
95 }
96
97 public void ApplyMaterialElementMap(Thing t, bool invert = false)
98 {
99 int num = ((!invert) ? 1 : (-1));
101 Rand.SetSeed(t.uid);
102 foreach (KeyValuePair<int, int> item in material.elementMap)
103 {
104 int value = item.Value;
105 if (value == 0)
106 {
107 continue;
108 }
109 Element orCreateElement = GetOrCreateElement(item.Key);
110 if (!orCreateElement.source.IsMaterialEncAppliable(t))
111 {
112 if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vExp == 0 && orCreateElement.vPotential == 0)
113 {
114 Remove(orCreateElement.id);
115 }
116 continue;
117 }
118 int num2 = orCreateElement.GetMaterialSourceValue(t, value) * num;
119 orCreateElement.vSource += num2;
120 if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vExp == 0 && orCreateElement.vPotential == 0)
121 {
122 Remove(orCreateElement.id);
123 }
124 }
125 Rand.SetSeed();
126 }
127
128 public void ImportElementMap(Dictionary<int, int> map)
129 {
130 foreach (KeyValuePair<int, int> item in map)
131 {
132 GetOrCreateElement(item.Key).vSource += item.Value;
133 }
134 }
135
137 {
138 for (int i = 0; i < ints.Length; i += 2)
139 {
140 GetOrCreateElement(ints[i]).vSource += ints[i + 1];
141 }
142 return this;
143 }
144
145 public void ApplyPotential(int mode = 0)
146 {
147 foreach (Element value in dict.Values)
148 {
149 if (value.HasTag("primary"))
150 {
151 value.vTempPotential = (value.ValueWithoutLink - ((mode != 2) ? 7 : 0)) * 5;
152 }
153 }
154 }
155
156 public int Value(int ele)
157 {
158 Element element = GetElement(ele);
159 if (element == null)
160 {
161 if (EClass.core.game == null)
162 {
163 return 0;
164 }
165 if (Card == null || !Card.IsPCFactionOrMinion)
166 {
167 return 0;
168 }
169 if (ele != 78)
170 {
171 return EClass.pc.faction.charaElements.Value(ele);
172 }
173 return GetOrCreateElement(ele).Value;
174 }
175 return element.Value;
176 }
177
178 public virtual int ValueBonus(Element e)
179 {
180 return 0;
181 }
182
183 public int ValueWithoutLink(int ele)
184 {
185 return GetElement(ele)?.ValueWithoutLink ?? 0;
186 }
187
188 public int ValueWithoutLink(string alias)
189 {
190 return GetElement(alias)?.ValueWithoutLink ?? 0;
191 }
192
193 public int GetFeatRef(int ele, int idx = 0)
194 {
195 if (!(GetElement(ele) is Feat feat))
196 {
197 return 0;
198 }
199 feat.Apply(feat.Value, this);
200 return Feat.featRef[idx].ToInt();
201 }
202
203 public int Exp(int ele)
204 {
205 return GetElement(ele)?.vExp ?? 0;
206 }
207
208 public bool Has(int ele)
209 {
210 Element element = GetElement(ele);
211 if (element == null)
212 {
213 return false;
214 }
215 return element.Value > 0;
216 }
217
218 public bool Has(SourceElement.Row row)
219 {
220 return Has(row.id);
221 }
222
223 public bool Has(string alias)
224 {
225 return Has(EClass.sources.elements.alias[alias].id);
226 }
227
228 public bool HasBase(int ele)
229 {
230 Element element = GetElement(ele);
231 if (element == null)
232 {
233 return false;
234 }
235 int num = element.ValueWithoutLink;
236 switch (ele)
237 {
238 case 300:
239 num += Value(1516) * -4;
240 num += Value(1517) * 4;
241 break;
242 case 307:
243 num += Value(1524) * -4;
244 num += Value(1525) * 4;
245 break;
246 }
247 return num != 0;
248 }
249
250 public int Base(int ele)
251 {
252 return GetElement(ele)?.ValueWithoutLink ?? 0;
253 }
254
255 public void Learn(int ele, int v = 1)
256 {
257 ModBase(ele, v);
258 OnLearn(ele);
259 }
260
261 public void Train(int ele, int a = 10)
262 {
263 OnTrain(ele);
264 ModTempPotential(ele, a);
265 }
266
267 public void ModExp(int ele, int a, bool chain = false)
268 {
269 if ((Card != null && Card.isChara && Card.Chara.isDead) || a == 0)
270 {
271 return;
272 }
273 Element element = GetElement(ele);
274 if (element == null || !element.CanGainExp)
275 {
276 return;
277 }
278 int value = (element.UsePotential ? element.Potential : 100);
279 if (element.UseExpMod && a >= 0)
280 {
281 float num = (float)a * (float)Mathf.Clamp(value, 10, 1000) / (float)(100 + Mathf.Max(0, element.ValueWithoutLink) * 25);
282 a = (int)num;
283 if (EClass.rndf(1f) < num % 1f)
284 {
285 a++;
286 }
287 }
288 element.vExp += a;
289 if (!chain && element.source.parentFactor > 0f && Card != null && !element.source.aliasParent.IsEmpty())
290 {
291 Element element2 = element.GetParent(Card);
292 if (element2.CanGainExp)
293 {
294 ModExp(element2.id, (int)Math.Max(1f, (float)a * element.source.parentFactor / 100f), chain: true);
295 }
296 }
297 if (element.vExp >= element.ExpToNext)
298 {
299 int num2 = element.vExp - element.ExpToNext;
300 int vBase = element.vBase;
301 ModBase(ele, 1);
302 OnLevelUp(element, vBase);
303 element.vExp = Mathf.Clamp(num2 / 2, 0, element.ExpToNext / 2);
304 if (element.vTempPotential > 0)
305 {
306 element.vTempPotential -= element.vTempPotential / 4 + EClass.rnd(5) + 5;
307 if (element.vTempPotential < 0)
308 {
309 element.vTempPotential = 0;
310 }
311 }
312 else if (element.vTempPotential < 0)
313 {
314 element.vTempPotential += -element.vTempPotential / 4 + EClass.rnd(5) + 5;
315 if (element.vTempPotential > 0)
316 {
317 element.vTempPotential = 0;
318 }
319 }
320 }
321 else if (element.vExp < 0)
322 {
323 if (element.ValueWithoutLink <= 1)
324 {
325 element.vExp = 0;
326 return;
327 }
328 int vBase2 = element.vBase;
329 ModBase(ele, -1);
330 OnLevelDown(element, vBase2);
331 element.vExp = Mathf.Max(element.ExpToNext / 2, element.ExpToNext + element.vExp);
332 }
333 }
334
335 public virtual void OnLearn(int ele)
336 {
337 }
338
339 public virtual void OnTrain(int ele)
340 {
341 }
342
343 public virtual void OnLevelUp(Element e, int lastValue)
344 {
345 }
346
347 public virtual void OnLevelDown(Element e, int lastValue)
348 {
349 }
350
351 public Element SetBase(string alias, int v, int potential = 0)
352 {
353 return SetBase(EClass.sources.elements.alias[alias].id, v, potential);
354 }
355
356 public Element SetBase(int id, int v, int potential = 0)
357 {
358 Element orCreateElement = GetOrCreateElement(id);
359 if (parent != null && orCreateElement.CanLink(this))
360 {
361 parent.ModLink(id, -orCreateElement.vBase + v);
362 }
363 orCreateElement.vBase = v;
364 orCreateElement.vExp = 0;
365 orCreateElement.vPotential = potential;
366 orCreateElement.OnChangeValue();
367 if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vPotential == 0 && orCreateElement.vExp == 0)
368 {
369 Remove(orCreateElement.id);
370 }
371 return orCreateElement;
372 }
373
374 public void SetTo(int id, int v)
375 {
376 Element orCreateElement = GetOrCreateElement(id);
377 int num = v - (orCreateElement.vBase + orCreateElement.vSource);
378 if (num != 0)
379 {
380 ModBase(id, num);
381 }
382 if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vPotential == 0 && orCreateElement.vExp == 0)
383 {
384 Remove(orCreateElement.id);
385 }
386 }
387
388 public void Remove(int id)
389 {
390 Element element = GetElement(id);
391 if (element != null)
392 {
393 if (parent != null && element.CanLink(this))
394 {
395 parent.ModLink(id, -element.Value);
396 }
397 dict.Remove(id);
398 }
399 }
400
401 public Element ModBase(int ele, int v)
402 {
403 Element orCreateElement = GetOrCreateElement(ele);
404 orCreateElement.vBase += v;
405 if (parent != null && orCreateElement.CanLink(this))
406 {
407 parent.ModLink(ele, v);
408 }
409 orCreateElement.CheckLevelBonus(this);
410 orCreateElement.OnChangeValue();
411 if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vPotential == 0 && orCreateElement.vExp == 0)
412 {
413 Remove(orCreateElement.id);
414 }
415 return orCreateElement;
416 }
417
418 public virtual void OnChangeValue()
419 {
420 }
421
422 public Element ModPotential(int ele, int v)
423 {
424 Element orCreateElement = GetOrCreateElement(ele);
425 orCreateElement.vPotential += v;
426 if (orCreateElement.vPotential > 1000)
427 {
428 orCreateElement.vPotential = 1000;
429 }
430 return orCreateElement;
431 }
432
433 public Element ModTempPotential(int ele, int v, int threshMsg = 0)
434 {
435 Element orCreateElement = GetOrCreateElement(ele);
436 orCreateElement.vTempPotential += v;
437 if (orCreateElement.vTempPotential > 1000)
438 {
439 orCreateElement.vTempPotential = 1000;
440 }
441 OnModTempPotential(orCreateElement, v, threshMsg);
442 return orCreateElement;
443 }
444
445 public virtual void OnModTempPotential(Element e, int v, int threshMsg)
446 {
447 }
448
449 private Element ModLink(int id, int v)
450 {
451 Element orCreateElement = GetOrCreateElement(id);
452 orCreateElement.vLink += v;
453 orCreateElement.OnChangeValue();
454 if (parent != null && orCreateElement.CanLink(this))
455 {
456 parent.ModLink(id, v);
457 }
458 return orCreateElement;
459 }
460
461 public int GetSpellExp(Chara c, Element e, int costMod = 100)
462 {
463 Act.Cost cost = e.GetCost(c);
464 int num = cost.cost * ((cost.type == Act.CostType.SP) ? 20 : 5) * (100 + c.Evalue(1208) * 30) / 100 + 10;
465 num = num * costMod / 100;
466 if (!e.source.aliasParent.IsEmpty())
467 {
468 int num2 = ValueWithoutLink(e.source.aliasParent) - ValueWithoutLink(e.source.id);
469 num = ((num2 < 0) ? (num * 100 / (100 - num2 * 25)) : (num * (100 + num2 * 5) / 100));
470 }
471 if (num < 0)
472 {
473 num = 0;
474 }
475 return num;
476 }
477
478 public Element GetElement(string alias)
479 {
480 return GetElement(EClass.sources.elements.alias.TryGetValue(alias)?.id ?? 0);
481 }
482
483 public Element GetElement(int id)
484 {
485 return dict.TryGetValue(id);
486 }
487
488 public Element CreateElement(int id)
489 {
490 Element element = Element.Create(id);
491 if (element == null)
492 {
493 return null;
494 }
495 element.owner = this;
496 dict.Add(id, element);
497 return element;
498 }
499
501 {
502 return GetOrCreateElement(ele.id);
503 }
504
505 public Element GetOrCreateElement(string alias)
506 {
507 return GetOrCreateElement(EClass.sources.elements.alias[alias].id);
508 }
509
511 {
512 Element value = null;
513 if (!dict.TryGetValue(id, out value))
514 {
515 value = CreateElement(id);
516 }
517 return value;
518 }
519
520 public void SetParent(Card c)
521 {
522 SetParent(c?.elements);
523 }
524
525 public void SetParent(ElementContainer newParent = null)
526 {
527 if (parent != null)
528 {
529 foreach (Element value in dict.Values)
530 {
531 if (value.CanLink(this))
532 {
533 parent.ModLink(value.id, -(value.vBase + value.vSource));
534 }
535 }
536 }
537 if (newParent != null)
538 {
539 foreach (Element value2 in dict.Values)
540 {
541 if (value2.CanLink(this))
542 {
543 newParent.ModLink(value2.id, value2.vBase + value2.vSource);
544 }
545 }
546 }
547 parent = newParent;
548 }
549
550 public List<Element> ListElements(Func<Element, bool> shoudList = null, Comparison<Element> comparison = null)
551 {
552 List<Element> list = new List<Element>();
553 List<Element> eles = dict.Values.ToList();
554 if (Card != null && Card.Chara != null)
555 {
557 {
558 AddElements(EClass.pc.faction.charaElements, isGlobal: true);
559 }
560 AddElements(Card.Chara.faithElements, isGlobal: false);
561 }
562 foreach (Element item2 in eles)
563 {
564 if (shoudList == null || shoudList(item2))
565 {
566 list.Add(item2);
567 }
568 }
569 if (comparison != null)
570 {
571 list.Sort(comparison);
572 }
573 return list;
574 void AddElements(ElementContainer container, bool isGlobal)
575 {
576 if (container == null)
577 {
578 return;
579 }
580 foreach (Element value in container.dict.Values)
581 {
582 bool flag = true;
583 foreach (Element item3 in eles)
584 {
585 if (value.id == item3.id)
586 {
587 flag = false;
588 break;
589 }
590 }
591 if (flag && value.Value != 0)
592 {
593 if (isGlobal)
594 {
596 eles.Add(item);
597 }
598 else
599 {
600 eles.Add(value);
601 }
602 }
603 }
604 }
605 }
606
607 public List<Element> ListBestAttributes()
608 {
609 List<Element> obj = ListElements((Element a) => a.HasTag("primary"));
610 obj.Sort((Element a, Element b) => (b.ValueWithoutLink - a.ValueWithoutLink) * 100000 + a.id - b.id);
611 return obj;
612 }
613
614 public List<Element> ListBestSkills()
615 {
616 List<Element> obj = ListElements((Element a) => a.source.category == "skill");
617 obj.Sort((Element a, Element b) => (b.ValueWithoutLink - a.ValueWithoutLink) * 100000 + a.id - b.id);
618 return obj;
619 }
620
621 public List<Element> ListGeneFeats()
622 {
623 return ListElements((Element a) => a.Value > 0 && a.source.category == "feat" && a.source.cost.Length != 0 && a.source.cost[0] > 0 && a.source.geneSlot >= 0);
624 }
625
626 public List<Element> ListLearnable(Chara c)
627 {
628 List<Element> list = new List<Element>();
629 foreach (KeyValuePair<int, Element> item in c.elements.dict)
630 {
631 if (!dict.ContainsKey(item.Key))
632 {
633 list.Add(item.Value);
634 }
635 }
636 return list;
637 }
638
639 public List<Element> ListRune()
640 {
641 return ListElements((Element a) => !a.source.encSlot.IsEmpty() && a.vBase + a.vSource != 0);
642 }
643
644 public void CopyTo(ElementContainer container)
645 {
646 container.dict.Clear();
647 foreach (KeyValuePair<int, Element> item in dict)
648 {
649 Element element = container.CreateElement(item.Key);
650 element.vBase = item.Value.vBase;
651 element.vExp = item.Value.vExp;
652 element.vSource = item.Value.vSource;
653 }
654 }
655
656 public static int GetSortVal(Element a)
657 {
658 int num = a.Value;
659 if (a.source.textAlt.Length <= 2 || a.Value < 0)
660 {
661 num -= 100000;
662 }
663 if (a.id == 2)
664 {
665 num += 20000;
666 }
667 if (a.IsFoodTraitMain)
668 {
669 num += 10000;
670 }
671 return num;
672 }
673
674 public 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)
675 {
676 List<Element> list = new List<Element>();
677 foreach (Element value in dict.Values)
678 {
679 if ((isValid == null || isValid(value)) && (mode != NoteMode.CharaMake || value.ValueWithoutLink != 0) && (value.Value != 0 || mode == NoteMode.CharaMakeAttributes) && (!value.HasTag("hidden") || EClass.debug.showExtra))
680 {
681 list.Add(value);
682 }
683 }
684 if (addRaceFeat)
685 {
686 Element element = Element.Create(29, 1);
687 element.owner = this;
688 list.Add(element);
689 }
690 if (list.Count == 0)
691 {
692 return;
693 }
694 onAdd?.Invoke();
695 switch (mode)
696 {
697 case NoteMode.CharaMake:
698 case NoteMode.CharaMakeAttributes:
699 list.Sort((Element a, Element b) => a.GetSortVal(UIList.SortMode.ByElementParent) - b.GetSortVal(UIList.SortMode.ByElementParent));
700 break;
701 case NoteMode.BonusTrait:
702 list.Sort((Element a, Element b) => GetSortVal(b) - GetSortVal(a));
703 break;
704 default:
705 list.Sort((Element a, Element b) => a.SortVal() - b.SortVal());
706 break;
707 }
708 foreach (Element item in list)
709 {
710 item.AddEncNote(n, Card, mode, funcText, onAddNote);
711 }
712 }
713
714 public void AddNoteAll(UINote n)
715 {
716 Transform transform = n.AddExtra<Transform>("noteRace");
717 UINote n2 = transform.Find("note1").GetComponent<UINote>();
718 UINote n3 = transform.Find("note2").GetComponent<UINote>();
719 AddNote(n3, (Element e) => e.HasTag("primary"), delegate
720 {
721 n3.AddHeader("HeaderNoteSmall", "attributes");
722 }, NoteMode.CharaMakeAttributes);
723 AddNote(n2, (Element e) => e.source.category == "skill" && !e.HasTag("hidden") && e.ValueWithoutLink > 1 && e.source.categorySub != "weapon", delegate
724 {
725 n2.AddHeader("HeaderNoteSmall", "skills");
726 }, NoteMode.CharaMake);
727 AddNote(n2, (Element e) => e is Feat, delegate
728 {
729 n2.AddHeader("HeaderNoteSmall", "feats");
730 }, NoteMode.CharaMake);
731 }
732}
SourceValueType
Definition: ACT.cs:62
CostType
Definition: ACT.cs:64
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2172
virtual Chara Chara
Definition: Card.cs:1970
ElementContainerCard elements
Definition: Card.cs:37
SourceMaterial.Row material
Definition: Card.cs:1951
int uid
Definition: Card.cs:118
virtual bool isChara
Definition: Card.cs:1983
int Evalue(int ele)
Definition: Card.cs:2471
Definition: Chara.cs:10
Faction faction
Definition: Chara.cs:417
override bool IsPCFaction
Definition: Chara.cs:661
ElementContainer faithElements
Definition: Chara.cs:38
bool isDead
Definition: Chara.cs:379
bool showExtra
Definition: CoreDebug.cs:167
Game game
Definition: Core.cs:72
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:58
static Core core
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:42
static float rndf(float a)
Definition: EClass.cs:87
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static int GetSortVal(Element a)
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
void Train(int ele, int a=10)
void ApplyPotential(int mode=0)
bool Has(string alias)
Dictionary< int, Element > dict
void SetParent(Card c)
ElementContainer parent
void AddNoteAll(UINote n)
List< Element > ListLearnable(Chara c)
void Learn(int ele, int v=1)
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)
bool Has(int ele)
void ApplyMaterialElementMap(Thing t, bool invert=false)
Element ModLink(int id, int v)
int ValueWithoutLink(string alias)
Element ModPotential(int ele, int v)
Element SetBase(int id, int v, int potential=0)
int Value(int ele)
virtual void OnTrain(int ele)
Element ModTempPotential(int ele, int v, int threshMsg=0)
Element GetOrCreateElement(int id)
void ImportElementMap(Dictionary< int, int > map)
virtual int ValueBonus(Element e)
void OnSerializing(StreamingContext context)
ElementContainer ImportElementMap(int[] ints)
List< Element > ListRune()
void CopyTo(ElementContainer container)
int ValueWithoutLink(int ele)
void ModExp(int ele, int a, bool chain=false)
Element ModBase(int ele, int v)
virtual void OnLevelDown(Element e, int lastValue)
List< Element > ListBestSkills()
virtual bool IsMeleeWeapon
Element GetElement(int id)
int GetFeatRef(int ele, int idx=0)
virtual void OnChangeValue()
void OnDeserialized(StreamingContext context)
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
List< Element > ListBestAttributes()
virtual void OnModTempPotential(Element e, int v, int threshMsg)
virtual void OnLearn(int ele)
void SetTo(int id, int v)
bool Has(SourceElement.Row row)
Element SetBase(string alias, int v, int potential=0)
void Remove(int id)
List< Element > ListGeneFeats()
virtual void OnLevelUp(Element e, int lastValue)
Element GetOrCreateElement(Element ele)
void SetParent(ElementContainer newParent=null)
Element CreateElement(int id)
int GetSpellExp(Chara c, Element e, int costMod=100)
bool HasBase(int ele)
Element GetElement(string alias)
Element GetOrCreateElement(string alias)
virtual bool CanGainExp
Definition: ELEMENT.cs:296
virtual void OnChangeValue()
Definition: ELEMENT.cs:955
int ValueWithoutLink
Definition: ELEMENT.cs:290
virtual bool UseExpMod
Definition: ELEMENT.cs:306
int GetMaterialSourceValue(Thing t, int v)
Definition: ELEMENT.cs:417
int id
Definition: ELEMENT.cs:246
int vBase
Definition: ELEMENT.cs:248
SourceElement.Row source
Definition: ELEMENT.cs:269
int vExp
Definition: ELEMENT.cs:250
virtual int GetSourceValue(int v, int lv, SourceValueType type)
Definition: ELEMENT.cs:434
int vPotential
Definition: ELEMENT.cs:252
virtual int GetSourcePotential(int v)
Definition: ELEMENT.cs:407
bool HasTag(string tag)
Definition: ELEMENT.cs:469
int vTempPotential
Definition: ELEMENT.cs:254
int GetSortVal(UIList.SortMode m)
Definition: ELEMENT.cs:1000
int Value
Definition: ELEMENT.cs:288
void CheckLevelBonus(ElementContainer owner, UINote n=null)
Definition: ELEMENT.cs:959
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1094
virtual bool CanLink(ElementContainer owner)
Definition: ELEMENT.cs:464
int vLink
Definition: ELEMENT.cs:256
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1019
int vSource
Definition: ELEMENT.cs:258
Element GetParent(Card c)
Definition: ELEMENT.cs:518
bool IsFoodTraitMain
Definition: ELEMENT.cs:363
virtual int ExpToNext
Definition: ELEMENT.cs:304
int SortVal(bool charaSheet=false)
Definition: ELEMENT.cs:458
ElementContainerFaction charaElements
Definition: FACTION.cs:144
Definition: FEAT.cs:253
static string[] featRef
Definition: FEAT.cs:256
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:37
SourceElement elements
Definition: Thing.cs:8
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
Definition: UINote.cs:6
Definition: ACT.cs:71