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