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
GraniteBiome.cs
Go to the documentation of this file.
1using System;
7
9{
10 // Token: 0x020008EE RID: 2286
11 public class GraniteBiome : MicroBiome
12 {
13 // Token: 0x0600460A RID: 17930 RVA: 0x00256C64 File Offset: 0x00254E64
14 public static bool CanPlace(Point origin, StructureMap structures)
15 {
16 if (!true)
17 {
18 }
19 bool flag;
20 return flag;
21 }
22
23 // Token: 0x0600460B RID: 17931 RVA: 0x00256C80 File Offset: 0x00254E80
24 public override bool Place(Point origin, StructureMap structures)
25 {
26 if (!true)
27 {
28 }
29 Tile tile;
30 return tile.active();
31 }
32
33 // Token: 0x0600460C RID: 17932 RVA: 0x00256CB0 File Offset: 0x00254EB0
35 {
36 this._sourceMagmaMap = 42165528;
38 this._targetMagmaMap = 42165528;
41 if (sourceMagmaMap == null)
42 {
43 }
44 long num = 0L;
45 bool flag = WorldGen.SolidTile(42165528, 43134976, num != 0L);
46 bool isActive = sourceMagmaMap3.IsActive;
49 bool isActive2 = sourceMagmaMap4.IsActive;
50 bool isActive3 = targetMagmaMap.IsActive;
53 }
54
55 // Token: 0x0600460D RID: 17933 RVA: 0x00256D50 File Offset: 0x00254F50
57 {
59 int num = 1;
60 if (num == 0)
61 {
62 }
63 if (num != 0)
64 {
65 if (num == 0)
66 {
67 }
68 return;
69 }
71 double num2 = vector2D.Length();
72 }
73
74 // Token: 0x0600460E RID: 17934 RVA: 0x00256D98 File Offset: 0x00254F98
76 {
77 /*
78An exception occurred when decompiling this method (0600460E)
79
80ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.GameContent.Biomes.GraniteBiome::ShouldUseLava(Microsoft.Xna.Framework.Point)
81
82 ---> System.Exception: Basic block has to end with unconditional control flow.
83{
84 Block_0:
85 stloc:valuetype Terraria.GameContent.Biomes.GraniteBiome/Magma[, ](var_0_06, ldfld:valuetype Terraria.GameContent.Biomes.GraniteBiome/Magma[, ](GraniteBiome::_sourceMagmaMap, ldloc:GraniteBiome(this)))
86 stloc:valuetype Terraria.GameContent.Biomes.GraniteBiome/Magma[, ](var_3_0F, ldfld:valuetype Terraria.GameContent.Biomes.GraniteBiome/Magma[, ](GraniteBiome::_sourceMagmaMap, ldloc:GraniteBiome(this)))
87 stloc:bool(var_7_1A, call:bool(Tile::active, ldloc:Tile[exp:valuetype Terraria.Tile&](var_6)))
88 stloc:uint16(var_9_23, callgetter:uint16(Tile::get_type, ldloc:Tile[exp:valuetype Terraria.Tile&](var_8)))
89}
90
91 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
92 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
93 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
94 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
95 --- End of inner exception stack trace ---
96 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
97 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
98*/;
99 }
100
101 // Token: 0x0600460F RID: 17935 RVA: 0x00256DD0 File Offset: 0x00254FD0
103 {
104 bool flag = this.ShouldUseLava(tileOrigin);
105 long num = 0L;
106 bool isActive = this._sourceMagmaMap.IsActive;
107 if (!true)
108 {
109 }
110 long num2 = 0L;
111 bool flag2 = WorldGen.SolidTile(0, (int)num, num2 != 0L);
112 }
113
114 // Token: 0x06004610 RID: 17936 RVA: 0x00256E20 File Offset: 0x00255020
116 {
117 if (!true)
118 {
119 }
120 long num = 0L;
122 bool isActive = sourceMagmaMap.IsActive;
123 if (sourceMagmaMap == null)
124 {
125 }
126 if (sourceMagmaMap == null)
127 {
128 }
129 long num2 = 0L;
130 bool flag = WorldGen.SolidTile(0, (int)num, num2 != 0L);
131 }
132
133 // Token: 0x06004611 RID: 17937 RVA: 0x00256E78 File Offset: 0x00255078
135 {
136 if (!true)
137 {
138 }
139 long num = 0L;
141 bool isActive = sourceMagmaMap.IsActive;
142 long num2 = 0L;
143 int num3;
144 WorldUtils.TileFrame(num3, (int)num, num2 != 0L);
145 if (sourceMagmaMap == null)
146 {
147 }
148 int num4 = 1;
149 WorldGen.SquareWallFrame(0, (int)num, num4 != 0);
150 int num5 = 8;
152 if (fastRandom.Next(num5) == 0)
153 {
154 if (!true)
155 {
156 }
157 Tile tile;
158 bool flag = tile.active();
159 if (!true)
160 {
161 }
162 Tile tile2;
163 bool flag2 = tile2.active();
164 int num6 = 3;
165 long num7 = 0L;
166 if (!isActive)
167 {
168 }
169 long num8 = 0L;
170 int num9;
172 if (!true)
173 {
174 }
175 Tile tile3;
176 bool flag3 = tile3.active();
177 int num10 = 3;
178 long num11 = 0L;
179 if (!isActive)
180 {
181 }
182 long num12 = 0L;
183 int num13;
185 }
186 int num14 = 2;
187 int num15;
188 if (num15 == 0)
189 {
190 if (!false)
191 {
192 }
193 int num16 = 1;
194 long num17 = 0L;
195 Tile.SmoothSlope(1073741824, num14, num16 != 0, num17 != 0L);
196 }
197 }
198
199 // Token: 0x06004612 RID: 17938 RVA: 0x00256F54 File Offset: 0x00255154
201 {
202 }
203
204 // Token: 0x06004613 RID: 17939 RVA: 0x00256F68 File Offset: 0x00255168
205 // Note: this type is marked as 'beforefieldinit'.
207 {
208 if (!true)
209 {
210 }
211 }
212
213 // Token: 0x0400825B RID: 33371
214 private const int MAX_MAGMA_ITERATIONS = 300;
215
216 // Token: 0x0400825C RID: 33372
218
219 // Token: 0x0400825D RID: 33373
221
222 // Token: 0x0400825E RID: 33374
223 private static Vector2D[] _normalisedVectors;
224
225 // Token: 0x020008EF RID: 2287
226 private struct Magma
227 {
228 // Token: 0x06004614 RID: 17940 RVA: 0x00256F90 File Offset: 0x00255190
229 private Magma(double pressure, double resistance, bool active)
230 {
231 this.Pressure = pressure;
232 }
233
234 // Token: 0x06004615 RID: 17941 RVA: 0x00256FA4 File Offset: 0x002551A4
236 {
237 double pressure = this.Pressure;
238 double resistance = this.Resistance;
241 magma.IsActive = true;
242 magma.Pressure = pressure;
243 return magma;
244 }
245
246 // Token: 0x06004616 RID: 17942 RVA: 0x00256FD8 File Offset: 0x002551D8
247 public static GraniteBiome.Magma CreateFlow(double pressure, double resistance = 0.0)
248 {
250 magma.IsActive = true;
251 magma.Pressure = pressure;
252 return magma;
253 }
254
255 // Token: 0x06004617 RID: 17943 RVA: 0x00256FF4 File Offset: 0x002551F4
256 public static GraniteBiome.Magma CreateEmpty(double resistance = 0.0)
257 {
260 return magma;
261 }
262
263 // Token: 0x0400825F RID: 33375
264 public readonly double Pressure;
265
266 // Token: 0x04008260 RID: 33376
267 public readonly double Resistance;
268
269 // Token: 0x04008261 RID: 33377
270 public readonly bool IsActive;
271 }
272 }
273}
class f__AnonymousType0<< Count > j__TPar
override bool Place(Point origin, StructureMap structures)
static bool CanPlace(Point origin, StructureMap structures)
void CleanupTiles(Point tileOrigin, Rectangle magmaMapArea)
void SimulatePressure([Out] Rectangle effectedMapArea)
void PlaceGranite(Point tileOrigin, Rectangle magmaMapArea)
void PlaceDecorations(Point tileOrigin, Rectangle magmaMapArea)
static void TileFrame(int x, int y, bool frameNeighbors=false)
static bool SolidTile(short tileSHeader, ushort tileType)
static void SquareWallFrame(int i, int j, bool resetFrame=true)
static void PlaceUncheckedStalactite(int x, int y, bool preferSmall, int variation, bool spiders)
Definition WorldGen.cs:7576
static GraniteBiome.Magma CreateFlow(double pressure, double resistance=0.0)
Magma(double pressure, double resistance, bool active)
static GraniteBiome.Magma CreateEmpty(double resistance=0.0)
static void SmoothSlope(int x, int y, bool applyToNeighbors=true, bool sync=false)
Definition Tile.cs:1338
bool active()
Definition Tile.cs:1241