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

◆ AI_135_OgreStomp()

void Terraria.Projectile.AI_135_OgreStomp ( )
inlineprivate

Definition at line 75555 of file Projectile.cs.

75556 {
75557 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
75558 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
75559 //IL_0051: Unknown result type (might be due to invalid IL or missing references)
75560 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
75561 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
75562 //IL_008e: Unknown result type (might be due to invalid IL or missing references)
75563 //IL_009a: Unknown result type (might be due to invalid IL or missing references)
75564 //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
75565 //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
75566 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
75567 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
75568 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
75569 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
75570 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
75571 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
75572 //IL_00f3: Unknown result type (might be due to invalid IL or missing references)
75573 //IL_0628: Unknown result type (might be due to invalid IL or missing references)
75574 //IL_0100: Unknown result type (might be due to invalid IL or missing references)
75575 //IL_0615: Unknown result type (might be due to invalid IL or missing references)
75576 //IL_010e: Unknown result type (might be due to invalid IL or missing references)
75577 //IL_011f: Unknown result type (might be due to invalid IL or missing references)
75578 //IL_0262: Unknown result type (might be due to invalid IL or missing references)
75579 //IL_0267: Unknown result type (might be due to invalid IL or missing references)
75580 //IL_0578: Unknown result type (might be due to invalid IL or missing references)
75581 //IL_057d: Unknown result type (might be due to invalid IL or missing references)
75582 //IL_0603: Unknown result type (might be due to invalid IL or missing references)
75583 //IL_0608: Unknown result type (might be due to invalid IL or missing references)
75584 //IL_0434: Unknown result type (might be due to invalid IL or missing references)
75585 //IL_0439: Unknown result type (might be due to invalid IL or missing references)
75586 //IL_027e: Unknown result type (might be due to invalid IL or missing references)
75587 //IL_0294: Unknown result type (might be due to invalid IL or missing references)
75588 //IL_033b: Unknown result type (might be due to invalid IL or missing references)
75589 //IL_0340: Unknown result type (might be due to invalid IL or missing references)
75590 //IL_035b: Unknown result type (might be due to invalid IL or missing references)
75591 //IL_0365: Unknown result type (might be due to invalid IL or missing references)
75592 //IL_036a: Unknown result type (might be due to invalid IL or missing references)
75593 //IL_0450: Unknown result type (might be due to invalid IL or missing references)
75594 //IL_046f: Unknown result type (might be due to invalid IL or missing references)
75595 //IL_0522: Unknown result type (might be due to invalid IL or missing references)
75596 //IL_0527: Unknown result type (might be due to invalid IL or missing references)
75597 //IL_0542: Unknown result type (might be due to invalid IL or missing references)
75598 //IL_054c: Unknown result type (might be due to invalid IL or missing references)
75599 //IL_0551: Unknown result type (might be due to invalid IL or missing references)
75600 float num = 40f;
75601 if (type == 922)
75602 {
75603 num = 30f;
75604 }
75605 ai[0] += 1f;
75606 if (ai[0] > 9f)
75607 {
75608 Kill();
75609 return;
75610 }
75611 velocity = Vector2.Zero;
75612 position = base.Center;
75613 base.Size = new Vector2(16f, 16f) * MathHelper.Lerp(5f, num, Utils.GetLerpValue(0f, 9f, ai[0]));
75614 base.Center = position;
75615 Point point = base.TopLeft.ToTileCoordinates();
75616 Point point2 = base.BottomRight.ToTileCoordinates();
75617 int num2 = point.X / 2 + point2.X / 2;
75618 int num3 = width / 2;
75619 if ((int)ai[0] % 3 != 0)
75620 {
75621 return;
75622 }
75623 int num4 = (int)ai[0] / 3;
75624 for (int i = point.X; i <= point2.X; i++)
75625 {
75626 for (int j = point.Y; j <= point2.Y; j++)
75627 {
75628 if (Vector2.Distance(base.Center, new Vector2((float)(i * 16), (float)(j * 16))) > (float)num3)
75629 {
75630 continue;
75631 }
75632 Tile tileSafely = Framing.GetTileSafely(i, j);
75633 if (!tileSafely.active() || !Main.tileSolid[tileSafely.type] || Main.tileSolidTop[tileSafely.type] || Main.tileFrameImportant[tileSafely.type])
75634 {
75635 continue;
75636 }
75637 Tile tileSafely2 = Framing.GetTileSafely(i, j - 1);
75638 if (tileSafely2.active() && Main.tileSolid[tileSafely2.type] && !Main.tileSolidTop[tileSafely2.type])
75639 {
75640 continue;
75641 }
75642 int num5 = WorldGen.KillTile_GetTileDustAmount(fail: true, tileSafely, i, j);
75643 for (int k = 0; k < num5; k++)
75644 {
75645 Dust obj = Main.dust[WorldGen.KillTile_MakeTileDust(i, j, tileSafely)];
75646 obj.velocity.Y -= 3f + (float)num4 * 1.5f;
75647 obj.velocity.Y *= Main.rand.NextFloat();
75648 obj.velocity.Y *= 0.75f;
75649 obj.scale += (float)num4 * 0.03f;
75650 }
75651 if (num4 >= 2)
75652 {
75653 if (type == 922)
75654 {
75655 Color newColor = NPC.AI_121_QueenSlime_GetDustColor();
75656 ((Color)(ref newColor)).A = 150;
75657 for (int l = 0; l < num5 - 1; l++)
75658 {
75659 int num6 = Dust.NewDust(position, 12, 12, 4, 0f, 0f, 50, newColor, 1.5f);
75660 Main.dust[num6].velocity.Y -= 0.1f + (float)num4 * 0.5f;
75661 Main.dust[num6].velocity.Y *= Main.rand.NextFloat();
75662 Main.dust[num6].velocity.X *= Main.rand.NextFloatDirection() * 3f;
75663 Main.dust[num6].position = new Vector2((float)(i * 16 + Main.rand.Next(16)), (float)(j * 16 + Main.rand.Next(16)));
75664 if (Main.rand.Next(3) != 0)
75665 {
75666 Dust obj2 = Main.dust[num6];
75667 obj2.velocity *= 0.5f;
75668 Main.dust[num6].noGravity = true;
75669 }
75670 }
75671 }
75672 else
75673 {
75674 for (int m = 0; m < num5 - 1; m++)
75675 {
75676 Dust obj3 = Main.dust[WorldGen.KillTile_MakeTileDust(i, j, tileSafely)];
75677 obj3.velocity.Y -= 1f + (float)num4;
75678 obj3.velocity.Y *= Main.rand.NextFloat();
75679 obj3.velocity.Y *= 0.75f;
75680 }
75681 }
75682 }
75683 if (num5 <= 0 || Main.rand.Next(3) == 0)
75684 {
75685 continue;
75686 }
75687 float num7 = (float)Math.Abs(num2 - i) / (num / 2f);
75688 if (type == 922)
75689 {
75690 Color newColor2 = NPC.AI_121_QueenSlime_GetDustColor();
75691 ((Color)(ref newColor2)).A = 150;
75692 for (int n = 0; n < 3; n++)
75693 {
75694 int num8 = Dust.NewDust(position, width, height, 31, 0f, 0f, 50, newColor2, 2f - (float)num4 * 0.15f + num7 * 0.5f);
75695 Main.dust[num8].velocity.Y -= 0.1f + (float)num4 * 0.5f + num7 * (float)num4 * 1f;
75696 Main.dust[num8].velocity.Y *= Main.rand.NextFloat();
75697 Main.dust[num8].velocity.X *= Main.rand.NextFloatDirection() * 3f;
75698 Main.dust[num8].position = new Vector2((float)(i * 16 + 20), (float)(j * 16 + 20));
75699 if (Main.rand.Next(3) != 0)
75700 {
75701 Dust obj4 = Main.dust[num8];
75702 obj4.velocity *= 0.5f;
75703 Main.dust[num8].noGravity = true;
75704 }
75705 }
75706 }
75707 else
75708 {
75709 Gore gore = Gore.NewGoreDirect(position, Vector2.Zero, 61 + Main.rand.Next(3), 1f - (float)num4 * 0.15f + num7 * 0.5f);
75710 gore.velocity.Y -= 0.1f + (float)num4 * 0.5f + num7 * (float)num4 * 1f;
75711 gore.velocity.Y *= Main.rand.NextFloat();
75712 gore.position = new Vector2((float)(i * 16 + 20), (float)(j * 16 + 20));
75713 }
75714 }
75715 }
75716 }
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
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...

References Terraria.NPC.AI_121_QueenSlime_GetDustColor(), Terraria.Main.dust, Terraria.Utils.GetLerpValue(), Terraria.Framing.GetTileSafely(), Terraria.WorldGen.KillTile_GetTileDustAmount(), Terraria.WorldGen.KillTile_MakeTileDust(), Terraria.Dust.NewDust(), Terraria.Gore.NewGoreDirect(), Terraria.Main.rand, Terraria.Main.tileFrameImportant, Terraria.Main.tileSolid, and Terraria.Main.tileSolidTop.

+ Here is the call graph for this function: