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