TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ TryDigging()

void Terraria.GameContent.MinecartDiggerHelper.TryDigging ( Player player,
Vector2 trackWorldPosition,
int digDirectionX,
int digDirectionY )
inline

Definition at line 11 of file MinecartDiggerHelper.cs.

12 {
13 //IL_0003: Unknown result type (might be due to invalid IL or missing references)
14 //IL_0004: Unknown result type (might be due to invalid IL or missing references)
15 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
16 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
17 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
18 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
19 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
20 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
21 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
22 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
23 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
24 //IL_0061: Unknown result type (might be due to invalid IL or missing references)
25 //IL_0069: Unknown result type (might be due to invalid IL or missing references)
26 //IL_009a: Unknown result type (might be due to invalid IL or missing references)
27 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
28 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
29 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
30 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
31 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
32 //IL_0076: Unknown result type (might be due to invalid IL or missing references)
33 //IL_0077: Unknown result type (might be due to invalid IL or missing references)
34 //IL_007d: Unknown result type (might be due to invalid IL or missing references)
35 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
36 //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
37 //IL_00f4: Unknown result type (might be due to invalid IL or missing references)
38 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
39 //IL_011a: Unknown result type (might be due to invalid IL or missing references)
40 //IL_012a: Unknown result type (might be due to invalid IL or missing references)
41 //IL_0130: Unknown result type (might be due to invalid IL or missing references)
42 //IL_0161: Unknown result type (might be due to invalid IL or missing references)
43 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
44 //IL_016b: Unknown result type (might be due to invalid IL or missing references)
45 //IL_016c: Unknown result type (might be due to invalid IL or missing references)
46 digDirectionY = 0;
47 Point point = trackWorldPosition.ToTileCoordinates();
48 if (Framing.GetTileSafely(point).type != 314 || (double)point.Y < Main.worldSurface)
49 {
50 return;
51 }
52 Point point2 = point;
53 point2.X += digDirectionX;
54 point2.Y += digDirectionY;
55 if (AlreadyLeadsIntoWantedTrack(point, point2) || (digDirectionY == 0 && (AlreadyLeadsIntoWantedTrack(point, new Point(point2.X, point2.Y - 1)) || AlreadyLeadsIntoWantedTrack(point, new Point(point2.X, point2.Y + 1)))))
56 {
57 return;
58 }
59 int num = 5;
60 if (digDirectionY != 0)
61 {
62 num = 5;
63 }
64 Point point3 = point2;
65 Point point4 = point3;
66 point4.Y -= num - 1;
67 int x = point4.X;
68 for (int i = point4.Y; i <= point3.Y; i++)
69 {
70 if (!CanGetPastTile(x, i) || !HasPickPower(player, x, i))
71 {
72 return;
73 }
74 }
75 if (CanConsumeATrackItem(player))
76 {
77 int x2 = point4.X;
78 for (int j = point4.Y; j <= point3.Y; j++)
79 {
81 }
82 ConsumeATrackItem(player);
84 player.velocity.X = MathHelper.Clamp(player.velocity.X, -1f, 1f);
86 {
88 }
89 }
90 }
bool DoTheTracksConnectProperly(Point tileCoordsOfFrontWheel, Point tileCoordsWeWantToReach)
bool HasPickPower(Player player, int x, int y)
void CorrectTrackConnections(Point startCoords, Point endCoords)
bool AlreadyLeadsIntoWantedTrack(Point tileCoordsOfFrontWheel, Point tileCoordsWeWantToReach)

References Terraria.GameContent.MinecartDiggerHelper.AlreadyLeadsIntoWantedTrack(), Terraria.GameContent.MinecartDiggerHelper.CanConsumeATrackItem(), Terraria.GameContent.MinecartDiggerHelper.CanGetPastTile(), Terraria.GameContent.MinecartDiggerHelper.ConsumeATrackItem(), Terraria.GameContent.MinecartDiggerHelper.CorrectTrackConnections(), Terraria.GameContent.MinecartDiggerHelper.DoTheTracksConnectProperly(), Terraria.Framing.GetTileSafely(), Terraria.GameContent.MinecartDiggerHelper.HasPickPower(), Terraria.GameContent.MinecartDiggerHelper.MineTheTileIfNecessary(), Terraria.GameContent.MinecartDiggerHelper.PlaceATrack(), Terraria.Entity.velocity, and Terraria.Main.worldSurface.

+ Here is the call graph for this function: