54581 {
54582 int num = 30;
54584 bool flag = false;
54585 bool flag2 =
false;
54586 bool flag3 =
false;
54588 {
54591 }
54593 {
54595 bool flag4 = velocity.Y == 0f;
54596 for (
int i = 0;
i < 200;
i++)
54597 {
54599 {
54600 if (
position.
X < Main.npc[i].position.X)
54601 {
54602 velocity.X -= 0.05f;
54603 }
54604 else
54605 {
54606 velocity.X += 0.05f;
54607 }
54608 if (
position.
Y < Main.npc[i].position.Y)
54609 {
54610 velocity.Y -= 0.05f;
54611 }
54612 else
54613 {
54614 velocity.Y += 0.05f;
54615 }
54616 }
54617 }
54619 {
54620 velocity.Y = 0f;
54621 }
54622 }
54624 {
54627 {
54630 if (Main.netMode != 1 &&
num4 != 255)
54631 {
54634 }
54635 }
54636 Lighting.AddLight(
base.Center, 0.4f, 0.36f, 0.2f);
54639 {
54641 }
54644 {
54647 if (Main.rand.Next(3) != 0)
54648 {
54650 dust.scale = 0.6f;
54651 dust.fadeIn = 1.1f;
54652 dust.noGravity = true;
54653 dust.noLight = true;
54654 }
54655 }
54656 }
54658 {
54661 }
54662 else if (
ai[3] > 0f)
54663 {
54665 }
54666 if (
ai[3] > (
float)(num *
num2))
54667 {
54669 }
54671 {
54673 }
54674 if (
ai[3] == (
float)num)
54675 {
54677 }
54683 {
54685 }
54687 {
54691 {
54692 for (
int j = 0;
j < 255;
j++)
54693 {
54694 if (Main.player[
j].active && !Main.player[
j].dead && Main.player[
j].Distance(
base.Center) < 800f && Main.player[
j].Center.Y < base.Center.Y &&
Math.
Abs(Main.player[
j].Center.X -
base.Center.X) < 20f)
54695 {
54697 break;
54698 }
54699 }
54700 }
54701 if (
flag5 && Main.netMode != 1)
54702 {
54703 for (
int k = 0;
k < 3;
k++)
54704 {
54705 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y, (Main.rand.NextFloat() - 0.5f) * 2f, -4f - 10f * Main.rand.NextFloat(), 538, 50, 0f, Main.myPlayer);
54706 }
54709 return;
54710 }
54711 }
54712 else if (
type == 423)
54713 {
54715 {
54717 velocity.X *= 0.7f;
54719 {
54721 Dust
obj = Main.dust[Dust.NewDust(
vector4, 0, 0, 242)];
54724 obj.velocity = -
vector5 * 2f;
54726 obj.fadeIn = 1f;
54727 obj.noGravity = true;
54728 }
54729 else if (
ai[1] == 30f)
54730 {
54731 for (
int l = 0;
l < 20;
l++)
54732 {
54734 Dust
obj2 = Main.dust[Dust.NewDust(
vector6, 0, 0, 242)];
54739 obj2.fadeIn = 1f;
54740 obj2.noGravity = true;
54741 }
54742 }
54744 {
54745 velocity.X = 0f;
54746 }
54747 if (
ai[1] == 30f && Main.netMode != 1)
54748 {
54751 }
54753 {
54754 ai[1] = -Main.rand.Next(320, 601);
54756 }
54757 }
54758 else
54759 {
54762 {
54763 flag = true;
54767 }
54769 {
54770 velocity.Y -= 4f;
54771 }
54772 }
54773 }
54774 else if (
type == 155 ||
type == 329)
54775 {
54777 {
54778 velocity.Y -= 4f;
54779 }
54780 }
54782 {
54783 velocity.Y -= 4f;
54785 }
54786 if (
type == 546 && !Main.player[
target].ZoneDesert)
54787 {
54790 if (!Main.player[
target].ZoneDesert)
54791 {
54795 }
54796 }
54797 if (
ai[3] < (
float)num)
54798 {
54799 if ((
type == 329 ||
type == 315) && !Main.pumpkinMoon)
54800 {
54802 }
54803 else
54804 {
54806 }
54807 }
54808 else
54809 {
54811 {
54813 {
54816 {
54820 }
54821 }
54822 }
54823 else
54824 {
54826 }
54829 {
54831 }
54832 }
54834 float num12 = 0.07f;
54836 {
54838 {
54840 {
54841 velocity.X *= 0.95f;
54842 }
54844 {
54845 velocity.X *= 0.95f;
54846 }
54847 }
54848 else if (
type == 329)
54849 {
54851 {
54852 velocity.X *= 0.9f;
54853 }
54855 {
54856 velocity.X *= 0.9f;
54857 }
54859 {
54860 velocity.X += 0.1f;
54861 }
54863 {
54864 velocity.X -= 0.1f;
54865 }
54866 }
54867 else if (
type == 315)
54868 {
54870 {
54871 velocity.X *= 0.95f;
54872 }
54874 {
54875 velocity.X *= 0.95f;
54876 }
54878 {
54880 {
54882 }
54883 }
54885 {
54886 velocity.X += 0.07f;
54888 {
54889 velocity.X =
num11;
54890 }
54891 }
54893 {
54894 velocity.X -= 0.07f;
54896 {
54897 velocity.X = 0f -
num11;
54898 }
54899 }
54900 }
54901 else if (
type == 410)
54902 {
54904 {
54905 velocity.X *= 0.9f;
54906 }
54909 }
54910 else if (
type == 423)
54911 {
54913 {
54914 velocity.X *= 0.85f;
54915 }
54918 }
54919 else if (
type == 546)
54920 {
54922 {
54923 velocity.X *= 0.92f;
54924 }
54926 if (!Main.player[
target].ZoneSandstorm)
54927 {
54929 }
54932 }
54934 {
54936 {
54938 }
54939 }
54941 {
54942 velocity.X +=
num12;
54944 {
54945 velocity.X =
num11;
54946 }
54947 }
54949 {
54950 velocity.X -=
num12;
54952 {
54953 velocity.X = 0f -
num11;
54954 }
54955 }
54956 }
54958 {
54961 {
54963 }
54965 {
54967 }
54973 {
54975 }
54977 {
54979 }
54981 {
54983 }
54985 {
54987 }
54989 {
54991 }
54992 if ((
float)(
num15 * 16) <
vector8.X + (
float)
width && (
float)(
num15 * 16 + 16) >
vector8.X && ((Main.tile[
num15,
num16].nactive() && !Main.tile[
num15,
num16].topSlope() && !Main.tile[
num15,
num16 - 1].topSlope() && Main.tileSolid[Main.tile[
num15,
num16].type] && !Main.tileSolidTop[Main.tile[
num15,
num16].type]) || (Main.tile[
num15,
num16 - 1].halfBrick() && Main.tile[
num15,
num16 - 1].nactive())) && (!Main.tile[
num15,
num16 - 1].nactive() || !Main.tileSolid[Main.tile[
num15,
num16 - 1].type] || Main.tileSolidTop[Main.tile[
num15,
num16 - 1].type] || (Main.tile[
num15,
num16 - 1].halfBrick() && (!Main.tile[
num15,
num16 - 4].nactive() || !Main.tileSolid[Main.tile[
num15,
num16 - 4].type] || Main.tileSolidTop[Main.tile[
num15,
num16 - 4].type]))) && (!Main.tile[
num15,
num16 - 2].nactive() || !Main.tileSolid[Main.tile[
num15,
num16 - 2].type] || Main.tileSolidTop[Main.tile[
num15,
num16 - 2].type]) && (!Main.tile[
num15,
num16 - 3].nactive() || !Main.tileSolid[Main.tile[
num15,
num16 - 3].type] || Main.tileSolidTop[Main.tile[
num15,
num16 - 3].type]) && (!Main.tile[
num15 -
num14,
num16 - 3].nactive() || !Main.tileSolid[Main.tile[
num15 -
num14,
num16 - 3].type]))
54993 {
54996 {
54998 }
54999 if (Main.tile[
num15,
num16 - 1].halfBrick())
55000 {
55002 }
55004 {
55006 if ((
double)
num18 <= 16.1)
55007 {
55011 {
55013 }
55014 else
55015 {
55017 }
55018 }
55019 }
55020 }
55021 }
55023 {
55029 {
55030 if (Main.tile[
m,
num19] !=
null && Main.tile[
m,
num19].nactive() && Main.tileSolid[Main.tile[
m,
num19].type])
55031 {
55033 break;
55034 }
55035 }
55037 {
55041 {
55043 }
55045 {
55047 }
55049 {
55051 }
55053 {
55055 }
55057 {
55059 }
55061 {
55063 }
55065 {
55067 }
55069 {
55071 }
55073 {
55075 }
55078 {
55080 }
55082 {
55085 if (Main.tile[
num22,
num23 - 2].nactive() && Main.tileSolid[Main.tile[
num22,
num23 - 2].type])
55086 {
55087 if (Main.tile[
num22,
num23 - 3].nactive() && Main.tileSolid[Main.tile[
num22,
num23 - 3].type])
55088 {
55089 velocity.Y = -8.5f;
55091 }
55092 else
55093 {
55094 velocity.Y = -7.5f;
55096 }
55097 }
55099 {
55100 velocity.Y = -7f;
55102 }
55104 {
55105 velocity.Y = -6f;
55107 }
55109 {
55110 velocity.Y = -8f;
55112 }
55113 }
55114 }
55115 }
55117 {
55119 for (
int n = 0;
n < 2;
n++)
55120 {
55121 if (Main.rand.Next(3) == 0)
55122 {
55125 obj3.noGravity = true;
55126 obj3.fadeIn = 1f;
55127 obj3.scale = 0.5f + Main.rand.NextFloat();
55128 }
55129 }
55130 }
55132 {
55135 }
55136 }
static float Lerp(float value1, float value2, float amount)
static double Sqrt(double d)
static double Abs(double value)
static int Sign(decimal value)
static void PlaySound(int type, Vector2 position, int style=1)
void EncourageDespawn(int despawnTime)
void TargetClosest(bool faceTarget=true)
IEntitySource GetSpawnSourceForNPCFromNPCAI()
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
void HitEffect(int hitDirection=0, double dmg=10.0)
IEntitySource GetSpawnSource_ForProjectile()