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