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

◆ AI_155_MysticSnakeCoil()

void Terraria.Projectile.AI_155_MysticSnakeCoil ( )
inlineprivate

Definition at line 54697 of file Projectile.cs.

54698 {
54699 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
54700 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
54701 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
54702 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
54703 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
54704 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
54705 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
54706 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
54707 //IL_006a: Unknown result type (might be due to invalid IL or missing references)
54708 //IL_0613: Unknown result type (might be due to invalid IL or missing references)
54709 //IL_0618: Unknown result type (might be due to invalid IL or missing references)
54710 //IL_061d: Unknown result type (might be due to invalid IL or missing references)
54711 //IL_0621: Unknown result type (might be due to invalid IL or missing references)
54712 //IL_0634: Unknown result type (might be due to invalid IL or missing references)
54713 //IL_0645: Unknown result type (might be due to invalid IL or missing references)
54714 //IL_06bd: Unknown result type (might be due to invalid IL or missing references)
54715 //IL_066a: Unknown result type (might be due to invalid IL or missing references)
54716 //IL_077a: Unknown result type (might be due to invalid IL or missing references)
54717 //IL_06af: Unknown result type (might be due to invalid IL or missing references)
54718 //IL_078f: Unknown result type (might be due to invalid IL or missing references)
54719 //IL_018d: Unknown result type (might be due to invalid IL or missing references)
54720 //IL_019c: Unknown result type (might be due to invalid IL or missing references)
54721 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
54722 //IL_01bb: Unknown result type (might be due to invalid IL or missing references)
54723 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
54724 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
54725 //IL_01de: Unknown result type (might be due to invalid IL or missing references)
54726 //IL_0249: Unknown result type (might be due to invalid IL or missing references)
54727 //IL_0267: Unknown result type (might be due to invalid IL or missing references)
54728 //IL_026d: Unknown result type (might be due to invalid IL or missing references)
54729 //IL_026f: Unknown result type (might be due to invalid IL or missing references)
54730 //IL_0284: Unknown result type (might be due to invalid IL or missing references)
54731 //IL_0289: Unknown result type (might be due to invalid IL or missing references)
54732 //IL_07e9: Unknown result type (might be due to invalid IL or missing references)
54733 //IL_07d4: Unknown result type (might be due to invalid IL or missing references)
54734 //IL_0712: Unknown result type (might be due to invalid IL or missing references)
54735 //IL_072c: Unknown result type (might be due to invalid IL or missing references)
54736 //IL_073d: Unknown result type (might be due to invalid IL or missing references)
54737 //IL_0747: Unknown result type (might be due to invalid IL or missing references)
54738 //IL_074c: Unknown result type (might be due to invalid IL or missing references)
54739 //IL_07fb: Unknown result type (might be due to invalid IL or missing references)
54740 //IL_0309: Unknown result type (might be due to invalid IL or missing references)
54741 //IL_0318: Unknown result type (might be due to invalid IL or missing references)
54742 //IL_031d: Unknown result type (might be due to invalid IL or missing references)
54743 //IL_0337: Unknown result type (might be due to invalid IL or missing references)
54744 //IL_0348: Unknown result type (might be due to invalid IL or missing references)
54745 //IL_0352: Unknown result type (might be due to invalid IL or missing references)
54746 //IL_0357: Unknown result type (might be due to invalid IL or missing references)
54747 //IL_0820: Unknown result type (might be due to invalid IL or missing references)
54748 //IL_0822: Unknown result type (might be due to invalid IL or missing references)
54749 //IL_040f: Unknown result type (might be due to invalid IL or missing references)
54750 //IL_0414: Unknown result type (might be due to invalid IL or missing references)
54751 //IL_0419: Unknown result type (might be due to invalid IL or missing references)
54752 //IL_041d: Unknown result type (might be due to invalid IL or missing references)
54753 //IL_0431: Unknown result type (might be due to invalid IL or missing references)
54754 //IL_0443: Unknown result type (might be due to invalid IL or missing references)
54755 //IL_044a: Unknown result type (might be due to invalid IL or missing references)
54756 //IL_045a: Unknown result type (might be due to invalid IL or missing references)
54757 //IL_0465: Unknown result type (might be due to invalid IL or missing references)
54758 //IL_0477: Unknown result type (might be due to invalid IL or missing references)
54759 //IL_048e: Unknown result type (might be due to invalid IL or missing references)
54760 //IL_0511: Unknown result type (might be due to invalid IL or missing references)
54761 //IL_04fe: Unknown result type (might be due to invalid IL or missing references)
54762 //IL_058f: Unknown result type (might be due to invalid IL or missing references)
54763 //IL_05bc: Unknown result type (might be due to invalid IL or missing references)
54764 //IL_05ca: Unknown result type (might be due to invalid IL or missing references)
54765 //IL_05d5: Unknown result type (might be due to invalid IL or missing references)
54766 //IL_05da: Unknown result type (might be due to invalid IL or missing references)
54767 if (Main.netMode != 1 && !Main.player[owner].active)
54768 {
54769 float num = ai[0];
54770 float y = position.Y;
54771 Point point = base.Center.ToTileCoordinates();
54772 Point end = default(Point);
54773 ((Point)(ref end))._002Ector(point.X, (int)y / 16);
54774 Point start = default(Point);
54775 ((Point)(ref start))._002Ector(point.X, (int)num / 16);
54777 Kill();
54778 return;
54779 }
54780 int num6 = 100;
54781 int num7 = 1800;
54782 if (ai[1] == 0f)
54783 {
54784 spriteDirection = ((!(Main.player[owner].Center.X > base.Center.X)) ? 1 : (-1));
54785 ai[1] = 1f;
54786 velocity.Y = -5f;
54787 }
54788 if (ai[1] == 1f)
54789 {
54790 localAI[1] += 1f;
54791 float num8 = Utils.Remap(localAI[1], 15f, 30f, 0f, 1f);
54792 int num9 = ((localAI[1] >= 60f) ? 1 : 0);
54793 velocity.Y = -3f * (1f - num8) + (float)(-32 * num9);
54794 velocity.Y = (int)velocity.Y;
54795 if (localAI[1] == 60f)
54796 {
54797 for (int i = 0; i < 30; i++)
54798 {
54799 Dust dust = Dust.NewDustDirect(base.TopLeft + new Vector2(-6f, 0f), 24, 16, 27, 0f, 0f, 150, Color.Transparent, 0.6f);
54800 dust.velocity *= 1f;
54801 dust.velocity.X *= 0.5f;
54802 dust.velocity.Y = -3f;
54803 dust.fadeIn = 1.2f;
54804 dust.noGravity = true;
54805 dust.position.X += Main.rand.NextFloatDirection() * 8f;
54806 dust.velocity = Utils.RotatedBy(new Vector2(0f, -1f), (float)Math.PI / 4f * Main.rand.NextFloatDirection() * 0f) * (Main.rand.NextFloatDirection() * 9f);
54807 if (dust.velocity.Y < 0f)
54808 {
54809 dust.velocity.Y *= 1f + Main.rand.NextFloat() * 3f;
54810 }
54811 }
54812 }
54813 bool flag = num8 > 0f && num9 <= 0;
54814 if ((Main.rand.Next(6) == 0 || num9 > 0) && !flag)
54815 {
54816 Dust dust2 = Dust.NewDustDirect(base.TopLeft + new Vector2(-6f, 0f), 24, 16, 27, 0f, 0f, 150, Color.Transparent, 0.6f);
54817 dust2.velocity *= 1f;
54818 dust2.velocity.X *= 0.5f;
54819 dust2.velocity.Y = -3f;
54820 dust2.fadeIn = 1.2f;
54821 dust2.noGravity = true;
54822 }
54823 alpha = Utils.Clamp(alpha - 5, 0, 255);
54824 if (++frameCounter >= 12)
54825 {
54826 frameCounter = 0;
54827 if (++frame >= 4)
54828 {
54829 frame = 0;
54830 }
54831 }
54832 if (Main.myPlayer == owner)
54833 {
54834 float num10 = ai[0];
54835 float y2 = position.Y;
54836 Point point2 = base.Center.ToTileCoordinates();
54837 Point point3 = default(Point);
54838 ((Point)(ref point3))._002Ector(point2.X, (int)y2 / 16);
54839 Point point4 = default(Point);
54840 ((Point)(ref point4))._002Ector(point2.X, (int)num10 / 16);
54841 bool flag2 = point4.Y - point3.Y >= num6;
54842 int x = point4.X;
54843 if (!WorldGen.InWorld(x, point3.Y, 40) || !WorldGen.InWorld(x, point4.Y, 40))
54844 {
54845 flag2 = true;
54846 }
54847 if (!flag2)
54848 {
54849 for (int num11 = point4.Y; num11 >= point3.Y; num11--)
54850 {
54851 if (Main.tile[x, num11].active() && !Main.tileCut[Main.tile[x, num11].type] && Main.tile[x, num11].type != 504)
54852 {
54853 flag2 = true;
54854 break;
54855 }
54856 }
54857 }
54858 if (flag2)
54859 {
54860 int num12 = 0;
54861 for (int num13 = point4.Y; num13 > point3.Y; num13--)
54862 {
54863 if ((WorldGen.TileEmpty(x, num13) || Main.tileCut[Main.tile[x, num13].type]) && WorldGen.PlaceTile(x, num13, 504, mute: false, forced: false, owner))
54864 {
54865 num12++;
54866 if (Main.netMode == 1)
54867 {
54868 NetMessage.SendData(17, -1, -1, null, 1, x, num13, 504f);
54869 }
54870 }
54871 }
54872 timeLeft = num7;
54873 ai[1] = 2f;
54874 netUpdate = true;
54875 base.Top = new Vector2((float)(x * 16 + 8), (float)(point3.Y * 16 + 16));
54876 velocity = Vector2.Zero;
54877 }
54878 }
54879 }
54880 if (ai[1] != 2f)
54881 {
54882 return;
54883 }
54884 alpha = 0;
54885 _ = timeLeft;
54886 float num2 = ai[0];
54887 float y3 = position.Y;
54888 Point point5 = base.Center.ToTileCoordinates();
54889 Point end2 = default(Point);
54890 ((Point)(ref end2))._002Ector(point5.X, (int)y3 / 16);
54891 Point start2 = default(Point);
54892 ((Point)(ref start2))._002Ector(point5.X, (int)num2 / 16);
54893 int x2 = start2.X;
54894 if (localAI[0] == 0f)
54895 {
54896 localAI[0] = 1f;
54897 for (int num3 = start2.Y; num3 >= end2.Y; num3--)
54898 {
54899 Tile tile = Main.tile[x2, num3];
54900 if (tile.active() && tile.type == 504)
54901 {
54903 }
54904 }
54905 }
54906 else
54907 {
54908 for (int num4 = start2.Y; num4 >= end2.Y; num4--)
54909 {
54910 Tile tile2 = Main.tile[x2, num4];
54911 if (tile2.active() && tile2.type == 504 && Main.rand.Next(80) == 0)
54912 {
54913 Dust dust3 = Dust.NewDustDirect(new Vector2((float)(x2 * 16 - 6), (float)(num4 * 16)), 28, 16, 27, 0f, 0f, 150, Color.Transparent, 0.6f);
54914 dust3.velocity *= 1f;
54915 dust3.velocity.X = 0f;
54916 dust3.fadeIn = 1.2f;
54917 dust3.noGravity = true;
54918 }
54919 }
54920 }
54921 if (timeLeft == 4)
54922 {
54923 for (int num5 = start2.Y; num5 >= end2.Y; num5--)
54924 {
54925 Tile tile3 = Main.tile[x2, num5];
54926 if (tile3.active() && tile3.type == 504)
54927 {
54929 }
54930 }
54931 }
54932 if (timeLeft > 4)
54933 {
54934 return;
54935 }
54936 if (!WorldGen.InWorld(x2, end2.Y, 20) || !WorldGen.InWorld(x2, start2.Y, 20))
54937 {
54938 Kill();
54939 return;
54940 }
54941 if (Main.myPlayer == owner)
54942 {
54944 }
54945 Kill();
54946 }
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 owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
void AI_155_SpawnRopeIn(int x, int y)
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
void AI_155_RemoveRope(Point start, Point end)
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.

References Terraria.Tile.active(), Terraria.WorldGen.InWorld(), Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Dust.NewDustDirect(), Terraria.WorldGen.PlaceTile(), Terraria.Main.player, Terraria.Main.rand, Terraria.Utils.Remap(), Terraria.Utils.RotatedBy(), Terraria.NetMessage.SendData(), Terraria.Main.tile, Terraria.Main.tileCut, Terraria.WorldGen.TileEmpty(), and Terraria.Dust.velocity.

+ Here is the call graph for this function: