Elin Modding Docs Doc
Loading...
Searching...
No Matches
CodexManager.cs
1using System;
2using System.Collections.Generic;
3using Newtonsoft.Json;
4
5// Token: 0x02000582 RID: 1410
6public class CodexManager : EClass
7{
8 // Token: 0x060026D3 RID: 9939 RVA: 0x000DC73C File Offset: 0x000DA93C
9 public CodexCreature GetOrCreate(string id)
10 {
11 CodexCreature codexCreature = this.creatures.TryGetValue(id, null);
12 if (codexCreature == null)
13 {
14 codexCreature = new CodexCreature
15 {
16 id = id
17 };
18 this.creatures[id] = codexCreature;
19 }
20 return codexCreature;
21 }
22
23 // Token: 0x060026D4 RID: 9940 RVA: 0x000DC778 File Offset: 0x000DA978
24 public void OnLoad()
25 {
26 foreach (KeyValuePair<string, CodexCreature> keyValuePair in this.creatures)
27 {
28 keyValuePair.Value.id = keyValuePair.Key;
29 }
30 }
31
32 // Token: 0x060026D5 RID: 9941 RVA: 0x000DC7D8 File Offset: 0x000DA9D8
33 public void AddCard(string id, int num = 1)
34 {
35 this.GetOrCreate(id).numCard += num;
36 }
37
38 // Token: 0x060026D6 RID: 9942 RVA: 0x000DC7EE File Offset: 0x000DA9EE
39 public bool Has(string id)
40 {
41 return this.creatures.ContainsKey(id);
42 }
43
44 // Token: 0x060026D7 RID: 9943 RVA: 0x000DC7FC File Offset: 0x000DA9FC
45 public void MarkCardDrop(string id)
46 {
47 this.GetOrCreate(id).droppedCard = true;
48 }
49
50 // Token: 0x060026D8 RID: 9944 RVA: 0x000DC80B File Offset: 0x000DAA0B
51 public bool DroppedCard(string id)
52 {
53 return this.creatures.ContainsKey(id) && this.creatures[id].droppedCard;
54 }
55
56 // Token: 0x060026D9 RID: 9945 RVA: 0x000DC830 File Offset: 0x000DAA30
57 public void AddKill(string id)
58 {
59 CodexCreature orCreate = this.GetOrCreate(id);
60 int kills = orCreate.kills;
61 orCreate.kills = kills + 1;
62 }
63
64 // Token: 0x060026DA RID: 9946 RVA: 0x000DC854 File Offset: 0x000DAA54
65 public void AddWeakspot(string id)
66 {
67 CodexCreature orCreate = this.GetOrCreate(id);
68 int weakspot = orCreate.weakspot;
69 orCreate.weakspot = weakspot + 1;
70 }
71
72 // Token: 0x060026DB RID: 9947 RVA: 0x000DC878 File Offset: 0x000DAA78
73 public void AddSpawn(string id)
74 {
75 CodexCreature orCreate = this.GetOrCreate(id);
76 int spawns = orCreate.spawns;
77 orCreate.spawns = spawns + 1;
78 }
79
80 // Token: 0x060026DC RID: 9948 RVA: 0x000DC89C File Offset: 0x000DAA9C
81 public List<CardRow> ListKills()
82 {
83 List<CardRow> list = new List<CardRow>();
84 foreach (KeyValuePair<string, CodexCreature> keyValuePair in this.creatures)
85 {
86 if (keyValuePair.Value.kills > 0)
87 {
88 CardRow cardRow = EClass.sources.cards.map.TryGetValue(keyValuePair.Key, null);
89 if (cardRow != null && !cardRow.HasTag(CTAG.noRandomProduct))
90 {
91 list.Add(cardRow);
92 }
93 }
94 }
95 return list;
96 }
97
98 // Token: 0x04001574 RID: 5492
99 [JsonProperty]
100 public Dictionary<string, CodexCreature> creatures = new Dictionary<string, CodexCreature>();
101}