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

◆ CheckCrackedBrickBreak()

void Terraria.Player.CheckCrackedBrickBreak ( )
inline

Definition at line 21399 of file Player.cs.

21400 {
21401 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
21402 //IL_0174: Unknown result type (might be due to invalid IL or missing references)
21403 //IL_0179: Unknown result type (might be due to invalid IL or missing references)
21404 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
21405 //IL_0181: Unknown result type (might be due to invalid IL or missing references)
21406 //IL_018f: Unknown result type (might be due to invalid IL or missing references)
21407 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
21408 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
21409 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
21410 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
21411 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
21412 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
21413 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
21414 //IL_007d: Unknown result type (might be due to invalid IL or missing references)
21415 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
21416 //IL_0087: Unknown result type (might be due to invalid IL or missing references)
21417 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
21418 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
21419 //IL_0094: Unknown result type (might be due to invalid IL or missing references)
21420 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
21421 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
21422 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
21423 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
21424 //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
21425 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
21426 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
21427 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
21428 //IL_00c9: Unknown result type (might be due to invalid IL or missing references)
21429 //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
21430 //IL_0128: Unknown result type (might be due to invalid IL or missing references)
21431 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
21432 //IL_0108: Unknown result type (might be due to invalid IL or missing references)
21433 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
21434 //IL_02d5: Unknown result type (might be due to invalid IL or missing references)
21435 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
21436 //IL_0147: Unknown result type (might be due to invalid IL or missing references)
21437 //IL_014e: Unknown result type (might be due to invalid IL or missing references)
21438 //IL_0244: Unknown result type (might be due to invalid IL or missing references)
21439 //IL_0249: Unknown result type (might be due to invalid IL or missing references)
21440 //IL_024d: Unknown result type (might be due to invalid IL or missing references)
21441 if (shimmering)
21442 {
21443 return;
21444 }
21445 bool flag = false;
21446 if ((float)Main.rand.Next(2, 12) < Math.Abs(velocity.X))
21447 {
21448 flag = true;
21449 }
21450 if ((float)Main.rand.Next(2, 12) < velocity.Y)
21451 {
21452 flag = true;
21453 }
21454 if (flag && velocity.Y < 1f)
21455 {
21456 Point point = (base.Bottom + Vector2.UnitY).ToTileCoordinates();
21457 Point point2 = (base.BottomLeft + Vector2.UnitY).ToTileCoordinates();
21458 Point point3 = (base.BottomRight + Vector2.UnitY).ToTileCoordinates();
21459 if ((WorldGen.SolidTileAllowBottomSlope(point.X, point.Y) && !TileID.Sets.CrackedBricks[Main.tile[point.X, point.Y].type]) || (WorldGen.SolidTileAllowBottomSlope(point2.X, point2.Y) && !TileID.Sets.CrackedBricks[Main.tile[point2.X, point2.Y].type]) || (WorldGen.SolidTileAllowBottomSlope(point3.X, point3.Y) && !TileID.Sets.CrackedBricks[Main.tile[point3.X, point3.Y].type]))
21460 {
21461 flag = false;
21462 }
21463 }
21464 if (!flag)
21465 {
21466 return;
21467 }
21468 Vector2 vector = position + velocity;
21469 flag = false;
21470 int num = (int)(vector.X / 16f);
21471 int num2 = (int)((vector.X + (float)width) / 16f);
21472 int num3 = (int)((position.Y + (float)height + 1f) / 16f);
21473 Rectangle rect = getRect();
21474 ((Rectangle)(ref rect)).Inflate(1, 1);
21475 for (int i = num; i <= num2; i++)
21476 {
21477 for (int j = num3; j <= num3 + 1 && Main.tile[i, j] != null; j++)
21478 {
21479 if (!Main.tile[i, j].nactive() || WorldGen.SolidTile(i, j - 1) || !TileID.Sets.CrackedBricks[Main.tile[i, j].type])
21480 {
21481 continue;
21482 }
21483 Rectangle val = new Rectangle(i * 16, j * 16, 16, 16);
21484 if (((Rectangle)(ref val)).Intersects(rect))
21485 {
21486 flag = true;
21487 if (velocity.Y > 1f)
21488 {
21489 velocity.Y = 1f;
21490 }
21491 NetMessage.SendData(13, -1, -1, null, whoAmI);
21492 }
21493 }
21494 }
21495 if (!flag)
21496 {
21497 return;
21498 }
21499 num = (int)((vector.X - 16f - 8f) / 16f);
21500 num2 = (int)((vector.X + (float)width + 16f + 8f) / 16f);
21501 for (int k = num; k <= num2; k++)
21502 {
21503 for (int l = num3; l <= num3 + 2; l++)
21504 {
21505 if (Main.tile[k, l].nactive() && !WorldGen.SolidTile(k, l - 1) && TileID.Sets.CrackedBricks[Main.tile[k, l].type])
21506 {
21507 WorldGen.KillTile(k, l);
21508 if (Main.netMode == 1)
21509 {
21510 NetMessage.SendData(17, -1, -1, null, 20, k, l);
21511 }
21512 }
21513 }
21514 }
21515 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static bool[] CrackedBricks
Definition TileID.cs:161
Rectangle getRect()
Definition Player.cs:41240

References Terraria.ID.TileID.Sets.CrackedBricks, Terraria.Player.getRect(), Terraria.Entity.height, Terraria.WorldGen.KillTile(), Terraria.Main.netMode, Terraria.Entity.position, Terraria.Main.rand, Terraria.NetMessage.SendData(), Terraria.Player.shimmering, Terraria.WorldGen.SolidTile(), Terraria.WorldGen.SolidTileAllowBottomSlope(), Terraria.Main.tile, Terraria.Entity.velocity, Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Player.Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: