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

◆ ItemCheck_Shoot()

void Terraria.Player.ItemCheck_Shoot ( int i,
Item sItem,
int weaponDamage )
inlineprivate

Definition at line 44776 of file Player.cs.

44777 {
44778 int projToShoot = sItem.shoot;
44779 float speed = sItem.shootSpeed;
44780 int damage = sItem.damage;
44782 {
44783 speed /= meleeSpeed;
44784 }
44785 bool canShoot = false;
44786 int Damage = weaponDamage;
44787 float KnockBack = sItem.knockBack;
44788 int usedAmmoItemId = 0;
44789 if (sItem.useAmmo > 0)
44790 {
44792 }
44793 else
44794 {
44795 canShoot = true;
44796 }
44797 if (ItemID.Sets.gunProj[sItem.type])
44798 {
44799 KnockBack = sItem.knockBack;
44801 speed = sItem.shootSpeed;
44802 }
44803 if (sItem.IsACoin)
44804 {
44805 canShoot = false;
44806 }
44807 if (sItem.type == 1254 && projToShoot == 14)
44808 {
44809 projToShoot = 242;
44810 }
44811 if (sItem.type == 1255 && projToShoot == 14)
44812 {
44813 projToShoot = 242;
44814 }
44815 if (sItem.type == 1265 && projToShoot == 14)
44816 {
44817 projToShoot = 242;
44818 }
44819 if (sItem.type == 3542)
44820 {
44821 if (Main.rand.Next(100) < 20)
44822 {
44823 projToShoot++;
44824 Damage *= 3;
44825 }
44826 else
44827 {
44828 speed -= 1f;
44829 }
44830 }
44831 if (sItem.type == 1928)
44832 {
44833 Damage = (int)((float)Damage * 1f);
44834 }
44835 if (sItem.type == 3063)
44836 {
44837 Damage = (int)((float)Damage * 1.25f);
44838 }
44839 if (sItem.type == 1306)
44840 {
44841 Damage = (int)((double)Damage * 0.67);
44842 }
44843 if (sItem.type == 1227)
44844 {
44845 Damage = (int)((double)Damage * 0.7);
44846 }
44847 if (!canShoot)
44848 {
44849 return;
44850 }
44853 if (projToShoot == 228)
44854 {
44855 KnockBack = 0f;
44856 }
44857 if (projToShoot == 1 && sItem.type == 120)
44858 {
44859 projToShoot = 2;
44860 }
44861 if (sItem.type == 682)
44862 {
44863 projToShoot = 117;
44864 }
44865 if (sItem.type == 725)
44866 {
44867 projToShoot = 120;
44868 }
44869 if (sItem.type == 2796)
44870 {
44871 projToShoot = 442;
44872 }
44873 if (sItem.type == 2223)
44874 {
44875 projToShoot = 357;
44876 }
44877 if (sItem.type == 5117)
44878 {
44879 projToShoot = 968;
44880 }
44881 if (sItem.fishingPole > 0 && overrideFishingBobber > -1)
44882 {
44884 }
44887 bool flag = true;
44888 int type = sItem.type;
44889 if (type == 723 || type == 3611)
44890 {
44891 flag = false;
44892 }
44893 Vector2 value = Vector2.UnitX.RotatedBy(fullRotation);
44894 Vector2 vector = Main.MouseWorld - pointPoisition;
44895 Vector2 v = itemRotation.ToRotationVector2() * direction;
44896 if (sItem.type == 3852 && !ItemAnimationJustStarted)
44897 {
44898 vector = (v.ToRotation() + fullRotation).ToRotationVector2();
44899 }
44900 if (vector != Vector2.Zero)
44901 {
44902 vector.Normalize();
44903 }
44904 float num = Vector2.Dot(value, vector);
44905 if (flag)
44906 {
44907 if (num > 0f)
44908 {
44909 ChangeDir(1);
44910 }
44911 else
44912 {
44913 ChangeDir(-1);
44914 }
44915 }
44916 if (sItem.type == 3094 || sItem.type == 3378 || sItem.type == 3543)
44917 {
44918 pointPoisition.Y = position.Y + (float)(height / 3);
44919 }
44920 if (sItem.type == 5117)
44921 {
44922 pointPoisition.Y = position.Y + (float)(height / 3);
44923 }
44924 if (sItem.type == 517)
44925 {
44926 pointPoisition.X += (float)Main.rand.Next(-3, 4) * 3.5f;
44927 pointPoisition.Y += (float)Main.rand.Next(-3, 4) * 3.5f;
44928 }
44929 if (sItem.type == 2611)
44930 {
44932 if (vector2 != Vector2.Zero)
44933 {
44934 vector2.Normalize();
44935 }
44937 }
44938 if (sItem.type == 3827)
44939 {
44940 pointPoisition += vector.SafeNormalize(Vector2.Zero).RotatedBy((float)direction * (-(float)Math.PI / 2f)) * 24f;
44941 }
44942 if (projToShoot == 9)
44943 {
44944 pointPoisition = new Vector2(position.X + (float)width * 0.5f + (float)(Main.rand.Next(201) * -direction) + ((float)Main.mouseX + Main.screenPosition.X - position.X), MountedCenter.Y - 600f);
44945 KnockBack = 0f;
44946 Damage = (int)((float)Damage * 1.5f);
44947 }
44948 if (sItem.type == 986 || sItem.type == 281)
44949 {
44950 pointPoisition.X += 6 * direction;
44951 pointPoisition.Y -= 6f * gravDir;
44952 }
44953 if (sItem.type == 3007)
44954 {
44955 pointPoisition.X -= 4 * direction;
44956 pointPoisition.Y -= 2f * gravDir;
44957 }
44958 float num2 = (float)Main.mouseX + Main.screenPosition.X - pointPoisition.X;
44959 float num3 = (float)Main.mouseY + Main.screenPosition.Y - pointPoisition.Y;
44960 if (sItem.type == 3852 && !ItemAnimationJustStarted)
44961 {
44963 num2 = vector3.X;
44964 num3 = vector3.Y;
44965 }
44966 if (gravDir == -1f)
44967 {
44968 num3 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - pointPoisition.Y;
44969 }
44970 float num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
44971 float num5 = num4;
44972 if ((float.IsNaN(num2) && float.IsNaN(num3)) || (num2 == 0f && num3 == 0f))
44973 {
44974 num2 = direction;
44975 num3 = 0f;
44976 num4 = speed;
44977 }
44978 else
44979 {
44980 num4 = speed / num4;
44981 }
44982 if (sItem.type == 1929 || sItem.type == 2270)
44983 {
44984 num2 += (float)Main.rand.Next(-50, 51) * 0.03f / num4;
44985 num3 += (float)Main.rand.Next(-50, 51) * 0.03f / num4;
44986 }
44987 num2 *= num4;
44988 num3 *= num4;
44989 if (projToShoot == 250)
44990 {
44991 for (int j = 0; j < 1000; j++)
44992 {
44993 if (Main.projectile[j].active && Main.projectile[j].owner == whoAmI && (Main.projectile[j].type == 250 || Main.projectile[j].type == 251))
44994 {
44995 Main.projectile[j].Kill();
44996 }
44997 }
44998 }
44999 if (projToShoot == 12 && Collision.CanHitLine(base.Center, 0, 0, pointPoisition + new Vector2(num2, num3) * 4f, 0, 0))
45000 {
45001 pointPoisition += new Vector2(num2, num3) * 3f;
45002 }
45003 if (projToShoot == 728 && !Collision.CanHitLine(base.Center, 0, 0, pointPoisition + new Vector2(num2, num3) * 2f, 0, 0))
45004 {
45005 Vector2 vector4 = new Vector2(num2, num3) * 0.25f;
45006 pointPoisition = base.Center - vector4;
45007 }
45008 if (projToShoot == 85)
45009 {
45010 pointPoisition += new Vector2(0f, -6f * (float)direction * Directions.Y).RotatedBy(vector.ToRotation());
45011 if (Collision.CanHitLine(pointPoisition, 0, 0, pointPoisition + new Vector2(num2, num3) * 5f, 0, 0))
45012 {
45013 pointPoisition += new Vector2(num2, num3) * 4f;
45014 }
45015 }
45016 if (projToShoot == 802 || projToShoot == 842)
45017 {
45018 Vector2 v2 = new Vector2(num2, num3);
45019 float num6 = (float)Math.PI / 4f;
45020 Vector2 vector5 = v2.SafeNormalize(Vector2.Zero).RotatedBy(num6 * (Main.rand.NextFloat() - 0.5f)) * (v2.Length() - Main.rand.NextFloatDirection() * 0.7f);
45021 num2 = vector5.X;
45022 num3 = vector5.Y;
45023 }
45024 if (sItem.useStyle == 5)
45025 {
45026 if (sItem.type == 3029)
45027 {
45029 vector6.X = (float)Main.mouseX + Main.screenPosition.X - pointPoisition.X;
45030 vector6.Y = (float)Main.mouseY + Main.screenPosition.Y - pointPoisition.Y - 1000f;
45031 itemRotation = (float)Math.Atan2(vector6.Y * (float)direction, vector6.X * (float)direction);
45032 NetMessage.SendData(13, -1, -1, null, whoAmI);
45033 NetMessage.SendData(41, -1, -1, null, whoAmI);
45034 }
45035 else if (sItem.type == 4381)
45036 {
45038 vector7.X = (float)Main.mouseX + Main.screenPosition.X - pointPoisition.X;
45039 vector7.Y = (float)Main.mouseY + Main.screenPosition.Y - pointPoisition.Y - 1000f;
45040 itemRotation = (float)Math.Atan2(vector7.Y * (float)direction, vector7.X * (float)direction);
45041 NetMessage.SendData(13, -1, -1, null, whoAmI);
45042 NetMessage.SendData(41, -1, -1, null, whoAmI);
45043 }
45044 else if (sItem.type == 3779)
45045 {
45046 itemRotation = 0f;
45047 NetMessage.SendData(13, -1, -1, null, whoAmI);
45048 NetMessage.SendData(41, -1, -1, null, whoAmI);
45049 }
45050 else
45051 {
45052 itemRotation = (float)Math.Atan2(num3 * (float)direction, num2 * (float)direction) - fullRotation;
45053 NetMessage.SendData(13, -1, -1, null, whoAmI);
45054 NetMessage.SendData(41, -1, -1, null, whoAmI);
45055 }
45056 }
45057 if (sItem.useStyle == 13)
45058 {
45059 itemRotation = (float)Math.Atan2(num3 * (float)direction, num2 * (float)direction) - fullRotation;
45060 NetMessage.SendData(13, -1, -1, null, whoAmI);
45061 NetMessage.SendData(41, -1, -1, null, whoAmI);
45062 }
45063 if (projToShoot == 17)
45064 {
45065 pointPoisition.X = (float)Main.mouseX + Main.screenPosition.X;
45066 pointPoisition.Y = (float)Main.mouseY + Main.screenPosition.Y;
45067 if (gravDir == -1f)
45068 {
45069 pointPoisition.Y = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY;
45070 }
45072 }
45073 if (projToShoot == 76)
45074 {
45075 projToShoot += Main.rand.Next(3);
45076 float num7 = (float)Main.screenHeight / Main.GameViewMatrix.Zoom.Y;
45077 num5 /= num7 / 2f;
45078 if (num5 > 1f)
45079 {
45080 num5 = 1f;
45081 }
45082 float num8 = num2 + (float)Main.rand.Next(-40, 41) * 0.01f;
45083 float num9 = num3 + (float)Main.rand.Next(-40, 41) * 0.01f;
45084 num8 *= num5 + 0.25f;
45085 num9 *= num5 + 0.25f;
45087 Main.projectile[num10].ai[1] = 1f;
45088 num5 = num5 * 2f - 1f;
45089 if (num5 < -1f)
45090 {
45091 num5 = -1f;
45092 }
45093 if (num5 > 1f)
45094 {
45095 num5 = 1f;
45096 }
45097 num5 = (float)Math.Round(num5 * (float)musicNotes);
45098 num5 /= (float)musicNotes;
45099 Main.projectile[num10].ai[0] = num5;
45100 NetMessage.SendData(27, -1, -1, null, num10);
45101 }
45102 else if (sItem.type == 3029)
45103 {
45104 int num11 = 3;
45105 if (projToShoot == 91 || projToShoot == 4 || projToShoot == 5 || projToShoot == 41)
45106 {
45107 if (Main.rand.Next(3) == 0)
45108 {
45109 num11--;
45110 }
45111 }
45112 else if (Main.rand.Next(3) == 0)
45113 {
45114 num11++;
45115 }
45116 for (int k = 0; k < num11; k++)
45117 {
45118 pointPoisition = new Vector2(position.X + (float)width * 0.5f + (float)(Main.rand.Next(201) * -direction) + ((float)Main.mouseX + Main.screenPosition.X - position.X), MountedCenter.Y - 600f);
45119 pointPoisition.X = (pointPoisition.X * 10f + base.Center.X) / 11f + (float)Main.rand.Next(-100, 101);
45120 pointPoisition.Y -= 150 * k;
45121 num2 = (float)Main.mouseX + Main.screenPosition.X - pointPoisition.X;
45122 num3 = (float)Main.mouseY + Main.screenPosition.Y - pointPoisition.Y;
45123 if (num3 < 0f)
45124 {
45125 num3 *= -1f;
45126 }
45127 if (num3 < 20f)
45128 {
45129 num3 = 20f;
45130 }
45131 num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
45132 num4 = speed / num4;
45133 num2 *= num4;
45134 num3 *= num4;
45135 float num12 = num2 + (float)Main.rand.Next(-40, 41) * 0.03f;
45136 float speedY = num3 + (float)Main.rand.Next(-40, 41) * 0.03f;
45137 num12 *= (float)Main.rand.Next(75, 150) * 0.01f;
45138 pointPoisition.X += Main.rand.Next(-50, 51);
45140 Main.projectile[num13].noDropItem = true;
45141 }
45142 }
45143 else if (sItem.type == 4381)
45144 {
45145 int num14 = Main.rand.Next(1, 3);
45146 if (Main.rand.Next(3) == 0)
45147 {
45148 num14++;
45149 }
45150 for (int l = 0; l < num14; l++)
45151 {
45152 pointPoisition = new Vector2(position.X + (float)width * 0.5f + (float)(Main.rand.Next(61) * -direction) + ((float)Main.mouseX + Main.screenPosition.X - position.X), MountedCenter.Y - 600f);
45153 pointPoisition.X = (pointPoisition.X * 10f + base.Center.X) / 11f + (float)Main.rand.Next(-30, 31);
45154 pointPoisition.Y -= 150f * Main.rand.NextFloat();
45155 num2 = (float)Main.mouseX + Main.screenPosition.X - pointPoisition.X;
45156 num3 = (float)Main.mouseY + Main.screenPosition.Y - pointPoisition.Y;
45157 if (num3 < 0f)
45158 {
45159 num3 *= -1f;
45160 }
45161 if (num3 < 20f)
45162 {
45163 num3 = 20f;
45164 }
45165 num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
45166 num4 = speed / num4;
45167 num2 *= num4;
45168 num3 *= num4;
45169 float num15 = num2 + (float)Main.rand.Next(-20, 21) * 0.03f;
45170 float speedY2 = num3 + (float)Main.rand.Next(-40, 41) * 0.03f;
45171 num15 *= (float)Main.rand.Next(55, 80) * 0.01f;
45172 pointPoisition.X += Main.rand.Next(-50, 51);
45174 Main.projectile[num16].noDropItem = true;
45175 }
45176 }
45177 else if (sItem.type == 98 || sItem.type == 533)
45178 {
45179 float speedX = num2 + (float)Main.rand.Next(-40, 41) * 0.01f;
45180 float speedY3 = num3 + (float)Main.rand.Next(-40, 41) * 0.01f;
45182 }
45183 else if (sItem.type == 1319)
45184 {
45185 float speedX2 = num2 + (float)Main.rand.Next(-40, 41) * 0.02f;
45186 float speedY4 = num3 + (float)Main.rand.Next(-40, 41) * 0.02f;
45188 }
45189 else if (sItem.type == 3107)
45190 {
45191 float speedX3 = num2 + (float)Main.rand.Next(-40, 41) * 0.02f;
45192 float speedY5 = num3 + (float)Main.rand.Next(-40, 41) * 0.02f;
45194 }
45196 {
45197 Vector2 vector8 = new Vector2((float)Main.mouseX + Main.screenPosition.X, (float)Main.mouseY + Main.screenPosition.Y);
45198 Vector2 vector9 = vector8 - base.Center;
45199 bool flag2 = false;
45200 if (vector9.Length() < 100f)
45201 {
45203 }
45204 if (!flag2)
45205 {
45206 if (vector9.Length() > 100f || !Collision.CanHit(base.Center, 1, 1, vector8, 1, 1))
45207 {
45209 }
45210 else
45211 {
45212 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, vector8.X, vector8.Y, 0f, 0f, projToShoot, Damage, KnockBack, i);
45213 }
45214 }
45215 }
45216 else if (sItem.type == 3053)
45217 {
45218 bool flag3 = false;
45219 if (itemAnimation <= sItem.useTime + 1)
45220 {
45221 flag3 = true;
45222 }
45224 vector10.Normalize();
45225 vector10 *= 4f;
45226 if (!flag3)
45227 {
45228 Vector2 vector11 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101));
45229 vector11.Normalize();
45230 vector10 += vector11;
45231 }
45232 vector10.Normalize();
45233 vector10 *= sItem.shootSpeed;
45234 float num17 = (float)Main.rand.Next(10, 80) * 0.001f;
45235 if (Main.rand.Next(2) == 0)
45236 {
45237 num17 *= -1f;
45238 }
45239 float num18 = (float)Main.rand.Next(10, 80) * 0.001f;
45240 if (Main.rand.Next(2) == 0)
45241 {
45242 num18 *= -1f;
45243 }
45244 if (flag3)
45245 {
45246 num18 = (num17 = 0f);
45247 }
45249 }
45250 else if (sItem.type == 3019)
45251 {
45253 float num19 = vector12.Length();
45254 vector12.X += (float)Main.rand.Next(-100, 101) * 0.01f * num19 * 0.15f;
45255 vector12.Y += (float)Main.rand.Next(-100, 101) * 0.01f * num19 * 0.15f;
45256 float num20 = num2 + (float)Main.rand.Next(-40, 41) * 0.03f;
45257 float num21 = num3 + (float)Main.rand.Next(-40, 41) * 0.03f;
45258 vector12.Normalize();
45259 vector12 *= num19;
45260 num20 *= (float)Main.rand.Next(50, 150) * 0.01f;
45261 num21 *= (float)Main.rand.Next(50, 150) * 0.01f;
45263 vector13.X += (float)Main.rand.Next(-100, 101) * 0.025f;
45264 vector13.Y += (float)Main.rand.Next(-100, 101) * 0.025f;
45265 vector13.Normalize();
45266 vector13 *= num19;
45267 num20 = vector13.X;
45268 num21 = vector13.Y;
45270 }
45271 else if (sItem.type == 2797)
45272 {
45273 Vector2 vector14 = Vector2.Normalize(new Vector2(num2, num3)) * 40f * sItem.scale;
45274 if (Collision.CanHit(pointPoisition, 0, 0, pointPoisition + vector14, 0, 0))
45275 {
45277 }
45278 float ai = new Vector2(num2, num3).ToRotation();
45279 float num22 = (float)Math.PI * 2f / 3f;
45280 int num23 = Main.rand.Next(4, 5);
45281 if (Main.rand.Next(4) == 0)
45282 {
45283 num23++;
45284 }
45285 for (int m = 0; m < num23; m++)
45286 {
45287 float num24 = (float)Main.rand.NextDouble() * 0.2f + 0.05f;
45288 Vector2 vector15 = new Vector2(num2, num3).RotatedBy(num22 * (float)Main.rand.NextDouble() - num22 / 2f) * num24;
45289 int num25 = Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition.X, pointPoisition.Y, vector15.X, vector15.Y, 444, Damage, KnockBack, i, ai);
45290 Main.projectile[num25].localAI[0] = projToShoot;
45291 Main.projectile[num25].localAI[1] = speed;
45292 }
45293 }
45294 else if (sItem.type == 2270)
45295 {
45296 float num26 = num2 + (float)Main.rand.Next(-40, 41) * 0.05f;
45297 float num27 = num3 + (float)Main.rand.Next(-40, 41) * 0.05f;
45298 if (Main.rand.Next(3) == 0)
45299 {
45300 num26 *= 1f + (float)Main.rand.Next(-30, 31) * 0.02f;
45301 num27 *= 1f + (float)Main.rand.Next(-30, 31) * 0.02f;
45302 }
45304 }
45305 else if (sItem.type == 5117)
45306 {
45307 float speedX4 = num2 + (float)Main.rand.Next(-15, 16) * 0.075f;
45308 float speedY6 = num3 + (float)Main.rand.Next(-15, 16) * 0.075f;
45309 int num28 = Main.rand.Next(Main.projFrames[sItem.shoot]);
45310 int damage2 = Damage;
45312 }
45313 else if (sItem.type == 1930)
45314 {
45315 int num29 = 2 + Main.rand.Next(3);
45316 for (int n = 0; n < num29; n++)
45317 {
45318 float num30 = num2;
45319 float num31 = num3;
45320 float num32 = 0.025f * (float)n;
45321 num30 += (float)Main.rand.Next(-35, 36) * num32;
45322 num31 += (float)Main.rand.Next(-35, 36) * num32;
45323 num4 = (float)Math.Sqrt(num30 * num30 + num31 * num31);
45324 num4 = speed / num4;
45325 num30 *= num4;
45326 num31 *= num4;
45327 float x = pointPoisition.X + num2 * (float)(num29 - n) * 1.75f;
45328 float y = pointPoisition.Y + num3 * (float)(num29 - n) * 1.75f;
45329 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, x, y, num30, num31, projToShoot, Damage, KnockBack, i, Main.rand.Next(0, 10 * (n + 1)));
45330 }
45331 }
45332 else if (sItem.type == 1931)
45333 {
45334 int num33 = 2;
45335 for (int num34 = 0; num34 < num33; num34++)
45336 {
45337 pointPoisition = new Vector2(position.X + (float)width * 0.5f + (float)(Main.rand.Next(201) * -direction) + ((float)Main.mouseX + Main.screenPosition.X - position.X), MountedCenter.Y - 600f);
45338 pointPoisition.X = (pointPoisition.X + base.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
45339 pointPoisition.Y -= 100 * num34;
45340 num2 = (float)Main.mouseX + Main.screenPosition.X - pointPoisition.X;
45341 num3 = (float)Main.mouseY + Main.screenPosition.Y - pointPoisition.Y;
45342 if (gravDir == -1f)
45343 {
45344 num3 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - pointPoisition.Y;
45345 }
45346 if (num3 < 0f)
45347 {
45348 num3 *= -1f;
45349 }
45350 if (num3 < 20f)
45351 {
45352 num3 = 20f;
45353 }
45354 num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
45355 num4 = speed / num4;
45356 num2 *= num4;
45357 num3 *= num4;
45358 float speedX5 = num2 + (float)Main.rand.Next(-40, 41) * 0.02f;
45359 float speedY7 = num3 + (float)Main.rand.Next(-40, 41) * 0.02f;
45360 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition.X, pointPoisition.Y, speedX5, speedY7, projToShoot, Damage, KnockBack, i, 0f, Main.rand.Next(5));
45361 }
45362 }
45363 else if (sItem.type == 2750)
45364 {
45365 int num35 = 1;
45366 for (int num36 = 0; num36 < num35; num36++)
45367 {
45368 pointPoisition = new Vector2(position.X + (float)width * 0.5f + (float)(Main.rand.Next(201) * -direction) + ((float)Main.mouseX + Main.screenPosition.X - position.X), MountedCenter.Y - 600f);
45369 pointPoisition.X = (pointPoisition.X + base.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
45370 pointPoisition.Y -= 100 * num36;
45371 num2 = (float)Main.mouseX + Main.screenPosition.X - pointPoisition.X + (float)Main.rand.Next(-40, 41) * 0.03f;
45372 num3 = (float)Main.mouseY + Main.screenPosition.Y - pointPoisition.Y;
45373 if (gravDir == -1f)
45374 {
45375 num3 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - pointPoisition.Y;
45376 }
45377 if (num3 < 0f)
45378 {
45379 num3 *= -1f;
45380 }
45381 if (num3 < 20f)
45382 {
45383 num3 = 20f;
45384 }
45385 num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
45386 num4 = speed / num4;
45387 num2 *= num4;
45388 num3 *= num4;
45389 float num37 = num2;
45390 float num38 = num3 + (float)Main.rand.Next(-40, 41) * 0.02f;
45391 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition.X, pointPoisition.Y, num37 * 0.75f, num38 * 0.75f, projToShoot + Main.rand.Next(3), Damage, KnockBack, i, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f);
45392 }
45393 }
45394 else if (sItem.type == 3570)
45395 {
45396 int num39 = 3;
45397 for (int num40 = 0; num40 < num39; num40++)
45398 {
45399 pointPoisition = new Vector2(position.X + (float)width * 0.5f + (float)(Main.rand.Next(201) * -direction) + ((float)Main.mouseX + Main.screenPosition.X - position.X), MountedCenter.Y - 600f);
45400 pointPoisition.X = (pointPoisition.X + base.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
45401 pointPoisition.Y -= 100 * num40;
45402 num2 = (float)Main.mouseX + Main.screenPosition.X - pointPoisition.X;
45403 num3 = (float)Main.mouseY + Main.screenPosition.Y - pointPoisition.Y;
45404 float ai2 = num3 + pointPoisition.Y;
45405 if (num3 < 0f)
45406 {
45407 num3 *= -1f;
45408 }
45409 if (num3 < 20f)
45410 {
45411 num3 = 20f;
45412 }
45413 num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
45414 num4 = speed / num4;
45415 num2 *= num4;
45416 num3 *= num4;
45417 Vector2 vector16 = new Vector2(num2, num3) / 2f;
45419 }
45420 }
45421 else if (sItem.type == 5065)
45422 {
45426 }
45427 else if (sItem.type == 3065)
45428 {
45429 Vector2 vector17 = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY);
45430 float num41 = vector17.Y;
45431 if (num41 > base.Center.Y - 200f)
45432 {
45433 num41 = base.Center.Y - 200f;
45434 }
45435 for (int num42 = 0; num42 < 3; num42++)
45436 {
45437 pointPoisition = base.Center + new Vector2(-Main.rand.Next(0, 401) * direction, -600f);
45438 pointPoisition.Y -= 100 * num42;
45440 if (vector18.Y < 0f)
45441 {
45442 vector18.Y *= -1f;
45443 }
45444 if (vector18.Y < 20f)
45445 {
45446 vector18.Y = 20f;
45447 }
45448 vector18.Normalize();
45449 vector18 *= speed;
45450 num2 = vector18.X;
45451 num3 = vector18.Y;
45452 float speedX6 = num2;
45453 float speedY8 = num3 + (float)Main.rand.Next(-40, 41) * 0.02f;
45455 }
45456 }
45457 else if (sItem.type == 2624)
45458 {
45459 float num43 = (float)Math.PI / 10f;
45460 int num44 = 5;
45462 vector19.Normalize();
45463 vector19 *= 40f;
45464 bool flag4 = Collision.CanHit(pointPoisition, 0, 0, pointPoisition + vector19, 0, 0);
45465 for (int num45 = 0; num45 < num44; num45++)
45466 {
45467 float num46 = (float)num45 - ((float)num44 - 1f) / 2f;
45468 Vector2 vector20 = vector19.RotatedBy(num43 * num46);
45469 if (!flag4)
45470 {
45471 vector20 -= vector19;
45472 }
45474 Main.projectile[num47].noDropItem = true;
45475 }
45476 }
45477 else if (sItem.type == 1929)
45478 {
45479 float speedX7 = num2 + (float)Main.rand.Next(-40, 41) * 0.03f;
45480 float speedY9 = num3 + (float)Main.rand.Next(-40, 41) * 0.03f;
45482 }
45483 else if (sItem.type == 1553)
45484 {
45485 float speedX8 = num2 + (float)Main.rand.Next(-40, 41) * 0.005f;
45486 float speedY10 = num3 + (float)Main.rand.Next(-40, 41) * 0.005f;
45488 }
45489 else if (sItem.type == 518)
45490 {
45491 float num48 = num2;
45492 float num49 = num3;
45493 num48 += (float)Main.rand.Next(-40, 41) * 0.04f;
45494 num49 += (float)Main.rand.Next(-40, 41) * 0.04f;
45496 }
45497 else if (sItem.type == 1265)
45498 {
45499 float num50 = num2;
45500 float num51 = num3;
45501 num50 += (float)Main.rand.Next(-30, 31) * 0.03f;
45502 num51 += (float)Main.rand.Next(-30, 31) * 0.03f;
45504 }
45505 else if (sItem.type == 4262)
45506 {
45507 float num52 = 2.6666667f;
45508 _ = base.Bottom;
45509 _ = (int)base.Bottom.X / 16;
45510 int num53 = 4;
45511 float num54 = Math.Abs((float)Main.mouseX + Main.screenPosition.X - position.X) / 16f;
45512 if (direction < 0)
45513 {
45514 num54 += 1f;
45515 }
45516 num53 = (int)num54;
45517 if (num53 > 15)
45518 {
45519 num53 = 15;
45520 }
45521 Point point = base.Center.ToTileCoordinates();
45522 int maxDistance = 31;
45523 for (int num55 = num53; num55 >= 0; num55--)
45524 {
45525 if (Collision.CanHitLine(base.Center, 1, 1, base.Center + new Vector2(16 * num55 * direction, 0f), 1, 1) && WorldUtils.Find(new Point(point.X + direction * num55, point.Y), Searches.Chain(new Searches.Down(maxDistance), new Conditions.MysticSnake()), out var result))
45526 {
45527 int num56 = result.Y;
45528 while (Main.tile[result.X, num56 - 1].active())
45529 {
45530 num56--;
45531 if (Main.tile[result.X, num56 - 1] == null || num56 < 10 || result.Y - num56 > 7)
45532 {
45533 num56 = -1;
45534 break;
45535 }
45536 }
45537 if (num56 >= 10)
45538 {
45539 result.Y = num56;
45540 for (int num57 = 0; num57 < 1000; num57++)
45541 {
45542 Projectile projectile = Main.projectile[num57];
45543 if (projectile.active && projectile.owner == whoAmI && projectile.type == projToShoot)
45544 {
45545 if (projectile.ai[1] == 2f)
45546 {
45547 projectile.timeLeft = 4;
45548 }
45549 else
45550 {
45551 projectile.Kill();
45552 }
45553 }
45554 }
45555 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, result.X * 16 + 8, result.Y * 16 + 8 - 16, 0f, 0f - num52, projToShoot, Damage, KnockBack, i, result.Y * 16 + 8 - 16);
45556 break;
45557 }
45558 }
45559 }
45560 }
45561 else if (sItem.type == 4952)
45562 {
45563 Vector2 vector21 = Main.rand.NextVector2Circular(1f, 1f) + Main.rand.NextVector2CircularEdge(3f, 3f);
45564 if (vector21.Y > 0f)
45565 {
45566 vector21.Y *= -1f;
45567 }
45568 float num58 = (float)itemAnimation / (float)itemAnimationMax * 0.66f + miscCounterNormalized;
45570 Point point2 = pointPoisition.ToTileCoordinates();
45571 Tile tile = Main.tile[point2.X, point2.Y];
45572 if (tile != null && tile.nactive() && Main.tileSolid[tile.type] && !Main.tileSolidTop[tile.type] && !TileID.Sets.Platforms[tile.type])
45573 {
45575 }
45577 }
45578 else if (sItem.type == 4953)
45579 {
45580 float num59 = (float)Math.PI / 10f;
45581 int num60 = 5;
45583 vector22.Normalize();
45584 vector22 *= 40f;
45585 bool num61 = Collision.CanHit(pointPoisition, 0, 0, pointPoisition + vector22, 0, 0);
45586 int num62 = (itemAnimationMax - itemAnimation) / 2;
45587 int num63 = num62;
45588 if (direction == 1)
45589 {
45590 num63 = 4 - num62;
45591 }
45592 float num64 = (float)num63 - ((float)num60 - 1f) / 2f;
45593 Vector2 vector23 = vector22.RotatedBy(num59 * num64);
45594 if (!num61)
45595 {
45596 vector23 -= vector22;
45597 }
45598 Vector2 mouseWorld = Main.MouseWorld;
45599 Vector2 origin = pointPoisition + vector23;
45600 Vector2 vector24 = origin.DirectionTo(mouseWorld).SafeNormalize(-Vector2.UnitY);
45601 Vector2 value2 = base.Center.DirectionTo(base.Center + new Vector2(num2, num3)).SafeNormalize(-Vector2.UnitY);
45602 float lerpValue = Utils.GetLerpValue(100f, 40f, mouseWorld.Distance(base.Center), clamped: true);
45603 if (lerpValue > 0f)
45604 {
45605 vector24 = Vector2.Lerp(vector24, value2, lerpValue).SafeNormalize(new Vector2(num2, num3).SafeNormalize(-Vector2.UnitY));
45606 }
45608 if (num62 == 2)
45609 {
45610 projToShoot = 932;
45611 Damage *= 2;
45612 }
45613 if (projToShoot == 932)
45614 {
45615 float ai3 = miscCounterNormalized * 12f % 1f;
45616 v3 = v3.SafeNormalize(Vector2.Zero) * (speed * 2f);
45617 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, origin, v3, projToShoot, Damage, KnockBack, i, 0f, ai3);
45618 }
45619 else
45620 {
45621 int num65 = Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, origin, v3, projToShoot, Damage, KnockBack, i);
45622 Main.projectile[num65].noDropItem = true;
45623 }
45624 }
45625 else if (sItem.type == 534)
45626 {
45627 int num66 = Main.rand.Next(4, 6);
45628 for (int num67 = 0; num67 < num66; num67++)
45629 {
45630 float num68 = num2;
45631 float num69 = num3;
45632 num68 += (float)Main.rand.Next(-40, 41) * 0.05f;
45633 num69 += (float)Main.rand.Next(-40, 41) * 0.05f;
45635 }
45636 }
45637 else if (sItem.type == 4703)
45638 {
45639 float num70 = (float)Math.PI / 2f;
45641 for (int num71 = 0; num71 < 7; num71++)
45642 {
45643 Vector2 v4 = new Vector2(num2, num3);
45644 float num72 = v4.Length();
45645 v4 += v4.SafeNormalize(Vector2.Zero).RotatedBy(num70 * Main.rand.NextFloat()) * Main.rand.NextFloatDirection() * 5f;
45646 v4 = v4.SafeNormalize(Vector2.Zero) * num72;
45647 float x2 = v4.X;
45648 float y2 = v4.Y;
45649 x2 += (float)Main.rand.Next(-40, 41) * 0.05f;
45650 y2 += (float)Main.rand.Next(-40, 41) * 0.05f;
45652 }
45653 }
45654 else if (sItem.type == 4270)
45655 {
45656 Vector2 pointPoisition2 = Main.MouseWorld;
45658 Vector2 vector25 = pointPoisition2 + Main.rand.NextVector2Circular(8f, 8f);
45659 Vector2 vector26 = FindSharpTearsSpot(vector25).ToWorldCoordinates(Main.rand.Next(17), Main.rand.Next(17));
45660 Vector2 vector27 = (vector25 - vector26).SafeNormalize(-Vector2.UnitY) * 16f;
45661 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, vector26.X, vector26.Y, vector27.X, vector27.Y, projToShoot, Damage, KnockBack, i, 0f, Main.rand.NextFloat() * 0.5f + 0.6f);
45662 }
45663 else if (sItem.type == 4715)
45664 {
45665 Vector2 vector28 = Main.MouseWorld;
45669 {
45670 NPC nPC = validTargets[Main.rand.Next(validTargets.Count)];
45671 vector28 = nPC.Center + nPC.velocity * 20f;
45672 }
45673 Vector2 vector29 = vector28 - base.Center;
45675 {
45676 vector28 += Main.rand.NextVector2Circular(24f, 24f);
45677 if (vector29.Length() > 700f)
45678 {
45679 vector29 *= 700f / vector29.Length();
45680 vector28 = base.Center + vector29;
45681 }
45682 }
45683 Vector2 vector30 = Main.rand.NextVector2CircularEdge(1f, 1f);
45684 if (vector30.Y > 0f)
45685 {
45686 vector30 *= -1f;
45687 }
45688 if (Math.Abs(vector30.Y) < 0.5f)
45689 {
45690 vector30.Y = (0f - Main.rand.NextFloat()) * 0.5f - 0.5f;
45691 }
45692 vector30 *= vector29.Length() * 2f;
45694 }
45695 else if (sItem.type == 4722)
45696 {
45697 Vector2 vector31 = Main.MouseWorld;
45701 {
45702 NPC nPC2 = validTargets2[Main.rand.Next(validTargets2.Count)];
45703 vector31 = nPC2.Center + nPC2.velocity * 20f;
45704 }
45705 Vector2 vector32 = vector31 - base.Center;
45706 Vector2 vector33 = Main.rand.NextVector2CircularEdge(1f, 1f);
45707 float num73 = 1f;
45708 int num74 = 1;
45709 for (int num75 = 0; num75 < num74; num75++)
45710 {
45712 {
45713 vector31 += Main.rand.NextVector2Circular(24f, 24f);
45714 if (vector32.Length() > 700f)
45715 {
45716 vector32 *= 700f / vector32.Length();
45717 vector31 = base.Center + vector32;
45718 }
45719 float num76 = Utils.GetLerpValue(0f, 6f, velocity.Length(), clamped: true) * 0.8f;
45720 vector33 *= 1f - num76;
45721 vector33 += velocity * num76;
45722 vector33 = vector33.SafeNormalize(Vector2.UnitX);
45723 }
45724 float num77 = 60f;
45725 float num78 = Main.rand.NextFloatDirection() * (float)Math.PI * (1f / num77) * 0.5f * num73;
45726 float num79 = num77 / 2f;
45727 float num80 = 12f + Main.rand.NextFloat() * 2f;
45729 Vector2 vector35 = new Vector2(0f, 0f);
45731 for (int num81 = 0; (float)num81 < num79; num81++)
45732 {
45733 vector35 += vector36;
45734 vector36 = vector36.RotatedBy(num78);
45735 }
45738 float lerpValue2 = Utils.GetLerpValue(itemAnimationMax, 0f, itemAnimation, clamped: true);
45740 }
45741 }
45742 else if (sItem.type == 4607)
45743 {
45745 }
45746 else if (sItem.type == 5069)
45747 {
45749 }
45750 else if (sItem.type == 5114)
45751 {
45753 }
45754 else if (sItem.type == 2188)
45755 {
45756 int num82 = 4;
45757 if (Main.rand.Next(3) == 0)
45758 {
45759 num82++;
45760 }
45761 if (Main.rand.Next(4) == 0)
45762 {
45763 num82++;
45764 }
45765 if (Main.rand.Next(5) == 0)
45766 {
45767 num82++;
45768 }
45769 for (int num83 = 0; num83 < num82; num83++)
45770 {
45771 float num84 = num2;
45772 float num85 = num3;
45773 float num86 = 0.05f * (float)num83;
45774 num84 += (float)Main.rand.Next(-35, 36) * num86;
45775 num85 += (float)Main.rand.Next(-35, 36) * num86;
45776 num4 = (float)Math.Sqrt(num84 * num84 + num85 * num85);
45777 num4 = speed / num4;
45778 num84 *= num4;
45779 num85 *= num4;
45780 float x3 = pointPoisition.X;
45781 float y3 = pointPoisition.Y;
45783 }
45784 }
45785 else if (sItem.type == 1308)
45786 {
45787 int num87 = 3;
45788 if (Main.rand.Next(3) == 0)
45789 {
45790 num87++;
45791 }
45792 for (int num88 = 0; num88 < num87; num88++)
45793 {
45794 float num89 = num2;
45795 float num90 = num3;
45796 float num91 = 0.05f * (float)num88;
45797 num89 += (float)Main.rand.Next(-35, 36) * num91;
45798 num90 += (float)Main.rand.Next(-35, 36) * num91;
45799 num4 = (float)Math.Sqrt(num89 * num89 + num90 * num90);
45800 num4 = speed / num4;
45801 num89 *= num4;
45802 num90 *= num4;
45803 float x4 = pointPoisition.X;
45804 float y4 = pointPoisition.Y;
45806 }
45807 }
45808 else if (sItem.type == 1258)
45809 {
45810 float num92 = num2;
45811 float num93 = num3;
45812 num92 += (float)Main.rand.Next(-40, 41) * 0.01f;
45813 num93 += (float)Main.rand.Next(-40, 41) * 0.01f;
45814 pointPoisition.X += (float)Main.rand.Next(-40, 41) * 0.05f;
45815 pointPoisition.Y += (float)Main.rand.Next(-45, 36) * 0.05f;
45817 }
45818 else if (sItem.type == 964)
45819 {
45820 int num94 = Main.rand.Next(3, 5);
45821 for (int num95 = 0; num95 < num94; num95++)
45822 {
45823 float num96 = num2;
45824 float num97 = num3;
45825 num96 += (float)Main.rand.Next(-35, 36) * 0.04f;
45826 num97 += (float)Main.rand.Next(-35, 36) * 0.04f;
45828 }
45829 }
45830 else if (sItem.type == 1569)
45831 {
45832 int num98 = 4;
45833 if (Main.rand.Next(2) == 0)
45834 {
45835 num98++;
45836 }
45837 if (Main.rand.Next(4) == 0)
45838 {
45839 num98++;
45840 }
45841 if (Main.rand.Next(8) == 0)
45842 {
45843 num98++;
45844 }
45845 if (Main.rand.Next(16) == 0)
45846 {
45847 num98++;
45848 }
45849 for (int num99 = 0; num99 < num98; num99++)
45850 {
45851 float num100 = num2;
45852 float num101 = num3;
45853 float num102 = 0.05f * (float)num99;
45854 num100 += (float)Main.rand.Next(-35, 36) * num102;
45855 num101 += (float)Main.rand.Next(-35, 36) * num102;
45856 num4 = (float)Math.Sqrt(num100 * num100 + num101 * num101);
45857 num4 = speed / num4;
45858 num100 *= num4;
45859 num101 *= num4;
45860 float x5 = pointPoisition.X;
45861 float y5 = pointPoisition.Y;
45863 }
45864 }
45865 else if (sItem.type == 1572 || sItem.type == 2366 || sItem.type == 3571 || sItem.type == 3569 || sItem.type == 5119)
45866 {
45867 bool num103 = sItem.type == 3571 || sItem.type == 3569;
45868 int num104 = (int)((float)Main.mouseX + Main.screenPosition.X) / 16;
45869 int num105 = (int)((float)Main.mouseY + Main.screenPosition.Y) / 16;
45870 if (gravDir == -1f)
45871 {
45872 num105 = (int)(Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY) / 16;
45873 }
45874 if (!num103)
45875 {
45876 for (; num105 < Main.maxTilesY - 10 && Main.tile[num104, num105] != null && !WorldGen.SolidTile2(num104, num105) && Main.tile[num104 - 1, num105] != null && !WorldGen.SolidTile2(num104 - 1, num105) && Main.tile[num104 + 1, num105] != null && !WorldGen.SolidTile2(num104 + 1, num105); num105++)
45877 {
45878 }
45879 num105--;
45880 }
45881 int num106 = 0;
45882 switch (sItem.type)
45883 {
45884 case 1572:
45885 num106 = 60;
45886 break;
45887 case 5119:
45888 num106 = 90;
45889 break;
45890 }
45891 int num107 = Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, (float)Main.mouseX + Main.screenPosition.X, num105 * 16 - 24, 0f, 15f, projToShoot, Damage, KnockBack, i, num106);
45892 Main.projectile[num107].originalDamage = damage;
45894 }
45895 else if (sItem.type == 1244 || sItem.type == 1256)
45896 {
45898 Main.projectile[num108].ai[0] = (float)Main.mouseX + Main.screenPosition.X;
45899 Main.projectile[num108].ai[1] = (float)Main.mouseY + Main.screenPosition.Y;
45900 }
45901 else if (sItem.type == 1229)
45902 {
45903 int num109 = 2;
45904 if (Main.rand.Next(3) == 0)
45905 {
45906 num109++;
45907 }
45908 for (int num110 = 0; num110 < num109; num110++)
45909 {
45910 float num111 = num2;
45911 float num112 = num3;
45912 if (num110 > 0)
45913 {
45914 num111 += (float)Main.rand.Next(-35, 36) * 0.04f;
45915 num112 += (float)Main.rand.Next(-35, 36) * 0.04f;
45916 }
45917 if (num110 > 1)
45918 {
45919 num111 += (float)Main.rand.Next(-35, 36) * 0.04f;
45920 num112 += (float)Main.rand.Next(-35, 36) * 0.04f;
45921 }
45922 if (num110 > 2)
45923 {
45924 num111 += (float)Main.rand.Next(-35, 36) * 0.04f;
45925 num112 += (float)Main.rand.Next(-35, 36) * 0.04f;
45926 }
45928 Main.projectile[num113].noDropItem = true;
45929 }
45930 }
45931 else if (sItem.type == 1121)
45932 {
45933 int num114 = Main.rand.Next(1, 4);
45934 if (Main.rand.Next(6) == 0)
45935 {
45936 num114++;
45937 }
45938 if (Main.rand.Next(6) == 0)
45939 {
45940 num114++;
45941 }
45942 if (strongBees && Main.rand.Next(3) == 0)
45943 {
45944 num114++;
45945 }
45946 for (int num115 = 0; num115 < num114; num115++)
45947 {
45948 float num116 = num2;
45949 float num117 = num3;
45950 num116 += (float)Main.rand.Next(-35, 36) * 0.02f;
45951 num117 += (float)Main.rand.Next(-35, 36) * 0.02f;
45953 Main.projectile[num118].magic = true;
45954 }
45955 }
45956 else if (sItem.type == 1155)
45957 {
45958 int num119 = Main.rand.Next(2, 5);
45959 for (int num120 = 0; num120 < num119; num120++)
45960 {
45961 float num121 = num2;
45962 float num122 = num3;
45963 num121 += (float)Main.rand.Next(-35, 36) * 0.02f;
45964 num122 += (float)Main.rand.Next(-35, 36) * 0.02f;
45966 }
45967 }
45968 else if (sItem.type == 1801)
45969 {
45970 int num123 = Main.rand.Next(2, 4);
45971 for (int num124 = 0; num124 < num123; num124++)
45972 {
45973 float num125 = num2;
45974 float num126 = num3;
45975 num125 += (float)Main.rand.Next(-35, 36) * 0.05f;
45976 num126 += (float)Main.rand.Next(-35, 36) * 0.05f;
45978 }
45979 }
45980 else if (sItem.type == 679)
45981 {
45982 for (int num127 = 0; num127 < 6; num127++)
45983 {
45984 float num128 = num2;
45985 float num129 = num3;
45986 num128 += (float)Main.rand.Next(-40, 41) * 0.05f;
45987 num129 += (float)Main.rand.Next(-40, 41) * 0.05f;
45989 }
45990 }
45991 else if (sItem.type == 1156)
45992 {
45993 for (int num130 = 0; num130 < 3; num130++)
45994 {
45995 float num131 = num2;
45996 float num132 = num3;
45997 num131 += (float)Main.rand.Next(-40, 41) * 0.05f;
45998 num132 += (float)Main.rand.Next(-40, 41) * 0.05f;
46000 }
46001 }
46002 else if (sItem.type == 4682)
46003 {
46004 for (int num133 = 0; num133 < 3; num133++)
46005 {
46006 float num134 = num2;
46007 float num135 = num3;
46008 num134 += (float)Main.rand.Next(-20, 21) * 0.1f;
46009 num135 += (float)Main.rand.Next(-20, 21) * 0.1f;
46011 }
46012 }
46013 else if (sItem.type == 2623)
46014 {
46015 for (int num136 = 0; num136 < 3; num136++)
46016 {
46017 float num137 = num2;
46018 float num138 = num3;
46019 num137 += (float)Main.rand.Next(-40, 41) * 0.1f;
46020 num138 += (float)Main.rand.Next(-40, 41) * 0.1f;
46022 }
46023 }
46024 else if (sItem.type == 3210)
46025 {
46027 vector39.X += (float)Main.rand.Next(-30, 31) * 0.04f;
46028 vector39.Y += (float)Main.rand.Next(-30, 31) * 0.03f;
46029 vector39.Normalize();
46030 vector39 *= (float)Main.rand.Next(70, 91) * 0.1f;
46031 vector39.X += (float)Main.rand.Next(-30, 31) * 0.04f;
46032 vector39.Y += (float)Main.rand.Next(-30, 31) * 0.03f;
46033 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition.X, pointPoisition.Y, vector39.X, vector39.Y, projToShoot, Damage, KnockBack, i, Main.rand.Next(20));
46034 }
46035 else if (sItem.type == 434)
46036 {
46037 float num139 = num2;
46038 float num140 = num3;
46039 if (itemAnimation < 5)
46040 {
46041 num139 += (float)Main.rand.Next(-40, 41) * 0.01f;
46042 num140 += (float)Main.rand.Next(-40, 41) * 0.01f;
46043 num139 *= 1.1f;
46044 num140 *= 1.1f;
46045 }
46046 else if (itemAnimation < 10)
46047 {
46048 num139 += (float)Main.rand.Next(-20, 21) * 0.01f;
46049 num140 += (float)Main.rand.Next(-20, 21) * 0.01f;
46050 num139 *= 1.05f;
46051 num140 *= 1.05f;
46052 }
46054 }
46055 else if (sItem.type == 1157)
46056 {
46057 projToShoot = Main.rand.Next(191, 195);
46059 Main.projectile[num141].localAI[0] = 30f;
46060 }
46061 else if (sItem.type == 1802)
46062 {
46064 }
46065 else if (sItem.type == 2364 || sItem.type == 2365)
46066 {
46068 }
46069 else if (sItem.type == 2535)
46070 {
46071 num2 = 0f;
46072 num3 = 0f;
46074 spinningpoint = spinningpoint.RotatedBy(1.5707963705062866);
46076 spinningpoint = spinningpoint.RotatedBy(-3.1415927410125732);
46078 }
46079 else if (sItem.type == 2551)
46080 {
46084 }
46085 else if (sItem.type == 2584)
46086 {
46088 }
46089 else if (sItem.type == 2621)
46090 {
46092 }
46093 else if (sItem.type == 2749 || sItem.type == 3249 || sItem.type == 3474 || sItem.type == 4273 || sItem.type == 4281)
46094 {
46096 }
46097 else if (sItem.type == 3531)
46098 {
46099 int num142 = -1;
46100 int num143 = -1;
46101 for (int num144 = 0; num144 < 1000; num144++)
46102 {
46103 if (Main.projectile[num144].active && Main.projectile[num144].owner == Main.myPlayer)
46104 {
46105 if (num142 == -1 && Main.projectile[num144].type == 625)
46106 {
46107 num142 = num144;
46108 }
46109 if (num143 == -1 && Main.projectile[num144].type == 628)
46110 {
46111 num143 = num144;
46112 }
46113 if (num142 != -1 && num143 != -1)
46114 {
46115 break;
46116 }
46117 }
46118 }
46119 if (num142 == -1 && num143 == -1)
46120 {
46121 num2 = 0f;
46122 num3 = 0f;
46123 pointPoisition.X = (float)Main.mouseX + Main.screenPosition.X;
46124 pointPoisition.Y = (float)Main.mouseY + Main.screenPosition.Y;
46129 Main.projectile[num146].localAI[1] = num147;
46130 Main.projectile[num147].localAI[1] = num148;
46131 Main.projectile[num145].originalDamage = damage;
46132 Main.projectile[num146].originalDamage = damage;
46133 Main.projectile[num147].originalDamage = damage;
46134 Main.projectile[num148].originalDamage = damage;
46135 }
46136 else if (num142 != -1 && num143 != -1)
46137 {
46138 int num149 = (int)Main.projectile[num143].ai[0];
46141 Main.projectile[num150].localAI[1] = num151;
46142 Main.projectile[num150].netUpdate = true;
46143 Main.projectile[num150].ai[1] = 1f;
46144 Main.projectile[num151].localAI[1] = num143;
46145 Main.projectile[num151].netUpdate = true;
46146 Main.projectile[num151].ai[1] = 1f;
46147 Main.projectile[num143].ai[0] = num151;
46148 Main.projectile[num143].netUpdate = true;
46149 Main.projectile[num143].ai[1] = 1f;
46150 Main.projectile[num150].originalDamage = damage;
46151 Main.projectile[num151].originalDamage = damage;
46152 Main.projectile[num143].originalDamage = damage;
46153 }
46154 }
46155 else if (sItem.type == 1309 || sItem.type == 4758 || sItem.type == 4269 || sItem.type == 5005)
46156 {
46158 }
46159 else if (sItem.shoot > 0 && (Main.projPet[sItem.shoot] || sItem.shoot == 72 || sItem.shoot == 18 || sItem.shoot == 500 || sItem.shoot == 650) && !sItem.summon)
46160 {
46161 for (int num152 = 0; num152 < 1000; num152++)
46162 {
46163 Projectile projectile2 = Main.projectile[num152];
46164 if (projectile2.active && projectile2.owner == whoAmI)
46165 {
46166 if (sItem.shoot == 72 && (projectile2.type == 72 || projectile2.type == 86 || projectile2.type == 87))
46167 {
46168 projectile2.Kill();
46169 }
46170 else if (sItem.type == 5131 && (projectile2.type == 881 || projectile2.type == 934))
46171 {
46172 projectile2.Kill();
46173 }
46174 else if (sItem.shoot == projectile2.type)
46175 {
46176 projectile2.Kill();
46177 }
46178 }
46179 }
46181 }
46182 else if (sItem.type == 3006)
46183 {
46186 }
46187 else if (sItem.type == 3014)
46188 {
46189 Vector2 pointPoisition3 = default(Vector2);
46190 pointPoisition3.X = Main.MouseWorld.X;
46191 pointPoisition3.Y = Main.MouseWorld.Y;
46193 while (Collision.CanHitLine(position, width, height, pointPoisition, 1, 1))
46194 {
46195 pointPoisition.X += num2;
46196 pointPoisition.Y += num3;
46198 {
46200 break;
46201 }
46202 }
46203 bool flag5 = false;
46204 int num153 = (int)pointPoisition.Y / 16;
46205 int num154 = (int)pointPoisition.X / 16;
46206 int num155;
46207 for (num155 = num153; num153 < Main.maxTilesY - 10 && num153 - num155 < 30 && !WorldGen.SolidTile(num154, num153) && !TileID.Sets.Platforms[Main.tile[num154, num153].type]; num153++)
46208 {
46209 }
46210 if (!WorldGen.SolidTile(num154, num153) && !TileID.Sets.Platforms[Main.tile[num154, num153].type])
46211 {
46212 flag5 = true;
46213 }
46214 float num156 = num153 * 16;
46215 num153 = num155;
46216 while (num153 > 10 && num155 - num153 < 30 && !WorldGen.SolidTile(num154, num153))
46217 {
46218 num153--;
46219 }
46220 float num157 = num153 * 16 + 16;
46221 float num158 = num156 - num157;
46222 int num159 = 15;
46223 if (num158 > (float)(16 * num159))
46224 {
46225 num158 = 16 * num159;
46226 }
46227 num157 = num156 - num158;
46228 pointPoisition.X = (int)(pointPoisition.X / 16f) * 16;
46229 if (!flag5)
46230 {
46232 }
46233 }
46234 else if (sItem.type == 3384)
46235 {
46236 int num160 = ((altFunctionUse == 2) ? 1 : 0);
46238 }
46239 else if (sItem.type == 3473)
46240 {
46241 float ai4 = (Main.rand.NextFloat() - 0.5f) * ((float)Math.PI / 4f);
46244 }
46245 else if (sItem.type == 4956)
46246 {
46250 if (num161 == 0)
46251 {
46252 num162 = 4956;
46253 }
46254 Vector2 pointPoisition4 = Main.MouseWorld;
46257 if (num161 == 1 || num161 == 2)
46258 {
46259 int npcTargetIndex;
46261 if (zenithTarget)
46262 {
46263 vector42 = Main.npc[npcTargetIndex].Center - MountedCenter;
46264 }
46265 bool flag6 = num161 == 2;
46266 if (num161 == 1 && !zenithTarget)
46267 {
46268 flag6 = true;
46269 }
46270 if (flag6)
46271 {
46272 vector42 += Main.rand.NextVector2Circular(150f, 150f);
46273 }
46274 }
46275 vector41 = vector42 / 2f;
46276 float ai5 = Main.rand.Next(-100, 101);
46278 }
46279 else if (sItem.type == 3836)
46280 {
46281 float ai6 = Main.rand.NextFloat() * speed * 0.75f * (float)direction;
46283 }
46284 else if (sItem.type == 3858)
46285 {
46286 bool num163 = altFunctionUse == 2;
46288 if (num163)
46289 {
46290 vector43 *= 1.5f;
46291 float ai7 = (0.3f + 0.7f * Main.rand.NextFloat()) * speed * 1.75f * (float)direction;
46292 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition, vector43, 708, (int)((float)Damage * 0.5f), KnockBack + 4f, i, ai7);
46293 }
46294 else
46295 {
46297 }
46298 }
46299 else if (sItem.type == 3859)
46300 {
46302 projToShoot = 710;
46303 vector44 *= 0.8f;
46304 Vector2 vector45 = vector44.SafeNormalize(-Vector2.UnitY);
46305 float num164 = (float)Math.PI / 180f * (float)(-direction);
46306 for (float num165 = -2.5f; num165 < 3f; num165 += 1f)
46307 {
46309 }
46310 }
46311 else if (sItem.type == 3870)
46312 {
46313 Vector2 vector46 = Vector2.Normalize(new Vector2(num2, num3)) * 40f * sItem.scale;
46314 if (Collision.CanHit(pointPoisition, 0, 0, pointPoisition + vector46, 0, 0))
46315 {
46317 }
46319 vector47 *= 0.8f;
46320 Vector2 vector48 = vector47.SafeNormalize(-Vector2.UnitY);
46321 float num166 = (float)Math.PI / 180f * (float)(-direction);
46322 for (int num167 = 0; num167 <= 2; num167++)
46323 {
46324 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition, (vector47 + vector48 * num167 * 1f).RotatedBy((float)num167 * num166), projToShoot, Damage, KnockBack, i);
46325 }
46326 }
46327 else if (sItem.type == 3542)
46328 {
46329 float num168 = (Main.rand.NextFloat() - 0.5f) * ((float)Math.PI / 4f) * 0.7f;
46330 for (int num169 = 0; num169 < 10; num169++)
46331 {
46332 if (Collision.CanHit(pointPoisition, 0, 0, pointPoisition + new Vector2(num2, num3).RotatedBy(num168) * 100f, 0, 0))
46333 {
46334 break;
46335 }
46336 num168 = (Main.rand.NextFloat() - 0.5f) * ((float)Math.PI / 4f) * 0.7f;
46337 }
46338 Vector2 vector49 = new Vector2(num2, num3).RotatedBy(num168) * (0.95f + Main.rand.NextFloat() * 0.3f);
46340 }
46341 else if (sItem.type == 3779)
46342 {
46343 float num170 = Main.rand.NextFloat() * ((float)Math.PI * 2f);
46344 for (int num171 = 0; num171 < 10; num171++)
46345 {
46346 if (Collision.CanHit(pointPoisition, 0, 0, pointPoisition + new Vector2(num2, num3).RotatedBy(num170) * 100f, 0, 0))
46347 {
46348 break;
46349 }
46350 num170 = Main.rand.NextFloat() * ((float)Math.PI * 2f);
46351 }
46352 Vector2 vector50 = new Vector2(num2, num3).RotatedBy(num170) * (0.95f + Main.rand.NextFloat() * 0.3f);
46354 }
46355 else if (sItem.type == 3787)
46356 {
46357 float f = Main.rand.NextFloat() * ((float)Math.PI * 2f);
46358 float value3 = 20f;
46359 float value4 = 60f;
46360 Vector2 vector51 = pointPoisition + f.ToRotationVector2() * MathHelper.Lerp(value3, value4, Main.rand.NextFloat());
46361 for (int num172 = 0; num172 < 50; num172++)
46362 {
46363 vector51 = pointPoisition + f.ToRotationVector2() * MathHelper.Lerp(value3, value4, Main.rand.NextFloat());
46364 if (Collision.CanHit(pointPoisition, 0, 0, vector51 + (vector51 - pointPoisition).SafeNormalize(Vector2.UnitX) * 8f, 0, 0))
46365 {
46366 break;
46367 }
46368 f = Main.rand.NextFloat() * ((float)Math.PI * 2f);
46369 }
46370 Vector2 v5 = Main.MouseWorld - vector51;
46371 Vector2 vector52 = new Vector2(num2, num3).SafeNormalize(Vector2.UnitY) * speed;
46372 v5 = v5.SafeNormalize(vector52) * speed;
46373 v5 = Vector2.Lerp(v5, vector52, 0.25f);
46375 }
46376 else if (sItem.type == 3788)
46377 {
46379 float num173 = (float)Math.PI / 4f;
46380 for (int num174 = 0; num174 < 2; num174++)
46381 {
46382 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition, vector53 + vector53.SafeNormalize(Vector2.Zero).RotatedBy(num173 * (Main.rand.NextFloat() * 0.5f + 0.5f)) * Main.rand.NextFloatDirection() * 2f, projToShoot, Damage, KnockBack, i);
46383 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition, vector53 + vector53.SafeNormalize(Vector2.Zero).RotatedBy((0f - num173) * (Main.rand.NextFloat() * 0.5f + 0.5f)) * Main.rand.NextFloatDirection() * 2f, projToShoot, Damage, KnockBack, i);
46384 }
46385 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition, vector53.SafeNormalize(Vector2.UnitX * direction) * (speed * 1.3f), 661, Damage * 2, KnockBack, i);
46386 }
46387 else if (sItem.type == 4463 || sItem.type == 486)
46388 {
46390 }
46391 else if (sItem.type == 46)
46392 {
46393 Vector2 vector54 = new Vector2(direction, gravDir * 4f).SafeNormalize(Vector2.UnitY).RotatedBy((float)Math.PI * 2f * Main.rand.NextFloatDirection() * 0.05f);
46394 Vector2 searchCenter = MountedCenter + new Vector2(70f, -40f) * Directions + vector54 * -10f;
46396 {
46397 NPC nPC3 = Main.npc[npcTargetIndex2];
46398 searchCenter = nPC3.Center + Main.rand.NextVector2Circular(nPC3.width / 2, nPC3.height / 2);
46399 }
46400 else
46401 {
46402 searchCenter += Main.rand.NextVector2Circular(20f, 20f);
46403 }
46404 float ai8 = 1f;
46405 if (Main.rand.Next(100) < meleeCrit)
46406 {
46407 ai8 = 2f;
46408 Damage *= 2;
46409 }
46410 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, searchCenter, vector54 * 0.001f, projToShoot, (int)((double)Damage * 0.5), KnockBack, i, ai8);
46411 NetMessage.SendData(13, -1, -1, null, whoAmI);
46412 }
46413 else if (sItem.type == 273)
46414 {
46418 NetMessage.SendData(13, -1, -1, null, whoAmI);
46419 }
46420 else if (sItem.type == 368)
46421 {
46424 NetMessage.SendData(13, -1, -1, null, whoAmI);
46425 }
46426 else if (sItem.type == 1826)
46427 {
46430 NetMessage.SendData(13, -1, -1, null, whoAmI);
46431 }
46432 else if (sItem.type == 675)
46433 {
46437 NetMessage.SendData(13, -1, -1, null, whoAmI);
46438 }
46439 else if (sItem.type == 674)
46440 {
46444 NetMessage.SendData(13, -1, -1, null, whoAmI);
46445 }
46446 else if (sItem.type == 757)
46447 {
46451 NetMessage.SendData(13, -1, -1, null, whoAmI);
46452 }
46453 else if (sItem.type == 190)
46454 {
46455 Vector2 vector55 = MountedCenter + new Vector2(70f, -40f) * Directions;
46456 int npcTargetIndex3;
46458 if (zenithTarget2)
46459 {
46460 NPC nPC4 = Main.npc[npcTargetIndex3];
46461 vector55 = Main.rand.NextVector2FromRectangle(nPC4.Hitbox);
46462 }
46463 else
46464 {
46465 vector55 += Main.rand.NextVector2Circular(20f, 20f);
46466 }
46467 Vector2 vector56 = base.Center + new Vector2(Main.rand.NextFloatDirection() * (float)width / 2f, height / 2) * Directions;
46469 float num175 = ((float)Math.PI + (float)Math.PI * 2f * Main.rand.NextFloat() * 1.5f) * ((float)(-direction) * gravDir);
46470 int num176 = 60;
46471 float num177 = num175 / (float)num176;
46472 float num178 = 16f;
46473 float num179 = v6.Length();
46474 if (Math.Abs(num177) >= 0.17f)
46475 {
46476 num177 *= 0.7f;
46477 }
46478 _ = direction;
46479 _ = gravDir;
46480 Vector2 vector57 = Vector2.UnitX * num178;
46482 int num180 = 0;
46483 while (v7.Length() < num179 && num180 < num176)
46484 {
46485 num180++;
46486 v7 += vector57;
46487 vector57 = vector57.RotatedBy(num177);
46488 }
46489 float num181 = v7.ToRotation();
46490 Vector2 spinningpoint2 = v6.SafeNormalize(Vector2.UnitY).RotatedBy(0f - num181 - num177) * num178;
46491 if (num180 == num176)
46492 {
46494 }
46495 if (!zenithTarget2)
46496 {
46497 vector56.Y -= gravDir * 24f;
46498 spinningpoint2 = spinningpoint2.RotatedBy((float)direction * gravDir * ((float)Math.PI * 2f) * 0.14f);
46499 }
46500 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, vector56, spinningpoint2, projToShoot, (int)((double)Damage * 0.25), KnockBack, i, num177, num180);
46501 NetMessage.SendData(13, -1, -1, null, whoAmI);
46502 }
46503 else if (sItem.type == 3475)
46504 {
46505 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition.X, pointPoisition.Y, num2, num3, 615, Damage, KnockBack, i, 5 * Main.rand.Next(0, 20));
46506 }
46507 else if (sItem.type == 3930)
46508 {
46509 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition.X, pointPoisition.Y, num2, num3, 714, Damage, KnockBack, i, 5 * Main.rand.Next(0, 20));
46510 }
46511 else if (sItem.type == 3540)
46512 {
46514 }
46515 else if (sItem.type == 5451)
46516 {
46517 for (int num182 = 0; num182 < 1000; num182++)
46518 {
46519 Projectile projectile3 = Main.projectile[num182];
46520 if (projectile3.type == projToShoot && projectile3.owner == whoAmI)
46521 {
46522 projectile3.Kill();
46523 }
46524 }
46526 }
46527 else if (sItem.type == 3854)
46528 {
46530 }
46531 else if (sItem.type == 3546)
46532 {
46533 for (int num183 = 0; num183 < 2; num183++)
46534 {
46535 float num184 = num2;
46536 float num185 = num3;
46537 num184 += (float)Main.rand.Next(-40, 41) * 0.05f;
46538 num185 += (float)Main.rand.Next(-40, 41) * 0.05f;
46539 Vector2 vector58 = pointPoisition + Vector2.Normalize(new Vector2(num184, num185).RotatedBy(-(float)Math.PI / 2f * (float)direction)) * 6f;
46540 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, vector58.X, vector58.Y, num184, num185, 167 + Main.rand.Next(4), Damage, KnockBack, i, 0f, 1f);
46541 }
46542 }
46543 else if (sItem.type == 3350)
46544 {
46545 float num186 = num2;
46546 float num187 = num3;
46547 num186 += (float)Main.rand.Next(-1, 2) * 0.5f;
46548 num187 += (float)Main.rand.Next(-1, 2) * 0.5f;
46549 if (Collision.CanHitLine(base.Center, 0, 0, pointPoisition + new Vector2(num186, num187) * 2f, 0, 0))
46550 {
46552 }
46553 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition.X, pointPoisition.Y - gravDir * 4f, num186, num187, projToShoot, Damage, KnockBack, i, 0f, (float)Main.rand.Next(12) / 6f);
46554 }
46555 else if (sItem.type == 3852)
46556 {
46557 if (altFunctionUse == 2)
46558 {
46559 Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, pointPoisition.X, base.Bottom.Y - 100f, (float)direction * speed, 0f, 704, (int)((float)Damage * 1.75f), KnockBack, i);
46560 }
46561 else
46562 {
46564 }
46565 }
46566 else if (sItem.type == 3818 || sItem.type == 3819 || sItem.type == 3820 || sItem.type == 3824 || sItem.type == 3825 || sItem.type == 3826 || sItem.type == 3829 || sItem.type == 3830 || sItem.type == 3831 || sItem.type == 3832 || sItem.type == 3833 || sItem.type == 3834)
46567 {
46570 int num188 = 0;
46571 int num189 = 0;
46572 int num190 = 0;
46573 switch (sItem.type)
46574 {
46575 case 3824:
46576 case 3825:
46577 case 3826:
46578 num188 = 1;
46579 num189 = Projectile.GetBallistraShotDelay(this);
46580 break;
46581 case 3832:
46582 case 3833:
46583 case 3834:
46584 num190 = Projectile.GetExplosiveTrapCooldown(this);
46585 break;
46586 case 3818:
46587 num188 = 1;
46588 num189 = 80;
46589 break;
46590 case 3819:
46591 num188 = 1;
46592 num189 = 70;
46593 break;
46594 case 3820:
46595 num188 = 1;
46596 num189 = 60;
46597 break;
46598 }
46599 int num191 = Projectile.NewProjectile(projectileSource_Item_WithPotentialAmmo, worldX, worldY - pushYUp, 0f, 0f, projToShoot, Damage, KnockBack, i, num188, num189);
46600 Main.projectile[num191].originalDamage = damage;
46601 Main.projectile[num191].localAI[0] = num190;
46603 }
46604 else if (sItem.type == 65)
46605 {
46607 new Vector2(100f, 0f);
46608 Vector2 mouseWorld2 = Main.MouseWorld;
46610 Vector2 vector60 = (pointPoisition - mouseWorld2).SafeNormalize(new Vector2(0f, -1f));
46611 while (vec.Y > pointPoisition.Y && WorldGen.SolidTile(vec.ToTileCoordinates()))
46612 {
46613 vec += vector60 * 16f;
46614 }
46616 }
46617 else if (sItem.type == 4923)
46618 {
46621 }
46622 else if (sItem.type == 1910)
46623 {
46625 }
46626 else if (sItem.type == 5134)
46627 {
46629 }
46630 else
46631 {
46633 if (sItem.type == 726)
46634 {
46635 Main.projectile[num192].magic = true;
46636 }
46637 if (sItem.type == 724 || sItem.type == 676)
46638 {
46639 Main.projectile[num192].melee = true;
46640 }
46641 if (projToShoot == 80)
46642 {
46643 Main.projectile[num192].ai[0] = tileTargetX;
46644 Main.projectile[num192].ai[1] = tileTargetY;
46645 }
46646 if (sItem.type == 760)
46647 {
46649 }
46650 if (projToShoot == 442)
46651 {
46652 Main.projectile[num192].ai[0] = tileTargetX;
46653 Main.projectile[num192].ai[1] = tileTargetY;
46654 }
46655 if (projToShoot == 826)
46656 {
46657 Main.projectile[num192].ai[1] = Main.rand.Next(3);
46658 }
46659 if (sItem.type == 949)
46660 {
46661 Main.projectile[num192].ai[1] = 1f;
46662 }
46663 if (Main.projectile[num192].aiStyle == 99)
46664 {
46666 }
46667 if (Main.projectile[num192].aiStyle == 160 && Main.IsItAHappyWindyDay)
46668 {
46670 }
46671 NetMessage.SendData(13, -1, -1, null, whoAmI);
46672 }
46673 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static double Atan2(double y, double x)
static double Sqrt(double d)
static decimal Round(decimal d)
Definition Math.cs:1096
static double Abs(double value)
const double PI
Definition Math.cs:16
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
static void HandleSpecialEvent(Player player, int eventID)
static bool[] gunProj
Definition ItemID.cs:1062
static bool[] NoMeleeSpeedVelocityScaling
static bool[] Platforms
Definition TileID.cs:163
void ApplyItemTime(Item sItem)
Definition Player.cs:3752
void PayDD2CrystalsBeforeUse(Item item)
Definition Player.cs:40433
int itemAnimationMax
Definition Player.cs:2567
bool ItemAnimationJustStarted
Definition Player.cs:3527
float itemRotation
Definition Player.cs:1177
float meleeSpeed
Definition Player.cs:2043
static int musicNotes
Definition Player.cs:2715
void UpdateMaxTurrets()
Definition Player.cs:49594
void FindSentryRestingSpot(int checkProj, out int worldX, out int worldY, out int pushYUp)
Definition Player.cs:49548
Vector2 MountedCenter
Definition Player.cs:2853
float GetWeaponKnockback(Item sItem, float KnockBack)
Definition Player.cs:49867
static int tileTargetY
Definition Player.cs:2085
IEntitySource GetProjectileSource_Item_WithPotentialAmmo(Item item, int ammoItemId)
Definition Player.cs:9292
void ChangeDir(int dir)
Definition Player.cs:40136
bool GetSparkleGuitarTarget(out List< NPC > validTargets)
Definition Player.cs:44414
Vector2 Directions
Definition Player.cs:3326
void LimitPointToPlayerReachableArea(ref Vector2 pointPoisition)
Definition Player.cs:43259
float beeKB(float KB)
Definition Player.cs:11853
static int tileTargetX
Definition Player.cs:2083
float miscCounterNormalized
Definition Player.cs:2880
Vector2 GetFarthestSpawnPositionOnLine(Vector2 startPos, float speedX, float speedY)
Definition Player.cs:46675
Vector2 RotatedRelativePoint(Vector2 pos, bool reverseRotation=false, bool addGfxOffY=true)
Definition Player.cs:3618
int beeDamage(int dmg)
Definition Player.cs:11844
float GetAdjustedItemScale(Item item)
Definition Player.cs:40623
void DestroyOldestProximityMinesOverMinesCap(int minesCap)
Definition Player.cs:44733
float fullRotation
Definition Player.cs:1291
Point FindSharpTearsSpot(Vector2 targetSpot)
Definition Player.cs:46731
bool GetZenithTarget(Vector2 searchCenter, float maxDistance, out int npcTargetIndex)
Definition Player.cs:44433
int nextCycledSpiderMinionType
Definition Player.cs:985
bool TryPlacingAGolfBallNearANearbyTee(Vector2 placePosition)
Definition Player.cs:46812
int SpawnMinionOnCursor(IEntitySource projectileSource, int ownerIndex, int minionProjectileId, int originalDamageNotScaledByMinionDamage, float KnockBack, Vector2 offsetFromCursor=default(Vector2), Vector2 velocityOnSpawn=default(Vector2))
Definition Player.cs:46703
int overrideFishingBobber
Definition Player.cs:1661
void PickAmmo(Item sItem, ref int projToShoot, ref float speed, ref bool canShoot, ref int Damage, ref float KnockBack, out int usedAmmoItemId, bool dontConsume=false)
Definition Player.cs:49978
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
Definition Searches.cs:123
static bool Find(Point origin, GenSearch search, out Point result)
Definition WorldUtils.cs:27
static float Dot(Vector2 value1, Vector2 value2)
Definition Vector2.cs:121
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
Definition Vector2.cs:227

References System.Math.Abs(), Terraria.Entity.active, Terraria.Projectile.ai, System.Math.Atan2(), Terraria.Collision.CanHit(), Terraria.Collision.CanHitLine(), Terraria.WorldBuilding.Searches.Chain(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.GameContent.Damage, Microsoft.Xna.Framework.Vector2.Dot(), Terraria.WorldBuilding.WorldUtils.Find(), Terraria.Main.GameViewMatrix, Terraria.Projectile.GetBallistraShotDelay(), Terraria.Projectile.GetExplosiveTrapCooldown(), Terraria.Utils.GetLerpValue(), Terraria.Graphics.FinalFractalHelper.GetRandomProfileIndex(), Terraria.ID.ItemID.Sets.gunProj, Terraria.GameContent.Achievements.AchievementsHelper.HandleSpecialEvent(), Terraria.ID.ProjectileID.Sets.IsAGolfBall, Terraria.Main.IsItAHappyWindyDay, Terraria.Projectile.Kill(), Microsoft.Xna.Framework.MathHelper.Lerp(), Microsoft.Xna.Framework.Vector2.Lerp(), Terraria.Main.MouseWorld, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.myPlayer, Terraria.Tile.nactive(), Terraria.Projectile.NewProjectile(), Terraria.ID.ProjectileID.Sets.NoMeleeSpeedVelocityScaling, Microsoft.Xna.Framework.Vector2.Normalize(), Terraria.Main.npc, Terraria.Projectile.owner, System.Math.PI, Terraria.ID.TileID.Sets.Platforms, Terraria.Main.projectile, Terraria.Main.projFrames, Terraria.Main.projPet, Terraria.Main.rand, System.Math.Round(), Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.NetMessage.SendData(), Terraria.WorldGen.SolidTile(), Terraria.WorldGen.SolidTile2(), System.Math.Sqrt(), Terraria.Main.tile, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, System.type, Terraria.Projectile.type, Terraria.Tile.type, Microsoft.Xna.Framework.Vector2.UnitX, Microsoft.Xna.Framework.Vector2.UnitY, System.value, Microsoft.Xna.Framework.Point.X, Microsoft.Xna.Framework.Point.Y, Microsoft.Xna.Framework.Vector2.Y, and Microsoft.Xna.Framework.Vector2.Zero.