Elin Decompiled Documentation EA 23.153 Nightly
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 }
14
15 public class Item
16 {
17 public string id;
18
19 public Type type;
20
21 public Func<bool> _get;
22
23 public Action<bool> _set;
24
25 public int grade;
26
27 public bool IsEmbark
28 {
29 get
30 {
32 {
34 }
35 return true;
36 }
37 }
38
39 public bool Get()
40 {
41 return _get();
42 }
43
44 public void Set(bool value)
45 {
46 _set(value);
47 }
48
49 public bool IsModified()
50 {
51 return Get() != EClass.game.principal.GetField<bool>(id);
52 }
53
54 public bool WasSealed()
55 {
56 if (EClass.game.principal.modified.Contains(id) || IsEmbark)
57 {
58 return false;
59 }
60 bool num = type == Type.Oath;
61 bool field = EClass.game.principal.GetField<bool>(id);
62 if (num)
63 {
64 return field;
65 }
66 return !field;
67 }
68
69 public bool IsSealed()
70 {
71 if (EClass.game.principal.modified.Contains(id))
72 {
73 return false;
74 }
75 bool num = type == Type.Oath;
76 bool flag = Get();
77 bool flag2 = (IsEmbark ? flag : EClass.game.principal.GetField<bool>(id));
78 if (num)
79 {
80 return flag2 && flag;
81 }
82 if (!flag2)
83 {
84 return !flag;
85 }
86 return false;
87 }
88 }
89
90 public class ItemSlider : Item
91 {
92 public int max;
93
94 public Func<int> _getInt;
95
96 public Action<int> _setInt;
97
98 public Func<int, string> funcText;
99
100 public int GetInt()
101 {
102 return _getInt();
103 }
104
105 public void SetInt(int value)
106 {
107 _setInt(value);
108 }
109 }
110
111 [JsonProperty]
112 public int id;
113
114 [JsonProperty]
115 public int socre;
116
117 [JsonProperty]
118 public int dropRateMtp;
119
120 [JsonProperty]
121 public int petFeatExpMtp;
122
123 [JsonProperty]
124 public bool ignoreEvaluate;
125
126 [JsonProperty]
128
129 [JsonProperty]
130 public bool tax;
131
132 [JsonProperty]
133 public bool opMilk;
134
135 [JsonProperty]
136 public bool disableManualSave;
137
138 [JsonProperty]
139 public bool permadeath;
140
141 [JsonProperty]
143
144 [JsonProperty]
146
147 [JsonProperty]
148 public bool realAdv;
149
150 [JsonProperty]
151 public bool dropRate;
152
153 [JsonProperty]
154 public bool petFeatExp;
155
156 [JsonProperty]
158
159 [JsonProperty]
161
162 [JsonProperty]
163 public HashSet<string> modified = new HashSet<string>();
164
165 public bool IsCustom => id == -1;
166
167 public List<Item> ListItems()
168 {
169 List<Item> list = new List<Item>();
170 Add(1, Type.Oath, "disableManualSave", () => disableManualSave, delegate(bool a)
171 {
173 });
174 Add(1, Type.Oath, "disableDeathPenaltyProtection", () => disableDeathPenaltyProtection, delegate(bool a)
175 {
177 });
178 Add(1, Type.Oath, "disableUsermapBenefit", () => disableUsermapBenefit, delegate(bool a)
179 {
181 });
182 Add(3, Type.Oath, "permadeath", () => permadeath, delegate(bool a)
183 {
184 permadeath = a;
185 });
186 Add(2, Type.Workaround, "disableVoidBlessing", () => disableVoidBlessing, delegate(bool a)
187 {
189 });
190 AddSlider(2, Type.Workaround, "dropRate", () => dropRate, delegate(bool a)
191 {
192 dropRate = a;
193 }, () => dropRateMtp, delegate(int a)
194 {
195 dropRateMtp = a;
196 }, (int a) => 0.5f + 0.5f * (float)a + "x", 5);
197 AddSlider(2, Type.Workaround, "petFeatExp", () => petFeatExp, delegate(bool a)
198 {
199 petFeatExp = a;
200 }, () => petFeatExpMtp, delegate(int a)
201 {
202 petFeatExpMtp = a;
203 }, (int a) => 0.5f + 0.5f * (float)a + "x", 3);
204 Add(-1, Type.Legacy, "enableDamageReduction", () => enableDamageReduction, delegate(bool a)
205 {
207 });
208 return list;
209 void Add(int grade, Type type, string id, Func<bool> _get, Action<bool> _set)
210 {
211 list.Add(new Item
212 {
213 type = type,
214 grade = grade,
215 id = id,
216 _get = _get,
217 _set = _set
218 });
219 }
220 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)
221 {
222 list.Add(new ItemSlider
223 {
224 type = type,
225 grade = grade,
226 id = id,
227 _get = _get,
228 _set = _set,
229 _getInt = _getInt,
230 _setInt = _setInt,
231 funcText = funcText,
232 max = max
233 });
234 }
235 }
236}
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:993