Elin Modding Docs Doc
Loading...
Searching...
No Matches
TraitGodStatue.cs
1using System;
2using UnityEngine;
3
4// Token: 0x02000422 RID: 1058
6{
7 // Token: 0x1700095F RID: 2399
8 // (get) Token: 0x06001E12 RID: 7698 RVA: 0x000AD588 File Offset: 0x000AB788
9 public Religion Religion
10 {
11 get
12 {
13 return EClass.game.religions.dictAll[base.GetParam(1, null)];
14 }
15 }
16
17 // Token: 0x06001E13 RID: 7699 RVA: 0x000AD5A6 File Offset: 0x000AB7A6
18 public override bool IsImplemented()
19 {
20 return true;
21 }
22
23 // Token: 0x06001E14 RID: 7700 RVA: 0x000AD5A9 File Offset: 0x000AB7A9
24 public override void OnCreate(int lv)
25 {
26 base.OnCreate(lv);
27 this.OnChangeMaterial();
28 }
29
30 // Token: 0x06001E15 RID: 7701 RVA: 0x000AD5B8 File Offset: 0x000AB7B8
31 public void OnChangeMaterial()
32 {
33 this.owner.isOn = (this.owner.material.alias == "gold");
34 if (this.Religion.id == "machine")
35 {
36 this.owner.AddCard(this.GetManiGene());
37 }
38 if (this.owner.placeState == PlaceState.installed)
39 {
40 this.owner.renderer.RefreshExtra();
41 }
42 }
43
44 // Token: 0x06001E16 RID: 7702 RVA: 0x000AD634 File Offset: 0x000AB834
45 public Thing GetManiGene()
46 {
47 this.owner.things.DestroyAll(null);
48 Debug.Log("Mani:" + this.owner.c_seed.ToString());
49 Rand.SetSeed(this.owner.c_seed);
50 CardRow r = SpawnList.Get("chara", null, null).Select(100, -1);
51 Rand.SetSeed(this.owner.c_seed);
52 Thing thing = DNA.GenerateGene(r, new DNA.Type?(DNA.Type.Superior), this.owner.LV, this.owner.c_seed);
53 thing.c_DNA.cost = thing.c_DNA.cost / 2;
54 thing.MakeRefFrom("mani");
55 Rand.SetSeed(-1);
56 Card owner = this.owner;
57 int c_seed = owner.c_seed;
58 owner.c_seed = c_seed + 1;
59 return thing;
60 }
61
62 // Token: 0x06001E17 RID: 7703 RVA: 0x000AD70C File Offset: 0x000AB90C
63 public override void _OnUse(Chara c)
64 {
65 this.Religion.Talk("shrine", null, null);
66 string id = this.Religion.id;
67 uint num = <PrivateImplementationDetails>.ComputeStringHash(id);
68 if (num <= 1330461687U)
69 {
70 if (num != 336916743U)
71 {
72 if (num != 636753111U)
73 {
74 if (num != 1330461687U)
75 {
76 return;
77 }
78 if (!(id == "element"))
79 {
80 return;
81 }
82 }
83 else if (!(id == "earth"))
84 {
85 return;
86 }
87 Rand.SetSeed(this.owner.c_seed);
88 SourceMaterial.Row randomMaterial = MATERIAL.GetRandomMaterial(this.owner.LV / 2 + 20, (this.Religion.id == "earth") ? "metal" : "leather", true);
89 Thing thing = ThingGen.Create("mathammer", -1, -1);
90 thing.ChangeMaterial(randomMaterial);
91 thing.noSell = true;
92 Rand.SetSeed(-1);
93 EClass.pc.Pick(thing, true, true);
94 return;
95 }
96 if (!(id == "wind"))
97 {
98 return;
99 }
100 EClass.pc.Pick(ThingGen.Create("blood_angel", -1, -1), true, true);
101 return;
102 }
103 else if (num <= 3290931474U)
104 {
105 if (num != 2445848765U)
106 {
107 if (num != 3290931474U)
108 {
109 return;
110 }
111 if (!(id == "harvest"))
112 {
113 return;
114 }
115 Thing t = ThingGen.Create("book_kumiromi", -1, -1);
116 EClass.pc.Pick(t, true, true);
117 return;
118 }
119 else
120 {
121 if (!(id == "healing"))
122 {
123 return;
124 }
125 Msg.Say("jure_hug");
126 EClass.player.ModKeyItem("jure_feather", 1, true);
127 Msg.Say("jure_hug2");
128 return;
129 }
130 }
131 else if (num != 3775092334U)
132 {
133 if (num != 4145017712U)
134 {
135 return;
136 }
137 if (!(id == "luck"))
138 {
139 return;
140 }
141 EClass.player.ModKeyItem((!EClass.player.wellWished && EClass.player.CountKeyItem("well_wish") == 0) ? "well_wish" : "well_enhance", 1, true);
142 return;
143 }
144 else
145 {
146 if (!(id == "machine"))
147 {
148 return;
149 }
150 Thing t2 = this.owner.things.Find("gene", -1, -1) ?? this.GetManiGene();
151 EClass.pc.Pick(t2, true, true);
152 return;
153 }
154 }
155}
Definition Card.cs:13
Definition Chara.cs:12
Definition DNA.cs:9
Definition Msg.cs:7
Definition Thing.cs:10