Elin Decompiled Documentation EA 23.130 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 dropRate;
149
150 [JsonProperty]
151 public bool petFeatExp;
152
153 [JsonProperty]
155
156 [JsonProperty]
158
159 [JsonProperty]
160 public HashSet<string> modified = new HashSet<string>();
161
162 public bool IsCustom => id == -1;
163
164 public List<Item> ListItems()
165 {
166 List<Item> list = new List<Item>();
167 Add(1, Type.Oath, "disableManualSave", () => disableManualSave, delegate(bool a)
168 {
170 });
171 Add(1, Type.Oath, "disableDeathPenaltyProtection", () => disableDeathPenaltyProtection, delegate(bool a)
172 {
174 });
175 Add(1, Type.Oath, "disableUsermapBenefit", () => disableUsermapBenefit, delegate(bool a)
176 {
178 });
179 Add(3, Type.Oath, "permadeath", () => permadeath, delegate(bool a)
180 {
181 permadeath = a;
182 });
183 Add(2, Type.Workaround, "disableVoidBlessing", () => disableVoidBlessing, delegate(bool a)
184 {
186 });
187 AddSlider(2, Type.Workaround, "dropRate", () => dropRate, delegate(bool a)
188 {
189 dropRate = a;
190 }, () => dropRateMtp, delegate(int a)
191 {
192 dropRateMtp = a;
193 }, (int a) => 0.5f + 0.5f * (float)a + "x", 5);
194 AddSlider(2, Type.Workaround, "petFeatExp", () => petFeatExp, delegate(bool a)
195 {
196 petFeatExp = a;
197 }, () => petFeatExpMtp, delegate(int a)
198 {
199 petFeatExpMtp = a;
200 }, (int a) => 0.5f + 0.5f * (float)a + "x", 3);
201 Add(-1, Type.Legacy, "enableDamageReduction", () => enableDamageReduction, delegate(bool a)
202 {
204 });
205 return list;
206 void Add(int grade, Type type, string id, Func<bool> _get, Action<bool> _set)
207 {
208 list.Add(new Item
209 {
210 type = type,
211 grade = grade,
212 id = id,
213 _get = _get,
214 _set = _set
215 });
216 }
217 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)
218 {
219 list.Add(new ItemSlider
220 {
221 type = type,
222 grade = grade,
223 id = id,
224 _get = _get,
225 _set = _set,
226 _getInt = _getInt,
227 _setInt = _setInt,
228 funcText = funcText,
229 max = max
230 });
231 }
232 }
233}
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