Elin Decompiled Documentation EA 23.356.1 Nightly
Loading...
Searching...
No Matches
DNA.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 DNA : EClass
9{
10 public enum Type
11 {
12 Inferior = 0,
13 Default = 3,
14 Superior = 5,
15 Superimani = 6,
16 Brain = 8
17 }
18
19 [JsonProperty]
20 public string id;
21
22 [JsonProperty]
23 public int[] ints = new int[6];
24
25 [JsonProperty]
26 public List<int> vals = new List<int>();
27
29
30 public Type type
31 {
32 get
33 {
34 return ints[0].ToEnum<Type>();
35 }
36 set
37 {
38 ints[0] = (int)value;
39 }
40 }
41
42 public int cost
43 {
44 get
45 {
46 return ints[1];
47 }
48 set
49 {
50 ints[1] = value;
51 }
52 }
53
54 public int lv
55 {
56 get
57 {
58 return ints[2];
59 }
60 set
61 {
62 ints[2] = value;
63 }
64 }
65
66 public int seed
67 {
68 get
69 {
70 return ints[3];
71 }
72 set
73 {
74 ints[3] = value;
75 }
76 }
77
78 public int slot
79 {
80 get
81 {
82 return ints[5];
83 }
84 set
85 {
86 ints[5] = value;
87 }
88 }
89
90 [OnSerializing]
91 private void _OnSerializing(StreamingContext context)
92 {
93 ints[4] = bits.ToInt();
94 }
95
96 [OnDeserialized]
97 private void _OnDeserialized(StreamingContext context)
98 {
99 if (ints.Length < 6)
100 {
101 Array.Resize(ref ints, 6);
102 slot = 1;
103 }
104 }
105
106 public static Thing GenerateGene(Chara c, Type? type = null)
107 {
108 Thing thing = ThingGen.Create((type == Type.Brain) ? "gene_brain" : "gene");
109 DNA dNA = new DNA();
110 thing.MakeRefFrom(c);
111 dNA.id = c.id;
112 dNA.lv = c.LV;
113 dNA.seed = EClass.rnd(20000);
114 thing.c_DNA = dNA;
115 dNA.GenerateWithGene(type ?? dNA.GetRandomType(), thing, c);
116 return thing;
117 }
118
119 public static Thing GenerateGene(CardRow r, Type? type = null, int lv = -1, int seed = -1)
120 {
121 Thing thing = ThingGen.Create((type == Type.Brain) ? "gene_brain" : "gene");
122 DNA dNA = new DNA();
123 thing.MakeRefFrom(r.id);
124 dNA.id = r.id;
125 dNA.lv = ((lv == -1) ? r.LV : lv);
126 dNA.seed = ((seed == -1) ? EClass.rnd(20000) : seed);
127 thing.c_DNA = dNA;
128 dNA.GenerateWithGene(type ?? dNA.GetRandomType(), thing);
129 return thing;
130 }
131
132 public static Thing CopyDNA(Thing from, Thing to)
133 {
134 to.c_DNA = from.c_DNA;
135 to.c_idRefCard = from.c_idRefCard;
136 to.ChangeMaterial(from.material);
137 return to;
138 }
139
140 public static Thing GenerateRandomGene(int lv = -1, int seed = -1)
141 {
142 if (lv == -1)
143 {
145 }
147 CardRow r = SpawnList.Get("chara").Select(100);
148 Rand.SetSeed();
149 return GenerateGene(r, Type.Superior, lv, seed);
150 }
151
152 public static void GenerateManiGene(Card owner)
153 {
154 owner.things.DestroyAll();
155 for (int i = 0; i < 3; i++)
156 {
157 Debug.Log("Mani:" + owner.c_seed);
158 Rand.SetSeed(owner.c_seed);
159 CardRow r = SpawnList.Get("chara").Select(100);
160 Rand.SetSeed(owner.c_seed);
161 Thing thing = GenerateGene(r, Type.Superimani, owner.LV, owner.c_seed);
162 thing.MakeRefFrom("mani");
163 Rand.SetSeed();
164 owner.c_seed++;
165 owner.AddCard(thing);
166 }
167 }
168
169 public void Apply(Chara c)
170 {
171 if (c.c_genes == null)
172 {
173 c.c_genes = new CharaGenes();
174 }
175 CharaGenes c_genes = c.c_genes;
176 if (type == Type.Inferior)
177 {
178 c.c_genes.inferior++;
179 return;
180 }
181 c.feat -= cost * c.GeneCostMTP / 100;
182 Apply(c, reverse: false);
183 c_genes.items.Add(this);
184 }
185
186 public void Apply(Chara c, bool reverse)
187 {
188 if (type == Type.Brain)
189 {
190 c._tactics = null;
191 return;
192 }
193 for (int i = 0; i < vals.Count; i += 2)
194 {
195 int num = vals[i];
196 int num2 = vals[i + 1];
198 switch (row.category)
199 {
200 case "slot":
201 if (reverse)
202 {
203 c.body.RemoveBodyPart(row.id);
204 }
205 else
206 {
207 c.body.AddBodyPart(row.id);
208 }
210 if (c.IsPC && (bool)WidgetEquip.Instance)
211 {
213 }
214 break;
215 case "feat":
216 {
217 int num3 = c.elements.ValueWithoutLink(num) + ((!reverse) ? 1 : (-1));
218 if (num3 < 0)
219 {
220 num3 = 0;
221 }
222 c.SetFeat(num, num3, !reverse);
223 if (reverse && num == 1423 && c.GetInt(134) > 0)
224 {
225 int num4 = c.elements.ValueWithoutLink(num) - c.GetInt(134);
226 if (num4 < 0)
227 {
228 num4 = 0;
229 }
230 c.SetFeat(num, num4);
231 c.SetInt(134);
232 }
233 break;
234 }
235 case "ability":
236 if (reverse)
237 {
238 c.ability.Remove(num * ((num2 >= 0) ? 1 : (-1)));
239 }
240 else
241 {
242 c.ability.Add(num, Mathf.Abs(num2), num2 < 0);
243 }
244 break;
245 default:
246 if (!reverse && c.elements.ValueWithoutLink(row.id) == 0)
247 {
248 c.elements.Learn(row.id, num2);
249 }
250 else
251 {
252 c.elements.ModBase(num, reverse ? (-num2) : num2);
253 }
254 break;
255 }
256 }
258 c.Refresh();
259 if (reverse)
260 {
262 }
263 }
264
265 public bool CanRemove(Chara c)
266 {
267 for (int i = 0; i < vals.Count; i += 2)
268 {
269 if (EClass.sources.elements.map[vals[i]].tag.Contains("permaGene"))
270 {
271 return false;
272 }
273 int num = vals[i];
274 if (num == 1228 || num == 1414)
275 {
276 if (c != null)
277 {
278 return !c.IsPC;
279 }
280 return true;
281 }
282 }
283 return true;
284 }
285
286 public void GenerateWithGene(Type _type, Card gene, Chara model = null)
287 {
288 Generate(_type, model);
290 gene.elements.SetTo(10, 0);
291 }
292
293 public void Generate(Type _type, Chara model = null)
294 {
295 type = _type;
296 cost = 0;
297 slot = 0;
298 vals.Clear();
300 if (model == null)
301 {
302 model = CharaGen.Create(id);
303 if (lv > model.LV)
304 {
305 model.SetLv(lv);
306 }
307 }
308 if (type == Type.Inferior || model == null)
309 {
310 type = Type.Inferior;
311 return;
312 }
313 if (type == Type.Brain)
314 {
315 cost = 4;
316 return;
317 }
318 int body = 0;
319 int action = 0;
320 int feat = 0;
321 int maxSlot = 1;
322 List<Element> listAttb = model.elements.ListBestAttributes();
323 List<Element> listSkill = model.elements.ListBestSkills();
324 List<Element> listFeat = model.elements.ListGeneFeats();
326 if (listFeat.Count == 0)
327 {
328 listFeat = model.ListAvailabeFeats(pet: true);
329 }
331 switch (type)
332 {
333 case Type.Default:
334 AddRandom(EClass.rnd(EClass.rnd(4)) + 1);
335 if (EClass.rnd(3) == 0 || vals.Count == 0)
336 {
337 AddSpecial();
338 }
339 break;
340 case Type.Superior:
341 AddRandom(EClass.rnd(EClass.rnd(4)) + 3);
342 if (EClass.rnd(3) == 0)
343 {
344 AddSpecial();
345 }
346 AddSpecial();
347 break;
348 case Type.Superimani:
349 AddRandom(EClass.rnd(EClass.rnd(4)) + 3);
350 if (EClass.rnd(3) == 0)
351 {
352 AddSpecial();
353 }
354 AddSpecial();
355 if (EClass.debug.enable)
356 {
357 lv = 100;
358 }
359 if (EClass.rnd(3) != 0 && lv > 10)
360 {
361 IEnumerable<SourceElement.Row> enumerable = EClass.sources.elements.map.Values.Where(delegate(SourceElement.Row row)
362 {
363 if (!row.tag.Contains("gene_mani"))
364 {
365 return false;
366 }
367 if (row.LV > lv)
368 {
369 return false;
370 }
371 if (row.aliasRef == "mold")
372 {
373 return false;
374 }
375 return (!(row.category == "ability") || !(row.aliasRef != "mold") || row.aliasRef.IsEmpty() || row.id <= 10000 || (EClass.sources.elements.alias[row.aliasRef].tag.Contains(row.alias.Split('_')[0]) ? true : false)) ? true : false;
376 });
377 if (enumerable.Count() > 0)
378 {
379 SourceElement.Row e = enumerable.RandomItem();
380 AddVal(e.id, (!(e.category == "ability")) ? 1 : 100, allowStack: false, (int v) => e.cost[0], allowNegative: false);
381 }
382 }
383 else
384 {
385 AddSpecial();
386 }
387 cost = cost / 2 - 10;
388 break;
389 }
390 if (vals.Count == 0)
391 {
392 for (int num = 0; num < 10; num++)
393 {
394 if (EClass.rnd(4) == 0)
395 {
396 AddSpecial();
397 }
398 else
399 {
400 AddRandom(1);
401 }
402 if (vals.Count > 0)
403 {
404 break;
405 }
406 }
407 }
408 Rand.SetSeed();
409 CalcCost();
410 CalcSlot();
411 void AddAction()
412 {
413 if (model.ability.list.items.Count != 0)
414 {
415 ActList.Item a = model.ability.list.items.RandomItem();
416 if (!(a.act.source.category != "ability") && a.act.source.geneSlot >= 0)
417 {
418 AddVal(a.act.source.id, a.chance * ((!a.pt) ? 1 : (-1)), allowStack: false, (int v) => 8 + a.act.source.cost[0] / 10 * 2, allowNegative: true);
419 action++;
420 }
421 }
422 }
423 void AddAttribute()
424 {
425 Element element = listAttb[EClass.rnd(3)];
426 AddVal(element.id, EClass.rndHalf(element.ValueWithoutLink / 2), allowStack: true, (int v) => v / 5 + 1, allowNegative: false);
427 }
428 void AddBody()
429 {
430 if (body == 0)
431 {
432 BodySlot bodySlot = null;
433 for (int i = 0; i < 100; i++)
434 {
435 BodySlot bodySlot2 = model.body.slots.RandomItem();
436 if (bodySlot2 != null && bodySlot2.elementId != 40 && bodySlot2.elementId != 44 && bodySlot2.elementId != 46)
437 {
438 bodySlot = bodySlot2;
439 break;
440 }
441 }
442 if (bodySlot != null)
443 {
444 AddVal(bodySlot.elementId, 1, allowStack: false, (int v) => 20, allowNegative: false);
445 body++;
446 }
447 }
448 }
449 void AddFeat()
450 {
451 if (listFeat.Count != 0)
452 {
453 feat++;
454 Element e2 = listFeat.RandomItem();
455 if (maxSlot <= 1 || e2.source.geneSlot <= 1)
456 {
457 if (e2.source.geneSlot > maxSlot)
458 {
459 maxSlot = e2.source.geneSlot;
460 }
461 AddVal(e2.id, 1, allowStack: false, (int v) => e2.source.cost[0] * 5, allowNegative: false);
462 }
463 }
464 }
465 void AddRandom(int n)
466 {
467 for (int i = 0; i < n; i++)
468 {
469 if (EClass.debug.enable && EClass.rnd(2) == 0)
470 {
471 AddSpecial();
472 }
473 else if (EClass.rnd(2) == 0)
474 {
475 AddSkill();
476 }
477 else
478 {
479 AddAttribute();
480 }
481 }
482 }
483 void AddSkill()
484 {
485 Element element = listSkill[Mathf.Clamp(EClass.rnd(6), 0, listSkill.Count - 1)];
486 AddVal(element.id, EClass.rndHalf(element.ValueWithoutLink / 2), allowStack: true, (int v) => v / 5 + 1, allowNegative: false);
487 }
488 void AddSpecial()
489 {
490 if (EClass.rnd(3) == 0)
491 {
492 AddAction();
493 }
494 else if (EClass.rnd(5) == 0)
495 {
496 AddBody();
497 }
498 else if (listFeat.Count > 0)
499 {
500 AddFeat();
501 }
502 else if (EClass.rnd(2) == 0)
503 {
504 AddSkill();
505 }
506 else
507 {
508 AddAttribute();
509 }
510 }
511 void AddVal(int id, int v, bool allowStack, Func<int, int> funcCost, bool allowNegative)
512 {
513 if (v >= 0 || allowNegative)
514 {
515 bool flag = false;
516 int num2 = EClass.curve(v, 20, 10, 90);
517 if (v < -100)
518 {
519 num2 = EClass.curve(Mathf.Abs(v + 100), 20, 10, 90);
520 }
521 v = EClass.curve(v, 20, 10, 80);
522 for (int i = 0; i < vals.Count; i += 2)
523 {
524 if (vals[i] == id)
525 {
526 if (allowStack)
527 {
528 v /= 2;
529 num2 /= 2;
530 vals[i + 1] += v;
531 Debug.Log(vals[i + 1] + ": " + v + "/" + num2);
532 flag = true;
533 break;
534 }
535 return;
536 }
537 }
538 if (v != 0)
539 {
540 if (!flag)
541 {
542 vals.Add(id);
543 vals.Add(v);
544 }
545 cost += Mathf.Max(0, funcCost(num2));
546 }
547 }
548 }
549 }
550
551 public void CalcCost()
552 {
553 if (cost < 0)
554 {
555 cost = 0;
556 }
557 }
558
559 public void CalcSlot()
560 {
561 slot = 0;
562 for (int i = 0; i < vals.Count; i += 2)
563 {
564 Element element = Element.Create(vals[i], vals[i + 1]);
565 if (type != Type.Superimani || !element.HasTag("gene_mani"))
566 {
567 if (element.source.geneSlot < 0)
568 {
569 slot = 99;
570 }
571 if (element.source.geneSlot > slot)
572 {
573 slot = element.source.geneSlot;
574 }
575 }
576 }
577 if (type == Type.Brain || type == Type.Inferior)
578 {
579 if (slot < 0)
580 {
581 slot = 0;
582 }
583 }
584 else if (slot < 1)
585 {
586 slot = 1;
587 }
588 }
589
590 public static Type GetType(string idMat)
591 {
592 return idMat switch
593 {
594 "jelly" => Type.Default,
595 "gold" => Type.Superior,
596 "amethyst" => Type.Brain,
597 "lapis" => Type.Superimani,
598 _ => Type.Inferior,
599 };
600 }
601
602 public string GetMaterialId(Type type)
603 {
604 return type switch
605 {
606 Type.Default => "jelly",
607 Type.Superior => "gold",
608 Type.Superimani => "lapis",
609 Type.Brain => "amethyst",
610 _ => "process",
611 };
612 }
613
614 public int GetDurationHour()
615 {
616 return Mathf.Min(cost, 5000) * Mathf.Min(cost, 5000) / 2;
617 }
618
620 {
621 if (EClass.rnd(5) == 0)
622 {
623 return Type.Superior;
624 }
625 if (EClass.rnd(10) == 0)
626 {
627 return Type.Inferior;
628 }
629 return Type.Default;
630 }
631
632 public string GetText()
633 {
634 string text = EClass.sources.cards.map.TryGetValue(id)?.GetName() ?? "???";
635 if (text == "*r")
636 {
637 text = "???";
638 }
639 return "gene".lang(text.ToTitleCase(), (cost == 0) ? "" : (cost.ToString() ?? ""));
640 }
641
642 public void WriteNote(UINote n, Thing owner = null, Chara tg = null)
643 {
644 if (slot >= 1 && (owner == null || !(owner.category.id == "relic")))
645 {
646 n.AddText("NoteText_enc", "isGeneReqSlots".lang(slot.ToString() ?? ""), FontColor.Warning);
647 }
648 if (!CanRemove(tg))
649 {
650 n.AddText("NoteText_enc", "isPermaGene".lang(), FontColor.Warning);
651 }
652 n.Space(4);
653 IList<int> vals = this.vals.Copy();
654 vals = (from i in Enumerable.Range(0, vals.Count / 2)
655 select new
656 {
657 id = vals[i * 2],
658 value = vals[i * 2 + 1]
659 } into x
660 orderby x.id
661 select x).SelectMany(x => new int[2] { x.id, x.value }).ToList();
662 if (type == Type.Brain)
663 {
664 SourceChara.Row row = EClass.sources.charas.map.TryGetValue(id);
665 if (row != null)
666 {
667 string key = row.tactics.IsEmpty(EClass.sources.tactics.map.TryGetValue(row.id)?.id ?? EClass.sources.tactics.map.TryGetValue(row.job)?.id ?? "predator");
668 n.AddText("NoteText_enc", "gene_info".lang(EClass.sources.tactics.map[key].GetName().ToTitleCase(), ""), FontColor.ButtonGeneral);
669 }
670 for (int num = 0; num < vals.Count; num += 2)
671 {
672 int num2 = vals[num];
673 int num3 = vals[num + 1];
674 FontColor color = ((num3 >= 0) ? FontColor.Good : FontColor.Bad);
675 string @ref = (num2 + 1).ToString() ?? "";
676 string text = "";
677 num3 = Mathf.Abs(num3 / 20) + 1;
678 text = text + "[" + "*".Repeat(Mathf.Clamp(num3, 1, 5)) + ((num3 > 5) ? "+" : "") + "]";
679 n.AddText("NoteText_enc", "gene_info_brain".lang(@ref, text), color);
680 }
681 return;
682 }
683 for (int num4 = 0; num4 < vals.Count; num4 += 2)
684 {
685 Element element = Element.Create(vals[num4], vals[num4 + 1]);
686 string text2 = "";
687 int num5 = element.Value / 10;
688 FontColor color2 = FontColor.Good;
689 bool flag = false;
690 string text3 = "";
691 switch (element.source.category)
692 {
693 case "slot":
694 color2 = FontColor.Myth;
695 num5 = -1;
696 break;
697 case "feat":
698 color2 = FontColor.FoodMisc;
699 num5 = -1;
700 break;
701 case "ability":
702 color2 = FontColor.Topic2;
703 num5 = -1;
704 if (element.Value < 0)
705 {
706 text3 = " (" + "party".lang() + ") ";
707 }
708 break;
709 default:
710 flag = true;
711 break;
712 }
713 if (num5 >= 0)
714 {
715 text2 = text2 + "[" + "*".Repeat(Mathf.Clamp(num5, 1, 5)) + ((num5 > 5) ? "+" : "") + "]";
716 }
717 if (flag)
718 {
719 text2 = text2 + " (" + element.Value + ")";
720 }
721 if ((bool)LayerCraft.Instance && (element.source.category == "slot" || element.HasTag("noRelic") || element.HasTag("permaGene")))
722 {
723 color2 = FontColor.Bad;
724 }
725 n.AddText("NoteText_enc", "gene_info".lang(element.Name.ToTitleCase(wholeText: true) + text3, text2), color2);
726 }
727 }
728
729 public void WriteNoteExtra(UINote n, Thing owner, Chara tg)
730 {
731 n.AddHeader("HeaderAdditionalTrait", "gene_hint");
732 _ = tg.c_genes;
733 int num = slot;
734 if (num > 1 && tg.HasElement(1237))
735 {
736 num--;
737 }
738 int num2 = tg.MaxGeneSlot - tg.CurrentGeneSlot;
739 int num3 = num2 - num;
740 int maxGeneSlot = tg.MaxGeneSlot;
741 n.AddText("gene_hint_slot".lang(num2.ToString() ?? "", num3.ToString() ?? "", maxGeneSlot.ToString() ?? ""), (num3 >= 0) ? FontColor.Good : FontColor.Bad);
742 int num4 = cost * tg.GeneCostMTP / 100;
743 int num5 = tg.feat - num4;
744 n.AddText("gene_hint_cost".lang(tg.feat.ToString() ?? "", num4 + ((num4 == cost) ? "" : ("(" + cost + ")")), num5.ToString() ?? ""), (num5 >= 0) ? FontColor.Good : FontColor.Bad);
745 }
746
748 {
749 for (int i = 0; i < vals.Count; i += 2)
750 {
751 Element element = Element.Create(vals[i], vals[i + 1]);
752 if (c.IsPC && !CanRemove(c))
753 {
754 return element;
755 }
756 if (!(element.source.category == "feat"))
757 {
758 continue;
759 }
760 if (c.Evalue(element.id) < element.source.max)
761 {
762 Element orCreateElement = c.elements.GetOrCreateElement(element.id);
763 if (orCreateElement != null && orCreateElement.vLink == 0)
764 {
765 continue;
766 }
767 }
768 return element;
769 }
770 return null;
771 }
772
774 {
775 for (int i = 0; i < vals.Count; i += 2)
776 {
777 Element element = Element.Create(vals[i], vals[i + 1]);
778 if (!(element.source.category == "ability"))
779 {
780 continue;
781 }
782 foreach (ActList.Item item in c.ability.list.items)
783 {
784 if (item.act.source.id == element.id)
785 {
786 return element;
787 }
788 }
789 }
790 return null;
791 }
792
793 public int GetBodySlot()
794 {
795 for (int i = 0; i < vals.Count; i += 2)
796 {
797 Element element = Element.Create(vals[i], vals[i + 1]);
798 if (element.source.category == "slot")
799 {
800 return element.id;
801 }
802 }
803 return -1;
804 }
805
806 public Element GetElement(int id)
807 {
808 for (int i = 0; i < vals.Count; i += 2)
809 {
810 if (vals[i] == id)
811 {
812 return Element.Create(vals[i], vals[i + 1]);
813 }
814 }
815 return null;
816 }
817
818 public void ReplaceBodySlot(int slot)
819 {
820 for (int i = 0; i < vals.Count; i += 2)
821 {
822 if (Element.Create(vals[i], vals[i + 1]).source.category == "slot")
823 {
824 vals[i] = slot;
825 }
826 }
827 }
828
829 public void MakeSlimeFood(Chara c)
830 {
831 int num = c.Evalue(6608) + 10;
832 for (int i = 0; i < vals.Count; i += 2)
833 {
834 Element element = Element.Create(vals[i], vals[i + 1]);
835 if ((element.source.category == "attribute" || element.source.category == "skill") && vals[i + 1] > num)
836 {
837 vals[i + 1] = num;
838 }
839 }
840 cost = 0;
841 }
842
843 public DNA Relicize()
844 {
845 for (int i = 0; i < vals.Count; i += 2)
846 {
847 Element element = Element.Create(vals[i], vals[i + 1]);
848 if (element.source.category == "slot" || element.HasTag("noRelic") || element.HasTag("permaGene"))
849 {
850 vals.RemoveRange(i, 2);
851 i -= 2;
852 }
853 }
854 cost = cost * Mathf.Clamp(slot, 1, 10) / 10;
855 return this;
856 }
857}
if(!match.Success)
FontColor
Definition: FontColor.cs:2
int chance
Definition: ActList.cs:9
bool pt
Definition: ActList.cs:11
Act act
Definition: ActList.cs:7
List< Item > items
Definition: ActList.cs:14
int elementId
Definition: BodySlot.cs:6
string id
Definition: CardRow.cs:7
Definition: Card.cs:11
ElementContainerCard elements
Definition: Card.cs:42
string id
Definition: Card.cs:36
SourceMaterial.Row material
Definition: Card.cs:2103
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3217
void SetInt(string id, int value=0)
Definition: Card.cs:2586
Card MakeRefFrom(string id)
Definition: Card.cs:6027
Card AddCard(Card c)
Definition: Card.cs:3266
Card SetLv(int a)
Definition: Card.cs:3070
int c_seed
Definition: Card.cs:1345
CharaGenes c_genes
Definition: Card.cs:1897
int feat
Definition: Card.cs:377
ThingContainer things
Definition: Card.cs:39
int Evalue(int ele)
Definition: Card.cs:2704
DNA c_DNA
Definition: Card.cs:1933
int GetInt(string id, int? defaultInt=null)
Definition: Card.cs:2567
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6383
int LV
Definition: Card.cs:389
string c_idRefCard
Definition: Card.cs:1777
void Remove(int id, bool permanent=false)
ActList list
Definition: CharaAbility.cs:13
void Add(int id, int chance, bool pt, bool permanent=false)
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:312
void RefreshBodyParts()
Definition: CharaBody.cs:338
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:367
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
int inferior
Definition: CharaGenes.cs:10
List< DNA > items
Definition: CharaGenes.cs:7
Definition: Chara.cs:10
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1806
CharaBody body
Definition: Chara.cs:96
override bool IsPC
Definition: Chara.cs:632
void RemoveAllStances()
Definition: Chara.cs:10282
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:10560
int MaxGeneSlot
Definition: Chara.cs:1117
int CurrentGeneSlot
Definition: Chara.cs:1132
void RefreshFaithElement()
Definition: Chara.cs:10877
CharaAbility ability
Definition: Chara.cs:430
bool enable
Definition: CoreDebug.cs:302
Definition: DNA.cs:9
void Apply(Chara c, bool reverse)
Definition: DNA.cs:186
bool CanRemove(Chara c)
Definition: DNA.cs:265
void WriteNote(UINote n, Thing owner=null, Chara tg=null)
Definition: DNA.cs:642
string id
Definition: DNA.cs:20
Type type
Definition: DNA.cs:31
int cost
Definition: DNA.cs:43
void MakeSlimeFood(Chara c)
Definition: DNA.cs:829
void GenerateWithGene(Type _type, Card gene, Chara model=null)
Definition: DNA.cs:286
void _OnDeserialized(StreamingContext context)
Definition: DNA.cs:97
Element GetInvalidFeat(Chara c)
Definition: DNA.cs:747
int seed
Definition: DNA.cs:67
static Thing GenerateGene(CardRow r, Type? type=null, int lv=-1, int seed=-1)
Definition: DNA.cs:119
void _OnSerializing(StreamingContext context)
Definition: DNA.cs:91
Type
Definition: DNA.cs:11
Type GetRandomType()
Definition: DNA.cs:619
static Thing CopyDNA(Thing from, Thing to)
Definition: DNA.cs:132
static Thing GenerateRandomGene(int lv=-1, int seed=-1)
Definition: DNA.cs:140
int slot
Definition: DNA.cs:79
static Type GetType(string idMat)
Definition: DNA.cs:590
int[] ints
Definition: DNA.cs:23
BitArray32 bits
Definition: DNA.cs:28
static void GenerateManiGene(Card owner)
Definition: DNA.cs:152
void CalcSlot()
Definition: DNA.cs:559
string GetMaterialId(Type type)
Definition: DNA.cs:602
void Generate(Type _type, Chara model=null)
Definition: DNA.cs:293
void WriteNoteExtra(UINote n, Thing owner, Chara tg)
Definition: DNA.cs:729
void Apply(Chara c)
Definition: DNA.cs:169
int GetDurationHour()
Definition: DNA.cs:614
Element GetElement(int id)
Definition: DNA.cs:806
void CalcCost()
Definition: DNA.cs:551
DNA Relicize()
Definition: DNA.cs:843
int lv
Definition: DNA.cs:55
string GetText()
Definition: DNA.cs:632
int GetBodySlot()
Definition: DNA.cs:793
static Thing GenerateGene(Chara c, Type? type=null)
Definition: DNA.cs:106
List< int > vals
Definition: DNA.cs:26
void ReplaceBodySlot(int slot)
Definition: DNA.cs:818
Element GetInvalidAction(Chara c)
Definition: DNA.cs:773
Definition: EClass.cs:6
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
static Zone _zone
Definition: EClass.cs:21
static int rnd(long a)
Definition: EClass.cs:59
static SourceManager sources
Definition: EClass.cs:43
static int rndHalf(int a)
Definition: EClass.cs:97
static CoreDebug debug
Definition: EClass.cs:49
void Learn(int ele, int v=1)
int ValueWithoutLink(int ele)
Element ModBase(int ele, int v)
void SetTo(int id, int v)
Element GetOrCreateElement(Element ele)
int ValueWithoutLink
Definition: ELEMENT.cs:303
int id
Definition: ELEMENT.cs:259
SourceElement.Row source
Definition: ELEMENT.cs:282
bool HasTag(string tag)
Definition: ELEMENT.cs:482
int Value
Definition: ELEMENT.cs:301
virtual string Name
Definition: ELEMENT.cs:313
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1163
int vLink
Definition: ELEMENT.cs:269
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:44
int LV
Definition: RenderRow.cs:22
Dictionary< string, CardRow > map
Definition: SourceCard.cs:9
SourceCard cards
SourceElement elements
SourceChara charas
SourceTactics tactics
static SpawnList Get(string id, string parent=null, CardFilter filter=null)
Definition: SpawnList.cs:18
CardRow Select(int lv=-1, int levelRange=-1)
Definition: SpawnList.cs:139
void DestroyAll(Func< Thing, bool > funcExclude=null)
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
Definition: UINote.cs:6
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62
static WidgetEquip Instance
Definition: WidgetEquip.cs:11
void Rebuild()
Definition: WidgetEquip.cs:61
override int ContentLv
Definition: Zone.cs:103
int ToInt()
Definition: BitArray32.cs:84