Elin Decompiled Documentation EA 23.222 Stable nyan
Loading...
Searching...
No Matches
GamePrincipal.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using Newtonsoft.Json;
4
5[Serializable]
6public class GamePrincipal : EClass
7{
8 public enum Type
9 {
10 Oath,
12 Legacy,
13 Flavor
14 }
15
16 public class Item
17 {
18 public string id;
19
20 public Type type;
21
22 public Func<bool> _get;
23
24 public Action<bool> _set;
25
26 public int grade;
27
28 public bool IsEmbark
29 {
30 get
31 {
33 {
35 }
36 return true;
37 }
38 }
39
40 public bool Get()
41 {
42 return _get();
43 }
44
45 public void Set(bool value)
46 {
47 _set(value);
48 }
49
50 public bool IsModified()
51 {
52 return Get() != EClass.game.principal.GetField<bool>(id);
53 }
54
55 public bool WasSealed()
56 {
57 if (EClass.game.principal.modified.Contains(id) || IsEmbark)
58 {
59 return false;
60 }
61 bool num = type == Type.Oath;
62 bool field = EClass.game.principal.GetField<bool>(id);
63 if (num)
64 {
65 return field;
66 }
67 return !field;
68 }
69
70 public bool IsSealed()
71 {
72 if (EClass.game.principal.modified.Contains(id))
73 {
74 return false;
75 }
76 bool num = type == Type.Oath;
77 bool flag = Get();
78 bool flag2 = (IsEmbark ? flag : EClass.game.principal.GetField<bool>(id));
79 if (num)
80 {
81 return flag2 && flag;
82 }
83 if (!flag2)
84 {
85 return !flag;
86 }
87 return false;
88 }
89 }
90
91 public class ItemSlider : Item
92 {
93 public int max;
94
95 public Func<int> _getInt;
96
97 public Action<int> _setInt;
98
99 public Func<int, string> funcText;
100
101 public int GetInt()
102 {
103 return _getInt();
104 }
105
106 public void SetInt(int value)
107 {
108 _setInt(value);
109 }
110 }
111
112 [JsonProperty]
113 public int id;
114
115 [JsonProperty]
116 public int socre;
117
118 [JsonProperty]
119 public int dropRateMtp;
120
121 [JsonProperty]
122 public int petFeatExpMtp;
123
124 [JsonProperty]
125 public bool ignoreEvaluate;
126
127 [JsonProperty]
129
130 [JsonProperty]
131 public bool tax;
132
133 [JsonProperty]
134 public bool opMilk;
135
136 [JsonProperty]
137 public bool disableManualSave;
138
139 [JsonProperty]
140 public bool permadeath;
141
142 [JsonProperty]
144
145 [JsonProperty]
147
148 [JsonProperty]
149 public bool scaleQuest;
150
151 [JsonProperty]
152 public bool realAdv;
153
154 [JsonProperty]
155 public bool noAging;
156
157 [JsonProperty]
158 public bool dropRate;
159
160 [JsonProperty]
161 public bool petFeatExp;
162
163 [JsonProperty]
165
166 [JsonProperty]
168
169 [JsonProperty]
170 public bool enableGeneDupe;
171
172 [JsonProperty]
173 public HashSet<string> modified = new HashSet<string>();
174
175 public bool IsCustom => id == -1;
176
177 public List<Item> ListItems()
178 {
179 List<Item> list = new List<Item>();
180 Add(1, Type.Oath, "disableManualSave", () => disableManualSave, delegate(bool a)
181 {
183 });
184 Add(1, Type.Oath, "disableDeathPenaltyProtection", () => disableDeathPenaltyProtection, delegate(bool a)
185 {
187 });
188 Add(1, Type.Oath, "disableUsermapBenefit", () => disableUsermapBenefit, delegate(bool a)
189 {
191 });
192 Add(1, Type.Oath, "scaleQuest", () => scaleQuest, delegate(bool a)
193 {
194 scaleQuest = a;
195 });
196 Add(3, Type.Oath, "permadeath", () => permadeath, delegate(bool a)
197 {
198 permadeath = a;
199 });
200 Add(2, Type.Workaround, "disableVoidBlessing", () => disableVoidBlessing, delegate(bool a)
201 {
203 });
204 AddSlider(2, Type.Workaround, "dropRate", () => dropRate, delegate(bool a)
205 {
206 dropRate = a;
207 }, () => dropRateMtp, delegate(int a)
208 {
209 dropRateMtp = a;
210 }, (int a) => 0.5f + 0.5f * (float)a + "x", 5);
211 AddSlider(2, Type.Workaround, "petFeatExp", () => petFeatExp, delegate(bool a)
212 {
213 petFeatExp = a;
214 }, () => petFeatExpMtp, delegate(int a)
215 {
216 petFeatExpMtp = a;
217 }, (int a) => 0.5f + 0.5f * (float)a + "x", 3);
218 Add(-1, Type.Legacy, "enableDamageReduction", () => enableDamageReduction, delegate(bool a)
219 {
221 });
222 Add(-1, Type.Legacy, "enableGeneDupe", () => enableGeneDupe, delegate(bool a)
223 {
224 enableGeneDupe = a;
225 });
226 Add(-1, Type.Flavor, "noAging", () => noAging, delegate(bool a)
227 {
228 noAging = a;
229 });
230 return list;
231 void Add(int grade, Type type, string id, Func<bool> _get, Action<bool> _set)
232 {
233 list.Add(new Item
234 {
235 type = type,
236 grade = grade,
237 id = id,
238 _get = _get,
239 _set = _set
240 });
241 }
242 void AddSlider(int grade, Type type, string id, Func<bool> _get, Action<bool> _set, Func<int> _getInt, Action<int> _setInt, Func<int, string> funcText, int max)
243 {
244 list.Add(new ItemSlider
245 {
246 type = type,
247 grade = grade,
248 id = id,
249 _get = _get,
250 _set = _set,
251 _getInt = _getInt,
252 _setInt = _setInt,
253 funcText = funcText,
254 max = max
255 });
256 }
257 }
258}
list. Add(item3)
bool IsGameStarted
Definition: Core.cs:84
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Core core
Definition: EClass.cs:6
static Player player
Definition: EClass.cs:12
Func< int, string > funcText
void SetInt(int value)
void Set(bool value)
Action< bool > _set
Func< bool > _get
bool enableDamageReduction
bool infiniteMarketFund
bool disableManualSave
bool disableVoidBlessing
HashSet< string > modified
bool disableUsermapBenefit
List< Item > ListItems()
bool disableDeathPenaltyProtection
GamePrincipal principal
Definition: Game.cs:221
bool resetPrincipal
Definition: Player.cs:1174