terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
PartySky.cs
Go to the documentation of this file.
1using System;
7
9{
10 // Token: 0x020009B2 RID: 2482
11 public class PartySky : CustomSky
12 {
13 // Token: 0x06004973 RID: 18803 RVA: 0x002624EC File Offset: 0x002606EC
14 public override void OnLoad()
15 {
16 if (!true)
17 {
18 }
20 long num = 0L;
21 this.GenerateBalloons(num != 0L);
22 }
23
24 // Token: 0x06004974 RID: 18804 RVA: 0x0026251C File Offset: 0x0026071C
25 private void GenerateBalloons(bool onlyMissing)
26 {
28 }
29
30 // Token: 0x06004975 RID: 18805 RVA: 0x00262584 File Offset: 0x00260784
31 public void ResetBalloon(int i)
32 {
34 float depth = balloons.Depth;
35 double num = this._random.NextDouble();
36 UnifiedRandom random = this._random;
39 int num2 = 2;
40 int num3 = random.Next(num2);
41 int frameWidth = balloons.FrameWidth;
42 int num4 = 3;
44 int num5 = this._random.Next(num4);
46 int num6 = 30;
47 if (random2.Next(num6) == 0)
48 {
50 this._balloons.Active = textures2 != null;
51 }
52 }
53
54 // Token: 0x06004976 RID: 18806 RVA: 0x00262620 File Offset: 0x00260820
55 private bool IsNearParty()
56 {
57 /*
58An exception occurred when decompiling this method (06004976)
59
60ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.GameContent.Skies.PartySky::IsNearParty()
61
62 ---> System.Exception: Basic block has to end with unconditional control flow.
63{
64 IL_0010:
65 stloc:int32(var_4_1C, ldfld:int32(SceneMetrics::<PartyMonolithCount>k__BackingField, callgetter:SceneMetrics(Main::get_SceneMetrics)))
66}
67
68 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
69 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
70 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
71 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
72 --- End of inner exception stack trace ---
73 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
74 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
75*/;
76 }
77
78 // Token: 0x06004977 RID: 18807 RVA: 0x00262650 File Offset: 0x00260850
79 public override void Update(GameTime gameTime)
80 {
81 float opacity = this._opacity;
82 int num = true.ToDirectionInt();
83 float depth = this._balloons.Depth;
84 long num2 = 0L;
85 if (depth != null)
86 {
88 if (this._leaving)
89 {
92 return;
93 }
94 this.ResetBalloon((int)num2);
96 if (balloons == null)
97 {
98 }
99 int num3 = 30;
100 int num4 = this._random.Next(num3);
102 if (num4 == 0)
103 {
105 }
106 }
107 if (this._balloonsDrawing == 0)
108 {
109 }
110 int num5 = 1;
111 this._active = num5 != 0;
112 }
113
114 // Token: 0x06004978 RID: 18808 RVA: 0x002626EC File Offset: 0x002608EC
115 public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
116 {
117 if (!true)
118 {
119 }
120 bool gameMenu = Main.gameMenu;
121 long num;
122 if (this._active)
123 {
124 float depth = this._balloons.Depth;
125 num = 0L;
126 }
127 if (num == 0L)
128 {
129 }
130 Vector2 screenPosition = Main.screenPosition;
131 if (num == 0L)
132 {
133 }
134 bool gameMenu2 = Main.gameMenu;
135 float opacity = this._opacity;
136 float depth2 = this._balloons.Depth;
137 }
138
139 // Token: 0x06004979 RID: 18809 RVA: 0x002627E8 File Offset: 0x002609E8
140 public override void Activate(Vector2 position, params object[] args)
141 {
142 if (this._active)
143 {
144 this.GenerateBalloons(true);
145 return;
146 }
147 long num = 0L;
148 this.GenerateBalloons(num != 0L);
149 this._active = true;
150 }
151
152 // Token: 0x0600497A RID: 18810 RVA: 0x00262818 File Offset: 0x00260A18
153 public override void Deactivate(params object[] args)
154 {
155 this._leaving = true;
156 }
157
158 // Token: 0x0600497B RID: 18811 RVA: 0x0026282C File Offset: 0x00260A2C
159 public override bool IsActive()
160 {
161 return this._active;
162 }
163
164 // Token: 0x0600497C RID: 18812 RVA: 0x00262840 File Offset: 0x00260A40
165 public override void Reset()
166 {
167 }
168
169 // Token: 0x0600497D RID: 18813 RVA: 0x00262850 File Offset: 0x00260A50
170 public PartySky()
171 {
172 }
173
174 // Token: 0x04008454 RID: 33876
175 public static bool MultipleSkyWorkaroundFix;
176
177 // Token: 0x04008455 RID: 33877
178 private bool _active;
179
180 // Token: 0x04008456 RID: 33878
181 private bool _leaving;
182
183 // Token: 0x04008457 RID: 33879
184 private float _opacity;
185
186 // Token: 0x04008458 RID: 33880
188
189 // Token: 0x04008459 RID: 33881
191
192 // Token: 0x0400845A RID: 33882
194
195 // Token: 0x0400845B RID: 33883
196 private int _balloonsDrawing;
197
198 // Token: 0x020009B3 RID: 2483
199 private struct Balloon
200 {
201 // Token: 0x1700084D RID: 2125
202 // (get) Token: 0x0600497E RID: 18814 RVA: 0x00262864 File Offset: 0x00260A64
203 // (set) Token: 0x0600497F RID: 18815 RVA: 0x00262878 File Offset: 0x00260A78
205 {
206 get
207 {
208 return this._texture;
209 }
210 set
211 {
213 }
214 }
215
216 // Token: 0x1700084E RID: 2126
217 // (get) Token: 0x06004980 RID: 18816 RVA: 0x0026288C File Offset: 0x00260A8C
218 // (set) Token: 0x06004981 RID: 18817 RVA: 0x002628A0 File Offset: 0x00260AA0
219 public int Frame
220 {
221 get
222 {
223 return this._frameCounter;
224 }
225 set
226 {
227 int num = 3121;
228 this._frameCounter = num;
229 }
230 }
231
232 // Token: 0x06004982 RID: 18818 RVA: 0x002628BC File Offset: 0x00260ABC
234 {
235 /*
236An exception occurred when decompiling this method (06004982)
237
238ICSharpCode.Decompiler.DecompilerException: Error decompiling Microsoft.Xna.Framework.Rectangle Terraria.GameContent.Skies.PartySky/Balloon::GetSourceRectangle()
239
240 ---> System.Exception: Basic block has to end with unconditional control flow.
241{
242 Block_0:
243 stloc:int32(var_0_06, ldfld:int32(Balloon::FrameHeight, ldloc:valuetype Terraria.GameContent.Skies.PartySky/Balloon&(this)))
244 stloc:float32(var_1_0D, ldfld:float32(Balloon::Speed, ldloc:valuetype Terraria.GameContent.Skies.PartySky/Balloon&(this)))
245}
246
247 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
248 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
249 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
250 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
251 --- End of inner exception stack trace ---
252 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
253 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
254*/;
255 }
256
257 // Token: 0x0400845C RID: 33884
258 private const int MAX_FRAMES_X = 3;
259
260 // Token: 0x0400845D RID: 33885
261 private const int MAX_FRAMES_Y = 3;
262
263 // Token: 0x0400845E RID: 33886
264 private const int FRAME_RATE = 14;
265
266 // Token: 0x0400845F RID: 33887
267 public int Variant;
268
269 // Token: 0x04008460 RID: 33888
271
272 // Token: 0x04008461 RID: 33889
274
275 // Token: 0x04008462 RID: 33890
276 public float Depth;
277
278 // Token: 0x04008463 RID: 33891
279 public int FrameHeight;
280
281 // Token: 0x04008464 RID: 33892
282 public int FrameWidth;
283
284 // Token: 0x04008465 RID: 33893
285 public float Speed;
286
287 // Token: 0x04008466 RID: 33894
288 public bool Active;
289
290 // Token: 0x04008467 RID: 33895
291 private int _frameCounter;
292 }
293 }
294}
class f__AnonymousType0<< Count > j__TPar
Asset< Texture2D >[] _textures
Definition PartySky.cs:187
void GenerateBalloons(bool onlyMissing)
Definition PartySky.cs:25
override void Update(GameTime gameTime)
Definition PartySky.cs:79
override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
Definition PartySky.cs:115
override void Activate(Vector2 position, params object[] args)
Definition PartySky.cs:140
override void Deactivate(params object[] args)
Definition PartySky.cs:153
static Microsoft.Xna.Framework.Vector2 screenPosition
Definition Main.cs:1973
static bool gameMenu
Definition Main.cs:2673