47787 {
47788 if (
type == 31 &&
ai[0] != 2f)
47789 {
47790 if (Main.rand.Next(2) == 0)
47791 {
47793 Main.dust[num].velocity.X *= 0.4f;
47794 }
47795 }
47796 else if (
type == 39)
47797 {
47798 if (Main.rand.Next(2) == 0)
47799 {
47801 Main.dust[
num2].velocity.X *= 0.4f;
47802 }
47803 }
47804 else if (
type >= 411 &&
type <= 414)
47805 {
47806 if (Main.rand.Next(3) == 0)
47807 {
47810 {
47812 }
47814 {
47816 }
47818 Main.dust[
num4].noGravity =
true;
47820 }
47821 }
47822 else if (
type == 40)
47823 {
47824 if (Main.rand.Next(2) == 0)
47825 {
47827 Main.dust[
num5].velocity *= 0.4f;
47828 }
47829 }
47830 else if (
type == 42 ||
type == 31)
47831 {
47832 if (Main.rand.Next(2) == 0)
47833 {
47835 Main.dust[
num6].velocity.X *= 0.4f;
47836 }
47837 }
47838 else if (
type == 56 ||
type == 65)
47839 {
47840 if (Main.rand.Next(2) == 0)
47841 {
47843 Main.dust[
num7].velocity.X *= 0.4f;
47844 }
47845 }
47846 else if (
type == 67 ||
type == 68)
47847 {
47848 if (Main.rand.Next(2) == 0)
47849 {
47851 Main.dust[
num8].velocity.X *= 0.4f;
47852 }
47853 }
47854 else if (
type == 71)
47855 {
47856 if (Main.rand.Next(2) == 0)
47857 {
47859 Main.dust[
num9].velocity.X *= 0.4f;
47860 }
47861 }
47862 else if (
type == 179)
47863 {
47864 if (Main.rand.Next(2) == 0)
47865 {
47867 Main.dust[
num10].velocity.X *= 0.4f;
47868 }
47869 }
47870 else if (
type == 241 ||
type == 354)
47871 {
47872 if (Main.rand.Next(2) == 0)
47873 {
47875 Main.dust[
num11].velocity.X *= 0.4f;
47876 }
47877 }
47878 else if (
type >= 736 &&
type <= 738)
47879 {
47880 if (Main.rand.Next(40) == 0)
47881 {
47884 {
47886 }
47887 }
47888 }
47889 else if (
type != 109 && Main.rand.Next(20) == 0)
47890 {
47892 }
47894 {
47896 {
47897 frame = Main.rand.Next(3);
47898 scale = 1f - (float)Main.rand.Next(30) * 0.01f;
47899 }
47901 }
47904 if (Main.myPlayer ==
owner &&
ai[0] == 0f)
47905 {
47908 {
47912 float num14 = (float)Main.mouseX + Main.screenPosition.X -
vector.X;
47913 float num15 = (float)Main.mouseY + Main.screenPosition.Y -
vector.Y;
47914 if (Main.player[
owner].gravDir == -1f)
47915 {
47916 num15 = Main.screenPosition.Y + (float)Main.screenHeight - (
float)Main.mouseY -
vector.Y;
47917 }
47921 {
47926 {
47928 }
47929 velocity.X =
num14;
47930 velocity.Y =
num15;
47931 }
47932 else
47933 {
47935 {
47937 }
47938 velocity.X =
num14;
47939 velocity.Y =
num15;
47940 }
47941 }
47942 else
47943 {
47946 }
47947 }
47948 if (
ai[0] == 1f &&
type != 109)
47949 {
47951 {
47954 {
47956 velocity.Y += 0.2f;
47957 }
47958 }
47959 else
47960 {
47961 velocity.Y += 0.41f;
47962 }
47963 }
47964 else if (
ai[0] == 2f &&
type != 109)
47965 {
47966 velocity.Y += 0.2f;
47967 if ((double)velocity.X < -0.04)
47968 {
47969 velocity.X += 0.04f;
47970 }
47971 else if ((double)velocity.X > 0.04)
47972 {
47973 velocity.X -= 0.04f;
47974 }
47975 else
47976 {
47977 velocity.X = 0f;
47978 }
47979 }
47981 {
47982 for (
int i = (
int)(position.X / 16f);
i <= (int)((
position.
X + (
float)
width) / 16f);
i++)
47983 {
47984 for (
int j = (
int)(position.Y / 16f);
j <= (int)((
position.
Y + (
float)
height) / 16f);
j++)
47985 {
47987 {
47988 continue;
47989 }
47990 Tile tile = Main.tile[
i,
j];
47991 if (tile == null || !tile.active())
47992 {
47993 continue;
47994 }
47995 if ((tile.type >= 185 && tile.type <= 187) || tile.type == 165 || tile.type == 12 || tile.type == 665 || tile.type == 639 || tile.type == 105 || tile.type == 178)
47996 {
47998 }
48000 {
48002 if (Main.netMode != 0)
48003 {
48004 NetMessage.SendData(17, -1, -1,
null, 14, i,
j);
48005 }
48006 position.Y -= 16f;
48007 }
48008 }
48009 }
48010 }
48012 {
48014 {
48016 }
48017 else if (
frame == 1)
48018 {
48020 }
48021 else
48022 {
48024 }
48026 {
48027 velocity.Y = 10f;
48028 }
48029 }
48030 else
48031 {
48034 {
48035 velocity.Y = 10f;
48036 }
48037 }
48038 }
static double Sqrt(double d)