40795 {
40796 if (Main.netMode != 1)
40797 {
40799 {
40800 ai[1] = Main.rand.NextFloat() * 0.2f + 0.7f;
40802 }
40803 if ((
localAI[0] -= 1f) <= 0f)
40804 {
40805 localAI[0] = Main.rand.Next(60, 181);
40806 if (Main.rand.Next(5) == 0)
40807 {
40809 {
40813 }
40814 else if (
ai[2] == 1f)
40815 {
40818 ai[0] = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
40820 {
40821 ai[0] =
AngleTo(Main.player[
target].Center) + Main.rand.NextFloatDirection() * 0.3f;
40822 }
40824 }
40825 }
40827 ai[0] = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
40829 {
40830 ai[0] =
AngleTo(Main.player[
target].Center) + Main.rand.NextFloatDirection() * 0.3f;
40831 }
40833 }
40834 }
40837 {
40839 value.X += Main.windSpeedTarget * 0.8f;
40842 {
40843 int num = 4;
40844 int num2 = (int)
base.Center.X / 16;
40845 int num3 = (int)
base.Center.Y / 16;
40847 {
40848 if (Main.tile[
num2, i] !=
null && ((Main.tile[
num2, i].nactive() && Main.tileSolid[Main.tile[
num2, i].type]) || Main.tile[
num2, i].liquid > 0))
40849 {
40850 ai[0] = 0f -
ai[0];
40852 {
40853 velocity.Y *= 0.9f;
40854 }
40855 }
40856 }
40857 }
40859 {
40861 bool flag = false;
40862 int num5 = (int)
base.Center.X / 16;
40863 int num6 = (int)
base.Center.Y / 16;
40865 {
40866 if (Main.tile[
num5,
j] !=
null && ((Main.tile[
num5,
j].nactive() && Main.tileSolid[Main.tile[
num5,
j].type]) || Main.tile[
num5,
j].liquid > 0))
40867 {
40868 flag = true;
40869 }
40870 }
40871 if (!flag)
40872 {
40873 ai[0] = 0f -
ai[0];
40875 {
40876 velocity.Y *= 0.9f;
40877 }
40878 }
40879 }
40881 {
40883 velocity.X *= -0.2f;
40884 }
40885 }
40886 else
40887 {
40889 {
40892 int num9 = (int)
base.Center.Y / 16;
40894 {
40895 if (Main.tile[
num8,
k] !=
null && Main.tile[
num8,
k].liquid > 0)
40896 {
40898 velocity.Y = -1f;
40900 ai[0] = Main.rand.NextFloat() * ((float)
Math.
PI / 4f) - (float)
Math.
PI / 2f;
40902 {
40903 ai[0] =
AngleTo(Main.player[
target].Center) + Main.rand.NextFloatDirection() * 0.3f;
40904 }
40906 return;
40907 }
40908 }
40909 }
40911 {
40912 velocity.X *= 0.98f;
40914 }
40915 else
40916 {
40918 velocity.Y += 0.2f;
40920 {
40922 velocity.X *= -0.2f;
40924 }
40925 }
40926 }
40927 direction = ((velocity.X > 0f) ? 1 : (-1));
40928 }
static float Lerp(float value1, float value2, float amount)
float AngleTo(Vector2 Destination)
float Distance(Vector2 Other)
void TargetClosest(bool faceTarget=true)
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)