Elin Decompiled Documentation EA 23.182 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, float a, bool chain = false)
270 {
271 if ((Card != null && Card.isChara && Card.Chara.isDead) || a == 0f)
272 {
273 return;
274 }
275 Element element = GetElement(ele);
276 if (element == null || !element.CanGainExp)
277 {
278 return;
279 }
280 if (a > 0f)
281 {
282 if (!chain && Card != null && Card.isChara)
283 {
284 a = a * (float)Card.Chara.GetDaysTogetherBonus() / 100f;
285 }
286 if (element.UseExpMod)
287 {
288 a = a * (float)Mathf.Clamp(element.UsePotential ? element.Potential : 100, 10, 1000) / (float)(100 + Mathf.Max(0, element.ValueWithoutLink) * 25);
289 if (EClass.rndf(1f) < a % 1f)
290 {
291 a += 1f;
292 }
293 }
294 if (!chain && element.source.parentFactor > 0f && Card != null && !element.source.aliasParent.IsEmpty())
295 {
296 Element element2 = element.GetParent(Card);
297 if (element2.CanGainExp)
298 {
299 ModExp(element2.id, Mathf.Clamp(a * element.source.parentFactor / 100f, 1f, 1000f), chain: true);
300 }
301 }
302 }
303 element.vExp += (int)a;
304 if (element.vExp >= element.ExpToNext)
305 {
306 int num = element.vExp - element.ExpToNext;
307 int vBase = element.vBase;
308 ModBase(ele, 1);
309 OnLevelUp(element, vBase);
310 element.vExp = Mathf.Clamp(num / 2, 0, element.ExpToNext / 2);
311 if (element.vTempPotential > 0)
312 {
313 element.vTempPotential -= element.vTempPotential / 4 + EClass.rnd(5) + 5;
314 if (element.vTempPotential < 0)
315 {
316 element.vTempPotential = 0;
317 }
318 }
319 else if (element.vTempPotential < 0)
320 {
321 element.vTempPotential += -element.vTempPotential / 4 + EClass.rnd(5) + 5;
322 if (element.vTempPotential > 0)
323 {
324 element.vTempPotential = 0;
325 }
326 }
327 }
328 else if (element.vExp < 0)
329 {
330 if (element.ValueWithoutLink <= 1)
331 {
332 element.vExp = 0;
333 return;
334 }
335 int vBase2 = element.vBase;
336 ModBase(ele, -1);
337 OnLevelDown(element, vBase2);
338 element.vExp = Mathf.Max(element.ExpToNext / 2, element.ExpToNext + element.vExp);
339 }
340 }
341
342 public virtual void OnLearn(int ele)
343 {
344 }
345
346 public virtual void OnTrain(int ele)
347 {
348 }
349
350 public virtual void OnLevelUp(Element e, int lastValue)
351 {
352 }
353
354 public virtual void OnLevelDown(Element e, int lastValue)
355 {
356 }
357
358 public Element SetBase(string alias, int v, int potential = 0)
359 {
360 return SetBase(EClass.sources.elements.alias[alias].id, v, potential);
361 }
362
363 public Element SetBase(int id, int v, int potential = 0)
364 {
365 Element orCreateElement = GetOrCreateElement(id);
366 if (parent != null && (!LimitLink || orCreateElement.CanLink(this)))
367 {
368 parent.ModLink(id, -orCreateElement.vBase + v);
369 }
370 orCreateElement.vBase = v;
371 orCreateElement.vExp = 0;
372 orCreateElement.vPotential = potential;
373 orCreateElement.OnChangeValue();
374 if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vPotential == 0 && orCreateElement.vExp == 0)
375 {
376 Remove(orCreateElement.id);
377 }
378 return orCreateElement;
379 }
380
381 public void SetTo(int id, int v)
382 {
383 Element orCreateElement = GetOrCreateElement(id);
384 int num = v - (orCreateElement.vBase + orCreateElement.vSource);
385 if (num != 0)
386 {
387 ModBase(id, num);
388 }
389 if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vPotential == 0 && orCreateElement.vExp == 0)
390 {
391 Remove(orCreateElement.id);
392 }
393 }
394
395 public void Remove(int id)
396 {
397 Element element = GetElement(id);
398 if (element != null)
399 {
400 if (parent != null && (!LimitLink || element.CanLink(this)))
401 {
402 parent.ModLink(id, -element.Value);
403 }
404 dict.Remove(id);
405 }
406 }
407
408 public Element ModBase(int ele, int v)
409 {
410 Element orCreateElement = GetOrCreateElement(ele);
411 orCreateElement.vBase += v;
412 if (parent != null && (!LimitLink || orCreateElement.CanLink(this)))
413 {
414 parent.ModLink(ele, v);
415 }
416 orCreateElement.CheckLevelBonus(this);
417 orCreateElement.OnChangeValue();
418 if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vPotential == 0 && orCreateElement.vExp == 0)
419 {
420 Remove(orCreateElement.id);
421 }
422 return orCreateElement;
423 }
424
425 public virtual void OnChangeValue()
426 {
427 }
428
429 public Element ModPotential(int ele, int v)
430 {
431 Element orCreateElement = GetOrCreateElement(ele);
432 orCreateElement.vPotential += v;
433 if (orCreateElement.vPotential > 1000)
434 {
435 orCreateElement.vPotential = 1000;
436 }
437 return orCreateElement;
438 }
439
440 public Element ModTempPotential(int ele, int v, int threshMsg = 0)
441 {
442 Element orCreateElement = GetOrCreateElement(ele);
443 orCreateElement.vTempPotential += v;
444 if (orCreateElement.vTempPotential > 1000)
445 {
446 orCreateElement.vTempPotential = 1000;
447 }
448 OnModTempPotential(orCreateElement, v, threshMsg);
449 return orCreateElement;
450 }
451
452 public virtual void OnModTempPotential(Element e, int v, int threshMsg)
453 {
454 }
455
456 private Element ModLink(int id, int v)
457 {
458 Element orCreateElement = GetOrCreateElement(id);
459 orCreateElement.vLink += v;
460 orCreateElement.OnChangeValue();
461 if (parent != null && (!LimitLink || orCreateElement.CanLink(this)))
462 {
463 parent.ModLink(id, v);
464 }
465 return orCreateElement;
466 }
467
468 public int GetSpellExp(Chara c, Element e, int costMod = 100)
469 {
470 Act.Cost cost = e.GetCost(c);
471 int num = cost.cost * ((cost.type == Act.CostType.SP) ? 20 : 5) * (100 + c.Evalue(1208) * 30) / 100 + 10;
472 num = num * costMod / 100;
473 if (!e.source.aliasParent.IsEmpty())
474 {
475 int num2 = ValueWithoutLink(e.source.aliasParent) - ValueWithoutLink(e.source.id);
476 num = ((num2 < 0) ? (num * 100 / (100 - num2 * 25)) : (num * (100 + num2 * 5) / 100));
477 }
478 if (num < 0)
479 {
480 num = 0;
481 }
482 return num;
483 }
484
485 public Element GetElement(string alias)
486 {
487 return GetElement(EClass.sources.elements.alias.TryGetValue(alias)?.id ?? 0);
488 }
489
490 public Element GetElement(int id)
491 {
492 return dict.TryGetValue(id);
493 }
494
495 public Element CreateElement(int id)
496 {
497 Element element = Element.Create(id);
498 if (element == null)
499 {
500 return null;
501 }
502 element.owner = this;
503 dict.Add(id, element);
504 return element;
505 }
506
508 {
509 return GetOrCreateElement(ele.id);
510 }
511
512 public Element GetOrCreateElement(string alias)
513 {
514 return GetOrCreateElement(EClass.sources.elements.alias[alias].id);
515 }
516
518 {
519 Element value = null;
520 if (!dict.TryGetValue(id, out value))
521 {
522 value = CreateElement(id);
523 }
524 return value;
525 }
526
527 public void SetParent(Card c)
528 {
529 SetParent(c?.elements);
530 }
531
532 public void SetParent(ElementContainer newParent = null)
533 {
534 if (parent != null)
535 {
536 foreach (Element value in dict.Values)
537 {
538 if (!LimitLink || value.CanLink(this))
539 {
540 parent.ModLink(value.id, -(value.vBase + value.vSource));
541 }
542 }
543 }
544 if (newParent != null)
545 {
546 foreach (Element value2 in dict.Values)
547 {
548 if (!LimitLink || value2.CanLink(this))
549 {
550 newParent.ModLink(value2.id, value2.vBase + value2.vSource);
551 }
552 }
553 }
554 parent = newParent;
555 }
556
557 public List<Element> ListElements(Func<Element, bool> shoudList = null, Comparison<Element> comparison = null)
558 {
559 List<Element> list = new List<Element>();
560 List<Element> eles = dict.Values.ToList();
561 if (Card != null && Card.Chara != null)
562 {
564 {
565 AddElements(EClass.pc.faction.charaElements, isGlobal: true);
566 }
567 AddElements(Card.Chara.faithElements, isGlobal: false);
568 }
569 foreach (Element item2 in eles)
570 {
571 if (shoudList == null || shoudList(item2))
572 {
573 list.Add(item2);
574 }
575 }
576 if (comparison != null)
577 {
578 list.Sort(comparison);
579 }
580 return list;
581 void AddElements(ElementContainer container, bool isGlobal)
582 {
583 if (container == null)
584 {
585 return;
586 }
587 foreach (Element value in container.dict.Values)
588 {
589 bool flag = true;
590 foreach (Element item3 in eles)
591 {
592 if (value.id == item3.id)
593 {
594 flag = false;
595 break;
596 }
597 }
598 if (flag && value.Value != 0)
599 {
600 if (isGlobal)
601 {
603 eles.Add(item);
604 }
605 else
606 {
607 eles.Add(value);
608 }
609 }
610 }
611 }
612 }
613
614 public List<Element> ListBestAttributes()
615 {
616 List<Element> obj = ListElements((Element a) => a.HasTag("primary"));
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> ListBestSkills()
622 {
623 List<Element> obj = ListElements((Element a) => a.source.category == "skill");
624 obj.Sort((Element a, Element b) => (b.ValueWithoutLink - a.ValueWithoutLink) * 100000 + a.id - b.id);
625 return obj;
626 }
627
628 public List<Element> ListGeneFeats()
629 {
630 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);
631 }
632
633 public List<Element> ListLearnable(Chara c)
634 {
635 List<Element> list = new List<Element>();
636 foreach (KeyValuePair<int, Element> item in c.elements.dict)
637 {
638 if (!dict.ContainsKey(item.Key))
639 {
640 list.Add(item.Value);
641 }
642 }
643 return list;
644 }
645
646 public List<Element> ListRune()
647 {
648 return ListElements((Element a) => !a.source.encSlot.IsEmpty() && a.vBase + a.vSource != 0);
649 }
650
651 public void CopyTo(ElementContainer container)
652 {
653 container.dict.Clear();
654 foreach (KeyValuePair<int, Element> item in dict)
655 {
656 Element element = container.CreateElement(item.Key);
657 element.vBase = item.Value.vBase;
658 element.vExp = item.Value.vExp;
659 element.vSource = item.Value.vSource;
660 }
661 }
662
663 public static int GetSortVal(Element a)
664 {
665 int num = a.Value;
666 if (a.source.textAlt.Length <= 2 || a.Value < 0)
667 {
668 num -= 100000;
669 }
670 if (a.id == 2)
671 {
672 num += 20000;
673 }
674 if (a.IsFoodTraitMain)
675 {
676 num += 10000;
677 }
678 return num;
679 }
680
681 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)
682 {
683 List<Element> list = new List<Element>();
684 foreach (Element value in dict.Values)
685 {
686 if ((isValid == null || isValid(value)) && (mode != NoteMode.CharaMake || value.ValueWithoutLink != 0) && (value.Value != 0 || mode == NoteMode.CharaMakeAttributes) && (!value.HasTag("hidden") || EClass.debug.showExtra))
687 {
688 list.Add(value);
689 }
690 }
691 if (addRaceFeat)
692 {
693 Element element = Element.Create(29, 1);
694 element.owner = this;
695 list.Add(element);
696 }
697 if (list.Count == 0)
698 {
699 return;
700 }
701 onAdd?.Invoke();
702 switch (mode)
703 {
704 case NoteMode.CharaMake:
705 case NoteMode.CharaMakeAttributes:
706 list.Sort((Element a, Element b) => a.GetSortVal(UIList.SortMode.ByElementParent) - b.GetSortVal(UIList.SortMode.ByElementParent));
707 break;
708 case NoteMode.BonusTrait:
709 list.Sort((Element a, Element b) => GetSortVal(b) - GetSortVal(a));
710 break;
711 default:
712 list.Sort((Element a, Element b) => a.SortVal() - b.SortVal());
713 break;
714 }
715 foreach (Element item in list)
716 {
717 item.AddEncNote(n, Card, mode, funcText, onAddNote);
718 }
719 }
720
721 public void AddNoteAll(UINote n)
722 {
723 Transform transform = n.AddExtra<Transform>("noteRace");
724 UINote n2 = transform.Find("note1").GetComponent<UINote>();
725 UINote n3 = transform.Find("note2").GetComponent<UINote>();
726 AddNote(n3, (Element e) => e.HasTag("primary"), delegate
727 {
728 n3.AddHeader("HeaderNoteSmall", "attributes");
729 }, NoteMode.CharaMakeAttributes);
730 AddNote(n2, (Element e) => e.source.category == "skill" && !e.HasTag("hidden") && e.ValueWithoutLink > 1 && e.source.categorySub != "weapon", delegate
731 {
732 n2.AddHeader("HeaderNoteSmall", "skills");
733 }, NoteMode.CharaMake);
734 AddNote(n2, (Element e) => e is Feat, delegate
735 {
736 n2.AddHeader("HeaderNoteSmall", "feats");
737 }, NoteMode.CharaMake);
738 }
739}
SourceValueType
Definition: ACT.cs:62
CostType
Definition: ACT.cs:64
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2234
virtual Chara Chara
Definition: Card.cs:2032
ElementContainerCard elements
Definition: Card.cs:39
SourceMaterial.Row material
Definition: Card.cs:2013
int uid
Definition: Card.cs:120
virtual bool isChara
Definition: Card.cs:2045
int GetDaysTogetherBonus()
Definition: Card.cs:2937
int Evalue(int ele)
Definition: Card.cs:2533
Definition: Chara.cs:10
Faction faction
Definition: Chara.cs:425
override bool IsPCFaction
Definition: Chara.cs:669
ElementContainer faithElements
Definition: Chara.cs:38
bool isDead
Definition: Chara.cs:387
bool showExtra
Definition: CoreDebug.cs:167
Game game
Definition: Core.cs:72
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:58
static SourceManager sources
Definition: EClass.cs:42
static float rndf(float a)
Definition: EClass.cs:92
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static int GetSortVal(Element a)
void ModExp(int ele, float a, bool chain=false)
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)
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 Potential
Definition: ELEMENT.cs:296
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
virtual bool UsePotential
Definition: ELEMENT.cs:332
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:261
static string[] featRef
Definition: FEAT.cs:264
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