Elin Modding Docs Doc
Loading...
Searching...
No Matches
InvOwnerGene.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x0200056A RID: 1386
7{
8 // Token: 0x17000B5A RID: 2906
9 // (get) Token: 0x060025EC RID: 9708 RVA: 0x000D731D File Offset: 0x000D551D
10 public override InvOwnerDraglet.ProcessType processType
11 {
12 get
13 {
14 return InvOwnerDraglet.ProcessType.None;
15 }
16 }
17
18 // Token: 0x17000B5B RID: 2907
19 // (get) Token: 0x060025ED RID: 9709 RVA: 0x000D7320 File Offset: 0x000D5520
20 public override string langTransfer
21 {
22 get
23 {
24 return "invGene";
25 }
26 }
27
28 // Token: 0x060025EE RID: 9710 RVA: 0x000D7327 File Offset: 0x000D5527
29 public InvOwnerGene(Card owner = null, Chara _tg = null) : base(owner, null, CurrencyType.None)
30 {
31 this.tg = _tg;
32 this.count = 1;
33 }
34
35 // Token: 0x060025EF RID: 9711 RVA: 0x000D7340 File Offset: 0x000D5540
36 public override bool ShouldShowGuide(Thing t)
37 {
38 return t.c_DNA != null && this.tg.feat >= t.c_DNA.cost;
39 }
40
41 // Token: 0x060025F0 RID: 9712 RVA: 0x000D7368 File Offset: 0x000D5568
42 public override void _OnProcess(Thing t)
43 {
44 DNA.Type type = t.c_DNA.type;
45 if (type != DNA.Type.Inferior && this.tg.c_genes != null && this.tg.c_genes.items.Count >= this.tg.MaxGene)
46 {
47 SE.Beep();
48 Msg.Say("tooManyGene", this.tg, null, null, null);
49 return;
50 }
51 if (type == DNA.Type.Brain)
52 {
53 if (this.tg.c_genes == null)
54 {
55 goto IL_144;
56 }
57 using (List<DNA>.Enumerator enumerator = this.tg.c_genes.items.GetEnumerator())
58 {
59 while (enumerator.MoveNext())
60 {
61 if (enumerator.Current.type == DNA.Type.Brain)
62 {
63 SE.Beep();
64 Msg.Say("invalidGeneBrain", this.tg, null, null, null);
65 return;
66 }
67 }
68 goto IL_144;
69 }
70 }
71 Element invalidFeat = t.c_DNA.GetInvalidFeat(this.tg);
72 if (invalidFeat != null)
73 {
74 SE.Beep();
75 Msg.Say("invalidGeneFeat", this.tg, invalidFeat.Name.ToTitleCase(false), null, null);
76 return;
77 }
78 Element invalidAction = t.c_DNA.GetInvalidAction(this.tg);
79 if (invalidAction != null)
80 {
81 SE.Beep();
82 Msg.Say("invalidGeneAction", this.tg, invalidAction.Name.ToTitleCase(false), null, null);
83 return;
84 }
85 IL_144:
86 SE.Play("mutation");
87 this.tg.PlayEffect("identify", true, 0f, default(Vector3));
88 Msg.Say("gene_modify", this.tg, t, null, null);
89 this.tg.AddCard(t);
90 ConSuspend condition = this.tg.GetCondition<ConSuspend>();
91 condition.gene = t;
92 condition.duration = t.c_DNA.GetDurationHour();
93 condition.dateFinish = EClass.world.date.GetRaw(condition.duration);
94 }
95
96 // Token: 0x040014FB RID: 5371
97 public Chara tg;
98}
Definition Card.cs:13
Definition Chara.cs:12
Definition DNA.cs:9
Definition Msg.cs:7
Definition Thing.cs:10