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

◆ CreateGroundExplosion()

void Terraria.Projectile.CreateGroundExplosion ( float MAX_SPREAD,
int fluff,
int distFluff,
int layerStart,
int layerEnd,
int layerJump )
inlineprivate

Definition at line 56678 of file Projectile.cs.

56679 {
56680 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
56681 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
56682 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
56683 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
56684 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
56685 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
56686 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
56687 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
56688 //IL_0072: Unknown result type (might be due to invalid IL or missing references)
56689 //IL_02f8: Unknown result type (might be due to invalid IL or missing references)
56690 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
56691 //IL_02e5: Unknown result type (might be due to invalid IL or missing references)
56692 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
56693 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
56694 //IL_0248: Unknown result type (might be due to invalid IL or missing references)
56695 //IL_024d: Unknown result type (might be due to invalid IL or missing references)
56696 //IL_02d3: Unknown result type (might be due to invalid IL or missing references)
56697 //IL_02d8: Unknown result type (might be due to invalid IL or missing references)
56698 Point point = base.TopLeft.ToTileCoordinates();
56699 Point point2 = base.BottomRight.ToTileCoordinates();
56700 point.X -= fluff;
56701 point.Y -= fluff;
56702 point2.X += fluff;
56703 point2.Y += fluff;
56704 int num = point.X / 2 + point2.X / 2;
56705 int num2 = width / 2 + distFluff;
56706 for (int i = layerStart; i < layerEnd; i += layerJump)
56707 {
56708 int num3 = i;
56709 for (int j = point.X; j <= point2.X; j++)
56710 {
56711 for (int k = point.Y; k <= point2.Y; k++)
56712 {
56713 if (!WorldGen.InWorld(j, k, 10))
56714 {
56715 return;
56716 }
56717 if (Vector2.Distance(base.Center, new Vector2((float)(j * 16), (float)(k * 16))) > (float)num2)
56718 {
56719 continue;
56720 }
56721 Tile tileSafely = Framing.GetTileSafely(j, k);
56722 if (!tileSafely.active() || !Main.tileSolid[tileSafely.type] || Main.tileSolidTop[tileSafely.type] || Main.tileFrameImportant[tileSafely.type])
56723 {
56724 continue;
56725 }
56726 Tile tileSafely2 = Framing.GetTileSafely(j, k - 1);
56727 if (tileSafely2.active() && Main.tileSolid[tileSafely2.type] && !Main.tileSolidTop[tileSafely2.type])
56728 {
56729 continue;
56730 }
56731 int num4 = WorldGen.KillTile_GetTileDustAmount(fail: true, tileSafely, j, k);
56732 for (int l = 0; l < num4; l++)
56733 {
56734 Dust obj = Main.dust[WorldGen.KillTile_MakeTileDust(j, k, tileSafely)];
56735 obj.velocity.Y -= 3f + (float)num3 * 1.5f;
56736 obj.velocity.Y *= Main.rand.NextFloat();
56737 obj.scale += (float)num3 * 0.03f;
56738 }
56739 if (num3 >= 2)
56740 {
56741 for (int m = 0; m < num4 - 1; m++)
56742 {
56743 Dust obj2 = Main.dust[WorldGen.KillTile_MakeTileDust(j, k, tileSafely)];
56744 obj2.velocity.Y -= 1f + (float)num3;
56745 obj2.velocity.Y *= Main.rand.NextFloat();
56746 }
56747 }
56748 if (num4 > 0 && Main.rand.Next(3) != 0)
56749 {
56750 float num5 = (float)Math.Abs(num - j) / (MAX_SPREAD / 2f);
56751 Gore gore = Gore.NewGoreDirect(position, Vector2.Zero, 61 + Main.rand.Next(3), 1f - (float)num3 * 0.15f + num5 * 0.5f);
56752 gore.velocity.Y -= 0.1f + (float)num3 * 0.5f + num5 * (float)num3 * 1f;
56753 gore.velocity.Y *= Main.rand.NextFloat();
56754 gore.position = new Vector2((float)(j * 16 + 20), (float)(k * 16 + 20));
56755 }
56756 }
56757 }
56758 }
56759 }
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

References Terraria.Main.dust, Terraria.Framing.GetTileSafely(), Terraria.WorldGen.InWorld(), Terraria.WorldGen.KillTile_GetTileDustAmount(), Terraria.WorldGen.KillTile_MakeTileDust(), Terraria.Gore.NewGoreDirect(), Terraria.Main.rand, Terraria.Main.tileFrameImportant, Terraria.Main.tileSolid, and Terraria.Main.tileSolidTop.

Referenced by Terraria.Projectile.MakeBoulderOfEarthExplosion().

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