Elin Modding Docs Doc
Loading...
Searching...
No Matches
Hoard.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Runtime.Serialization;
5using Newtonsoft.Json;
6using UnityEngine;
7
8// Token: 0x02000517 RID: 1303
9public class Hoard : EClass
10{
11 // Token: 0x06002303 RID: 8963 RVA: 0x000C5214 File Offset: 0x000C3414
12 [OnDeserialized]
13 private void OnDeserialized(StreamingContext context)
14 {
15 foreach (Hoard.Item item in this.list)
16 {
17 this.items.Add(item.id, item);
18 }
19 }
20
21 // Token: 0x06002304 RID: 8964 RVA: 0x000C5274 File Offset: 0x000C3474
22 public Hoard.Item AddRandom(int r, bool msg = true)
23 {
24 IEnumerable<SourceCollectible.Row> ie = from a in EClass.sources.collectibles.rows
25 where a.rarity == r
26 select a;
27 return this.Add(ie.RandomItem<SourceCollectible.Row>().id, 1, msg);
28 }
29
30 // Token: 0x06002305 RID: 8965 RVA: 0x000C52C4 File Offset: 0x000C34C4
31 public Hoard.Item AddRandom(bool msg = true)
32 {
33 string id = EClass.sources.collectibles.rows.RandomItem<SourceCollectible.Row>().id;
34 return this.Add(id, 1, msg);
35 }
36
37 // Token: 0x06002306 RID: 8966 RVA: 0x000C52F4 File Offset: 0x000C34F4
38 public Hoard.Item Add(string id)
39 {
40 SourceCollectible.Row row = EClass.sources.collectibles.map[id];
41 int num = (row.num == 0) ? 10 : row.num;
42 if (num != 1)
43 {
44 num *= 2;
45 }
46 Hoard.Item item = this.Add(row.id, num, false);
47 item.random = true;
48 return item;
49 }
50
51 // Token: 0x06002307 RID: 8967 RVA: 0x000C5348 File Offset: 0x000C3548
52 public Hoard.Item Add(string id, int num, bool msg = false)
53 {
54 if (num == 0)
55 {
56 return this.items.TryGetValue(id, null);
57 }
58 Hoard.Item item = null;
59 if (!this.items.TryGetValue(id, out item))
60 {
61 item = new Hoard.Item
62 {
63 id = id
64 };
65 this.list.Add(item);
66 this.items[id] = item;
67 }
68 if (item.num == item.show)
69 {
70 item.show += num;
71 }
72 item.num += num;
73 if (item.IsUnique && item.show > 1)
74 {
75 item.show = 1;
76 }
77 if (msg)
78 {
79 Msg.SetColor(EClass.Colors.GetRarityColor(item.Source.rarity, true));
80 Msg.AquireItem(item.Name(num));
81 }
82 if (this.hentai)
83 {
84 item.show = item.num;
85 }
86 return item;
87 }
88
89 // Token: 0x06002308 RID: 8968 RVA: 0x000C541F File Offset: 0x000C361F
90 public Sprite GetSprite(string id)
91 {
92 SpriteSheet.Add("UI/Layer/Hoard/Molds/_sprites_hoard");
93 return SpriteSheet.Get("_sprites_hoard_" + id);
94 }
95
96 // Token: 0x06002309 RID: 8969 RVA: 0x000C543C File Offset: 0x000C363C
97 public GameObject GetActor(string id)
98 {
99 EClass.sources.collectibles.Init();
100 SourceCollectible.Row row = EClass.sources.collectibles.map[id];
101 SpriteRenderer spriteRenderer = UnityEngine.Object.Instantiate<SpriteRenderer>(ResourceCache.Load<SpriteRenderer>("UI/Layer/Hoard/Molds/" + row.prefab.IsEmpty("default")));
102 spriteRenderer.sprite = this.GetSprite(id);
103 return spriteRenderer.gameObject;
104 }
105
106 // Token: 0x0600230A RID: 8970 RVA: 0x000C54A4 File Offset: 0x000C36A4
107 public void Clear()
108 {
109 this.items.Clear();
110 this.list.Clear();
111 }
112
113 // Token: 0x04001276 RID: 4726
114 public Dictionary<string, Hoard.Item> items = new Dictionary<string, Hoard.Item>();
115
116 // Token: 0x04001277 RID: 4727
117 [JsonProperty]
118 public List<Hoard.Item> list = new List<Hoard.Item>();
119
120 // Token: 0x04001278 RID: 4728
121 [JsonProperty]
122 public Hoard.Mode mode;
123
124 // Token: 0x04001279 RID: 4729
125 [JsonProperty]
126 public int bg;
127
128 // Token: 0x0400127A RID: 4730
129 [JsonProperty]
130 public int reflection = 100;
131
132 // Token: 0x0400127B RID: 4731
133 [JsonProperty]
134 public int maxSounds = 28;
135
136 // Token: 0x0400127C RID: 4732
137 [JsonProperty]
138 public int volume = 40;
139
140 // Token: 0x0400127D RID: 4733
141 [JsonProperty]
142 public int hiScore;
143
144 // Token: 0x0400127E RID: 4734
145 [JsonProperty]
146 public int score;
147
148 // Token: 0x0400127F RID: 4735
149 public bool shadow = true;
150
151 // Token: 0x04001280 RID: 4736
152 public bool voice = true;
153
154 // Token: 0x04001281 RID: 4737
155 public bool pixelPerfect;
156
157 // Token: 0x04001282 RID: 4738
158 public bool hentai;
159
160 // Token: 0x02000A27 RID: 2599
161 public enum Mode
162 {
163 // Token: 0x040029C8 RID: 10696
164 all,
165 // Token: 0x040029C9 RID: 10697
166 lux,
167 // Token: 0x040029CA RID: 10698
168 junk
169 }
170
171 // Token: 0x02000A28 RID: 2600
172 public class Item : EClass
173 {
174 // Token: 0x170011D8 RID: 4568
175 // (get) Token: 0x06003FD9 RID: 16345 RVA: 0x0014DAE9 File Offset: 0x0014BCE9
176 // (set) Token: 0x06003FDA RID: 16346 RVA: 0x0014DAF3 File Offset: 0x0014BCF3
177 public int num
178 {
179 get
180 {
181 return this.ints[1];
182 }
183 set
184 {
185 this.ints[1] = value;
186 }
187 }
188
189 // Token: 0x170011D9 RID: 4569
190 // (get) Token: 0x06003FDB RID: 16347 RVA: 0x0014DAFE File Offset: 0x0014BCFE
191 // (set) Token: 0x06003FDC RID: 16348 RVA: 0x0014DB08 File Offset: 0x0014BD08
192 public int show
193 {
194 get
195 {
196 return this.ints[2];
197 }
198 set
199 {
200 this.ints[2] = value;
201 }
202 }
203
204 // Token: 0x170011DA RID: 4570
205 // (get) Token: 0x06003FDD RID: 16349 RVA: 0x0014DB13 File Offset: 0x0014BD13
206 // (set) Token: 0x06003FDE RID: 16350 RVA: 0x0014DB21 File Offset: 0x0014BD21
207 public bool random
208 {
209 get
210 {
211 return this.bits[0];
212 }
213 set
214 {
215 this.bits[0] = value;
216 }
217 }
218
219 // Token: 0x170011DB RID: 4571
220 // (get) Token: 0x06003FDF RID: 16351 RVA: 0x0014DB30 File Offset: 0x0014BD30
221 // (set) Token: 0x06003FE0 RID: 16352 RVA: 0x0014DB3E File Offset: 0x0014BD3E
222 public bool floating
223 {
224 get
225 {
226 return this.bits[1];
227 }
228 set
229 {
230 this.bits[1] = value;
231 }
232 }
233
234 // Token: 0x170011DC RID: 4572
235 // (get) Token: 0x06003FE1 RID: 16353 RVA: 0x0014DB4D File Offset: 0x0014BD4D
236 public SourceCollectible.Row Source
237 {
238 get
239 {
240 if (!EClass.sources.collectibles.initialized)
241 {
242 EClass.sources.collectibles.Init();
243 }
244 return EClass.sources.collectibles.map[this.id];
245 }
246 }
247
248 // Token: 0x170011DD RID: 4573
249 // (get) Token: 0x06003FE2 RID: 16354 RVA: 0x0014DB89 File Offset: 0x0014BD89
250 public bool IsUnique
251 {
252 get
253 {
254 return this.Source.tag.Contains("unique");
255 }
256 }
257
258 // Token: 0x06003FE3 RID: 16355 RVA: 0x0014DBA0 File Offset: 0x0014BDA0
259 [OnSerializing]
260 internal void OnSerializing(StreamingContext context)
261 {
262 this.ints[0] = (int)this.bits.Bits;
263 }
264
265 // Token: 0x06003FE4 RID: 16356 RVA: 0x0014DBB5 File Offset: 0x0014BDB5
266 [OnDeserialized]
267 internal void _OnDeserialized(StreamingContext context)
268 {
269 this.bits.Bits = (uint)this.ints[0];
270 }
271
272 // Token: 0x06003FE5 RID: 16357 RVA: 0x0014DBCC File Offset: 0x0014BDCC
273 public string Name(int n)
274 {
275 return string.Concat(new string[]
276 {
277 "(",
278 "collectible".lang(),
279 ") [",
280 Lang._rarity(this.Source.rarity),
281 "] ",
282 this.Source.GetName(),
283 " x ",
284 n.ToString()
285 });
286 }
287
288 // Token: 0x040029CB RID: 10699
289 [JsonProperty]
290 public string id;
291
292 // Token: 0x040029CC RID: 10700
293 [JsonProperty]
294 public int[] ints = new int[5];
295
296 // Token: 0x040029CD RID: 10701
297 public BitArray32 bits;
298 }
299}
Definition Hoard.cs:10
Definition Msg.cs:7