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

◆ AI_147_Celeb2Rocket()

void Terraria.Projectile.AI_147_Celeb2Rocket ( )
inlineprivate

Definition at line 55752 of file Projectile.cs.

55753 {
55754 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
55755 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
55756 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
55757 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
55758 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
55759 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
55760 //IL_083f: Unknown result type (might be due to invalid IL or missing references)
55761 //IL_0844: Unknown result type (might be due to invalid IL or missing references)
55762 //IL_0849: Unknown result type (might be due to invalid IL or missing references)
55763 //IL_085f: Unknown result type (might be due to invalid IL or missing references)
55764 //IL_0865: Unknown result type (might be due to invalid IL or missing references)
55765 //IL_0867: Unknown result type (might be due to invalid IL or missing references)
55766 //IL_0874: Unknown result type (might be due to invalid IL or missing references)
55767 //IL_0879: Unknown result type (might be due to invalid IL or missing references)
55768 //IL_087e: Unknown result type (might be due to invalid IL or missing references)
55769 //IL_088e: Unknown result type (might be due to invalid IL or missing references)
55770 //IL_0894: Unknown result type (might be due to invalid IL or missing references)
55771 //IL_0896: Unknown result type (might be due to invalid IL or missing references)
55772 //IL_089b: Unknown result type (might be due to invalid IL or missing references)
55773 //IL_089f: Unknown result type (might be due to invalid IL or missing references)
55774 //IL_08a4: Unknown result type (might be due to invalid IL or missing references)
55775 //IL_08a8: Unknown result type (might be due to invalid IL or missing references)
55776 //IL_08b2: Unknown result type (might be due to invalid IL or missing references)
55777 //IL_08b7: Unknown result type (might be due to invalid IL or missing references)
55778 //IL_08bc: Unknown result type (might be due to invalid IL or missing references)
55779 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
55780 //IL_0784: Unknown result type (might be due to invalid IL or missing references)
55781 //IL_0790: Unknown result type (might be due to invalid IL or missing references)
55782 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
55783 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
55784 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
55785 //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
55786 //IL_01f4: Unknown result type (might be due to invalid IL or missing references)
55787 //IL_0204: Unknown result type (might be due to invalid IL or missing references)
55788 //IL_020a: Unknown result type (might be due to invalid IL or missing references)
55789 //IL_020c: Unknown result type (might be due to invalid IL or missing references)
55790 //IL_0211: Unknown result type (might be due to invalid IL or missing references)
55791 //IL_0220: Unknown result type (might be due to invalid IL or missing references)
55792 //IL_0225: Unknown result type (might be due to invalid IL or missing references)
55793 //IL_022a: Unknown result type (might be due to invalid IL or missing references)
55794 //IL_022f: Unknown result type (might be due to invalid IL or missing references)
55795 //IL_0231: Unknown result type (might be due to invalid IL or missing references)
55796 //IL_0242: Unknown result type (might be due to invalid IL or missing references)
55797 //IL_0248: Unknown result type (might be due to invalid IL or missing references)
55798 //IL_024a: Unknown result type (might be due to invalid IL or missing references)
55799 //IL_024f: Unknown result type (might be due to invalid IL or missing references)
55800 //IL_0252: Unknown result type (might be due to invalid IL or missing references)
55801 //IL_026a: Unknown result type (might be due to invalid IL or missing references)
55802 //IL_026f: Unknown result type (might be due to invalid IL or missing references)
55803 //IL_0284: Unknown result type (might be due to invalid IL or missing references)
55804 //IL_02d0: Unknown result type (might be due to invalid IL or missing references)
55805 //IL_02d5: Unknown result type (might be due to invalid IL or missing references)
55806 //IL_02d7: Unknown result type (might be due to invalid IL or missing references)
55807 //IL_02dc: Unknown result type (might be due to invalid IL or missing references)
55808 //IL_02ea: Unknown result type (might be due to invalid IL or missing references)
55809 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
55810 //IL_02f9: Unknown result type (might be due to invalid IL or missing references)
55811 //IL_02fe: Unknown result type (might be due to invalid IL or missing references)
55812 //IL_0305: Unknown result type (might be due to invalid IL or missing references)
55813 //IL_030a: Unknown result type (might be due to invalid IL or missing references)
55814 //IL_030f: Unknown result type (might be due to invalid IL or missing references)
55815 //IL_031d: Unknown result type (might be due to invalid IL or missing references)
55816 //IL_0328: Unknown result type (might be due to invalid IL or missing references)
55817 //IL_032d: Unknown result type (might be due to invalid IL or missing references)
55818 //IL_0349: Unknown result type (might be due to invalid IL or missing references)
55819 //IL_034c: Unknown result type (might be due to invalid IL or missing references)
55820 //IL_0359: Unknown result type (might be due to invalid IL or missing references)
55821 //IL_035f: Unknown result type (might be due to invalid IL or missing references)
55822 //IL_0361: Unknown result type (might be due to invalid IL or missing references)
55823 //IL_036b: Unknown result type (might be due to invalid IL or missing references)
55824 //IL_0370: Unknown result type (might be due to invalid IL or missing references)
55825 //IL_05a5: Unknown result type (might be due to invalid IL or missing references)
55826 //IL_05b4: Unknown result type (might be due to invalid IL or missing references)
55827 int num = 0;
55828 int num11 = 1;
55829 int num16 = 1;
55830 localAI[num] += 1f;
55831 alpha = 0;
55832 rotation = velocity.ToRotation() + (float)Math.PI / 2f;
55833 int num17 = (int)ai[0];
55834 Vector2 center = base.Center;
55835 Color celeb2Color = GetCeleb2Color();
55836 Lighting.AddLight(center, ((Color)(ref celeb2Color)).ToVector3() * 0.5f);
55837 switch (num17)
55838 {
55839 case 0:
55840 if (localAI[num] >= 20f)
55841 {
55842 velocity.Y += 0.12f;
55843 penetrate = (maxPenetrate = -1);
55844 }
55845 if (velocity.Y > 16f)
55846 {
55847 velocity.Y = 16f;
55848 }
55849 if (localAI[num] > 20f && localAI[num] % 20f == 0f)
55850 {
55852 }
55853 break;
55854 case 1:
55855 {
55856 if (localAI[num] == 10f)
55857 {
55858 velocity.Y -= 10f;
55859 }
55860 if (localAI[num] >= 10f)
55861 {
55862 velocity.Y += 0.25f;
55863 }
55864 if (velocity.Y > 16f)
55865 {
55866 velocity.Y = 16f;
55867 }
55868 if (!(localAI[num] >= 10f))
55869 {
55870 break;
55871 }
55872 scale += 0.015f;
55873 if (scale > 2.5f)
55874 {
55875 scale = 2.5f;
55876 }
55877 if (localAI[num] % 10f != 0f)
55878 {
55879 break;
55880 }
55881 _ = velocity;
55882 for (float num18 = 0f; num18 < 1f; num18 += 0.12f)
55883 {
55884 Vector2 spinningpoint = Vector2.UnitX * -8f;
55885 spinningpoint += -Vector2.UnitY.RotatedBy(num18 * ((float)Math.PI * 2f)) * new Vector2(2f, 4f);
55886 spinningpoint = spinningpoint.RotatedBy(rotation - (float)Math.PI / 2f);
55887 int num19 = Dust.NewDust(base.Center, 0, 0, 267, 0f, 0f, 0, Color.Lerp(GetCeleb2Color(), Color.White, Main.rand.NextFloat() * 0.3f));
55888 Main.dust[num19].scale = 0.9f;
55889 Main.dust[num19].fadeIn = 1.1f;
55890 Main.dust[num19].noGravity = true;
55891 Main.dust[num19].position = base.Center + spinningpoint;
55892 Main.dust[num19].velocity = -velocity * 0.35f + spinningpoint * 0.35f;
55893 Dust obj = Main.dust[num19];
55894 obj.velocity *= scale;
55895 if (localAI[num] == 10f)
55896 {
55897 Main.dust[num19].velocity = spinningpoint.RotatedBy(velocity.ToRotation()) * 0.3f;
55898 }
55899 }
55900 break;
55901 }
55902 case 2:
55903 if (localAI[num] >= 60f)
55904 {
55905 velocity.Y += 0.15f;
55906 }
55907 if (velocity.Y > 16f)
55908 {
55909 velocity.Y = 16f;
55910 }
55911 break;
55912 case 3:
55913 {
55914 float num20 = localAI[num11];
55915 if (num20 == 0f)
55916 {
55917 float num21 = ((Vector2)(ref velocity)).Length();
55918 localAI[num11] = num21;
55919 num20 = num21;
55920 }
55921 if (localAI[num] >= 25f && ai[num16] == 0f)
55922 {
55923 if (localAI[num] >= 20f)
55924 {
55925 velocity.Y += 0.15f;
55926 }
55927 if (velocity.Y > 16f)
55928 {
55929 velocity.Y = 16f;
55930 }
55931 }
55932 if (!(localAI[num] >= 20f))
55933 {
55934 break;
55935 }
55936 float num22 = position.X;
55937 float num2 = position.Y;
55938 float num3 = 800f;
55939 bool flag = false;
55940 int num4 = 0;
55941 if (ai[num16] == 0f)
55942 {
55943 for (int i = 0; i < 200; i++)
55944 {
55945 if (Main.npc[i].CanBeChasedBy(this) && (ai[num16] == 0f || ai[num16] == (float)(i + 1)))
55946 {
55947 float num5 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2);
55948 float num6 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2);
55949 float num7 = Math.Abs(position.X + (float)(width / 2) - num5) + Math.Abs(position.Y + (float)(height / 2) - num6);
55950 if (num7 < num3 && Collision.CanHit(new Vector2(position.X + (float)(width / 2), position.Y + (float)(height / 2)), 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height))
55951 {
55952 num3 = num7;
55953 num22 = num5;
55954 num2 = num6;
55955 flag = true;
55956 num4 = i;
55957 }
55958 }
55959 }
55960 if (flag)
55961 {
55962 ai[1] = num4 + 1;
55963 }
55964 flag = false;
55965 }
55966 if (ai[num16] != 0f)
55967 {
55968 int num8 = (int)(ai[num16] - 1f);
55969 if (Main.npc[num8].active && Main.npc[num8].CanBeChasedBy(this, ignoreDontTakeDamage: true))
55970 {
55971 float num9 = Main.npc[num8].position.X + (float)(Main.npc[num8].width / 2);
55972 float num10 = Main.npc[num8].position.Y + (float)(Main.npc[num8].height / 2);
55973 if (Math.Abs(position.X + (float)(width / 2) - num9) + Math.Abs(position.Y + (float)(height / 2) - num10) < 1000f)
55974 {
55975 flag = true;
55976 num22 = Main.npc[num8].position.X + (float)(Main.npc[num8].width / 2);
55977 num2 = Main.npc[num8].position.Y + (float)(Main.npc[num8].height / 2);
55978 }
55979 }
55980 }
55981 if (!friendly)
55982 {
55983 flag = false;
55984 }
55985 if (flag)
55986 {
55987 float num23 = num20;
55988 Vector2 vector2 = default(Vector2);
55989 ((Vector2)(ref vector2))._002Ector(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
55990 float num12 = num22 - vector2.X;
55991 float num13 = num2 - vector2.Y;
55992 float num14 = (float)Math.Sqrt(num12 * num12 + num13 * num13);
55993 num14 = num23 / num14;
55994 num12 *= num14;
55995 num13 *= num14;
55996 int num15 = 8;
55997 velocity.X = (velocity.X * (float)(num15 - 1) + num12) / (float)num15;
55998 velocity.Y = (velocity.Y * (float)(num15 - 1) + num13) / (float)num15;
55999 }
56000 break;
56001 }
56002 case 4:
56003 {
56004 if (localAI[num] == 1f && ai[1] == 1f)
56005 {
56006 localAI[num] += 45f;
56007 }
56008 float x = velocity.SafeNormalize(Vector2.Zero).RotatedBy(localAI[num] * ((float)Math.PI / 45f)).X;
56009 Vector2 vector = velocity.SafeNormalize(Vector2.Zero).RotatedBy(1.5707963705062866);
56010 position += vector * x * 3f;
56011 scale = 2f;
56012 if (localAI[num] >= 10f)
56013 {
56014 velocity.Y += 0.04f;
56015 }
56016 if (velocity.Y > 16f)
56017 {
56018 velocity.Y = 16f;
56019 }
56020 break;
56021 }
56022 case 5:
56023 if (localAI[num] >= 40f)
56024 {
56025 velocity.Y += 0.08f;
56026 }
56027 if (velocity.Y > 16f)
56028 {
56029 velocity.Y = 16f;
56030 }
56031 break;
56032 case 6:
56033 if (localAI[num] >= 30f)
56034 {
56035 velocity.Y += 0.1f;
56036 }
56037 if (velocity.Y > 16f)
56038 {
56039 velocity.Y = 16f;
56040 }
56041 break;
56042 }
56043 }
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
int maxPenetrate
How many npc can this projectile hit before dying. (Or tile bounces) Automatically set at the end o...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
int penetrate
The remaining number of npc can this projectile hit before dying. (Or tile bounces)....
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....
bool friendly
If True, this projectile will hurt enemies (!F:Terraria.NPC.friendly) Defaults to false.
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
float scale
Scales how large the projectile will be drawn. Will also affect the hitbox (F:Terraria....

References Terraria.Lighting.AddLight(), Terraria.Collision.CanHit(), Terraria.Main.dust, Terraria.Dust.NewDust(), Terraria.Main.npc, and Terraria.Main.rand.

+ Here is the call graph for this function: