44777 {
44780 int damage =
sItem.damage;
44782 {
44784 }
44789 if (
sItem.useAmmo > 0)
44790 {
44792 }
44793 else
44794 {
44796 }
44798 {
44802 }
44804 {
44806 }
44808 {
44810 }
44812 {
44814 }
44816 {
44818 }
44819 if (
sItem.type == 3542)
44820 {
44821 if (Main.rand.Next(100) < 20)
44822 {
44825 }
44826 else
44827 {
44829 }
44830 }
44831 if (
sItem.type == 1928)
44832 {
44834 }
44835 if (
sItem.type == 3063)
44836 {
44838 }
44839 if (
sItem.type == 1306)
44840 {
44842 }
44843 if (
sItem.type == 1227)
44844 {
44846 }
44848 {
44849 return;
44850 }
44854 {
44856 }
44858 {
44860 }
44861 if (
sItem.type == 682)
44862 {
44864 }
44865 if (
sItem.type == 725)
44866 {
44868 }
44869 if (
sItem.type == 2796)
44870 {
44872 }
44873 if (
sItem.type == 2223)
44874 {
44876 }
44877 if (
sItem.type == 5117)
44878 {
44880 }
44882 {
44884 }
44887 bool flag = true;
44890 {
44891 flag = false;
44892 }
44897 {
44899 }
44901 {
44903 }
44905 if (flag)
44906 {
44907 if (num > 0f)
44908 {
44910 }
44911 else
44912 {
44914 }
44915 }
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 {
44933 {
44935 }
44937 }
44938 if (
sItem.type == 3827)
44939 {
44941 }
44943 {
44947 }
44949 {
44951 pointPoisition.Y -= 6f *
gravDir;
44952 }
44953 if (
sItem.type == 3007)
44954 {
44956 pointPoisition.Y -= 2f *
gravDir;
44957 }
44961 {
44965 }
44967 {
44968 num3 = Main.screenPosition.Y + (float)Main.screenHeight - (
float)Main.mouseY -
pointPoisition.Y;
44969 }
44972 if ((
float.IsNaN(
num2) &&
float.IsNaN(
num3)) || (
num2 == 0f &&
num3 == 0f))
44973 {
44977 }
44978 else
44979 {
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 }
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 }
45000 {
45002 }
45004 {
45007 }
45009 {
45012 {
45014 }
45015 }
45017 {
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;
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;
45041 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
45042 NetMessage.SendData(41, -1, -1,
null,
whoAmI);
45043 }
45044 else if (
sItem.type == 3779)
45045 {
45047 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
45048 NetMessage.SendData(41, -1, -1,
null,
whoAmI);
45049 }
45050 else
45051 {
45053 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
45054 NetMessage.SendData(41, -1, -1,
null,
whoAmI);
45055 }
45056 }
45057 if (
sItem.useStyle == 13)
45058 {
45060 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
45061 NetMessage.SendData(41, -1, -1,
null,
whoAmI);
45062 }
45064 {
45065 pointPoisition.X = (float)Main.mouseX + Main.screenPosition.X;
45066 pointPoisition.Y = (float)Main.mouseY + Main.screenPosition.Y;
45068 {
45069 pointPoisition.Y = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY;
45070 }
45072 }
45074 {
45076 float num7 = (float)Main.screenHeight / Main.GameViewMatrix.Zoom.Y;
45079 {
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;
45087 Main.projectile[
num10].ai[1] = 1f;
45090 {
45092 }
45094 {
45096 }
45100 NetMessage.SendData(27, -1, -1,
null,
num10);
45101 }
45102 else if (
sItem.type == 3029)
45103 {
45106 {
45107 if (Main.rand.Next(3) == 0)
45108 {
45110 }
45111 }
45112 else if (Main.rand.Next(3) == 0)
45113 {
45115 }
45117 {
45119 pointPoisition.X = (pointPoisition.X * 10f +
base.Center.X) / 11f + (
float)Main.rand.Next(-100, 101);
45120 pointPoisition.Y -= 150 *
k;
45124 {
45126 }
45128 {
45130 }
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 {
45149 }
45151 {
45153 pointPoisition.X = (pointPoisition.X * 10f +
base.Center.X) / 11f + (
float)Main.rand.Next(-30, 31);
45154 pointPoisition.Y -= 150f * Main.rand.NextFloat();
45158 {
45160 }
45162 {
45164 }
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);
45199 bool flag2 =
false;
45201 {
45203 }
45205 {
45207 {
45209 }
45210 else
45211 {
45213 }
45214 }
45215 }
45216 else if (
sItem.type == 3053)
45217 {
45218 bool flag3 =
false;
45220 {
45222 }
45227 {
45231 }
45234 float num17 = (float)Main.rand.Next(10, 80) * 0.001f;
45235 if (Main.rand.Next(2) == 0)
45236 {
45238 }
45239 float num18 = (float)Main.rand.Next(10, 80) * 0.001f;
45240 if (Main.rand.Next(2) == 0)
45241 {
45243 }
45245 {
45247 }
45248 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
vector10.X,
vector10.Y,
projToShoot,
Damage,
KnockBack, i,
num18,
num17);
45249 }
45250 else if (
sItem.type == 3019)
45251 {
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;
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;
45269 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
num20,
num21,
projToShoot,
Damage,
KnockBack, i,
vector12.X,
vector12.Y);
45270 }
45271 else if (
sItem.type == 2797)
45272 {
45275 {
45277 }
45280 int num23 = Main.rand.Next(4, 5);
45281 if (Main.rand.Next(4) == 0)
45282 {
45284 }
45286 {
45287 float num24 = (float)Main.rand.NextDouble() * 0.2f + 0.05f;
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]);
45311 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
speedX4,
speedY6,
projToShoot,
damage2,
KnockBack, i, 0f,
num28);
45312 }
45313 else if (
sItem.type == 1930)
45314 {
45315 int num29 = 2 + Main.rand.Next(3);
45317 {
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;
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 {
45336 {
45338 pointPoisition.X = (pointPoisition.X +
base.Center.X) / 2f + (
float)Main.rand.Next(-200, 201);
45339 pointPoisition.Y -= 100 *
num34;
45343 {
45344 num3 = Main.screenPosition.Y + (float)Main.screenHeight - (
float)Main.mouseY -
pointPoisition.Y;
45345 }
45347 {
45349 }
45351 {
45353 }
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 {
45367 {
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;
45374 {
45375 num3 = Main.screenPosition.Y + (float)Main.screenHeight - (
float)Main.mouseY -
pointPoisition.Y;
45376 }
45378 {
45380 }
45382 {
45384 }
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 {
45398 {
45400 pointPoisition.X = (pointPoisition.X +
base.Center.X) / 2f + (
float)Main.rand.Next(-200, 201);
45401 pointPoisition.Y -= 100 *
num40;
45406 {
45408 }
45410 {
45412 }
45418 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
vector16.X,
vector16.Y,
projToShoot,
Damage,
KnockBack, i, 0f,
ai2);
45419 }
45420 }
45421 else if (
sItem.type == 5065)
45422 {
45426 }
45427 else if (
sItem.type == 3065)
45428 {
45432 {
45433 num41 = base.Center.Y - 200f;
45434 }
45436 {
45438 pointPoisition.Y -= 100 *
num42;
45441 {
45442 vector18.Y *= -1f;
45443 }
45445 {
45446 vector18.Y = 20f;
45447 }
45453 float speedY8 =
num3 + (float)Main.rand.Next(-40, 41) * 0.02f;
45454 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
speedX6,
speedY8,
projToShoot,
Damage,
KnockBack, i, 0f,
num41);
45455 }
45456 }
45457 else if (
sItem.type == 2624)
45458 {
45466 {
45470 {
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 {
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 {
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;
45509 _ = (int)
base.Bottom.X / 16;
45513 {
45515 }
45518 {
45520 }
45521 Point point =
base.Center.ToTileCoordinates();
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 {
45532 {
45534 break;
45535 }
45536 }
45538 {
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 }
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);
45565 {
45566 vector21.Y *= -1f;
45567 }
45572 if (tile !=
null && tile.nactive() && Main.tileSolid[tile.type] && !Main.tileSolidTop[tile.type] && !
TileID.
Sets.
Platforms[tile.type])
45573 {
45575 }
45576 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
vector21.X,
vector21.Y,
projToShoot,
Damage,
KnockBack, i, -1f,
num58 % 1f);
45577 }
45578 else if (
sItem.type == 4953)
45579 {
45589 {
45591 }
45595 {
45597 }
45604 {
45606 }
45609 {
45612 }
45614 {
45618 }
45619 else
45620 {
45622 Main.projectile[
num65].noDropItem =
true;
45623 }
45624 }
45625 else if (
sItem.type == 534)
45626 {
45627 int num66 = Main.rand.Next(4, 6);
45629 {
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 {
45642 {
45645 v4 +=
v4.SafeNormalize(
Vector2.
Zero).RotatedBy(
num70 * Main.rand.NextFloat()) * Main.rand.NextFloatDirection() * 5f;
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 {
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 {
45669 {
45671 vector28 = nPC.Center + nPC.velocity * 20f;
45672 }
45675 {
45676 vector28 += Main.rand.NextVector2Circular(24f, 24f);
45678 {
45681 }
45682 }
45685 {
45687 }
45689 {
45690 vector30.Y = (0f - Main.rand.NextFloat()) * 0.5f - 0.5f;
45691 }
45693 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
vector30.X,
vector30.Y,
projToShoot,
Damage,
KnockBack, i,
vector28.X,
vector28.Y);
45694 }
45695 else if (
sItem.type == 4722)
45696 {
45701 {
45703 vector31 = nPC2.Center + nPC2.velocity * 20f;
45704 }
45710 {
45712 {
45713 vector31 += Main.rand.NextVector2Circular(24f, 24f);
45715 {
45718 }
45723 }
45727 float num80 = 12f + Main.rand.NextFloat() * 2f;
45732 {
45735 }
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 {
45757 if (Main.rand.Next(3) == 0)
45758 {
45760 }
45761 if (Main.rand.Next(4) == 0)
45762 {
45764 }
45765 if (Main.rand.Next(5) == 0)
45766 {
45768 }
45770 {
45774 num84 += (float)Main.rand.Next(-35, 36) *
num86;
45775 num85 += (float)Main.rand.Next(-35, 36) *
num86;
45783 }
45784 }
45785 else if (
sItem.type == 1308)
45786 {
45788 if (Main.rand.Next(3) == 0)
45789 {
45791 }
45793 {
45797 num89 += (float)Main.rand.Next(-35, 36) *
num91;
45798 num90 += (float)Main.rand.Next(-35, 36) *
num91;
45806 }
45807 }
45808 else if (
sItem.type == 1258)
45809 {
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);
45822 {
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 {
45833 if (Main.rand.Next(2) == 0)
45834 {
45836 }
45837 if (Main.rand.Next(4) == 0)
45838 {
45840 }
45841 if (Main.rand.Next(8) == 0)
45842 {
45844 }
45845 if (Main.rand.Next(16) == 0)
45846 {
45848 }
45850 {
45863 }
45864 }
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;
45871 {
45872 num105 = (int)(Main.screenPosition.Y + (
float)Main.screenHeight - (float)Main.mouseY) / 16;
45873 }
45875 {
45877 {
45878 }
45880 }
45882 switch (
sItem.type)
45883 {
45884 case 1572:
45886 break;
45887 case 5119:
45889 break;
45890 }
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 {
45904 if (Main.rand.Next(3) == 0)
45905 {
45907 }
45909 {
45913 {
45914 num111 += (float)Main.rand.Next(-35, 36) * 0.04f;
45915 num112 += (float)Main.rand.Next(-35, 36) * 0.04f;
45916 }
45918 {
45919 num111 += (float)Main.rand.Next(-35, 36) * 0.04f;
45920 num112 += (float)Main.rand.Next(-35, 36) * 0.04f;
45921 }
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 {
45937 }
45938 if (Main.rand.Next(6) == 0)
45939 {
45941 }
45943 {
45945 }
45947 {
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);
45960 {
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);
45972 {
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 {
45983 {
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 {
45994 {
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 {
46005 {
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 {
46016 {
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;
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;
46034 }
46035 else if (
sItem.type == 434)
46036 {
46040 {
46041 num139 += (float)Main.rand.Next(-40, 41) * 0.01f;
46042 num140 += (float)Main.rand.Next(-40, 41) * 0.01f;
46045 }
46047 {
46048 num139 += (float)Main.rand.Next(-20, 21) * 0.01f;
46049 num140 += (float)Main.rand.Next(-20, 21) * 0.01f;
46052 }
46054 }
46055 else if (
sItem.type == 1157)
46056 {
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 {
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 }
46094 {
46096 }
46097 else if (
sItem.type == 3531)
46098 {
46102 {
46103 if (Main.projectile[
num144].active && Main.projectile[
num144].owner == Main.myPlayer)
46104 {
46105 if (
num142 == -1 && Main.projectile[
num144].type == 625)
46106 {
46108 }
46109 if (
num143 == -1 && Main.projectile[
num144].type == 628)
46110 {
46112 }
46114 {
46115 break;
46116 }
46117 }
46118 }
46120 {
46123 pointPoisition.X = (float)Main.mouseX + Main.screenPosition.X;
46124 pointPoisition.Y = (float)Main.mouseY + Main.screenPosition.Y;
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 }
46137 {
46142 Main.projectile[
num150].netUpdate =
true;
46143 Main.projectile[
num150].ai[1] = 1f;
46145 Main.projectile[
num151].netUpdate =
true;
46146 Main.projectile[
num151].ai[1] = 1f;
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 }
46160 {
46162 {
46165 {
46167 {
46169 }
46171 {
46173 }
46175 {
46177 }
46178 }
46179 }
46181 }
46182 else if (
sItem.type == 3006)
46183 {
46186 }
46187 else if (
sItem.type == 3014)
46188 {
46190 pointPoisition3.X = Main.MouseWorld.X;
46191 pointPoisition3.Y = Main.MouseWorld.Y;
46194 {
46195 pointPoisition.X +=
num2;
46196 pointPoisition.Y +=
num3;
46198 {
46200 break;
46201 }
46202 }
46203 bool flag5 =
false;
46208 {
46209 }
46211 {
46213 }
46217 {
46219 }
46224 {
46226 }
46230 {
46231 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y, 0f, 0f,
projToShoot,
Damage,
KnockBack, i,
num157,
num158);
46232 }
46233 }
46234 else if (
sItem.type == 3384)
46235 {
46237 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
num2,
num3,
projToShoot,
Damage,
KnockBack, i, 0f,
num160);
46238 }
46239 else if (
sItem.type == 3473)
46240 {
46241 float ai4 = (Main.rand.NextFloat() - 0.5f) * ((
float)Math.PI / 4f);
46243 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
vector40.X,
vector40.Y,
projToShoot,
Damage,
KnockBack, i, 0f,
ai4);
46244 }
46245 else if (
sItem.type == 4956)
46246 {
46251 {
46253 }
46258 {
46262 {
46264 }
46267 {
46269 }
46271 {
46272 vector42 += Main.rand.NextVector2Circular(150f, 150f);
46273 }
46274 }
46276 float ai5 = Main.rand.Next(-100, 101);
46278 }
46279 else if (
sItem.type == 3836)
46280 {
46283 }
46284 else if (
sItem.type == 3858)
46285 {
46289 {
46291 float ai7 = (0.3f + 0.7f * Main.rand.NextFloat()) *
speed * 1.75f * (
float)
direction;
46293 }
46294 else
46295 {
46297 }
46298 }
46299 else if (
sItem.type == 3859)
46300 {
46307 {
46309 }
46310 }
46311 else if (
sItem.type == 3870)
46312 {
46315 {
46317 }
46323 {
46325 }
46326 }
46327 else if (
sItem.type == 3542)
46328 {
46329 float num168 = (Main.rand.NextFloat() - 0.5f) * ((
float)Math.PI / 4f) * 0.7f;
46331 {
46333 {
46334 break;
46335 }
46336 num168 = (Main.rand.NextFloat() - 0.5f) * ((
float)Math.PI / 4f) * 0.7f;
46337 }
46340 }
46341 else if (
sItem.type == 3779)
46342 {
46343 float num170 = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
46345 {
46347 {
46348 break;
46349 }
46350 num170 = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
46351 }
46354 }
46355 else if (
sItem.type == 3787)
46356 {
46357 float f = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
46362 {
46365 {
46366 break;
46367 }
46368 f = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
46369 }
46375 }
46376 else if (
sItem.type == 3788)
46377 {
46381 {
46384 }
46386 }
46387 else if (
sItem.type == 4463 ||
sItem.type == 486)
46388 {
46390 }
46391 else if (
sItem.type == 46)
46392 {
46396 {
46399 }
46400 else
46401 {
46402 searchCenter += Main.rand.NextVector2Circular(20f, 20f);
46403 }
46406 {
46409 }
46411 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
46412 }
46413 else if (
sItem.type == 273)
46414 {
46416 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
direction, 0f),
projToShoot,
Damage,
KnockBack, i, (
float)
direction *
gravDir,
itemAnimationMax,
adjustedItemScale);
46417 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
num2,
num3),
projToShoot,
Damage,
KnockBack, i, (
float)
direction *
gravDir * 0.1f, 30f,
adjustedItemScale);
46418 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
46419 }
46420 else if (
sItem.type == 368)
46421 {
46423 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
direction, 0f),
projToShoot,
Damage,
KnockBack, i, (
float)
direction *
gravDir,
itemAnimationMax,
adjustedItemScale2);
46424 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
46425 }
46426 else if (
sItem.type == 1826)
46427 {
46429 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
direction, 0f),
projToShoot,
Damage,
KnockBack, i, (
float)
direction *
gravDir,
itemAnimationMax,
adjustedItemScale3);
46430 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
46431 }
46432 else if (
sItem.type == 675)
46433 {
46435 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
direction, 0f), 972,
Damage,
KnockBack, i, (
float)
direction *
gravDir,
itemAnimationMax,
adjustedItemScale4);
46436 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
num2,
num3),
projToShoot,
Damage / 2,
KnockBack, i, (
float)
direction *
gravDir, 32f,
adjustedItemScale4);
46437 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
46438 }
46439 else if (
sItem.type == 674)
46440 {
46442 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
direction, 0f),
projToShoot,
Damage,
KnockBack, i, (
float)
direction *
gravDir,
itemAnimationMax,
adjustedItemScale5);
46443 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
direction, 0f), 982, 0,
KnockBack, i, (
float)
direction *
gravDir,
itemAnimationMax,
adjustedItemScale5);
46444 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
46445 }
46446 else if (
sItem.type == 757)
46447 {
46449 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
direction, 0f), 984,
Damage,
KnockBack, i, (
float)
direction *
gravDir,
itemAnimationMax,
adjustedItemScale6);
46450 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
MountedCenter,
new Vector2(
num2,
num3) * 5f,
projToShoot,
Damage,
KnockBack, i, (
float)
direction *
gravDir, 18f,
adjustedItemScale6);
46451 NetMessage.SendData(13, -1, -1,
null,
whoAmI);
46452 }
46453 else if (
sItem.type == 190)
46454 {
46459 {
46461 vector55 = Main.rand.NextVector2FromRectangle(
nPC4.Hitbox);
46462 }
46463 else
46464 {
46465 vector55 += Main.rand.NextVector2Circular(20f, 20f);
46466 }
46475 {
46477 }
46484 {
46488 }
46492 {
46494 }
46496 {
46499 }
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 {
46518 {
46521 {
46523 }
46524 }
46526 }
46527 else if (
sItem.type == 3854)
46528 {
46530 }
46531 else if (
sItem.type == 3546)
46532 {
46534 {
46537 num184 += (float)Main.rand.Next(-40, 41) * 0.05f;
46538 num185 += (float)Main.rand.Next(-40, 41) * 0.05f;
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 {
46547 num186 += (float)Main.rand.Next(-1, 2) * 0.5f;
46548 num187 += (float)Main.rand.Next(-1, 2) * 0.5f;
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 {
46558 {
46560 }
46561 else
46562 {
46564 }
46565 }
46567 {
46573 switch (
sItem.type)
46574 {
46575 case 3824:
46576 case 3825:
46577 case 3826:
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:
46589 break;
46590 case 3819:
46593 break;
46594 case 3820:
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;
46603 }
46604 else if (
sItem.type == 65)
46605 {
46612 {
46614 }
46616 }
46617 else if (
sItem.type == 4923)
46618 {
46620 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
num2,
num3,
projToShoot,
Damage,
KnockBack, i, 0f,
adjustedItemScale7);
46621 }
46622 else if (
sItem.type == 1910)
46623 {
46625 }
46626 else if (
sItem.type == 5134)
46627 {
46628 Projectile.NewProjectile(
projectileSource_Item_WithPotentialAmmo,
pointPoisition.X,
pointPoisition.Y,
num2,
num3,
projToShoot,
Damage,
KnockBack, i, 0f, 1f);
46629 }
46630 else
46631 {
46633 if (
sItem.type == 726)
46634 {
46635 Main.projectile[
num192].magic =
true;
46636 }
46638 {
46639 Main.projectile[
num192].melee =
true;
46640 }
46642 {
46645 }
46646 if (
sItem.type == 760)
46647 {
46649 }
46651 {
46654 }
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)
static double Atan2(double y, double x)
static double Sqrt(double d)
static decimal Round(decimal d)
static double Abs(double value)
static void HandleSpecialEvent(Player player, int eventID)
static bool[] NoMeleeSpeedVelocityScaling
static bool[] IsAGolfBall
void ApplyItemTime(Item sItem)
void PayDD2CrystalsBeforeUse(Item item)
bool ItemAnimationJustStarted
void FindSentryRestingSpot(int checkProj, out int worldX, out int worldY, out int pushYUp)
float GetWeaponKnockback(Item sItem, float KnockBack)
IEntitySource GetProjectileSource_Item_WithPotentialAmmo(Item item, int ammoItemId)
bool GetSparkleGuitarTarget(out List< NPC > validTargets)
void LimitPointToPlayerReachableArea(ref Vector2 pointPoisition)
float miscCounterNormalized
Vector2 GetFarthestSpawnPositionOnLine(Vector2 startPos, float speedX, float speedY)
Vector2 RotatedRelativePoint(Vector2 pos, bool reverseRotation=false, bool addGfxOffY=true)
float GetAdjustedItemScale(Item item)
void DestroyOldestProximityMinesOverMinesCap(int minesCap)
Point FindSharpTearsSpot(Vector2 targetSpot)
bool GetZenithTarget(Vector2 searchCenter, float maxDistance, out int npcTargetIndex)
int nextCycledSpiderMinionType
bool TryPlacingAGolfBallNearANearbyTee(Vector2 placePosition)
int SpawnMinionOnCursor(IEntitySource projectileSource, int ownerIndex, int minionProjectileId, int originalDamageNotScaledByMinionDamage, float KnockBack, Vector2 offsetFromCursor=default(Vector2), Vector2 velocityOnSpawn=default(Vector2))
int overrideFishingBobber
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)
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
static bool Find(Point origin, GenSearch search, out Point result)
static float Dot(Vector2 value1, Vector2 value2)
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
static int GetRandomProfileIndex()