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
CoinLossRevengeSystem.cs
Go to the documentation of this file.
1using System;
3using System.IO;
9
11{
12 // Token: 0x020007AB RID: 1963
14 {
15 // Token: 0x06003FEC RID: 16364 RVA: 0x002416B0 File Offset: 0x0023F8B0
17 {
18 Vector2 vector = reader.ReadVector2();
19 int gameTime = this._gameTime;
20 }
21
22 // Token: 0x06003FED RID: 16365 RVA: 0x000021DB File Offset: 0x000003DB
24 {
25 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
26 }
27
28 // Token: 0x06003FEE RID: 16366 RVA: 0x002416CC File Offset: 0x0023F8CC
30 {
31 long num = 0L;
32 object markersLock = this._markersLock;
33 Monitor.Enter(markersLock, num != 0L);
35 long num2 = 0L;
37 if (num2 == 0L)
38 {
39 return;
40 }
41 throw new OutOfMemoryException();
42 }
43
44 // Token: 0x06003FEF RID: 16367 RVA: 0x00241720 File Offset: 0x0023F920
46 {
47 }
48
49 // Token: 0x06003FF0 RID: 16368 RVA: 0x00241734 File Offset: 0x0023F934
50 public void CacheEnemy(NPC npc)
51 {
52 if (!npc.boss)
53 {
54 int realLife = npc.realLife;
55 int rarity = npc.rarity;
56 int extraValue = npc.extraValue;
57 if (rarity == 0)
58 {
59 }
60 float x = npc.position.X;
61 if (rarity == 0)
62 {
63 }
64 float x2 = npc.position.X;
65 int width = npc.width;
66 if (17440 == 0)
67 {
68 }
69 float y = npc.position.Y;
70 if (49664 == 0)
71 {
72 }
73 float y2 = npc.position.Y;
74 if (17440 == 0)
75 {
76 }
77 int height = npc.height;
78 int netID = npc.netID;
79 if (50208 == 0)
80 {
81 }
82 Vector2 center = npc.Center;
83 float lifePercent = npc.GetLifePercent();
84 int type = npc.type;
85 int aiStyle = npc.aiStyle;
86 int extraValue2 = npc.extraValue;
87 float value = npc.value;
89 int gameTime = this._gameTime;
90 if (50208 == 0)
91 {
92 }
93 bool netHost = Main.NetHost;
95 string text = "Cached " + givenOrTypeName;
96 if (49664 == 0)
97 {
98 }
99 }
100 }
101
102 // Token: 0x06003FF1 RID: 16369 RVA: 0x000021DB File Offset: 0x000003DB
103 public void Reset()
104 {
105 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
106 }
107
108 // Token: 0x06003FF2 RID: 16370 RVA: 0x0024183C File Offset: 0x0023FA3C
109 public void Update()
110 {
111 int gameTime = this._gameTime;
113 if (gameTime == 0)
114 {
115 }
116 bool netClient = Main.NetClient;
117 if (gameTime != 0)
118 {
119 return;
120 }
122 }
123
124 // Token: 0x06003FF3 RID: 16371 RVA: 0x0024186C File Offset: 0x0023FA6C
125 public void CheckRespawns()
126 {
127 object markersLock = this._markersLock;
129 long num = 0L;
130 int size = markers._size;
131 if (3 != 0)
132 {
134 }
135 if (num != 0L)
136 {
137 throw new OutOfMemoryException();
138 }
139 long num2 = 0L;
140 if (num != 0L)
141 {
142 return;
143 }
145 Monitor.Enter(this._markersLock, num2 != 0L);
147 int size2 = markers2._size;
148 int size3 = markers2._size;
149 object syncRoot = markers2._syncRoot;
150 }
151
152 // Token: 0x06003FF4 RID: 16372 RVA: 0x00241980 File Offset: 0x0023FB80
161
162 // Token: 0x06003FF5 RID: 16373 RVA: 0x00241A7C File Offset: 0x0023FC7C
164 {
165 object markersLock = this._markersLock;
167 if (!false)
168 {
169 long num = 0L;
171 if (num == 0L)
172 {
173 }
174 throw new OutOfMemoryException();
175 }
176 throw new OutOfMemoryException();
177 }
178
179 // Token: 0x06003FF6 RID: 16374 RVA: 0x00241ACC File Offset: 0x0023FCCC
186
187 // Token: 0x06003FF7 RID: 16375 RVA: 0x00241B34 File Offset: 0x0023FD34
188 // Note: this type is marked as 'beforefieldinit'.
190 {
191 long num = 0L;
192 long num2 = 0L;
193 long num3 = 0L;
194 int num4 = Item.buyPrice((int)num, (int)num2, 10, (int)num3);
195 }
196
197 // Token: 0x06003FF8 RID: 16376 RVA: 0x00241B54 File Offset: 0x0023FD54
200 {
201 if (x._forceExpire)
202 {
203 return true;
204 }
205 int expirationTime = x._expirationTime;
206 return true;
207 }
208
209 // Token: 0x06003FF9 RID: 16377 RVA: 0x00241B74 File Offset: 0x0023FD74
212 {
213 if (x._forceExpire)
214 {
215 return true;
216 }
217 int expirationTime = x._expirationTime;
218 return true;
219 }
220
221 // Token: 0x04007DDA RID: 32218
222 public static bool DisplayCaching;
223
224 // Token: 0x04007DDB RID: 32219
225 public static int MinimumCoinsForCaching;
226
227 // Token: 0x04007DDC RID: 32220
228 private const int PLAYER_BOX_WIDTH_INNER = 1968;
229
230 // Token: 0x04007DDD RID: 32221
231 private const int PLAYER_BOX_HEIGHT_INNER = 1200;
232
233 // Token: 0x04007DDE RID: 32222
234 private const int PLAYER_BOX_WIDTH_OUTER = 2608;
235
236 // Token: 0x04007DDF RID: 32223
237 private const int PLAYER_BOX_HEIGHT_OUTER = 1840;
238
239 // Token: 0x04007DE0 RID: 32224
241
242 // Token: 0x04007DE1 RID: 32225
244
245 // Token: 0x04007DE2 RID: 32226
247
248 // Token: 0x04007DE3 RID: 32227
249 private readonly object _markersLock;
250
251 // Token: 0x04007DE4 RID: 32228
252 private int _gameTime;
253
254 // Token: 0x020007AC RID: 1964
255 public class RevengeMarker
256 {
257 // Token: 0x06003FFA RID: 16378 RVA: 0x00241B94 File Offset: 0x0023FD94
258 public void SetToExpire()
259 {
260 this._forceExpire = true;
261 }
262
263 // Token: 0x170007B9 RID: 1977
264 // (get) Token: 0x06003FFB RID: 16379 RVA: 0x00241BA8 File Offset: 0x0023FDA8
266 {
267 get
268 {
269 return this._attemptedRespawn;
270 }
271 }
272
273 // Token: 0x06003FFC RID: 16380 RVA: 0x00241BBC File Offset: 0x0023FDBC
274 public void SetRespawnAttemptLock(bool state)
275 {
276 }
277
278 // Token: 0x06003FFD RID: 16381 RVA: 0x00241BCC File Offset: 0x0023FDCC
279 public RevengeMarker(Vector2 coords, int npcNetId, float npcHPPercent, int npcType, int npcAiStyle, int coinValue, float baseValue, bool spawnedFromStatue, int gameTime, int uniqueID = -1)
280 {
281 int num = 1;
282 long num2 = 0L;
283 base..ctor();
284 this._npcNetID = coords;
288 if (num == 0)
289 {
290 }
294 int num3;
296 }
297
298 // Token: 0x06003FFE RID: 16382 RVA: 0x00241C24 File Offset: 0x0023FE24
299 public bool IsInvalid()
300 {
301 int num = 1;
303 if (num == 0)
304 {
305 }
307 if (num == 0)
308 {
309 }
311 if (npcTypeAgainstDiscouragement2 == 0)
312 {
313 }
315 {
316 }
318 {
319 }
320 int num2 = 275;
321 if (num2 != 0)
322 {
323 if (num2 == 0)
324 {
325 }
326 return;
327 }
328 }
329
330 // Token: 0x06003FFF RID: 16383 RVA: 0x00241C6C File Offset: 0x0023FE6C
331 public bool IsExpired(int gameTime)
332 {
333 return !this._forceExpire || true;
334 }
335
336 // Token: 0x06004000 RID: 16384 RVA: 0x00241C84 File Offset: 0x0023FE84
337 private int CalculateExpirationTime(int gameCacheTime, int coinValue)
338 {
339 if (true)
340 {
341 return;
342 }
343 }
344
345 // Token: 0x06004001 RID: 16385 RVA: 0x00241CA0 File Offset: 0x0023FEA0
347 {
348 Rectangle hitbox = this._hitbox;
349 int width = this._hitbox.Width;
350 bool flag;
351 return flag;
352 }
353
354 // Token: 0x06004002 RID: 16386 RVA: 0x00241CC4 File Offset: 0x0023FEC4
355 public void SpawnEnemy()
356 {
357 int num = 1;
358 float x = this._location.X;
359 float y = this._location.Y;
360 int npcNetID = this._npcNetID;
361 if (num == 0)
362 {
363 }
364 if (32640 == 0)
365 {
366 }
367 int npcNetID2 = this._npcNetID;
368 int npcNetID3 = this._npcNetID;
369 float baseValue = this._baseValue;
371 float npcHPPercent = this._npcHPPercent;
372 if (!spawnedFromStatue)
373 {
374 }
375 int num2 = 32640;
376 int num3 = 32768;
377 if (num2 == 0)
378 {
379 }
380 if (num2 != 0)
381 {
382 int coinsValue = this._coinsValue;
383 float x2 = this._location.X;
384 float y2 = this._location.Y;
385 return;
386 }
387 float x3 = this._location.X;
388 float y3 = this._location.Y;
389 string text2;
390 string text = "Spawned " + text2;
391 if (num3 == 0)
392 {
393 }
394 int num4 = 255;
395 int num5 = 255;
396 int num6 = 255;
397 Main.NewText(text, (byte)num4, (byte)num5, (byte)num6);
398 }
399
400 // Token: 0x06004003 RID: 16387 RVA: 0x00241DC0 File Offset: 0x0023FFC0
402 {
405 float x = playerTarget.position.X;
406 float y = playerTarget.position.Y;
407 bool flag;
408 return flag;
409 }
410
411 // Token: 0x06004004 RID: 16388 RVA: 0x00241E2C File Offset: 0x0024002C
413 {
414 int num = 1;
415 float x = this._location.X;
416 float y = this._location.Y;
417 if (num == 0)
418 {
419 }
420 if (mapTopLeft == null)
421 {
422 }
423 if (mapTopLeft == null)
424 {
425 }
426 int coinsValue = this._coinsValue;
427 int num2 = 9999;
428 if (num2 == 0)
429 {
430 }
431 int num3 = 16959;
432 if (num2 == 0)
433 {
434 }
435 if (num2 == 0)
436 {
437 }
438 if (num3 == 0)
439 {
440 }
442 Vector2 vector = rectangle.Size();
443 Vector2 vector2 = rectangle.Size();
445 if (rectangle2 == null)
446 {
447 }
449 bool flag;
450 return flag;
451 }
452
453 // Token: 0x06004005 RID: 16389 RVA: 0x00241EC4 File Offset: 0x002400C4
454 public void UseMouseOver(SpriteBatch spriteBatch, string mouseTextString, float drawScale = 1f)
455 {
456 if ("" == null)
457 {
458 }
460 if ("" == null)
461 {
462 }
463 if ("" == null)
464 {
465 }
466 }
467
468 // Token: 0x170007BA RID: 1978
469 // (get) Token: 0x06004006 RID: 16390 RVA: 0x00241EF8 File Offset: 0x002400F8
470 public int UniqueID
471 {
472 get
473 {
474 return this._uniqueID;
475 }
476 }
477
478 // Token: 0x06004007 RID: 16391 RVA: 0x00241F0C File Offset: 0x0024010C
479 public void WriteSelfTo(BinaryWriter writer)
480 {
481 int uniqueID = this._uniqueID;
482 float x = this._location.X;
483 float y = this._location.Y;
484 int npcNetID = this._npcNetID;
485 float npcHPPercent = this._npcHPPercent;
488 int coinsValue = this._coinsValue;
489 float baseValue = this._baseValue;
491 }
492
493 // Token: 0x06004008 RID: 16392 RVA: 0x00241F70 File Offset: 0x00240170
494 // Note: this type is marked as 'beforefieldinit'.
496 {
497 long num = 0L;
498 long num2 = 0L;
499 long num3 = 0L;
500 int num4 = Item.buyPrice((int)num, (int)num2, (int)num3, 1);
501 long num5 = 0L;
502 long num6 = 0L;
503 int num7 = Item.buyPrice(0, (int)num5, 1, (int)num6);
504 long num8 = 0L;
505 long num9 = 0L;
506 int num10 = Item.buyPrice(0, 1, (int)num8, (int)num9);
507 long num11 = 0L;
508 long num12 = 0L;
509 long num13 = 0L;
510 int num14 = Item.buyPrice(1, (int)num11, (int)num12, (int)num13);
511 }
512
513 // Token: 0x04007DE5 RID: 32229
514 private static int _uniqueIDCounter;
515
516 // Token: 0x04007DE6 RID: 32230
517 private static readonly int _expirationCompCopper;
518
519 // Token: 0x04007DE7 RID: 32231
520 private static readonly int _expirationCompSilver;
521
522 // Token: 0x04007DE8 RID: 32232
523 private static readonly int _expirationCompGold;
524
525 // Token: 0x04007DE9 RID: 32233
526 private static readonly int _expirationCompPlat;
527
528 // Token: 0x04007DEA RID: 32234
529 private const int ONE_MINUTE = 3600;
530
531 // Token: 0x04007DEB RID: 32235
532 private const int ENEMY_BOX_WIDTH = 2160;
533
534 // Token: 0x04007DEC RID: 32236
535 private const int ENEMY_BOX_HEIGHT = 1440;
536
537 // Token: 0x04007DED RID: 32237
539
540 // Token: 0x04007DEE RID: 32238
542
543 // Token: 0x04007DEF RID: 32239
545
546 // Token: 0x04007DF0 RID: 32240
547 private readonly int _npcNetID;
548
549 // Token: 0x04007DF1 RID: 32241
550 private readonly float _npcHPPercent;
551
552 // Token: 0x04007DF2 RID: 32242
553 private readonly float _baseValue;
554
555 // Token: 0x04007DF3 RID: 32243
557
558 // Token: 0x04007DF4 RID: 32244
560
561 // Token: 0x04007DF5 RID: 32245
563
564 // Token: 0x04007DF6 RID: 32246
566
567 // Token: 0x04007DF7 RID: 32247
569
570 // Token: 0x04007DF8 RID: 32248
571 private readonly int _uniqueID;
572
573 // Token: 0x04007DF9 RID: 32249
574 private bool _forceExpire;
575
576 // Token: 0x04007DFA RID: 32250
577 private bool _attemptedRespawn;
578 }
579
580 // Token: 0x020007AD RID: 1965
582 private sealed class <>c__DisplayClass5_0
583 {
584 // Token: 0x06004009 RID: 16393 RVA: 0x00241FCC File Offset: 0x002401CC
586 {
587 }
588
589 // Token: 0x0600400A RID: 16394 RVA: 0x00241FE0 File Offset: 0x002401E0
591 {
592 /*
593An exception occurred when decompiling this method (0600400A)
594
595ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.GameContent.CoinLossRevengeSystem/<>c__DisplayClass5_0::<DestroyMarker>b__0(Terraria.GameContent.CoinLossRevengeSystem/RevengeMarker)
596
597 ---> System.Exception: Basic block has to end with unconditional control flow.
598{
599 Block_0:
600 stloc:int32(var_0_06, ldfld:int32(RevengeMarker::_uniqueID, ldloc:RevengeMarker(x)))
601 stloc:int32(var_1_0D, ldfld:int32('<>c__DisplayClass5_0'::markerUniqueID, ldloc:'<>c__DisplayClass5_0'(this)))
602}
603
604 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
605 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
606 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
607 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
608 --- End of inner exception stack trace ---
609 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
610 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
611*/;
612 }
613
614 // Token: 0x04007DFB RID: 32251
615 public int markerUniqueID;
616 }
617
618 // Token: 0x020007AE RID: 1966
620 [Serializable]
621 private sealed class <>c
622 {
623 // Token: 0x0600400B RID: 16395 RVA: 0x00241FFC File Offset: 0x002401FC
624 // Note: this type is marked as 'beforefieldinit'.
625 static <>c()
626 {
627 }
628
629 // Token: 0x0600400C RID: 16396 RVA: 0x0024200C File Offset: 0x0024020C
630 public <>c()
631 {
632 }
633
634 // Token: 0x0600400D RID: 16397 RVA: 0x00242020 File Offset: 0x00240220
636 {
637 return x.IsInvalid();
638 }
639
640 // Token: 0x0600400E RID: 16398 RVA: 0x00242034 File Offset: 0x00240234
642 {
643 return x.IsInvalid();
644 }
645
646 // Token: 0x04007DFC RID: 32252
647 public static readonly CoinLossRevengeSystem.<>c <>9;
648
649 // Token: 0x04007DFD RID: 32253
650 public static Func<CoinLossRevengeSystem.RevengeMarker, bool> <>9__20_1;
651
652 // Token: 0x04007DFE RID: 32254
653 public static Predicate<CoinLossRevengeSystem.RevengeMarker> <>9__20_2;
654 }
655 }
656}
class f__AnonymousType0<< Count > j__TPar
static void Exit(object obj)
Definition Monitor.cs:47
static void Enter(object obj)
Definition Monitor.cs:11
Vector2 Center
Definition Entity.cs:134
Vector2 position
Definition Entity.cs:460
bool DrawMapIcon(SpriteBatch spriteBatch, Vector2 mapTopLeft, Vector2 mapX2Y2AndOff, Rectangle? mapRect, float mapScale, float drawScale, int gameTime)
bool Intersects(Rectangle rectInner, Rectangle rectOuter)
int CalculateExpirationTime(int gameCacheTime, int coinValue)
void UseMouseOver(SpriteBatch spriteBatch, string mouseTextString, float drawScale=1f)
RevengeMarker(Vector2 coords, int npcNetId, float npcHPPercent, int npcType, int npcAiStyle, int coinValue, float baseValue, bool spawnedFromStatue, int gameTime, int uniqueID=-1)
bool< RemoveExpiredOrInvalidMarkers > b__20_3(CoinLossRevengeSystem.RevengeMarker x)
bool< RemoveExpiredOrInvalidMarkers > b__20_0(CoinLossRevengeSystem.RevengeMarker x)
void AddMarker(CoinLossRevengeSystem.RevengeMarker marker)
List< CoinLossRevengeSystem.RevengeMarker > _markers
CoinLossRevengeSystem.RevengeMarker DrawMapIcons(SpriteBatch spriteBatch, Vector2 mapTopLeft, Vector2 mapX2Y2AndOff, Rectangle? mapRect, float mapScale, float drawScale, string unused)
static int buyPrice(int platinum=0, int gold=0, int silver=0, int copper=0)
Definition Item.cs:1127
static bool NetHost
Definition Main.cs:5544
static void NewText(string newText, byte R=255, byte G=255, byte B=255)
Definition Main.cs:17778
static bool NetClient
Definition Main.cs:5438
static Microsoft.Xna.Framework.Vector2 MouseScreen
Definition Main.cs:4441
bool boss
Definition NPC.cs:11486
int aiStyle
Definition NPC.cs:11393
float GetLifePercent()
Definition NPC.cs:874
string GivenOrTypeName
Definition NPC.cs:379
bool SpawnedFromStatue
Definition NPC.cs:11102
int extraValue
Definition NPC.cs:11501
static int GetNPCInvasionGroup(int npcID)
Definition NPC.cs:4954
float value
Definition NPC.cs:11498
int netID
Definition NPC.cs:11510
int rarity
Definition NPC.cs:11138
int realLife
Definition NPC.cs:11195