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