Elin Modding Docs Doc
Loading...
Searching...
No Matches
ConSuspend.cs
1using System;
2using Newtonsoft.Json;
3
4// Token: 0x020002BC RID: 700
5public class ConSuspend : BadCondition
6{
7 // Token: 0x060016BC RID: 5820 RVA: 0x000970A4 File Offset: 0x000952A4
8 public override int GetPhase()
9 {
10 return 0;
11 }
12
13 // Token: 0x17000659 RID: 1625
14 // (get) Token: 0x060016BD RID: 5821 RVA: 0x000970A7 File Offset: 0x000952A7
15 public override bool ConsumeTurn
16 {
17 get
18 {
19 return true;
20 }
21 }
22
23 // Token: 0x060016BE RID: 5822 RVA: 0x000970AA File Offset: 0x000952AA
24 public override void SetOwner(Chara _owner, bool onDeserialize = false)
25 {
26 base.SetOwner(_owner, false);
27 this.owner.conSuspend = this;
28 }
29
30 // Token: 0x060016BF RID: 5823 RVA: 0x000970C0 File Offset: 0x000952C0
31 public override void Tick()
32 {
33 if (this.uidMachine == 0)
34 {
35 return;
36 }
37 TraitGeneMachine traitGeneMachine = this.owner.pos.FindThing<TraitGeneMachine>();
38 if (traitGeneMachine == null || !traitGeneMachine.owner.isOn || (this.duration > 0 && !this.HasGene))
39 {
40 base.Kill(false);
41 }
42 }
43
44 // Token: 0x1700065A RID: 1626
45 // (get) Token: 0x060016C0 RID: 5824 RVA: 0x0009710F File Offset: 0x0009530F
46 public bool HasGene
47 {
48 get
49 {
50 return this.gene != null && this.gene.GetRootCard() == this.owner;
51 }
52 }
53
54 // Token: 0x060016C1 RID: 5825 RVA: 0x0009712E File Offset: 0x0009532E
55 public override void OnRemoved()
56 {
57 this.owner.conSuspend = null;
58 if (this.HasGene)
59 {
60 this.owner.PickOrDrop(this.owner.pos, this.gene, true);
61 }
62 }
63
64 // Token: 0x04001068 RID: 4200
65 [JsonProperty]
66 public int uidMachine;
67
68 // Token: 0x04001069 RID: 4201
69 [JsonProperty]
70 public int duration;
71
72 // Token: 0x0400106A RID: 4202
73 [JsonProperty]
74 public int dateFinish;
75
76 // Token: 0x0400106B RID: 4203
77 [JsonProperty]
78 public Thing gene;
79}
Definition Chara.cs:12
Definition Thing.cs:10