13608 {
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13621 {
13622 if (Main.netMode != 1)
13623 {
13624 for (
int i = 0;
i < 255;
i++)
13625 {
13626 if (Main.player[i].active && Main.player[i].talkNPC ==
whoAmI)
13627 {
13629 {
13631 }
13633 {
13635 }
13637 {
13639 }
13641 {
13643 }
13645 {
13647 }
13649 {
13651 }
13653 {
13655 }
13656 }
13657 }
13658 }
13660 {
13663 }
13665 {
13666 if (
wet || Main.tile[(
int)(
base.Center.X / 16f), (
int)(
position.
Y - 4f) / 16].liquid > 0)
13667 {
13668 velocity.Y = -0.4f;
13669 int num = 1;
13670 if (
base.Center.X / 16f > (
float)(Main.maxTilesX / 2))
13671 {
13672 num = -1;
13673 }
13675 int num3 = (int)
base.Center.X / 16;
13676 int j = (int)
base.Center.Y / 16;
13677 bool flag = false;
13678 if (num > 0)
13679 {
13681 {
13683 {
13684 flag = true;
13685 }
13686 }
13687 }
13688 else
13689 {
13691 {
13693 {
13694 flag = true;
13695 }
13696 }
13697 }
13699 {
13700 flag = true;
13701 }
13702 if (flag)
13703 {
13704 velocity.X *= 0.99f;
13706 {
13707 velocity.X = 0f;
13708 }
13709 return;
13710 }
13711 velocity.X += (float)num * 0.01f;
13713 {
13714 velocity.X *= 0.95f;
13715 }
13717 {
13718 velocity.X *= 0.95f;
13719 }
13720 }
13721 else
13722 {
13723 velocity.X *= 0.93f;
13724 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
13725 {
13726 velocity.X = 0f;
13727 }
13728 }
13729 }
13730 else
13731 {
13732 velocity.X *= 0.93f;
13733 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
13734 {
13735 velocity.X = 0f;
13736 }
13737 }
13738 return;
13739 }
13741 {
13743 return;
13744 }
13746 {
13748 return;
13749 }
13751 {
13753 return;
13754 }
13756 {
13757 bool flag2 =
false;
13758 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.12)
13759 {
13761 }
13762 bool flag3 =
false;
13763 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.04)
13764 {
13766 }
13769 {
13771 }
13773 {
13775 }
13776 bool dead = Main.player[
target].dead;
13777 float num5 = position.X + (float)(
width / 2) - Main.player[
target].position.X - (float)(Main.player[
target].width / 2);
13778 float num6 = position.Y + (float)
height - 59f - Main.player[
target].position.Y - (
float)(Main.player[
target].height / 2);
13781 {
13783 }
13784 else if ((
double)
num7 > 6.283)
13785 {
13787 }
13789 if (this.
ai[0] == 0f && this.
ai[1] == 0f)
13790 {
13792 }
13793 if (this.
ai[0] == 0f && this.
ai[1] == 2f && this.
ai[2] > 40f)
13794 {
13796 }
13797 if (this.
ai[0] == 3f && this.
ai[1] == 0f)
13798 {
13800 }
13801 if (this.
ai[0] == 3f && this.
ai[1] == 2f && this.
ai[2] > 40f)
13802 {
13804 }
13805 if (this.
ai[0] == 3f && this.
ai[1] == 4f && this.
ai[2] > num4)
13806 {
13808 }
13809 if (this.
ai[0] == 3f && this.
ai[1] == 5f)
13810 {
13812 }
13813 if (Main.expertMode)
13814 {
13816 }
13817 if (
flag3 && Main.expertMode)
13818 {
13820 }
13822 {
13824 {
13826 }
13827 else
13828 {
13830 }
13831 }
13833 {
13835 {
13837 }
13838 else
13839 {
13841 }
13842 }
13844 {
13846 }
13848 {
13850 }
13851 else if ((
double)
rotation > 6.283)
13852 {
13854 }
13856 {
13858 }
13859 if (Main.rand.Next(5) == 0)
13860 {
13862 Main.dust[
num9].velocity.X *= 0.5f;
13863 Main.dust[
num9].velocity.Y *= 0.1f;
13864 }
13866 if (Main.IsItDay() || dead)
13867 {
13868 velocity.Y -= 0.04f;
13870 return;
13871 }
13872 if (this.
ai[0] == 0f)
13873 {
13874 if (this.
ai[1] == 0f)
13875 {
13877 float num11 = 0.04f;
13878 if (Main.expertMode)
13879 {
13882 }
13883 if (Main.getGoodWorld)
13884 {
13887 }
13897 {
13898 velocity.X +=
num11;
13900 {
13901 velocity.X +=
num11;
13902 }
13903 }
13905 {
13906 velocity.X -=
num11;
13908 {
13909 velocity.X -=
num11;
13910 }
13911 }
13913 {
13914 velocity.Y +=
num11;
13916 {
13917 velocity.Y +=
num11;
13918 }
13919 }
13921 {
13922 velocity.Y -=
num11;
13924 {
13925 velocity.Y -=
num11;
13926 }
13927 }
13929 float num16 = 600f;
13930 if (Main.expertMode)
13931 {
13933 }
13934 if (this.
ai[2] >= num16)
13935 {
13941 }
13943 {
13944 if (!Main.player[
target].dead)
13945 {
13947 }
13948 float num17 = 110f;
13949 if (Main.expertMode)
13950 {
13952 }
13953 if (Main.getGoodWorld)
13954 {
13956 }
13957 if (this.
ai[3] >= num17)
13958 {
13962 if (Main.expertMode)
13963 {
13965 }
13974 vector2.X += vector3.X * 10f;
13975 vector2.Y += vector3.Y * 10f;
13976 if (Main.netMode != 1)
13977 {
13981 if (Main.netMode == 2 &&
num22 < 200)
13982 {
13983 NetMessage.SendData(23, -1, -1,
null,
num22);
13984 }
13985 }
13987 for (
int m = 0;
m < 10;
m++)
13988 {
13990 }
13991 }
13992 }
13993 }
13994 else if (this.
ai[1] == 1f)
13995 {
13998 if (Main.expertMode)
13999 {
14001 }
14002 if (Main.getGoodWorld)
14003 {
14005 }
14016 {
14018 }
14019 }
14020 else if (this.
ai[1] == 2f)
14021 {
14023 if (this.
ai[2] >= 40f)
14024 {
14026 if (Main.expertMode)
14027 {
14029 }
14030 if (Main.getGoodWorld)
14031 {
14033 }
14034 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
14035 {
14036 velocity.X = 0f;
14037 }
14038 if ((
double)velocity.Y > -0.1 && (double)
velocity.
Y < 0.1)
14039 {
14040 velocity.Y = 0f;
14041 }
14042 }
14043 else
14044 {
14046 }
14048 if (Main.expertMode)
14049 {
14051 }
14052 if (Main.getGoodWorld)
14053 {
14055 }
14056 if (this.
ai[2] >= (
float)num27)
14057 {
14062 if (this.
ai[3] >= 3f)
14063 {
14066 }
14067 else
14068 {
14070 }
14071 }
14072 }
14073 float num28 = 0.5f;
14074 if (Main.expertMode)
14075 {
14077 }
14079 {
14086 {
14088 }
14089 }
14090 return;
14091 }
14092 if (this.
ai[0] == 1f || this.
ai[0] == 2f)
14093 {
14094 if (this.
ai[0] == 1f || this.
ai[3] == 1f)
14095 {
14096 this.
ai[2] += 0.005f;
14097 if ((
double)this.
ai[2] > 0.5)
14098 {
14100 }
14101 }
14102 else
14103 {
14104 this.
ai[2] -= 0.005f;
14105 if (this.
ai[2] < 0f)
14106 {
14108 }
14109 }
14112 if (Main.getGoodWorld)
14113 {
14115 }
14118 {
14120 }
14121 if (Main.expertMode &&
this.ai[1] % (
float)
num29 == 0f)
14122 {
14125 float num31 = Main.rand.Next(-200, 200);
14126 float num32 = Main.rand.Next(-200, 200);
14127 if (Main.getGoodWorld)
14128 {
14131 }
14138 vector6.X += vector7.X * 10f;
14139 vector6.Y += vector7.Y * 10f;
14140 if (Main.netMode != 1)
14141 {
14145 if (Main.netMode == 2 &&
num34 < 200)
14146 {
14147 NetMessage.SendData(23, -1, -1,
null,
num34);
14148 }
14149 }
14150 for (
int n = 0;
n < 10;
n++)
14151 {
14153 }
14154 }
14155 if (this.
ai[1] >= 100f)
14156 {
14157 if (this.
ai[3] == 1f)
14158 {
14161 }
14162 else
14163 {
14166 if (this.
ai[0] == 3f)
14167 {
14169 }
14170 else
14171 {
14174 {
14175 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 8);
14176 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 7);
14177 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 6);
14178 }
14180 {
14181 Dust.NewDust(
position,
width,
height, 5, (
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f);
14182 }
14184 }
14185 }
14186 }
14187 Dust.NewDust(
position,
width,
height, 5, (
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f);
14188 velocity.X *= 0.98f;
14189 velocity.Y *= 0.98f;
14191 {
14192 velocity.X = 0f;
14193 }
14195 {
14196 velocity.Y = 0f;
14197 }
14198 return;
14199 }
14203 if (Main.expertMode)
14204 {
14206 {
14208 }
14210 {
14213 }
14214 }
14217 if (this.
ai[1] == 0f &&
flag2)
14218 {
14220 }
14221 if (this.
ai[1] == 0f)
14222 {
14224 float num40 = 0.07f;
14229 if (
num43 > 400f && Main.expertMode)
14230 {
14234 {
14238 {
14241 }
14242 }
14243 }
14244 if (Main.getGoodWorld)
14245 {
14248 }
14253 {
14254 velocity.X +=
num40;
14256 {
14257 velocity.X +=
num40;
14258 }
14259 }
14261 {
14262 velocity.X -=
num40;
14264 {
14265 velocity.X -=
num40;
14266 }
14267 }
14269 {
14270 velocity.Y +=
num40;
14272 {
14273 velocity.Y +=
num40;
14274 }
14275 }
14277 {
14278 velocity.Y -=
num40;
14280 {
14281 velocity.Y -=
num40;
14282 }
14283 }
14285 if (this.
ai[2] >= 200f)
14286 {
14290 if (Main.expertMode && (
double)
life < (double)
lifeMax * 0.35)
14291 {
14293 }
14296 }
14297 if (Main.expertMode &&
flag3)
14298 {
14303 this.
ai[3] -= 1000f;
14304 }
14305 }
14306 else if (this.
ai[1] == 1f)
14307 {
14310 float num44 = 6.8f;
14311 if (Main.expertMode && this.ai[3] == 1f)
14312 {
14314 }
14315 if (Main.expertMode && this.ai[3] == 2f)
14316 {
14318 }
14319 if (Main.getGoodWorld)
14320 {
14322 }
14333 {
14335 }
14336 }
14337 else if (this.
ai[1] == 2f)
14338 {
14341 if (Main.expertMode)
14342 {
14344 }
14345 if (this.
ai[2] >= num48)
14346 {
14348 if (Main.expertMode)
14349 {
14351 }
14352 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
14353 {
14354 velocity.X = 0f;
14355 }
14356 if ((
double)velocity.Y > -0.1 && (double)
velocity.
Y < 0.1)
14357 {
14358 velocity.Y = 0f;
14359 }
14360 }
14361 else
14362 {
14364 }
14366 if (Main.expertMode)
14367 {
14369 }
14370 if (this.
ai[2] >= (
float)num49)
14371 {
14376 if (this.
ai[3] >= 3f)
14377 {
14380 if (Main.expertMode && Main.netMode != 1 && (
double)
life < (double)
lifeMax * 0.5)
14381 {
14383 this.
ai[3] += Main.rand.Next(1, 4);
14384 }
14387 {
14389 }
14390 }
14391 else
14392 {
14394 }
14395 }
14396 }
14397 else if (this.
ai[1] == 3f)
14398 {
14400 {
14407 {
14409 }
14410 }
14411 else if (Main.netMode != 1)
14412 {
14421 {
14423 }
14425 {
14427 }
14428 if (this.
ai[2] == -1f && !
flag3)
14429 {
14432 }
14434 {
14436 }
14439 num51 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f;
14440 num52 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f;
14442 {
14443 num51 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f;
14444 num52 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f;
14445 }
14451 velocity.X += (float)Main.rand.Next(-20, 21) * 0.1f;
14452 velocity.Y += (float)Main.rand.Next(-20, 21) * 0.1f;
14454 {
14455 velocity.X += (float)Main.rand.Next(-50, 51) * 0.1f;
14456 velocity.Y += (float)Main.rand.Next(-50, 51) * 0.1f;
14459 if (
base.Center.X > Main.player[
target].Center.X)
14460 {
14462 }
14463 if (
base.Center.Y > Main.player[
target].Center.Y)
14464 {
14466 }
14471 velocity.X += (float)Main.rand.Next(-20, 21) * 0.1f;
14472 velocity.Y += (float)Main.rand.Next(-20, 21) * 0.1f;
14473 }
14474 else if (
num55 < 100f)
14475 {
14477 {
14480 if (
base.Center.X > Main.player[
target].Center.X)
14481 {
14483 }
14484 if (
base.Center.Y > Main.player[
target].Center.Y)
14485 {
14487 }
14488 velocity.X =
num59;
14489 velocity.Y =
num58;
14490 }
14491 }
14493 {
14496 if (
base.Center.X > Main.player[
target].Center.X)
14497 {
14499 }
14500 if (
base.Center.Y > Main.player[
target].Center.Y)
14501 {
14503 }
14504 velocity.X =
num61;
14505 velocity.Y =
num60;
14506 }
14510 {
14512 }
14513 }
14514 }
14515 else if (this.
ai[1] == 4f)
14516 {
14517 if (this.
ai[2] == 0f)
14518 {
14520 }
14524 {
14526 }
14527 if (this.
ai[2] >= num62)
14528 {
14530 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
14531 {
14532 velocity.X = 0f;
14533 }
14534 if ((
double)velocity.Y > -0.1 && (double)
velocity.
Y < 0.1)
14535 {
14536 velocity.Y = 0f;
14537 }
14538 }
14539 else
14540 {
14542 }
14544 if (this.
ai[2] >= num63)
14545 {
14548 {
14550 }
14553 if (this.
ai[3] >= 5f)
14554 {
14558 {
14565 }
14566 }
14567 else
14568 {
14570 }
14571 }
14572 }
14573 else if (this.
ai[1] == 5f)
14574 {
14575 float num64 = 600f;
14577 float num66 = 0.3f;
14586 {
14587 velocity.X +=
num66;
14589 {
14590 velocity.X +=
num66;
14591 }
14592 }
14594 {
14595 velocity.X -=
num66;
14597 {
14598 velocity.X -=
num66;
14599 }
14600 }
14602 {
14603 velocity.Y +=
num66;
14605 {
14606 velocity.Y +=
num66;
14607 }
14608 }
14610 {
14611 velocity.Y -=
num66;
14613 {
14614 velocity.Y -=
num66;
14615 }
14616 }
14618 if (this.
ai[2] >= 70f)
14619 {
14623 this.
ai[3] = Main.rand.Next(-3, 1);
14625 }
14626 }
14627 if (
flag3 && this.
ai[1] == 5f)
14628 {
14630 }
14631 return;
14632 }
14634 {
14636 return;
14637 }
14639 {
14641 return;
14642 }
14644 {
14646 return;
14647 }
14649 {
14651 velocity.X *= 0.93f;
14653 {
14654 velocity.X = 0f;
14655 }
14656 if (this.
ai[0] == 0f)
14657 {
14659 }
14661 {
14663 {
14665 }
14667 {
14669 }
14670 }
14671 if (this.
ai[2] != 0f && this.
ai[3] != 0f)
14672 {
14675 {
14677 }
14680 {
14682 {
14683 int num71 = Dust.NewDust(
new Vector2(
position.
X,
position.
Y),
width,
height, 27, 0f, 0f, 100,
default(
Color), Main.rand.Next(1, 3));
14684 Dust dust = Main.dust[
num71];
14685 dust.velocity *= 3f;
14686 if (Main.dust[
num71].scale > 1f)
14687 {
14688 Main.dust[
num71].noGravity =
true;
14689 }
14690 }
14691 else if (
type == 32)
14692 {
14694 Dust dust = Main.dust[
num72];
14695 dust.velocity *= 3f;
14696 Main.dust[
num72].noGravity =
true;
14697 }
14698 else if (
type == 283 ||
type == 284)
14699 {
14701 Dust dust = Main.dust[
num73];
14702 dust.velocity *= 2f;
14703 Main.dust[
num73].scale = 1.4f;
14704 }
14705 else if (
type == 285 ||
type == 286)
14706 {
14708 Dust dust = Main.dust[
num74];
14709 dust.velocity *= 3f;
14710 Main.dust[
num74].noGravity =
true;
14711 }
14712 else if (
type == 281 ||
type == 282)
14713 {
14715 Dust dust = Main.dust[
num75];
14716 dust.velocity *= 3f;
14717 Main.dust[
num75].noGravity =
true;
14718 }
14719 else if (
type == 172)
14720 {
14722 Dust dust = Main.dust[
num76];
14723 dust.velocity *= 3f;
14724 Main.dust[
num76].noGravity =
true;
14725 }
14726 else if (
type == 533)
14727 {
14729 Dust dust = Main.dust[
num77];
14730 dust.velocity *= 3f;
14731 Main.dust[
num77].noGravity =
true;
14732 }
14733 else
14734 {
14736 Dust dust = Main.dust[
num78];
14737 dust.velocity *= 3f;
14738 Main.dust[
num78].noGravity =
true;
14739 }
14740 }
14742 position.X = this.
ai[2] * 16f - (float)(
width / 2) + 8f;
14743 position.Y = this.
ai[3] * 16f - (float)
height;
14745 velocity.X = 0f;
14746 velocity.Y = 0f;
14751 {
14753 {
14754 int num80 = Dust.NewDust(
new Vector2(
position.
X,
position.
Y),
width,
height, 27, 0f, 0f, 100,
default(
Color), Main.rand.Next(1, 3));
14755 Dust dust = Main.dust[
num80];
14756 dust.velocity *= 3f;
14757 if (Main.dust[
num80].scale > 1f)
14758 {
14759 Main.dust[
num80].noGravity =
true;
14760 }
14761 }
14762 else if (
type == 32)
14763 {
14765 Dust dust = Main.dust[
num81];
14766 dust.velocity *= 3f;
14767 Main.dust[
num81].noGravity =
true;
14768 }
14769 else if (
type == 172)
14770 {
14772 Dust dust = Main.dust[
num82];
14773 dust.velocity *= 3f;
14774 Main.dust[
num82].noGravity =
true;
14775 }
14776 else if (
type == 283 ||
type == 284)
14777 {
14779 Dust dust = Main.dust[
num83];
14780 dust.velocity *= 2f;
14781 Main.dust[
num83].scale = 1.4f;
14782 }
14783 else if (
type == 285 ||
type == 286)
14784 {
14786 Dust dust = Main.dust[
num84];
14787 dust.velocity *= 3f;
14788 Main.dust[
num84].noGravity =
true;
14789 }
14790 else if (
type == 281 ||
type == 282)
14791 {
14793 Dust dust = Main.dust[
num85];
14794 dust.velocity *= 3f;
14795 Main.dust[
num85].noGravity =
true;
14796 }
14797 else if (
type == 533)
14798 {
14800 Dust dust = Main.dust[
num86];
14801 dust.velocity *= 3f;
14802 Main.dust[
num86].noGravity =
true;
14803 }
14804 else
14805 {
14807 Dust dust = Main.dust[
num87];
14808 dust.velocity *= 3f;
14809 Main.dust[
num87].noGravity =
true;
14810 }
14811 }
14812 }
14815 {
14816 if (this.
ai[0] == 100f || this.
ai[0] == 150f || this.
ai[0] == 200f || this.
ai[0] == 250f || this.
ai[0] == 300f)
14817 {
14820 }
14821 if (this.
ai[0] >= 450f)
14822 {
14824 }
14825 }
14826 else if (
type == 172)
14827 {
14828 if (this.
ai[0] == 75f || this.
ai[0] == 150f || this.
ai[0] == 225f || this.
ai[0] == 300f || this.
ai[0] == 375f || this.
ai[0] == 450f)
14829 {
14832 }
14833 }
14834 else if (
type == 533)
14835 {
14836 if (this.
ai[0] == 180f)
14837 {
14840 }
14841 }
14842 else if (
type == 281 ||
type == 282)
14843 {
14844 if (this.
ai[0] == 100f || this.
ai[0] == 120f || this.
ai[0] == 140f || this.
ai[0] == 200f || this.
ai[0] == 220f || this.
ai[0] == 240f || this.
ai[0] == 300f || this.
ai[0] == 320f || this.
ai[0] == 340f)
14845 {
14848 }
14849 if (this.
ai[0] >= 540f)
14850 {
14852 }
14853 }
14854 else
14855 {
14856 if (Main.getGoodWorld &&
type == 24 &&
AnyNPCs(113))
14857 {
14859 if (this.
ai[0] % 2f == 1f)
14860 {
14862 }
14863 }
14864 if (this.
ai[0] == 100f || this.
ai[0] == 200f || this.
ai[0] == 300f)
14865 {
14868 }
14869 }
14870 if ((
type == 285 ||
type == 286) && this.
ai[0] > 400f)
14871 {
14873 }
14874 if (
type == 533 && this.
ai[0] >= 360f)
14875 {
14877 }
14878 if (this.
ai[0] >= 650f && Main.netMode != 1)
14879 {
14885 {
14887 this.
ai[2] = chosenTile.X;
14888 this.
ai[3] = chosenTile.Y;
14889 }
14891 }
14892 if (this.
ai[1] > 0f)
14893 {
14896 {
14897 if (this.
ai[1] % 30f == 0f && this.
ai[1] / 30f < 5f)
14898 {
14900 if (Main.netMode != 1)
14901 {
14902 Point point =
base.Center.ToTileCoordinates();
14910 bool flag4 =
false;
14912 {
14914 }
14916 {
14921 {
14924 {
14926 }
14928 {
14930 }
14932 {
14935 break;
14936 }
14937 }
14938 }
14939 }
14940 }
14941 }
14942 else if (this.
ai[1] == 25f)
14943 {
14945 {
14946 if (Main.netMode != 1)
14947 {
14950 {
14952 }
14954 {
14956 }
14961 {
14962 num96 += (float)Main.rand.Next(-30, 31);
14963 num97 += (float)Main.rand.Next(-30, 31);
14966 }
14974 {
14977 }
14979 {
14982 }
14985 Main.projectile[
num101].timeLeft = 300;
14987 {
14988 Main.projectile[
num101].ai[0] = Main.player[
target].Center.X;
14989 Main.projectile[
num101].ai[1] = Main.player[
target].Center.Y;
14990 Main.projectile[
num101].netUpdate =
true;
14991 }
14993 }
14994 }
14995 else
14996 {
14998 {
15000 }
15001 if (Main.netMode != 1)
15002 {
15004 {
15006 }
15007 else if (
type == 45)
15008 {
15010 }
15011 else if (
type == 32)
15012 {
15014 }
15015 else if (
type == 172)
15016 {
15019 float num103 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector14.X + (
float)Main.rand.Next(-10, 11);
15020 float num104 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector14.Y + (
float)Main.rand.Next(-10, 11);
15028 Main.projectile[
num108].timeLeft = 300;
15030 }
15031 else
15032 {
15034 }
15035 }
15036 }
15037 }
15038 }
15041 {
15042 if (Main.rand.Next(5) == 0)
15043 {
15045 Main.dust[
num109].noGravity =
true;
15046 Main.dust[
num109].velocity.X *= 0.5f;
15047 Main.dust[
num109].velocity.Y = -2f;
15048 }
15049 }
15050 else if (
type == 32)
15051 {
15052 if (Main.rand.Next(3) != 0)
15053 {
15055 Main.dust[
num110].noGravity =
true;
15056 Main.dust[
num110].velocity.X *= 0.3f;
15057 Main.dust[
num110].velocity.Y *= 0.2f;
15058 Main.dust[
num110].velocity.Y -= 1f;
15059 }
15060 }
15061 else if (
type == 172)
15062 {
15065 {
15067 }
15069 {
15070 if (Main.rand.Next(255) > 255 -
alpha)
15071 {
15073 Main.dust[
num113].noGravity =
true;
15074 Main.dust[
num113].velocity.X *= 0.1f + (float)Main.rand.Next(30) * 0.01f;
15075 Main.dust[
num113].velocity.Y *= 0.1f + (float)Main.rand.Next(30) * 0.01f;
15076 Dust dust = Main.dust[
num113];
15077 dust.scale *= 1f + (float)Main.rand.Next(6) * 0.1f;
15078 }
15079 }
15080 }
15081 else if (
type == 283 ||
type == 284)
15082 {
15083 if (Main.rand.Next(2) == 0)
15084 {
15086 Main.dust[
num114].velocity.X *= 0.5f;
15087 Main.dust[
num114].velocity.Y *= 0.5f;
15088 }
15089 }
15090 else if (
type == 285 ||
type == 286)
15091 {
15092 if (Main.rand.Next(2) == 0)
15093 {
15095 Main.dust[
num115].noGravity =
true;
15096 Dust dust = Main.dust[
num115];
15097 dust.velocity *= 0.4f;
15098 Main.dust[
num115].velocity.Y -= 0.7f;
15099 }
15100 }
15101 else if (
type == 281 ||
type == 282)
15102 {
15103 if (Main.rand.Next(2) == 0)
15104 {
15106 Main.dust[
num116].noGravity =
true;
15107 Dust dust = Main.dust[
num116];
15108 dust.velocity *= 0.5f;
15109 Main.dust[
num116].fadeIn = 1.2f;
15110 }
15111 }
15112 else if (
type == 533)
15113 {
15114 Lighting.AddLight(
base.Top, 0.6f, 0.6f, 0.3f);
15115 }
15116 else if (Main.rand.Next(2) == 0)
15117 {
15119 Main.dust[
num117].noGravity =
true;
15120 Main.dust[
num117].velocity.X *= 1f;
15121 Main.dust[
num117].velocity.Y *= 1f;
15122 }
15124 return;
15125 }
15127 {
15129 {
15131 {
15133 }
15134 if (this.
ai[0] == 0f)
15135 {
15140 {
15142 }
15143 vector15 =
vector15.RotatedByRandom(1.5707963705062866).RotatedBy(-0.7853981852531433);
15145 {
15146 vector15.Y = 0.2f;
15147 }
15149 }
15151 {
15153 }
15154 }
15156 {
15160 {
15162 }
15164 {
15166 }
15167 if (Main.getGoodWorld)
15168 {
15170 {
15172 }
15174 {
15176 }
15178 {
15180 }
15181 }
15189 }
15191 {
15193 {
15195 }
15197 {
15199 }
15200 else if (
type == 666 && (
double)(base.Center.Y / 16f) < Main.worldSurface)
15201 {
15203 }
15204 }
15206 {
15209 {
15211 }
15213 if (this.
ai[0] > 3f)
15214 {
15216 }
15217 if (this.
ai[0] == 2f)
15218 {
15222 {
15224 Dust dust = Main.dust[
num123];
15225 dust.velocity *= 1.3f;
15226 dust = Main.dust[
num123];
15228 Main.dust[
num123].noGravity =
true;
15229 }
15230 }
15231 }
15233 {
15237 }
15240 {
15243 float num125 = 1f / 12f;
15249 {
15251 }
15254 {
15256 }
15257 return;
15258 }
15261 {
15263 {
15266 {
15268 Main.dust[
num128].noGravity =
true;
15269 Dust dust = Main.dust[
num128];
15270 dust.velocity *= 0.3f;
15271 Main.dust[
num128].velocity.X -= velocity.X * 0.2f;
15272 Main.dust[
num128].velocity.Y -= velocity.Y * 0.2f;
15273 }
15274 }
15275 else if (
type == 33)
15276 {
15278 {
15283 Main.dust[
num133].noGravity =
true;
15284 Dust dust = Main.dust[
num133];
15285 dust.velocity *= 0.1f;
15286 dust = Main.dust[
num133];
15290 }
15291 if (Main.rand.Next(5) == 0)
15292 {
15295 Dust dust = Main.dust[
num135];
15296 dust.velocity *= 0.25f;
15297 dust = Main.dust[
num135];
15299 }
15300 }
15301 else if (
type == 112 ||
type == 666)
15302 {
15304 Dust dust = Main.dust[
num136];
15305 dust.velocity *= 0.3f;
15306 Main.dust[
num136].noGravity =
true;
15307 }
15308 else
15309 {
15310 Lighting.AddLight((
int)((position.X + (float)(
width / 2)) / 16f), (int)((
position.
Y + (
float)(
height / 2)) / 16f), 1f, 0.3f, 0.1f);
15312 Main.dust[
num137].noGravity =
true;
15313 Main.dust[
num137].velocity.X *= 0.3f;
15314 Main.dust[
num137].velocity.Y *= 0.3f;
15315 }
15316 }
15319 return;
15320 }
15322 {
15332 if (this.
ai[1] > 600f)
15333 {
15336 if (this.
ai[1] > 650f)
15337 {
15339 }
15340 }
15342 {
15343 this.
ai[0] += 0.9f;
15344 if (this.
ai[0] > 0f)
15345 {
15346 velocity.Y += 0.019f;
15347 }
15348 else
15349 {
15350 velocity.Y -= 0.019f;
15351 }
15352 if (this.
ai[0] < -100f || this.
ai[0] > 100f)
15353 {
15354 velocity.X += 0.019f;
15355 }
15356 else
15357 {
15358 velocity.X -= 0.019f;
15359 }
15360 if (this.
ai[0] > 200f)
15361 {
15362 this.
ai[0] = -200f;
15363 }
15364 }
15366 {
15369 }
15371 {
15374 }
15376 {
15379 }
15383 if (Main.player[
target].dead)
15384 {
15387 }
15389 {
15391 }
15393 {
15395 }
15397 {
15399 }
15401 {
15403 }
15405 {
15408 }
15410 {
15413 }
15415 {
15416 return;
15417 }
15419 {
15422 }
15428 {
15430 if (this.
ai[3] == 0f)
15431 {
15432 if (this.
ai[2] > 120f)
15433 {
15437 }
15438 return;
15439 }
15440 if (this.
ai[2] > 40f)
15441 {
15443 }
15444 if (Main.netMode != 1 && this.ai[2] == 20f)
15445 {
15453 }
15454 }
15455 else
15456 {
15459 }
15460 return;
15461 }
15463 {
15466 if (this.
ai[0] == 0f && Main.netMode != 1)
15467 {
15471 {
15473 Main.npc[
num148].ai[0] = -1f;
15476 Main.npc[
num148].netUpdate =
true;
15478 Main.npc[
num148].ai[0] = 1f;
15480 Main.npc[
num148].ai[3] = 150f;
15482 Main.npc[
num148].netUpdate =
true;
15483 }
15484 }
15485 if ((
type == 68 || Main.netMode == 1) &&
localAI[0] == 0f)
15486 {
15489 }
15491 {
15494 {
15496 }
15497 }
15498 if ((
type == 68 || Main.IsItDay()) &&
this.ai[1] != 3f &&
this.ai[1] != 2f)
15499 {
15502 }
15504 if (Main.expertMode)
15505 {
15507 {
15509 {
15511 }
15512 }
15515 {
15518 {
15520 }
15521 if (Main.getGoodWorld)
15522 {
15524 }
15525 if (Main.netMode != 1 &&
this.ai[2] %
num151 == 0f)
15526 {
15531 if (Collision.CanHit(
center3, 1, 1, Main.player[
target].position, Main.player[
target].width, Main.player[
target].height))
15532 {
15535 {
15537 }
15538 float num156 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
center3.X + (
float)Main.rand.Next(-20, 21);
15539 float num157 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
center3.Y + (
float)Main.rand.Next(-20, 21);
15554 Main.projectile[
num160].timeLeft = 300;
15555 }
15556 }
15557 }
15558 }
15559 if (this.
ai[1] == 0f)
15560 {
15563 if (this.
ai[2] >= 800f)
15564 {
15569 }
15575 if (Main.expertMode)
15576 {
15581 }
15582 if (Main.getGoodWorld)
15583 {
15588 }
15590 {
15592 {
15593 velocity.Y *= 0.98f;
15594 }
15597 {
15599 }
15600 }
15602 {
15604 {
15605 velocity.Y *= 0.98f;
15606 }
15609 {
15610 velocity.Y = 0f -
num162;
15611 }
15612 }
15614 {
15616 {
15617 velocity.X *= 0.98f;
15618 }
15621 {
15623 }
15624 }
15626 {
15628 {
15629 velocity.X *= 0.98f;
15630 }
15633 {
15634 velocity.X = 0f -
num164;
15635 }
15636 }
15637 }
15638 else if (this.
ai[1] == 1f)
15639 {
15640 if (Main.getGoodWorld)
15641 {
15643 {
15645 }
15646 else if (Main.netMode != 1 &&
this.ai[2] % 200f == 0f &&
CountNPCS(32) < 6)
15647 {
15650 {
15653 {
15654 int num169 = (int)(
base.Center.X / 16f) + Main.rand.Next(-50, 51);
15657 {
15658 }
15661 {
15663 if (Main.netMode == 2 &&
num171 < 200)
15664 {
15665 NetMessage.SendData(23, -1, -1,
null,
num171);
15666 }
15667 break;
15668 }
15669 }
15670 }
15671 }
15672 }
15675 if (this.
ai[2] == 2f)
15676 {
15678 }
15679 if (this.
ai[2] >= 400f)
15680 {
15683 }
15691 if (Main.expertMode)
15692 {
15695 {
15697 }
15699 {
15701 }
15703 {
15705 }
15707 {
15709 }
15711 {
15713 }
15715 {
15717 }
15719 {
15721 }
15723 {
15725 }
15727 {
15729 }
15731 {
15733 }
15735 {
15736 case 0:
15738 break;
15739 case 1:
15741 break;
15742 }
15743 }
15744 if (Main.getGoodWorld)
15745 {
15747 }
15751 }
15752 else if (this.
ai[1] == 2f)
15753 {
15764 }
15765 else if (this.
ai[1] == 3f)
15766 {
15767 velocity.Y += 0.1f;
15769 {
15770 velocity.Y *= 0.95f;
15771 }
15772 velocity.X *= 0.95f;
15774 }
15775 if (this.
ai[1] != 2f && this.
ai[1] != 3f &&
type != 68 && (
num149 != 0 || !Main.expertMode))
15776 {
15778 Main.dust[
num179].noGravity =
true;
15779 Main.dust[
num179].velocity.X *= 1.3f;
15780 Main.dust[
num179].velocity.X += velocity.X * 0.4f;
15783 {
15785 Main.dust[
num179].noGravity =
true;
15786 Dust dust = Main.dust[
num179];
15788 Main.dust[
num179].velocity.
Y += 5f;
15789 }
15790 }
15791 return;
15792 }
15794 {
15796 if (!Main.npc[(
int)this.
ai[1]].active || Main.npc[(int)this.
ai[1]].
aiStyle != 11)
15797 {
15799 if (this.
ai[2] > 50f || Main.netMode != 2)
15800 {
15804 }
15805 }
15806 if (this.
ai[2] == 0f || this.
ai[2] == 3f)
15807 {
15808 if (Main.npc[(int)this.ai[1]].ai[1] == 3f)
15809 {
15811 }
15812 if (Main.npc[(int)this.ai[1]].ai[1] != 0f)
15813 {
15814 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y - 100f)
15815 {
15817 {
15818 velocity.Y *= 0.96f;
15819 }
15820 velocity.Y -= 0.07f;
15822 {
15823 velocity.Y = 6f;
15824 }
15825 }
15826 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y - 100f)
15827 {
15829 {
15830 velocity.Y *= 0.96f;
15831 }
15832 velocity.Y += 0.07f;
15834 {
15835 velocity.Y = -6f;
15836 }
15837 }
15838 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120f *
this.ai[0])
15839 {
15841 {
15842 velocity.X *= 0.96f;
15843 }
15844 velocity.X -= 0.1f;
15846 {
15847 velocity.X = 8f;
15848 }
15849 }
15850 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120f *
this.ai[0])
15851 {
15853 {
15854 velocity.X *= 0.96f;
15855 }
15856 velocity.X += 0.1f;
15858 {
15859 velocity.X = -8f;
15860 }
15861 }
15862 }
15863 else
15864 {
15866 if (Main.expertMode)
15867 {
15868 this.
ai[3] += 0.5f;
15869 }
15870 if (this.
ai[3] >= 300f)
15871 {
15875 }
15876 if (Main.expertMode)
15877 {
15878 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y + 230f)
15879 {
15881 {
15882 velocity.Y *= 0.96f;
15883 }
15884 velocity.Y -= 0.04f;
15886 {
15887 velocity.Y = 3f;
15888 }
15889 }
15890 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y + 230f)
15891 {
15893 {
15894 velocity.Y *= 0.96f;
15895 }
15896 velocity.Y += 0.04f;
15898 {
15899 velocity.Y = -3f;
15900 }
15901 }
15902 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 200f *
this.ai[0])
15903 {
15905 {
15906 velocity.X *= 0.96f;
15907 }
15908 velocity.X -= 0.07f;
15910 {
15911 velocity.X = 8f;
15912 }
15913 }
15914 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 200f *
this.ai[0])
15915 {
15917 {
15918 velocity.X *= 0.96f;
15919 }
15920 velocity.X += 0.07f;
15922 {
15923 velocity.X = -8f;
15924 }
15925 }
15926 }
15927 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y + 230f)
15928 {
15930 {
15931 velocity.Y *= 0.96f;
15932 }
15933 velocity.Y -= 0.04f;
15935 {
15936 velocity.Y = 3f;
15937 }
15938 }
15939 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y + 230f)
15940 {
15942 {
15943 velocity.Y *= 0.96f;
15944 }
15945 velocity.Y += 0.04f;
15947 {
15948 velocity.Y = -3f;
15949 }
15950 }
15951 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 200f *
this.ai[0])
15952 {
15954 {
15955 velocity.X *= 0.96f;
15956 }
15957 velocity.X -= 0.07f;
15959 {
15960 velocity.X = 8f;
15961 }
15962 }
15963 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 200f *
this.ai[0])
15964 {
15966 {
15967 velocity.X *= 0.96f;
15968 }
15969 velocity.X += 0.07f;
15971 {
15972 velocity.X = -8f;
15973 }
15974 }
15975 }
15977 float num181 = Main.npc[(int)this.
ai[1]].
position.
X + (
float)(Main.npc[(int)this.
ai[1]].
width / 2) - 200f * this.
ai[0] - vector22.
X;
15981 }
15982 else if (this.
ai[2] == 1f)
15983 {
15985 float num184 = Main.npc[(int)this.
ai[1]].
position.
X + (
float)(Main.npc[(int)this.
ai[1]].
width / 2) - 200f * this.
ai[0] - vector23.
X;
15989 velocity.X *= 0.95f;
15990 velocity.Y -= 0.1f;
15991 if (Main.expertMode)
15992 {
15993 velocity.Y -= 0.06f;
15995 {
15996 velocity.Y = -13f;
15997 }
15998 }
16000 {
16001 velocity.Y = -8f;
16002 }
16003 if (
position.
Y < Main.npc[(
int)this.
ai[1]].position.Y - 200f)
16004 {
16015 }
16016 }
16017 else if (this.
ai[2] == 2f)
16018 {
16020 {
16022 }
16023 }
16024 else if (this.
ai[2] == 4f)
16025 {
16027 float num187 = Main.npc[(int)this.
ai[1]].
position.
X + (
float)(Main.npc[(int)this.
ai[1]].
width / 2) - 200f * this.
ai[0] - vector24.
X;
16031 velocity.Y *= 0.95f;
16032 velocity.X += 0.1f * (0f - this.
ai[0]);
16033 if (Main.expertMode)
16034 {
16035 velocity.X += 0.07f * (0f - this.
ai[0]);
16037 {
16038 velocity.X = -12f;
16039 }
16041 {
16042 velocity.X = 12f;
16043 }
16044 }
16046 {
16047 velocity.X = -8f;
16048 }
16050 {
16051 velocity.X = 8f;
16052 }
16053 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)this.
ai[1]].position.X + (float)(Main.npc[(
int)this.
ai[1]].width / 2) - 500f ||
position.
X + (
float)(
width / 2) > Main.npc[(
int)this.
ai[1]].position.X + (float)(Main.npc[(
int)this.
ai[1]].width / 2) + 500f)
16054 {
16065 }
16066 }
16067 else if (this.
ai[2] == 5f && ((
velocity.
X > 0f &&
position.
X + (
float)(
width / 2) > Main.player[
target].position.X + (
float)(Main.player[
target].width / 2)) || (velocity.X < 0f && position.X + (float)(
width / 2) < Main.player[
target].position.X + (float)(Main.player[
target].width / 2))))
16068 {
16070 }
16071 return;
16072 }
16074 {
16075 if (this.
ai[0] < 0f || this.
ai[0] >= (
float)Main.maxTilesX || this.
ai[1] < 0f || this.
ai[1] >= (float)Main.maxTilesX)
16076 {
16077 return;
16078 }
16079 if (Main.tile[(
int)this.
ai[0], (int)this.
ai[1]] ==
null)
16080 {
16081 Main.tile[(int)this.
ai[0], (
int)this.
ai[1]] =
new Tile();
16082 }
16083 if (!Main.tile[(int)this.ai[0], (int)this.ai[1]].active())
16084 {
16088 return;
16089 }
16095 {
16096 num191 = ((!Main.getGoodWorld) ? 250f : 350f);
16097 }
16099 {
16101 }
16103 {
16105 }
16107 {
16110 }
16112 {
16115 }
16116 this.ai[2] += 1f;
16117 if (this.ai[2] > 300f)
16118 {
16120 if (this.ai[2] > 450f)
16121 {
16122 this.ai[2] = 0f;
16123 }
16124 }
16130 {
16134 }
16136 {
16139 {
16140 velocity.X +=
num190 * 1.5f;
16141 }
16142 }
16144 {
16147 {
16148 velocity.X -=
num190 * 1.5f;
16149 }
16150 }
16152 {
16155 {
16156 velocity.Y +=
num190 * 1.5f;
16157 }
16158 }
16160 {
16163 {
16164 velocity.Y -=
num190 * 1.5f;
16165 }
16166 }
16168 {
16169 if (Main.getGoodWorld)
16170 {
16171 if ((double)velocity.X > 3.5)
16172 {
16173 velocity.X = 3.5f;
16174 }
16175 if ((double)velocity.X < -3.5)
16176 {
16177 velocity.X = -3.5f;
16178 }
16179 if ((double)velocity.Y > 3.5)
16180 {
16181 velocity.Y = 3.5f;
16182 }
16183 if ((double)velocity.Y < -3.5)
16184 {
16185 velocity.Y = -3.5f;
16186 }
16187 }
16188 else
16189 {
16191 {
16192 velocity.X = 3f;
16193 }
16195 {
16196 velocity.X = -3f;
16197 }
16199 {
16200 velocity.Y = 3f;
16201 }
16203 {
16204 velocity.Y = -3f;
16205 }
16206 }
16207 }
16208 else if (
type == 175)
16209 {
16211 {
16212 velocity.X = 4f;
16213 }
16215 {
16216 velocity.X = -4f;
16217 }
16219 {
16220 velocity.Y = 4f;
16221 }
16223 {
16224 velocity.Y = -4f;
16225 }
16226 }
16227 else
16228 {
16230 {
16231 velocity.X = 2f;
16232 }
16234 {
16235 velocity.X = -2f;
16236 }
16238 {
16239 velocity.Y = 2f;
16240 }
16242 {
16243 velocity.Y = -2f;
16244 }
16245 }
16247 {
16249 }
16250 else
16251 {
16253 {
16256 }
16258 {
16261 }
16262 }
16264 {
16266 velocity.X = oldVelocity.X * -0.7f;
16268 {
16269 velocity.X = 2f;
16270 }
16272 {
16273 velocity.X = -2f;
16274 }
16275 }
16277 {
16279 velocity.Y = oldVelocity.Y * -0.7f;
16281 {
16282 velocity.Y = 2f;
16283 }
16285 {
16286 velocity.Y = -2f;
16287 }
16288 }
16289 if (Main.netMode == 1)
16290 {
16291 return;
16292 }
16293 if (
type == 101 && !Main.player[
target].DeadOrGhost)
16294 {
16296 {
16298 }
16301 {
16303 {
16306 num192 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector25.X + (
float)Main.rand.Next(-10, 11);
16307 num193 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector25.Y + (
float)Main.rand.Next(-10, 11);
16315 Main.projectile[
num197].timeLeft = 300;
16317 }
16318 else
16319 {
16321 }
16322 }
16323 }
16324 if (
type != 260 || Main.player[
target].DeadOrGhost)
16325 {
16326 return;
16327 }
16329 {
16331 }
16334 {
16335 return;
16336 }
16338 {
16341 num192 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector25.X + (
float)Main.rand.Next(-10, 11);
16344 {
16346 }
16355 Main.npc[
num200].netUpdate =
true;
16357 }
16358 else
16359 {
16361 }
16362 return;
16363 }
16365 {
16368 {
16369 velocity.X = oldVelocity.X * -0.5f;
16371 {
16372 velocity.X = 2f;
16373 }
16375 {
16376 velocity.X = -2f;
16377 }
16378 }
16380 {
16381 velocity.Y = oldVelocity.Y * -0.5f;
16383 {
16384 velocity.Y = 1f;
16385 }
16387 {
16388 velocity.Y = -1f;
16389 }
16390 }
16392 {
16396 {
16398 }
16400 {
16402 }
16405 {
16408 }
16409 }
16410 else
16411 {
16413 }
16415 {
16416 if ((
double)
position.
Y < Main.worldSurface * 16.0 && Main.IsItDay() && !Main.eclipse)
16417 {
16420 }
16422 {
16423 velocity.X -= 0.2f;
16425 {
16426 velocity.X -= 0.1f;
16427 }
16429 {
16430 velocity.X += 0.05f;
16431 }
16433 {
16434 velocity.X = -7f;
16435 }
16436 }
16438 {
16439 velocity.X += 0.2f;
16441 {
16442 velocity.X += 0.1f;
16443 }
16445 {
16446 velocity.X -= 0.05f;
16447 }
16449 {
16450 velocity.X = 7f;
16451 }
16452 }
16454 {
16455 velocity.Y -= 0.2f;
16457 {
16458 velocity.Y -= 0.1f;
16459 }
16461 {
16462 velocity.Y += 0.05f;
16463 }
16465 {
16466 velocity.Y = -7f;
16467 }
16468 }
16470 {
16471 velocity.Y += 0.2f;
16473 {
16474 velocity.Y += 0.1f;
16475 }
16477 {
16478 velocity.Y -= 0.05f;
16479 }
16481 {
16482 velocity.Y = 7f;
16483 }
16484 }
16485 }
16486 else if (
type == 226)
16487 {
16489 {
16490 velocity.X -= 0.2f;
16492 {
16493 velocity.X -= 0.1f;
16494 }
16496 {
16497 velocity.X += 0.05f;
16498 }
16500 {
16501 velocity.X = -4f;
16502 }
16503 }
16505 {
16506 velocity.X += 0.2f;
16508 {
16509 velocity.X += 0.1f;
16510 }
16512 {
16513 velocity.X -= 0.05f;
16514 }
16516 {
16517 velocity.X = 4f;
16518 }
16519 }
16521 {
16522 velocity.Y -= 0.1f;
16524 {
16525 velocity.Y -= 0.05f;
16526 }
16528 {
16529 velocity.Y += 0.03f;
16530 }
16532 {
16533 velocity.Y = -2.5f;
16534 }
16535 }
16537 {
16538 velocity.Y += 0.1f;
16540 {
16541 velocity.Y += 0.05f;
16542 }
16544 {
16545 velocity.Y -= 0.03f;
16546 }
16548 {
16549 velocity.Y = 2.5f;
16550 }
16551 }
16552 }
16553 else if (
type == 660)
16554 {
16561 {
16566 }
16568 {
16571 {
16573 }
16575 {
16576 velocity.X +=
num203 * 0.5f;
16577 }
16579 {
16580 velocity.X = 0f -
num205;
16581 }
16582 }
16584 {
16587 {
16589 }
16591 {
16592 velocity.X -=
num203 * 0.5f;
16593 }
16595 {
16597 }
16598 }
16600 {
16603 {
16605 }
16607 {
16608 velocity.Y +=
num204 * 0.75f;
16609 }
16611 {
16612 velocity.Y = 0f -
num206;
16613 }
16614 }
16616 {
16619 {
16621 }
16623 {
16624 velocity.Y -=
num204 * 0.75f;
16625 }
16627 {
16629 }
16630 }
16631 }
16632 else
16633 {
16635 {
16636 velocity.X -= 0.1f;
16638 {
16639 velocity.X -= 0.1f;
16640 }
16642 {
16643 velocity.X += 0.05f;
16644 }
16646 {
16647 velocity.X = -4f;
16648 }
16649 }
16651 {
16652 velocity.X += 0.1f;
16654 {
16655 velocity.X += 0.1f;
16656 }
16658 {
16659 velocity.X -= 0.05f;
16660 }
16662 {
16663 velocity.X = 4f;
16664 }
16665 }
16667 {
16668 velocity.Y -= 0.04f;
16670 {
16671 velocity.Y -= 0.05f;
16672 }
16674 {
16675 velocity.Y += 0.03f;
16676 }
16678 {
16679 velocity.Y = -1.5f;
16680 }
16681 }
16683 {
16684 velocity.Y += 0.04f;
16686 {
16687 velocity.Y += 0.05f;
16688 }
16690 {
16691 velocity.Y -= 0.03f;
16692 }
16694 {
16695 velocity.Y = 1.5f;
16696 }
16697 }
16698 }
16700 {
16702 {
16704 {
16705 velocity.Y *= 0.95f;
16706 }
16707 velocity.Y -= 0.5f;
16709 {
16710 velocity.Y = -4f;
16711 }
16713 }
16715 {
16717 {
16718 velocity.X -= 0.1f;
16720 {
16721 velocity.X -= 0.07f;
16722 }
16724 {
16725 velocity.X += 0.03f;
16726 }
16728 {
16729 velocity.X = -4f;
16730 }
16731 }
16733 {
16734 velocity.X += 0.1f;
16736 {
16737 velocity.X += 0.07f;
16738 }
16740 {
16741 velocity.X -= 0.03f;
16742 }
16744 {
16745 velocity.X = 4f;
16746 }
16747 }
16749 {
16750 velocity.Y -= 0.04f;
16752 {
16753 velocity.Y -= 0.03f;
16754 }
16756 {
16757 velocity.Y += 0.02f;
16758 }
16760 {
16761 velocity.Y = -1.5f;
16762 }
16763 }
16765 {
16766 velocity.Y += 0.04f;
16768 {
16769 velocity.Y += 0.03f;
16770 }
16772 {
16773 velocity.Y -= 0.02f;
16774 }
16776 {
16777 velocity.Y = 1.5f;
16778 }
16779 }
16780 }
16781 else
16782 {
16784 {
16785 velocity.X -= 0.1f;
16787 {
16788 velocity.X -= 0.1f;
16789 }
16791 {
16792 velocity.X += 0.05f;
16793 }
16795 {
16796 velocity.X = -4f;
16797 }
16798 }
16800 {
16801 velocity.X += 0.1f;
16803 {
16804 velocity.X += 0.1f;
16805 }
16807 {
16808 velocity.X -= 0.05f;
16809 }
16811 {
16812 velocity.X = 4f;
16813 }
16814 }
16816 {
16817 velocity.Y -= 0.04f;
16819 {
16820 velocity.Y -= 0.05f;
16821 }
16823 {
16824 velocity.Y += 0.03f;
16825 }
16827 {
16828 velocity.Y = -1.5f;
16829 }
16830 }
16832 {
16833 velocity.Y += 0.04f;
16835 {
16836 velocity.Y += 0.05f;
16837 }
16839 {
16840 velocity.Y -= 0.03f;
16841 }
16843 {
16844 velocity.Y = 1.5f;
16845 }
16846 }
16847 }
16848 }
16850 {
16852 {
16853 velocity.Y *= 0.95f;
16854 }
16855 velocity.Y -= 0.5f;
16857 {
16858 velocity.Y = -4f;
16859 }
16861 }
16862 if (
type == 158 && Main.netMode != 1)
16863 {
16869 {
16871 }
16872 }
16873 this.ai[1] += 1f;
16875 {
16876 this.ai[1] += 1f;
16877 }
16878 if (this.ai[1] > 200f)
16879 {
16881 {
16882 this.ai[1] = 0f;
16883 }
16889 {
16894 }
16895 if (this.ai[1] > 1000f)
16896 {
16897 this.ai[1] = 0f;
16898 }
16899 this.ai[2] += 1f;
16900 if (this.ai[2] > 0f)
16901 {
16903 {
16905 }
16906 }
16908 {
16910 }
16911 if (this.ai[2] < -150f || this.ai[2] > 150f)
16912 {
16914 {
16916 }
16917 }
16919 {
16921 }
16922 if (this.ai[2] > 300f)
16923 {
16924 this.ai[2] = -300f;
16925 }
16926 }
16927 if (Main.netMode == 1)
16928 {
16929 return;
16930 }
16932 {
16933 this.ai[0] += 1f;
16934 if (this.ai[0] == 30f || this.ai[0] == 60f || this.ai[0] == 90f)
16935 {
16937 {
16940 float num216 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector27.X + (
float)Main.rand.Next(-100, 101);
16941 float num217 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector27.Y + (
float)Main.rand.Next(-100, 101);
16949 Main.projectile[
num221].timeLeft = 300;
16950 }
16951 }
16952 else if (this.ai[0] >= (float)(400 + Main.rand.Next(400)))
16953 {
16954 this.ai[0] = 0f;
16955 }
16956 }
16958 {
16959 this.ai[0] += 1f;
16960 if (this.ai[0] == 20f || this.ai[0] == 40f || this.ai[0] == 60f || this.ai[0] == 80f)
16961 {
16963 {
16966 float num223 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector28.X + (
float)Main.rand.Next(-100, 101);
16967 float num224 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector28.Y + (
float)Main.rand.Next(-100, 101);
16975 Main.projectile[
num228].timeLeft = 300;
16976 }
16977 }
16978 else if (this.ai[0] >= (float)(300 + Main.rand.Next(300)))
16979 {
16980 this.ai[0] = 0f;
16981 }
16982 }
16984 {
16985 return;
16986 }
16987 this.ai[0] += 1f;
16988 if (this.ai[0] == 20f || this.ai[0] == 40f || this.ai[0] == 60f || this.ai[0] == 80f || this.ai[0] == 100f)
16989 {
16991 {
16994 float num230 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector29.X + (
float)Main.rand.Next(-50, 51);
16995 float num231 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector29.Y + (
float)Main.rand.Next(-50, 51);
17004 Main.projectile[
num235].timeLeft = 300;
17005 }
17006 }
17007 else if (this.ai[0] >= (float)(250 + Main.rand.Next(250)))
17008 {
17009 this.ai[0] = 0f;
17010 }
17011 return;
17012 }
17014 {
17017 bool flag6 =
false;
17018 bool flag7 =
false;
17019 bool flag8 =
false;
17021 if (Main.getGoodWorld)
17022 {
17025 }
17027 if (this.ai[3] == 0f &&
life > 0)
17028 {
17030 }
17032 {
17035 if (Main.netMode != 1)
17036 {
17037 this.ai[0] = -100f;
17040 }
17041 }
17044 {
17047 {
17049 if (Main.player[
target].Center.X <
base.Center.X)
17050 {
17052 }
17053 else
17054 {
17056 }
17057 if (Main.netMode != 1 && this.ai[1] != 5f)
17058 {
17060 this.ai[2] = 0f;
17061 this.ai[0] = 0f;
17062 this.ai[1] = 5f;
17063 localAI[1] = Main.maxTilesX * 16;
17064 localAI[2] = Main.maxTilesY * 16;
17065 }
17066 }
17067 }
17069 {
17070 this.ai[2] = 0f;
17071 this.ai[0] = 0f;
17072 this.ai[1] = 5f;
17073 if (Main.netMode != 1)
17074 {
17083 bool flag9 =
false;
17085 {
17087 {
17089 }
17092 }
17094 {
17099 {
17100 continue;
17101 }
17105 {
17107 }
17108 else
17109 {
17111 {
17114 {
17116 break;
17117 }
17118 }
17119 }
17123 {
17125 }
17126 if (
flag10 && !Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
17127 {
17129 }
17131 {
17135 break;
17136 }
17137 }
17139 {
17143 }
17144 }
17145 }
17146 if (!Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0) ||
Math.
Abs(
base.Top.Y - Main.player[
target].Bottom.Y) > 160f)
17147 {
17148 this.ai[2]++;
17149 if (Main.netMode != 1)
17150 {
17152 }
17153 }
17154 else if (Main.netMode != 1)
17155 {
17158 {
17160 }
17161 }
17162 if (
timeLeft < 10 && (this.ai[0] != 0f || this.ai[1] != 0f))
17163 {
17164 this.ai[0] = 0f;
17165 this.ai[1] = 0f;
17168 }
17169 Dust dust;
17170 if (this.ai[1] == 5f)
17171 {
17174 this.ai[0]++;
17177 if (this.ai[0] >= 60f)
17178 {
17180 }
17181 if (this.ai[0] == 60f)
17182 {
17184 }
17185 if (this.ai[0] >= 60f && Main.netMode != 1)
17186 {
17188 this.ai[1] = 6f;
17189 this.ai[0] = 0f;
17191 }
17192 if (Main.netMode == 1 && this.ai[0] >= 120f)
17193 {
17194 this.ai[1] = 6f;
17195 this.ai[0] = 0f;
17196 }
17198 {
17200 {
17201 int num250 = Dust.NewDust(
position +
Vector2.
UnitX * -20f,
width + 40,
height, 4,
velocity.
X,
velocity.
Y, 150,
new Color(78, 136, 255, 80), 2f);
17202 Main.dust[
num250].noGravity =
true;
17203 dust = Main.dust[
num250];
17204 dust.velocity *= 0.5f;
17205 }
17206 }
17207 }
17208 else if (this.ai[1] == 6f)
17209 {
17212 this.ai[0]++;
17215 if (this.ai[0] >= 30f && Main.netMode != 1)
17216 {
17217 this.ai[1] = 0f;
17218 this.ai[0] = 0f;
17221 }
17222 if (Main.netMode == 1 && this.ai[0] >= 60f)
17223 {
17224 this.ai[1] = 0f;
17225 this.ai[0] = 0f;
17227 }
17229 {
17230 int num252 = Dust.NewDust(
position +
Vector2.
UnitX * -20f,
width + 40,
height, 4,
velocity.
X,
velocity.
Y, 150,
new Color(78, 136, 255, 80), 2f);
17231 Main.dust[
num252].noGravity =
true;
17232 dust = Main.dust[
num252];
17233 dust.velocity *= 2f;
17234 }
17235 }
17238 {
17239 velocity.X *= 0.8f;
17240 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
17241 {
17242 velocity.X = 0f;
17243 }
17245 {
17246 this.ai[0] += 2f;
17248 {
17249 this.ai[0] += 1f;
17250 }
17252 {
17253 this.ai[0] += 1f;
17254 }
17256 {
17257 this.ai[0] += 2f;
17258 }
17260 {
17261 this.ai[0] += 3f;
17262 }
17264 {
17265 this.ai[0] += 4f;
17266 }
17267 if (this.ai[0] >= 0f)
17268 {
17271 if (this.ai[1] == 3f)
17272 {
17273 velocity.Y = -13f;
17275 this.ai[0] = -200f;
17276 this.ai[1] = 0f;
17277 }
17278 else if (this.ai[1] == 2f)
17279 {
17280 velocity.Y = -6f;
17282 this.ai[0] = -120f;
17283 this.ai[1] += 1f;
17284 }
17285 else
17286 {
17287 velocity.Y = -8f;
17289 this.ai[0] = -120f;
17290 this.ai[1] += 1f;
17291 }
17292 }
17293 else if (this.ai[0] >= -30f)
17294 {
17296 }
17297 }
17298 }
17300 {
17302 if (Main.getGoodWorld)
17303 {
17305 }
17307 {
17309 {
17311 }
17312 else
17313 {
17314 velocity.X *= 0.93f;
17315 }
17316 }
17317 }
17318 int num254 = Dust.NewDust(
position,
width,
height, 4,
velocity.
X,
velocity.
Y, 255,
new Color(0, 80, 255, 80),
scale * 1.2f);
17319 Main.dust[
num254].noGravity =
true;
17320 dust = Main.dust[
num254];
17321 dust.velocity *= 0.5f;
17323 {
17324 return;
17325 }
17331 {
17332 position.X +=
width / 2;
17337 position.X -=
width / 2;
17339 }
17340 if (Main.netMode == 1)
17341 {
17342 return;
17343 }
17346 {
17347 return;
17348 }
17350 int num257 = Main.rand.Next(1, 4);
17352 {
17356 if (Main.expertMode && Main.rand.Next(4) == 0)
17357 {
17359 }
17362 Main.npc[
num260].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
17363 Main.npc[
num260].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
17364 Main.npc[
num260].ai[0] = -1000 * Main.rand.Next(3);
17365 Main.npc[
num260].ai[1] = 0f;
17366 if (Main.netMode == 2 &&
num260 < 200)
17367 {
17368 NetMessage.SendData(23, -1, -1,
null,
num260);
17369 }
17370 }
17371 return;
17372 }
17374 {
17376 {
17378 }
17380 {
17381 if (this.ai[2] == 0f)
17382 {
17383 int num261 = Main.rand.Next(300, 1200);
17384 if ((this.ai[3] += 1f) >= (
float)
num261)
17385 {
17386 this.ai[2] = Main.rand.Next(1, 3);
17388 {
17389 this.ai[2] = 2f;
17390 }
17391 if (this.ai[2] == 2f)
17392 {
17394 }
17395 this.ai[3] = 0f;
17397 }
17398 }
17399 if (this.ai[2] == 1f)
17400 {
17402 {
17403 this.ai[2] = 0f;
17404 this.ai[3] = 0f;
17406 }
17408 {
17409 velocity.Y -= 0.4f;
17411 {
17412 velocity.Y = -6f;
17413 }
17415 if (
rotation < (
float)Math.PI * -2f / 5f)
17416 {
17418 }
17420 {
17422 }
17423 if (this.ai[3] == 1f)
17424 {
17425 this.ai[2] = 0f;
17426 this.ai[3] = 0f;
17428 }
17429 }
17430 else
17431 {
17433 this.ai[3] = 1f;
17434 velocity.Y += 0.3f;
17436 {
17437 velocity.Y = 10f;
17438 }
17439 }
17440 return;
17441 }
17442 if (this.ai[2] == 2f)
17443 {
17445 {
17446 this.ai[2] = 0f;
17447 this.ai[3] = 0f;
17449 }
17451 {
17452 velocity.Y -= 0.4f;
17454 {
17455 velocity.Y = -6f;
17456 }
17458 if (
rotation < (
float)Math.PI * -2f / 5f)
17459 {
17461 }
17463 {
17465 }
17467 {
17472 velocity.X *= 0.95f;
17473 if (this.ai[3] == 0f)
17474 {
17476 }
17477 this.ai[3]++;
17478 if (this.ai[3] >= 300f)
17479 {
17480 this.ai[2] = 0f;
17481 this.ai[3] = 0f;
17483 velocity.Y = 4f;
17484 }
17485 if (this.ai[3] == 60f && Main.rand.Next(2) == 0)
17486 {
17488 }
17489 }
17490 }
17491 else
17492 {
17493 this.ai[2] = 0f;
17494 this.ai[3] = 0f;
17496 velocity.Y += 0.3f;
17498 {
17499 velocity.Y = 10f;
17500 }
17501 }
17502 return;
17503 }
17504 }
17506 {
17509 {
17512 {
17514 }
17515 }
17519 {
17521 {
17524 }
17525 else
17526 {
17529 }
17530 }
17532 {
17534 {
17537 }
17538 else
17539 {
17542 }
17543 }
17545 {
17547 {
17548 velocity.X *= -1f;
17551 }
17553 {
17556 {
17559 this.ai[0] = -1f;
17560 }
17562 {
17565 this.ai[0] = 1f;
17566 }
17567 }
17568 }
17570 {
17571 Lighting.AddLight((
int)(position.X + (float)(
width / 2) + (float)(
direction * (
width + 8))) / 16, (int)(
position.
Y + 2f) / 16, 0.07f, 0.04f, 0.025f);
17572 }
17574 {
17577 {
17579 {
17580 velocity.X *= 0.95f;
17581 }
17583 {
17584 velocity.X *= 0.95f;
17585 }
17586 velocity.X += (float)
direction * 0.25f;
17589 {
17590 velocity.X = 7f;
17591 }
17593 {
17594 velocity.X = -7f;
17595 }
17597 {
17598 velocity.Y = 4f;
17599 }
17601 {
17602 velocity.Y = -4f;
17603 }
17604 }
17605 else if (
type == 65 ||
type == 102)
17606 {
17607 velocity.X += (float)
direction * 0.15f;
17610 {
17611 velocity.X = 5f;
17612 }
17614 {
17615 velocity.X = -5f;
17616 }
17618 {
17619 velocity.Y = 3f;
17620 }
17622 {
17623 velocity.Y = -3f;
17624 }
17625 }
17626 else
17627 {
17631 {
17632 velocity.X = 3f;
17633 }
17635 {
17636 velocity.X = -3f;
17637 }
17639 {
17640 velocity.Y = 2f;
17641 }
17643 {
17644 velocity.Y = -2f;
17645 }
17646 }
17647 }
17648 else
17649 {
17651 {
17653 {
17655 }
17656 else
17657 {
17659 }
17662 {
17663 velocity.X *= 0.95f;
17664 }
17665 if (this.ai[0] == -1f)
17666 {
17669 {
17671 }
17673 {
17675 }
17676 velocity.Y -= 0.02f;
17678 {
17679 this.ai[0] = 1f;
17680 }
17681 }
17682 else
17683 {
17686 {
17688 }
17690 {
17692 }
17693 velocity.Y += 0.02f;
17695 {
17696 this.ai[0] = -1f;
17697 }
17698 }
17699 }
17700 else
17701 {
17705 {
17707 }
17709 {
17710 velocity.X *= 0.95f;
17711 }
17712 if (this.ai[0] == -1f)
17713 {
17714 velocity.Y -= 0.01f;
17715 if ((double)velocity.Y < -0.3)
17716 {
17717 this.ai[0] = 1f;
17718 }
17719 }
17720 else
17721 {
17722 velocity.Y += 0.01f;
17723 if ((double)velocity.Y > 0.3)
17724 {
17725 this.ai[0] = -1f;
17726 }
17727 }
17728 }
17732 {
17734 }
17736 {
17738 }
17740 {
17742 }
17744 {
17746 {
17747 this.ai[0] = -1f;
17748 }
17750 {
17751 this.ai[0] = -1f;
17752 }
17753 }
17755 {
17756 velocity.Y *= 0.95f;
17757 }
17758 }
17759 }
17760 else
17761 {
17763 {
17765 {
17766 velocity.X *= 0.94f;
17768 {
17769 velocity.X = 0f;
17770 }
17771 }
17772 else if (Main.netMode != 1)
17773 {
17774 velocity.Y = (float)Main.rand.Next(-50, -20) * 0.1f;
17775 velocity.X = (float)Main.rand.Next(-20, 20) * 0.1f;
17777 }
17778 }
17779 velocity.Y += 0.3f;
17781 {
17782 velocity.Y = 10f;
17783 }
17784 this.ai[0] = 1f;
17785 }
17788 {
17790 }
17792 {
17794 }
17795 return;
17796 }
17798 {
17800 if (this.ai[0] == 0f)
17801 {
17804 if (Main.netMode != 1)
17805 {
17807 {
17808 this.ai[0] = 1f;
17810 }
17811 else
17812 {
17815 {
17816 this.ai[0] = 1f;
17817 velocity.Y -= 6f;
17819 }
17820 }
17821 }
17822 }
17823 else if (!Main.player[
target].dead)
17824 {
17826 {
17827 velocity.X = oldVelocity.X * -0.5f;
17829 {
17830 velocity.X = 2f;
17831 }
17833 {
17834 velocity.X = -2f;
17835 }
17836 }
17838 {
17839 velocity.Y = oldVelocity.Y * -0.5f;
17841 {
17842 velocity.Y = 1f;
17843 }
17845 {
17846 velocity.Y = -1f;
17847 }
17848 }
17851 {
17852 velocity.X -= 0.1f;
17854 {
17855 velocity.X -= 0.1f;
17856 }
17858 {
17859 velocity.X -= 0.05f;
17860 }
17862 {
17863 velocity.X = -3f;
17864 }
17865 }
17867 {
17868 velocity.X += 0.1f;
17870 {
17871 velocity.X += 0.1f;
17872 }
17874 {
17875 velocity.X += 0.05f;
17876 }
17878 {
17879 velocity.X = 3f;
17880 }
17881 }
17885 {
17887 }
17889 {
17890 velocity.Y += 0.05f;
17892 {
17893 velocity.Y += 0.01f;
17894 }
17895 }
17896 else
17897 {
17898 velocity.Y -= 0.05f;
17900 {
17901 velocity.Y -= 0.01f;
17902 }
17903 }
17905 {
17906 velocity.Y = -3f;
17907 }
17909 {
17910 velocity.Y = 3f;
17911 }
17912 }
17914 {
17916 {
17917 velocity.Y *= 0.95f;
17918 }
17919 velocity.Y -= 0.5f;
17921 {
17922 velocity.Y = -4f;
17923 }
17925 }
17926 return;
17927 }
17929 {
17931 if (
wet && this.ai[1] == 1f)
17932 {
17934 }
17935 else
17936 {
17938 }
17939 if (Main.expertMode && (
type == 63 ||
type == 64 ||
type == 103 ||
type == 242))
17940 {
17942 {
17944 {
17945 if (this.ai[1] == 0f)
17946 {
17947 this.ai[2] += 2f;
17948 }
17949 else
17950 {
17951 this.ai[2] -= 0.25f;
17952 }
17953 }
17955 {
17957 this.ai[2] += 1f;
17958 if (this.ai[2] >= 120f)
17959 {
17960 this.ai[1] = 0f;
17961 }
17962 }
17963 else
17964 {
17965 this.ai[2] += 1f;
17966 if (this.ai[2] >= 420f)
17967 {
17968 this.ai[1] = 1f;
17969 this.ai[2] = 0f;
17970 }
17971 }
17972 }
17973 else
17974 {
17975 this.ai[1] = 0f;
17976 this.ai[2] = 0f;
17977 }
17978 }
17981 {
17983 }
17985 {
17987 }
17988 else if (
type == 103)
17989 {
17991 }
17992 else if (
type != 221 &&
type != 242)
17993 {
17995 }
17997 {
17999 }
18001 {
18002 return;
18003 }
18005 {
18009 {
18011 {
18014 }
18015 else
18016 {
18019 }
18020 }
18022 {
18024 {
18027 }
18028 else
18029 {
18032 }
18033 }
18035 {
18036 velocity.X *= -1f;
18038 }
18040 {
18042 {
18045 this.ai[0] = -1f;
18046 }
18048 {
18051 this.ai[0] = 1f;
18052 }
18053 }
18056 {
18059 {
18061 }
18062 }
18064 {
18070 {
18073 }
18075 {
18078 }
18080 {
18083 }
18085 {
18087 {
18089 }
18093 {
18095 }
18105 }
18106 return;
18107 }
18109 velocity.X += (float)
direction * 0.02f;
18112 {
18113 velocity.X *= 0.95f;
18114 }
18115 if (this.ai[0] == -1f)
18116 {
18117 velocity.Y -= 0.01f;
18119 {
18120 this.ai[0] = 1f;
18121 }
18122 }
18123 else
18124 {
18125 velocity.Y += 0.01f;
18127 {
18128 this.ai[0] = -1f;
18129 }
18130 }
18134 {
18136 }
18138 {
18140 }
18142 {
18144 }
18146 {
18148 {
18149 this.ai[0] = -1f;
18150 }
18152 {
18153 this.ai[0] = -1f;
18154 }
18155 }
18156 else
18157 {
18158 this.ai[0] = 1f;
18159 }
18161 {
18162 velocity.Y *= 0.99f;
18163 }
18164 return;
18165 }
18168 {
18169 velocity.X *= 0.98f;
18171 {
18172 velocity.X = 0f;
18173 }
18174 }
18175 velocity.Y += 0.2f;
18177 {
18178 velocity.Y = 10f;
18179 }
18180 this.ai[0] = 1f;
18181 return;
18182 }
18184 {
18196 {
18200 {
18202 }
18204 {
18206 }
18208 {
18209 velocity.X *= 0.9f;
18211 {
18213 velocity.X = 0f;
18214 }
18215 }
18216 }
18217 if (this.ai[0] > 0f)
18218 {
18219 if (this.ai[0] == 200f)
18220 {
18222 }
18223 this.ai[0] -= 1f;
18224 }
18226 {
18227 this.ai[0] = 200f;
18231 Main.projectile[
num287].ai[0] = 2f;
18232 Main.projectile[
num287].timeLeft = 300;
18233 Main.projectile[
num287].friendly =
false;
18234 NetMessage.SendData(27, -1, -1,
null,
num287);
18236 }
18237 try
18238 {
18245 {
18247 }
18249 {
18251 }
18253 {
18255 }
18257 {
18259 }
18261 {
18264 velocity.Y = -0.2f;
18265 return;
18266 }
18269 if (Main.rand.Next(2) == 0)
18270 {
18273 Main.dust[
num292].velocity.X *= 0.4f;
18274 Main.dust[
num292].velocity.Y *= -1f;
18275 if (Main.rand.Next(2) == 0)
18276 {
18277 Main.dust[
num292].noGravity =
true;
18278 Dust dust = Main.dust[
num292];
18279 dust.scale += 0.2f;
18280 }
18282 }
18283 return;
18284 }
18285 catch
18286 {
18287 return;
18288 }
18289 }
18291 {
18292 if (this.ai[0] == 0f)
18293 {
18294 if (Main.netMode != 1)
18295 {
18299 position.Y +=
height / 2 + 8;
18300 this.ai[1] = position.X + (float)(
width / 2);
18301 this.ai[2] = position.Y + (float)(
height / 2);
18303 {
18305 }
18307 {
18309 }
18310 this.ai[3] = 1f + (float)Main.rand.Next(15) * 0.1f;
18311 velocity.Y = (float)(
directionY * 6) * this.ai[3];
18312 this.ai[0] += 1f;
18314 }
18315 else
18316 {
18317 this.ai[1] = position.X + (float)(
width / 2);
18318 this.ai[2] = position.Y + (float)(
height / 2);
18319 }
18320 return;
18321 }
18322 float num293 = 6f * this.ai[3];
18323 float num294 = 0.2f * this.ai[3];
18325 if (this.ai[0] >= 1f && this.ai[0] < (
float)(
int)
num295)
18326 {
18328 this.ai[0] += 1f;
18329 return;
18330 }
18331 if (this.ai[0] >= (
float)(int)
num295)
18332 {
18333 velocity.Y = 0f;
18336 this.ai[0] = -1f;
18337 return;
18338 }
18340 {
18342 {
18345 }
18346 }
18348 {
18350 velocity.Y = 0f -
num293;
18351 }
18353 {
18355 {
18358 }
18359 }
18361 {
18363 velocity.X = 0f -
num293;
18364 }
18367 }
18369 {
18370 if (this.ai[0] == 0f)
18371 {
18374 this.ai[0] = 1f;
18375 }
18377 if (this.ai[1] == 0f)
18378 {
18381 {
18382 this.ai[0] = 2f;
18383 }
18384 if (!
collideY && this.ai[0] == 2f)
18385 {
18387 this.ai[1] = 1f;
18388 this.ai[0] = 1f;
18389 }
18391 {
18393 this.ai[1] = 1f;
18394 }
18395 }
18396 else
18397 {
18400 {
18401 this.ai[0] = 2f;
18402 }
18403 if (!
collideX && this.ai[0] == 2f)
18404 {
18406 this.ai[1] = 0f;
18407 this.ai[0] = 1f;
18408 }
18410 {
18412 this.ai[1] = 0f;
18413 }
18414 }
18417 float num297 = (float)(270 - Main.mouseTextColor) / 400f;
18418 Lighting.AddLight((
int)(position.X + (float)(
width / 2)) / 16, (
int)(position.Y + (float)(
height / 2)) / 16, 0.9f, 0.3f +
num297, 0.2f);
18419 }
18421 {
18423 bool flag17 =
type == 330 && !Main.pumpkinMoon;
18424 if (
type == 253 && !Main.eclipse)
18425 {
18427 }
18428 if (
type == 490 && Main.dayTime)
18429 {
18431 }
18433 {
18434 this.ai[2] = 0f;
18435 }
18437 {
18440 {
18444 }
18445 }
18447 {
18449 {
18450 velocity.X = (float)Main.rand.Next(-1, 2) * 1.5f;
18452 }
18453 }
18454 else if (this.ai[2] >= 0f)
18455 {
18460 {
18462 }
18464 {
18466 }
18469 {
18471 }
18473 {
18474 this.ai[2] += 1f;
18475 if (this.ai[2] >= 30f &&
num298 == 16)
18476 {
18478 }
18479 if (this.ai[2] >= 60f)
18480 {
18481 this.ai[2] = -200f;
18483 velocity.X *= -1f;
18485 }
18486 }
18487 else
18488 {
18491 this.ai[2] = 0f;
18492 }
18494 }
18495 else if (
type == 253)
18496 {
18498 this.ai[2] += 2f;
18499 }
18500 else
18501 {
18503 {
18504 this.ai[2] += 0.1f;
18505 }
18506 else
18507 {
18508 this.ai[2] += 1f;
18509 }
18511 {
18513 }
18514 else
18515 {
18517 }
18518 }
18525 {
18527 {
18528 this.ai[3] = 0f;
18530 }
18531 if (Main.netMode != 1 &&
this.ai[3] == 32f && !Main.player[
target].npcTypeNoAggro[
type])
18532 {
18549 }
18551 if (this.ai[3] > 0f)
18552 {
18553 this.ai[3] += 1f;
18554 if (this.ai[3] >= 64f)
18555 {
18556 this.ai[3] = 0f;
18557 }
18558 }
18559 if (Main.netMode != 1 && this.ai[3] == 0f)
18560 {
18563 {
18565 this.ai[3] = 1f;
18567 }
18568 }
18569 }
18570 else if (
type == 75)
18571 {
18574 if (Main.rand.Next(6) == 0)
18575 {
18577 Dust dust = Main.dust[
num311];
18578 dust.velocity *= 0.3f;
18579 }
18580 if (Main.rand.Next(40) == 0)
18581 {
18583 }
18585 }
18586 else if (
type == 169)
18587 {
18591 if (Main.rand.Next(3) == 0)
18592 {
18594 Dust dust = Main.dust[
num312];
18595 dust.velocity *= 0.3f;
18596 Main.dust[
num312].noGravity =
true;
18597 }
18600 {
18601 this.ai[3] = 0f;
18603 }
18614 {
18616 }
18617 else
18618 {
18620 }
18623 {
18625 }
18626 else
18627 {
18629 }
18630 if (Main.netMode != 1 && this.ai[3] == 16f)
18631 {
18635 }
18637 if (this.ai[3] > 0f)
18638 {
18639 this.ai[3] += 1f;
18640 if (this.ai[3] >= 64f)
18641 {
18642 this.ai[3] = 0f;
18643 }
18644 }
18645 if (Main.netMode != 1 && this.ai[3] == 0f)
18646 {
18649 {
18651 this.ai[3] = 1f;
18653 }
18654 }
18655 }
18656 else if (
type == 268)
18657 {
18660 if (Main.netMode != 1 && !
confused)
18661 {
18662 this.ai[3] += 1f;
18664 {
18665 this.ai[3] = -45f;
18667 }
18668 if (Main.netMode != 1 && this.ai[3] >= (float)(60 + Main.rand.Next(60)))
18669 {
18670 this.ai[3] = 0f;
18672 {
18678 num322 += (float)Main.rand.Next(-10, 11);
18679 num324 += (float)Main.rand.Next(-30, 21);
18688 }
18689 }
18690 }
18691 }
18693 {
18696 {
18700 {
18702 }
18704 }
18705 }
18707 {
18709 {
18711 }
18712 else
18713 {
18715 {
18717 {
18719 }
18721 {
18723 {
18725 }
18727 break;
18728 }
18729 }
18730 }
18731 }
18732 if (Main.player[
target].npcTypeNoAggro[
type])
18733 {
18736 {
18738 {
18740 }
18742 {
18744 break;
18745 }
18746 }
18748 }
18750 {
18752 {
18754 {
18756 }
18758 {
18761 break;
18762 }
18763 }
18764 }
18766 {
18770 {
18771 velocity.Y += 2f;
18772 }
18773 }
18775 {
18777 {
18778 velocity.Y += 0.2f;
18780 {
18781 velocity.Y = 2f;
18782 }
18783 }
18784 else if (
type == 490)
18785 {
18786 velocity.Y += 0.03f;
18788 {
18789 velocity.Y = 0.75f;
18790 }
18791 }
18792 else
18793 {
18794 velocity.Y += 0.1f;
18796 {
18797 velocity.Y -= 0.05f;
18799 {
18800 velocity.Y = 6f;
18801 }
18802 }
18804 {
18805 velocity.Y = 3f;
18806 }
18807 }
18808 }
18809 else
18810 {
18812 {
18814 {
18815 velocity.Y -= 0.2f;
18816 }
18817 }
18818 else if (
type == 490)
18819 {
18821 {
18822 velocity.Y -= 0.075f;
18823 }
18825 {
18826 velocity.Y = -0.75f;
18827 }
18828 }
18830 {
18831 velocity.Y -= 0.1f;
18832 }
18834 {
18835 velocity.Y = -4f;
18836 }
18837 }
18839 {
18840 velocity.Y -= 0.2f;
18842 {
18843 velocity.Y = -2f;
18844 }
18845 }
18847 {
18848 velocity.X = oldVelocity.X * -0.4f;
18850 {
18851 velocity.X = 1f;
18852 }
18854 {
18855 velocity.X = -1f;
18856 }
18857 }
18859 {
18860 velocity.Y = oldVelocity.Y * -0.25f;
18862 {
18863 velocity.Y = 1f;
18864 }
18866 {
18867 velocity.Y = -1f;
18868 }
18869 }
18872 {
18874 }
18876 {
18878 }
18880 {
18882 }
18884 {
18888 {
18890 }
18891 else
18892 {
18894 }
18896 {
18897 velocity.X *= 0.9f;
18898 }
18900 {
18901 velocity.X *= 0.9f;
18902 }
18903 }
18905 {
18906 velocity.X -= 0.1f;
18908 {
18909 velocity.X -= 0.1f;
18910 }
18912 {
18913 velocity.X += 0.05f;
18914 }
18916 {
18917 velocity.X = 0f -
num334;
18918 }
18919 }
18921 {
18922 velocity.X += 0.1f;
18924 {
18925 velocity.X += 0.1f;
18926 }
18928 {
18929 velocity.X -= 0.05f;
18930 }
18932 {
18934 }
18935 }
18938 {
18939 velocity.Y -= 0.04f;
18941 {
18942 velocity.Y -= 0.05f;
18943 }
18945 {
18946 velocity.Y += 0.03f;
18947 }
18949 {
18950 velocity.Y = 0f -
num334;
18951 }
18952 }
18954 {
18955 velocity.Y += 0.04f;
18957 {
18958 velocity.Y += 0.05f;
18959 }
18961 {
18962 velocity.Y -= 0.03f;
18963 }
18965 {
18967 }
18968 }
18970 {
18972 }
18973 }
18975 {
18979 {
18981 }
18982 else if (
type == 179)
18983 {
18985 }
18986 else
18987 {
18989 }
18991 {
18993 }
18994 if (this.ai[0] == 0f)
18995 {
19008 this.ai[0] = 1f;
19009 this.ai[1] = 0f;
19011 }
19012 else if (this.ai[0] == 1f)
19013 {
19015 {
19016 this.ai[0] = 2f;
19017 this.ai[1] = 0f;
19018 }
19020 this.ai[1] += 1f;
19021 if (this.ai[1] >= 100f)
19022 {
19024 this.ai[0] = 2f;
19025 this.ai[1] = 0f;
19026 velocity.X = 0f;
19027 velocity.Y = 0f;
19028 }
19029 else
19030 {
19032 }
19033 }
19034 else
19035 {
19037 {
19038 this.ai[0] = 2f;
19039 this.ai[1] = 0f;
19040 }
19042 this.ai[1] += 1f;
19043 float num340 = this.ai[1] / 120f;
19046 if (this.ai[1] >= 120f)
19047 {
19049 this.ai[0] = 0f;
19050 this.ai[1] = 0f;
19051 }
19052 }
19053 }
19055 {
19058 {
19060 {
19062 this.ai[0] = 1f;
19065 }
19066 else if (this.ai[0] == 1f && Main.cloudAlpha == 0f && !Main.dayTime)
19067 {
19069 {
19071 {
19072 continue;
19073 }
19074 if (Main.npc[
num341].townNPC)
19075 {
19077 {
19080 {
19081 this.ai[0] = 2f;
19082 }
19083 }
19084 }
19086 {
19087 this.ai[0] = 1f;
19088 break;
19089 }
19090 }
19091 }
19092 }
19093 if (this.ai[0] == 0f)
19094 {
19096 if (
type == 611 && (Main.cloudAlpha > 0f || Main.dayTime))
19097 {
19098 this.ai[0] = 1f;
19099 }
19101 if (Main.netMode != 1)
19102 {
19104 {
19105 this.ai[0] = 1f;
19108 }
19109 else if (
type != 611)
19110 {
19113 {
19114 this.ai[0] = 1f;
19115 velocity.Y -= 6f;
19118 }
19119 }
19120 }
19121 }
19122 else if (this.ai[0] == 2f)
19123 {
19124 velocity.X *= 0.98f;
19126 {
19127 this.ai[0] = 0f;
19128 velocity.X = 0f;
19129 }
19130 velocity.Y += 0.05f;
19132 {
19133 velocity.Y = 2f;
19134 }
19135 }
19136 else if (!Main.player[
target].dead)
19137 {
19140 {
19142 }
19144 {
19146 velocity.X = oldVelocity.X * -0.5f;
19148 {
19149 velocity.X =
num343 - 1f;
19150 }
19152 {
19153 velocity.X = 0f -
num343 + 1f;
19154 }
19155 }
19157 {
19158 velocity.Y = oldVelocity.Y * -0.5f;
19160 {
19161 velocity.Y = 1f;
19162 }
19164 {
19165 velocity.Y = -1f;
19166 }
19167 }
19169 {
19170 velocity.X -= 0.1f;
19172 {
19173 velocity.X -= 0.1f;
19174 }
19176 {
19177 velocity.X -= 0.05f;
19178 }
19180 {
19181 velocity.X = 0f -
num343;
19182 }
19183 }
19185 {
19186 velocity.X += 0.1f;
19188 {
19189 velocity.X += 0.1f;
19190 }
19192 {
19193 velocity.X += 0.05f;
19194 }
19196 {
19198 }
19199 }
19206 {
19208 {
19209 continue;
19210 }
19212 {
19214 }
19216 {
19218 {
19220 }
19222 break;
19223 }
19224 }
19226 {
19227 velocity.Y += 0.05f;
19228 }
19229 else
19230 {
19231 velocity.Y -= 0.1f;
19232 }
19234 {
19235 velocity.Y -= 0.2f;
19236 }
19238 {
19239 velocity.Y = 2f;
19240 }
19242 {
19243 velocity.Y = -4f;
19244 }
19245 }
19247 {
19248 this.ai[1] = 0f;
19250 {
19251 velocity.Y *= 0.95f;
19252 }
19253 velocity.Y -= 0.5f;
19255 {
19256 velocity.Y = -4f;
19257 }
19259 }
19260 }
19262 {
19263 bool flag25 =
type == 341 && !Main.snowMoon;
19264 if (this.ai[3] == 0f)
19265 {
19266 position.X += 8f;
19267 if (
position.
Y / 16f > (
float)Main.UnderworldLayer)
19268 {
19269 this.ai[3] = 3f;
19270 }
19271 else if ((
double)(
position.
Y / 16f) > Main.worldSurface)
19272 {
19274 this.ai[3] = 2f;
19275 }
19276 else
19277 {
19278 this.ai[3] = 1f;
19279 }
19280 }
19282 {
19283 this.ai[3] = 1f;
19284 }
19285 if (this.ai[0] == 0f)
19286 {
19288 {
19290 }
19291 if (Main.netMode == 1)
19292 {
19293 return;
19294 }
19296 {
19297 this.ai[0] = 1f;
19299 return;
19300 }
19303 {
19304 this.ai[0] = 1f;
19306 }
19307 }
19309 {
19310 this.ai[2] += 1f;
19312 if (this.ai[1] == 0f)
19313 {
19315 }
19316 if (this.ai[2] < (
float)
num348)
19317 {
19318 velocity.X *= 0.9f;
19319 return;
19320 }
19321 this.ai[2] = 0f;
19323 {
19325 }
19327 {
19329 }
19331 this.ai[1] += 1f;
19332 if (this.ai[1] == 2f)
19333 {
19335 velocity.Y = -8f;
19336 this.ai[1] = 0f;
19337 }
19338 else
19339 {
19341 velocity.Y = -4f;
19342 }
19344 }
19346 {
19347 velocity.X += 0.1f;
19348 }
19350 {
19351 velocity.X -= 0.1f;
19352 }
19353 }
19355 {
19357 }
19359 {
19361 {
19363 }
19365 {
19367 Main.wofDrawAreaBottom = -1;
19368 Main.wofDrawAreaTop = -1;
19369 }
19370 if (Main.getGoodWorld && Main.netMode != 1 && Main.rand.Next(180) == 0 &&
CountNPCS(24) < 4)
19371 {
19374 {
19377 {
19381 {
19384 }
19385 num353 += Main.rand.Next(-50, 51);
19387 {
19388 }
19391 {
19393 if (Main.netMode == 2 &&
num355 < 200)
19394 {
19395 NetMessage.SendData(23, -1, -1,
null,
num355);
19396 }
19397 break;
19398 }
19399 }
19400 }
19401 }
19402 this.ai[1] += 1f;
19403 if (this.ai[2] == 0f)
19404 {
19406 {
19407 this.ai[1] += 1f;
19408 }
19410 {
19411 this.ai[1] += 1f;
19412 }
19413 if (this.ai[1] > 2700f)
19414 {
19415 this.ai[2] = 1f;
19416 }
19417 }
19419 if (this.ai[2] > 0f && this.ai[1] > (
float)
num356)
19420 {
19423 {
19425 }
19426 this.ai[2] += 1f;
19427 this.ai[1] = 0f;
19428 if (this.ai[2] > (
float)
num357)
19429 {
19430 this.ai[2] = 0f;
19431 }
19432 if (Main.netMode != 1 &&
CountNPCS(117) < 10)
19433 {
19436 }
19437 }
19439 if (
localAI[3] >= (
float)(600 + Main.rand.Next(1000)))
19440 {
19441 localAI[3] = -Main.rand.Next(200);
19443 }
19444 int num359 = Main.UnderworldLayer + 10;
19446 Main.wofNPCIndex =
whoAmI;
19453 {
19455 if (
num365 > Main.maxTilesY - 10)
19456 {
19457 num365 = Main.maxTilesY - 10;
19458 break;
19459 }
19461 {
19462 continue;
19463 }
19465 {
19466 try
19467 {
19469 {
19471 }
19472 }
19473 catch
19474 {
19476 }
19477 }
19478 }
19480 if (Main.wofDrawAreaBottom == -1)
19481 {
19482 Main.wofDrawAreaBottom =
num365 * 16;
19483 }
19484 else if (Main.wofDrawAreaBottom >
num365 * 16)
19485 {
19486 Main.wofDrawAreaBottom--;
19487 if (Main.wofDrawAreaBottom <
num365 * 16)
19488 {
19489 Main.wofDrawAreaBottom =
num365 * 16;
19490 }
19491 }
19492 else if (Main.wofDrawAreaBottom <
num365 * 16)
19493 {
19494 Main.wofDrawAreaBottom++;
19495 if (Main.wofDrawAreaBottom >
num365 * 16)
19496 {
19497 Main.wofDrawAreaBottom =
num365 * 16;
19498 }
19499 }
19503 {
19506 {
19508 break;
19509 }
19511 {
19512 continue;
19513 }
19515 {
19517 break;
19518 }
19520 {
19521 try
19522 {
19524 {
19526 }
19527 }
19528 catch
19529 {
19531 }
19532 }
19533 }
19535 if (Main.wofDrawAreaTop == -1)
19536 {
19537 Main.wofDrawAreaTop =
num365 * 16;
19538 }
19539 else if (Main.wofDrawAreaTop >
num365 * 16)
19540 {
19541 Main.wofDrawAreaTop--;
19542 if (Main.wofDrawAreaTop <
num365 * 16)
19543 {
19544 Main.wofDrawAreaTop =
num365 * 16;
19545 }
19546 }
19547 else if (Main.wofDrawAreaTop <
num365 * 16)
19548 {
19549 Main.wofDrawAreaTop++;
19550 if (Main.wofDrawAreaTop >
num365 * 16)
19551 {
19552 Main.wofDrawAreaTop =
num365 * 16;
19553 }
19554 }
19557 if (Main.wofDrawAreaTop > Main.wofDrawAreaBottom - 160)
19558 {
19559 Main.wofDrawAreaTop = Main.wofDrawAreaBottom - 160;
19560 }
19561 else if (Main.wofDrawAreaBottom < Main.wofDrawAreaTop + 160)
19562 {
19563 Main.wofDrawAreaBottom = Main.wofDrawAreaTop + 160;
19564 }
19565 float num368 = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2 -
height / 2;
19567 {
19568 velocity.Y = -1f;
19569 }
19571 {
19572 velocity.Y = 1f;
19573 }
19574 velocity.Y = 0f;
19578 {
19580 }
19582 {
19584 }
19586 {
19588 }
19590 {
19592 }
19593 if ((
double)
life < (double)
lifeMax * 0.66 && Main.expertMode)
19594 {
19596 }
19597 if ((
double)
life < (double)
lifeMax * 0.33 && Main.expertMode)
19598 {
19600 }
19601 if ((
double)
life < (double)
lifeMax * 0.05 && Main.expertMode)
19602 {
19604 }
19605 if ((
double)
life < (double)
lifeMax * 0.035 && Main.expertMode)
19606 {
19608 }
19609 if ((
double)
life < (double)
lifeMax * 0.025 && Main.expertMode)
19610 {
19612 }
19613 if (Main.expertMode)
19614 {
19617 }
19618 if (Main.getGoodWorld)
19619 {
19622 }
19624 {
19626 if (Main.player[
target].dead)
19627 {
19628 float num370 =
float.PositiveInfinity;
19631 {
19633 if (player.active)
19634 {
19637 {
19639 num371 = ((base.Center.X < player.Center.X) ? 1 : (-1));
19640 }
19641 }
19642 }
19644 }
19646 }
19648 {
19649 velocity.X = 0f -
num369;
19651 }
19652 else
19653 {
19656 }
19657 if (Main.player[
target].dead || !Main.player[
target].gross)
19658 {
19660 }
19661 if (Main.player[
target].dead)
19662 {
19665 {
19669 if (Main.netMode != 1)
19670 {
19671 NetMessage.SendData(28, -1, -1,
null,
whoAmI, -1f);
19672 }
19673 return;
19674 }
19675 }
19676 else
19677 {
19679 }
19689 {
19691 {
19693 }
19694 else
19695 {
19697 }
19698 }
19700 {
19702 }
19703 else
19704 {
19706 }
19707 if (Main.expertMode && Main.netMode != 1)
19708 {
19712 {
19714 }
19716 {
19718 }
19720 {
19722 }
19724 if (Main.rand.Next(
num378) == 0)
19725 {
19727 float[]
array =
new float[10];
19729 {
19731 {
19734 }
19735 }
19738 {
19741 {
19742 int num383 = Main.rand.Next(10);
19746 {
19748 {
19750 break;
19751 }
19752 }
19754 {
19756 break;
19757 }
19758 }
19760 {
19762 }
19763 }
19764 }
19765 }
19766 if (Main.netMode != 1 &&
localAI[0] == 1f)
19767 {
19769 float num386 = (base.Center.Y + (float)Main.wofDrawAreaTop) / 2f;
19771 float num388 = (base.Center.Y + (float)Main.wofDrawAreaBottom) / 2f;
19773 float num389 = (base.Center.Y + (float)Main.wofDrawAreaBottom) / 2f;
19775 {
19777 }
19778 }
19779 }
19781 {
19782 if (Main.wofNPCIndex < 0)
19783 {
19785 return;
19786 }
19788 if (Main.npc[Main.wofNPCIndex].life > 0)
19789 {
19790 life = Main.npc[Main.wofNPCIndex].life;
19791 }
19793 position.X = Main.npc[Main.wofNPCIndex].position.X;
19794 direction = Main.npc[Main.wofNPCIndex].direction;
19796 float num391 = (Main.wofDrawAreaBottom + Main.wofDrawAreaTop) / 2;
19797 num391 = ((!(this.ai[0] > 0f)) ? ((
num391 + (float)Main.wofDrawAreaBottom) / 2f) : ((
num391 + (float)Main.wofDrawAreaTop) / 2f));
19800 {
19801 velocity.Y = -1f;
19802 }
19804 {
19805 velocity.Y = 1f;
19806 }
19807 else
19808 {
19809 velocity.Y = 0f;
19811 }
19813 {
19814 velocity.Y = 5f;
19815 }
19817 {
19818 velocity.Y = -5f;
19819 }
19829 {
19831 {
19833 }
19834 else
19835 {
19838 }
19839 }
19841 {
19843 }
19844 else
19845 {
19848 }
19849 if (Main.netMode == 1)
19850 {
19851 return;
19852 }
19855 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.75)
19856 {
19859 }
19860 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5)
19861 {
19864 }
19865 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.25)
19866 {
19869 }
19870 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.1)
19871 {
19874 }
19875 if (Main.expertMode)
19876 {
19879 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.1)
19880 {
19883 }
19884 }
19886 {
19888 {
19891 }
19892 }
19893 else
19894 {
19896 {
19897 return;
19898 }
19902 {
19904 }
19906 {
19910 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5)
19911 {
19914 }
19915 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.25)
19916 {
19919 }
19920 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.1)
19921 {
19924 }
19935 }
19936 }
19937 }
19939 {
19941 {
19942 this.ai[1] = 10f;
19943 }
19944 if (Main.wofNPCIndex < 0)
19945 {
19947 return;
19948 }
19954 if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5)
19955 {
19958 if (!Main.expertMode)
19959 {
19961 }
19962 else
19963 {
19965 }
19966 }
19967 else if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.75)
19968 {
19971 if (!Main.expertMode)
19972 {
19974 }
19975 else
19976 {
19978 }
19979 }
19981 {
19983 }
19984 if (Main.expertMode)
19985 {
19988 {
19990 }
19992 {
19994 }
19996 {
19998 }
20000 {
20002 }
20004 {
20006 }
20008 }
20009 float num404 = Main.npc[Main.wofNPCIndex].position.X + (float)(Main.npc[Main.wofNPCIndex].width / 2);
20010 float y3 = Main.npc[Main.wofNPCIndex].position.Y;
20011 float num405 = Main.wofDrawAreaBottom - Main.wofDrawAreaTop;
20012 y3 = (float)Main.wofDrawAreaTop +
num405 *
this.ai[0];
20013 this.ai[2] += 1f;
20014 if (this.ai[2] > 100f)
20015 {
20017 if (this.ai[2] > 200f)
20018 {
20019 this.ai[2] = 0f;
20020 }
20021 }
20026 if (this.ai[1] == 0f)
20027 {
20029 {
20033 }
20035 {
20038 {
20039 velocity.X +=
num401 * 2.5f;
20040 }
20041 }
20043 {
20046 {
20047 velocity.X -=
num401 * 2.5f;
20048 }
20049 }
20051 {
20054 {
20055 velocity.Y +=
num401 * 2.5f;
20056 }
20057 }
20059 {
20062 {
20063 velocity.Y -=
num401 * 2.5f;
20064 }
20065 }
20067 if (Main.expertMode && Main.wofNPCIndex >= 0)
20068 {
20070 float num411 = Main.npc[Main.wofNPCIndex].life / Main.npc[Main.wofNPCIndex].lifeMax;
20071 if ((
double)
num411 < 0.75)
20072 {
20074 }
20075 if ((
double)
num411 < 0.5)
20076 {
20078 }
20079 if ((
double)
num411 < 0.25)
20080 {
20082 }
20083 if ((
double)
num411 < 0.1)
20084 {
20086 }
20090 if (
base.Center.X < Main.npc[Main.wofNPCIndex].Center.X && Main.npc[Main.wofNPCIndex].velocity.X > 0f)
20091 {
20093 }
20094 if (
base.Center.X > Main.npc[Main.wofNPCIndex].Center.X && Main.npc[Main.wofNPCIndex].velocity.X < 0f)
20095 {
20097 }
20098 }
20100 {
20102 }
20104 {
20105 velocity.X = 0f -
num409;
20106 }
20108 {
20110 }
20112 {
20113 velocity.Y = 0f -
num409;
20114 }
20115 }
20116 else if (this.ai[1] > 0f)
20117 {
20118 this.ai[1] -= 1f;
20119 }
20120 else
20121 {
20122 this.ai[1] = 0f;
20123 }
20125 {
20128 }
20130 {
20133 }
20134 Lighting.AddLight((
int)(position.X + (float)(
width / 2)) / 16, (
int)(position.Y + (float)(
height / 2)) / 16, 0.3f, 0.2f, 0.1f);
20135 }
20137 {
20139 {
20141 }
20143 float num412 = position.X + (float)(
width / 2) - Main.player[
target].position.X - (float)(Main.player[
target].width / 2);
20144 float num413 = position.Y + (float)
height - 59f - Main.player[
target].position.Y - (
float)(Main.player[
target].height / 2);
20147 {
20149 }
20150 else if ((
double)
num414 > 6.283)
20151 {
20153 }
20156 {
20158 {
20160 }
20161 else
20162 {
20164 }
20165 }
20167 {
20169 {
20171 }
20172 else
20173 {
20175 }
20176 }
20178 {
20180 }
20182 {
20184 }
20185 else if ((
double)
rotation > 6.283)
20186 {
20188 }
20190 {
20192 }
20193 if (Main.rand.Next(5) == 0)
20194 {
20196 Main.dust[
num416].velocity.X *= 0.5f;
20197 Main.dust[
num416].velocity.Y *= 0.1f;
20198 }
20199 if (Main.netMode != 1 && !Main.IsItDay() && !
dead2 &&
timeLeft < 10)
20200 {
20202 {
20204 {
20206 }
20207 }
20208 }
20211 {
20216 float num418 = nPC.velocity.X * 0.025f;
20219 }
20221 if (Main.IsItDay() ||
dead2)
20222 {
20223 velocity.Y -= 0.04f;
20225 return;
20226 }
20227 if (this.ai[0] == 0f)
20228 {
20229 if (this.ai[1] == 0f)
20230 {
20233 if (Main.expertMode)
20234 {
20237 }
20238 if (Main.getGoodWorld)
20239 {
20242 }
20245 {
20247 }
20252 {
20258 }
20262 {
20264 {
20268 }
20272 }
20273 else
20274 {
20279 {
20282 {
20284 }
20285 }
20287 {
20290 {
20292 }
20293 }
20295 {
20298 {
20300 }
20301 }
20303 {
20306 {
20308 }
20309 }
20310 }
20314 {
20317 }
20318 this.ai[2] += 1f;
20319 if (this.ai[2] >= (
float)
num427)
20320 {
20321 this.ai[1] = 1f;
20322 this.ai[2] = 0f;
20323 this.ai[3] = 0f;
20326 }
20328 {
20329 if (!Main.player[
target].dead)
20330 {
20331 this.ai[3] += 1f;
20332 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.9)
20333 {
20334 this.ai[3] += 0.3f;
20335 }
20336 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.8)
20337 {
20338 this.ai[3] += 0.3f;
20339 }
20340 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.7)
20341 {
20342 this.ai[3] += 0.3f;
20343 }
20344 if (Main.expertMode && (
double)
life < (
double)
lifeMax * 0.6)
20345 {
20346 this.ai[3] += 0.3f;
20347 }
20348 if (Main.getGoodWorld)
20349 {
20350 this.ai[3] += 0.5f;
20351 }
20352 }
20353 if (this.ai[3] >= (
float)
num428)
20354 {
20355 this.ai[3] = 0f;
20359 if (Main.netMode != 1)
20360 {
20364 if (Main.expertMode)
20365 {
20367 }
20372 num422 += (float)Main.rand.Next(-40, 41) * 0.08f;
20373 num423 += (float)Main.rand.Next(-40, 41) * 0.08f;
20374 vector43.X +=
num422 * 15f;
20375 vector43.Y +=
num423 * 15f;
20377 }
20378 }
20379 }
20380 }
20381 else if (this.ai[1] == 1f)
20382 {
20385 if (Main.expertMode)
20386 {
20388 }
20389 if (Main.getGoodWorld)
20390 {
20392 }
20400 this.ai[1] = 2f;
20401 }
20402 else if (this.ai[1] == 2f)
20403 {
20404 this.ai[2] += 1f;
20405 if (this.ai[2] >= 25f)
20406 {
20407 velocity.X *= 0.96f;
20408 velocity.Y *= 0.96f;
20409 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
20410 {
20411 velocity.X = 0f;
20412 }
20413 if ((
double)velocity.Y > -0.1 && (double)
velocity.
Y < 0.1)
20414 {
20415 velocity.Y = 0f;
20416 }
20417 }
20418 else
20419 {
20421 }
20422 if (this.ai[2] >= 70f)
20423 {
20424 this.ai[3] += 1f;
20425 this.ai[2] = 0f;
20428 if (this.ai[3] >= 4f)
20429 {
20430 this.ai[1] = 0f;
20431 this.ai[3] = 0f;
20432 }
20433 else
20434 {
20435 this.ai[1] = 1f;
20436 }
20437 }
20438 }
20440 {
20441 this.ai[0] = 1f;
20442 this.ai[1] = 0f;
20443 this.ai[2] = 0f;
20444 this.ai[3] = 0f;
20446 }
20447 return;
20448 }
20449 if (this.ai[0] == 1f || this.ai[0] == 2f)
20450 {
20452 {
20454 }
20455 if (this.ai[0] == 1f)
20456 {
20457 this.ai[2] += 0.005f;
20458 if ((double)this.ai[2] > 0.5)
20459 {
20460 this.ai[2] = 0.5f;
20461 }
20462 }
20463 else
20464 {
20465 this.ai[2] -= 0.005f;
20466 if (this.ai[2] < 0f)
20467 {
20468 this.ai[2] = 0f;
20469 }
20470 }
20472 this.ai[1] += 1f;
20473 if (this.ai[1] >= 100f)
20474 {
20475 this.ai[0] += 1f;
20476 this.ai[1] = 0f;
20477 if (this.ai[0] == 3f)
20478 {
20479 this.ai[2] = 0f;
20480 }
20481 else
20482 {
20485 {
20486 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 143);
20487 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7);
20488 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6);
20489 }
20491 {
20492 Dust.NewDust(
position,
width,
height, 5, (
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f);
20493 }
20495 }
20496 }
20497 Dust.NewDust(
position,
width,
height, 5, (
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f);
20498 velocity.X *= 0.98f;
20499 velocity.Y *= 0.98f;
20500 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
20501 {
20502 velocity.X = 0f;
20503 }
20504 if ((
double)velocity.Y > -0.1 && (double)
velocity.
Y < 0.1)
20505 {
20506 velocity.Y = 0f;
20507 }
20508 return;
20509 }
20513 if (this.ai[1] == 0f)
20514 {
20517 if (Main.expertMode)
20518 {
20521 }
20522 if (Main.getGoodWorld)
20523 {
20526 }
20531 {
20537 }
20540 {
20542 {
20546 }
20547 velocity.X = (velocity.X * 4f +
num440) / 5f;
20548 velocity.Y = (velocity.Y * 4f +
num441) / 5f;
20549 }
20550 else
20551 {
20556 {
20559 {
20561 }
20562 }
20564 {
20567 {
20569 }
20570 }
20572 {
20575 {
20577 }
20578 }
20580 {
20583 {
20585 }
20586 }
20587 }
20590 {
20592 }
20593 this.ai[2] += 1f;
20594 if (this.ai[2] >= (
float)
num443)
20595 {
20596 this.ai[1] = 1f;
20597 this.ai[2] = 0f;
20598 this.ai[3] = 0f;
20601 }
20606 if (Main.netMode == 1)
20607 {
20608 return;
20609 }
20612 {
20614 }
20616 {
20618 }
20620 {
20622 }
20624 {
20626 }
20628 {
20633 if (Main.expertMode)
20634 {
20636 }
20641 vector45.X +=
num440 * 15f;
20642 vector45.Y +=
num441 * 15f;
20644 }
20645 return;
20646 }
20649 {
20651 }
20654 if (Main.expertMode)
20655 {
20658 }
20659 if (Main.getGoodWorld)
20660 {
20663 }
20672 {
20675 {
20677 }
20678 }
20680 {
20683 {
20685 }
20686 }
20688 {
20691 {
20693 }
20694 }
20696 {
20699 {
20701 }
20702 }
20707 if (Main.netMode != 1)
20708 {
20711 {
20713 }
20715 {
20717 }
20719 {
20721 }
20723 {
20725 }
20726 if (Main.expertMode)
20727 {
20729 }
20731 {
20740 vector46.X +=
num450 * 15f;
20741 vector46.Y +=
num451 * 15f;
20743 }
20744 }
20745 this.ai[2] += 1f;
20746 if (this.ai[2] >= 180f)
20747 {
20748 this.ai[1] = 0f;
20749 this.ai[2] = 0f;
20750 this.ai[3] = 0f;
20753 }
20754 }
20756 {
20758 {
20760 }
20762 float num456 = position.X + (float)(
width / 2) - Main.player[
target].position.X - (float)(Main.player[
target].width / 2);
20763 float num457 = position.Y + (float)
height - 59f - Main.player[
target].position.Y - (
float)(Main.player[
target].height / 2);
20766 {
20768 }
20769 else if ((
double)
num458 > 6.283)
20770 {
20772 }
20775 {
20777 }
20779 {
20781 {
20783 }
20784 else
20785 {
20787 }
20788 }
20790 {
20792 {
20794 }
20795 else
20796 {
20798 }
20799 }
20801 {
20803 }
20805 {
20807 }
20808 else if ((
double)
rotation > 6.283)
20809 {
20811 }
20813 {
20815 }
20816 if (Main.rand.Next(5) == 0)
20817 {
20819 Main.dust[
num460].velocity.X *= 0.5f;
20820 Main.dust[
num460].velocity.Y *= 0.1f;
20821 }
20822 if (Main.netMode != 1 && !Main.IsItDay() && !
dead3 &&
timeLeft < 10)
20823 {
20825 {
20827 {
20829 }
20830 }
20831 }
20834 {
20839 float num462 = nPC2.velocity.X * 0.025f;
20842 }
20844 if (Main.IsItDay() ||
dead3)
20845 {
20846 velocity.Y -= 0.04f;
20848 return;
20849 }
20850 if (this.ai[0] == 0f)
20851 {
20852 if (this.ai[1] == 0f)
20853 {
20857 if (Main.getGoodWorld)
20858 {
20861 }
20864 {
20866 }
20871 {
20877 }
20881 {
20883 {
20887 }
20888 velocity.X = (velocity.X * 4f +
num466) / 5f;
20889 velocity.Y = (velocity.Y * 4f +
num467) / 5f;
20890 }
20891 else
20892 {
20897 {
20900 {
20902 }
20903 }
20905 {
20908 {
20910 }
20911 }
20913 {
20916 {
20918 }
20919 }
20921 {
20924 {
20926 }
20927 }
20928 }
20931 {
20933 }
20934 this.ai[2] += 1f;
20935 if (this.ai[2] >= (
float)
num470)
20936 {
20937 this.ai[1] = 1f;
20938 this.ai[2] = 0f;
20939 this.ai[3] = 0f;
20942 }
20943 else
20944 {
20945 if (!Main.player[
target].dead)
20946 {
20947 this.ai[3] += 1f;
20948 if (Main.expertMode && (
double)
life < (double)
lifeMax * 0.8)
20949 {
20950 this.ai[3] += 0.6f;
20951 }
20952 if (Main.getGoodWorld)
20953 {
20954 this.ai[3] += 0.4f;
20955 }
20956 }
20957 if (this.ai[3] >= 60f)
20958 {
20959 this.ai[3] = 0f;
20963 if (Main.netMode != 1)
20964 {
20968 if (Main.expertMode)
20969 {
20971 }
20976 num466 += (float)Main.rand.Next(-40, 41) * 0.05f;
20977 num467 += (float)Main.rand.Next(-40, 41) * 0.05f;
20978 vector49.X +=
num466 * 4f;
20979 vector49.Y +=
num467 * 4f;
20981 }
20982 }
20983 }
20984 }
20985 else if (this.ai[1] == 1f)
20986 {
20989 if (Main.expertMode)
20990 {
20992 {
20994 }
20996 {
20998 }
21000 {
21002 }
21004 {
21006 }
21008 {
21010 }
21011 }
21012 if (Main.getGoodWorld)
21013 {
21015 }
21023 this.ai[1] = 2f;
21024 }
21025 else if (this.ai[1] == 2f)
21026 {
21027 this.ai[2] += 1f;
21028 if (this.ai[2] >= 8f)
21029 {
21030 velocity.X *= 0.9f;
21031 velocity.Y *= 0.9f;
21032 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
21033 {
21034 velocity.X = 0f;
21035 }
21036 if ((
double)velocity.Y > -0.1 && (double)
velocity.
Y < 0.1)
21037 {
21038 velocity.Y = 0f;
21039 }
21040 }
21041 else
21042 {
21044 }
21045 if (this.ai[2] >= 42f)
21046 {
21047 this.ai[3] += 1f;
21048 this.ai[2] = 0f;
21051 if (this.ai[3] >= 10f)
21052 {
21053 this.ai[1] = 0f;
21054 this.ai[3] = 0f;
21055 }
21056 else
21057 {
21058 this.ai[1] = 1f;
21059 }
21060 }
21061 }
21063 {
21064 this.ai[0] = 1f;
21065 this.ai[1] = 0f;
21066 this.ai[2] = 0f;
21067 this.ai[3] = 0f;
21069 }
21070 return;
21071 }
21072 if (this.ai[0] == 1f || this.ai[0] == 2f)
21073 {
21075 {
21077 }
21078 if (this.ai[0] == 1f)
21079 {
21080 this.ai[2] += 0.005f;
21081 if ((double)this.ai[2] > 0.5)
21082 {
21083 this.ai[2] = 0.5f;
21084 }
21085 }
21086 else
21087 {
21088 this.ai[2] -= 0.005f;
21089 if (this.ai[2] < 0f)
21090 {
21091 this.ai[2] = 0f;
21092 }
21093 }
21095 this.ai[1] += 1f;
21096 if (this.ai[1] >= 100f)
21097 {
21098 this.ai[0] += 1f;
21099 this.ai[1] = 0f;
21100 if (this.ai[0] == 3f)
21101 {
21102 this.ai[2] = 0f;
21103 }
21104 else
21105 {
21108 {
21109 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 144);
21110 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7);
21111 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6);
21112 }
21114 {
21115 Dust.NewDust(
position,
width,
height, 5, (
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f);
21116 }
21118 }
21119 }
21120 Dust.NewDust(
position,
width,
height, 5, (
float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f);
21121 velocity.X *= 0.98f;
21122 velocity.Y *= 0.98f;
21123 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
21124 {
21125 velocity.X = 0f;
21126 }
21127 if ((
double)velocity.Y > -0.1 && (double)
velocity.
Y < 0.1)
21128 {
21129 velocity.Y = 0f;
21130 }
21131 return;
21132 }
21136 if (this.ai[1] == 0f)
21137 {
21142 {
21144 }
21150 {
21151 if (Main.expertMode)
21152 {
21154 {
21156 }
21158 {
21160 }
21162 {
21164 }
21166 {
21168 }
21170 {
21172 }
21174 {
21176 }
21177 }
21178 if (Main.getGoodWorld)
21179 {
21182 }
21187 {
21190 {
21192 }
21193 }
21195 {
21198 {
21200 }
21201 }
21203 {
21206 {
21208 }
21209 }
21211 {
21214 {
21216 }
21217 }
21218 }
21221 {
21223 }
21224 this.ai[2] += 1f;
21225 if (this.ai[2] >= (
float)
num486)
21226 {
21227 this.ai[1] = 1f;
21228 this.ai[2] = 0f;
21229 this.ai[3] = 0f;
21232 }
21234 {
21237 {
21240 }
21241 if (Main.netMode != 1)
21242 {
21245 {
21247 }
21249 {
21251 }
21253 {
21255 }
21257 {
21259 }
21261 {
21273 num484 += (float)Main.rand.Next(-40, 41) * 0.01f;
21274 num483 += (float)Main.rand.Next(-40, 41) * 0.01f;
21275 num484 += velocity.Y * 0.5f;
21276 num483 += velocity.X * 0.5f;
21277 vector51.X -=
num483 * 1f;
21278 vector51.Y -=
num484 * 1f;
21280 {
21285 }
21287 }
21288 }
21289 }
21291 {
21301 {
21305 }
21309 }
21310 }
21311 else if (this.ai[1] == 1f)
21312 {
21316 if (Main.expertMode)
21317 {
21319 }
21327 this.ai[1] = 2f;
21328 }
21329 else
21330 {
21331 if (this.ai[1] != 2f)
21332 {
21333 return;
21334 }
21335 this.ai[2] += 1f;
21336 if (Main.expertMode)
21337 {
21338 this.ai[2] += 0.5f;
21339 }
21340 if (this.ai[2] >= 50f)
21341 {
21342 velocity.X *= 0.93f;
21343 velocity.Y *= 0.93f;
21344 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
21345 {
21346 velocity.X = 0f;
21347 }
21348 if ((
double)velocity.Y > -0.1 && (double)
velocity.
Y < 0.1)
21349 {
21350 velocity.Y = 0f;
21351 }
21352 }
21353 else
21354 {
21356 }
21357 if (this.ai[2] >= 80f)
21358 {
21359 this.ai[3] += 1f;
21360 this.ai[2] = 0f;
21363 if (this.ai[3] >= 6f)
21364 {
21365 this.ai[1] = 0f;
21366 this.ai[3] = 0f;
21367 }
21368 else
21369 {
21370 this.ai[1] = 1f;
21371 }
21372 }
21373 }
21374 }
21376 {
21379 if (this.ai[3] != 0f)
21380 {
21382 }
21384 if (this.ai[0] == 0f && Main.netMode != 1)
21385 {
21387 this.ai[0] = 1f;
21389 Main.npc[
num495].ai[0] = -1f;
21392 Main.npc[
num495].netUpdate =
true;
21394 Main.npc[
num495].ai[0] = 1f;
21397 Main.npc[
num495].netUpdate =
true;
21399 Main.npc[
num495].ai[0] = -1f;
21402 Main.npc[
num495].ai[3] = 150f;
21403 Main.npc[
num495].netUpdate =
true;
21405 Main.npc[
num495].ai[0] = 1f;
21408 Main.npc[
num495].netUpdate =
true;
21409 Main.npc[
num495].ai[3] = 150f;
21410 }
21412 {
21415 {
21416 this.ai[1] = 3f;
21417 }
21418 }
21419 if (Main.IsItDay() && this.ai[1] != 3f && this.ai[1] != 2f)
21420 {
21421 this.ai[1] = 2f;
21423 }
21424 if (this.ai[1] == 0f)
21425 {
21426 this.ai[2] += 1f;
21427 if (this.ai[2] >= 600f)
21428 {
21429 this.ai[2] = 0f;
21430 this.ai[1] = 1f;
21433 }
21435 {
21437 }
21438 else
21439 {
21441 }
21449 int num503 = ((!(Main.player[
target].Center.X <
base.Center.X)) ? 1 : (-1));
21451 {
21455 }
21456 if (Main.expertMode)
21457 {
21462 }
21464 {
21466 {
21467 velocity.Y *= 0.98f;
21468 }
21471 {
21473 }
21474 }
21476 {
21478 {
21479 velocity.Y *= 0.98f;
21480 }
21483 {
21484 velocity.Y = 0f -
num497;
21485 }
21486 }
21488 {
21490 {
21491 velocity.X *= 0.98f;
21492 }
21495 {
21497 }
21498 }
21500 {
21502 {
21503 velocity.X *= 0.98f;
21504 }
21507 {
21508 velocity.X = 0f -
num499;
21509 }
21510 }
21511 }
21512 else if (this.ai[1] == 1f)
21513 {
21516 this.ai[2] += 1f;
21517 if (this.ai[2] == 2f)
21518 {
21520 }
21521 if (this.ai[2] >= 400f)
21522 {
21523 this.ai[2] = 0f;
21524 this.ai[1] = 0f;
21525 }
21527 {
21529 }
21530 else
21531 {
21533 }
21539 if (Main.expertMode)
21540 {
21543 {
21545 }
21547 {
21549 }
21551 {
21553 }
21555 {
21557 }
21559 {
21561 }
21563 {
21565 }
21567 {
21569 }
21571 {
21573 }
21575 {
21577 }
21579 {
21581 }
21582 }
21584 {
21587 }
21592 {
21595 {
21597 }
21599 {
21601 }
21602 }
21603 }
21604 else if (this.ai[1] == 2f)
21605 {
21609 {
21611 }
21612 else
21613 {
21615 }
21623 {
21625 }
21627 {
21629 }
21633 }
21634 else
21635 {
21636 if (this.ai[1] != 3f)
21637 {
21638 return;
21639 }
21641 {
21644 {
21645 Main.npc[
num514].EncourageDespawn(5);
21646 }
21649 {
21650 Main.npc[
num514].EncourageDespawn(5);
21651 }
21653 {
21656 {
21657 Main.npc[
num514].Transform(136);
21658 }
21660 }
21661 velocity.Y += 0.1f;
21663 {
21664 velocity.Y *= 0.95f;
21665 }
21666 velocity.X *= 0.95f;
21668 {
21669 velocity.Y = 13f;
21670 }
21671 }
21672 else
21673 {
21675 velocity.Y += 0.1f;
21677 {
21678 velocity.Y *= 0.95f;
21679 }
21680 velocity.X *= 0.95f;
21681 }
21682 }
21683 }
21685 {
21690 if (this.ai[2] != 99f)
21691 {
21693 {
21694 this.ai[2] = 99f;
21695 }
21696 }
21698 {
21699 this.ai[2] = 0f;
21700 }
21702 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 32)
21703 {
21704 this.ai[2] += 10f;
21705 if (this.ai[2] > 50f || Main.netMode != 2)
21706 {
21710 }
21711 }
21712 if (this.ai[2] == 99f)
21713 {
21714 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y)
21715 {
21717 {
21718 velocity.Y *= 0.96f;
21719 }
21720 velocity.Y -= 0.1f;
21722 {
21723 velocity.Y = 8f;
21724 }
21725 }
21726 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y)
21727 {
21729 {
21730 velocity.Y *= 0.96f;
21731 }
21732 velocity.Y += 0.1f;
21734 {
21735 velocity.Y = -8f;
21736 }
21737 }
21738 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2))
21739 {
21741 {
21742 velocity.X *= 0.96f;
21743 }
21744 velocity.X -= 0.5f;
21746 {
21747 velocity.X = 12f;
21748 }
21749 }
21750 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2))
21751 {
21753 {
21754 velocity.X *= 0.96f;
21755 }
21756 velocity.X += 0.5f;
21758 {
21759 velocity.X = -12f;
21760 }
21761 }
21762 }
21763 else if (this.ai[2] == 0f || this.ai[2] == 3f)
21764 {
21765 if (Main.npc[(int)this.ai[1]].ai[1] == 3f)
21766 {
21768 }
21769 if (Main.npc[(int)this.ai[1]].ai[1] != 0f)
21770 {
21772 if (Main.player[
target].dead)
21773 {
21774 velocity.Y += 0.1f;
21776 {
21777 velocity.Y = 16f;
21778 }
21779 }
21780 else
21781 {
21791 {
21793 {
21794 velocity.X *= 0.97f;
21795 }
21796 velocity.X -= 0.05f;
21797 }
21799 {
21801 {
21802 velocity.X *= 0.97f;
21803 }
21804 velocity.X += 0.05f;
21805 }
21807 {
21809 {
21810 velocity.Y *= 0.97f;
21811 }
21812 velocity.Y -= 0.05f;
21813 }
21815 {
21817 {
21818 velocity.Y *= 0.97f;
21819 }
21820 velocity.Y += 0.05f;
21821 }
21822 }
21823 this.ai[3] += 1f;
21824 if (this.ai[3] >= 600f)
21825 {
21826 this.ai[2] = 0f;
21827 this.ai[3] = 0f;
21829 }
21830 }
21831 else
21832 {
21833 this.ai[3] += 1f;
21834 if (this.ai[3] >= 300f)
21835 {
21836 this.ai[2] += 1f;
21837 this.ai[3] = 0f;
21839 }
21840 if (
position.
Y > Main.npc[(
int)this.ai[1]].position.Y + 320f)
21841 {
21843 {
21844 velocity.Y *= 0.96f;
21845 }
21846 velocity.Y -= 0.04f;
21848 {
21849 velocity.Y = 3f;
21850 }
21851 }
21852 else if (
position.
Y < Main.npc[(
int)this.ai[1]].position.Y + 260f)
21853 {
21855 {
21856 velocity.Y *= 0.96f;
21857 }
21858 velocity.Y += 0.04f;
21860 {
21861 velocity.Y = -3f;
21862 }
21863 }
21864 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2))
21865 {
21867 {
21868 velocity.X *= 0.96f;
21869 }
21870 velocity.X -= 0.3f;
21872 {
21873 velocity.X = 12f;
21874 }
21875 }
21876 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) - 250f)
21877 {
21879 {
21880 velocity.X *= 0.96f;
21881 }
21882 velocity.X += 0.3f;
21884 {
21885 velocity.X = -12f;
21886 }
21887 }
21888 }
21894 }
21895 else if (this.ai[2] == 1f)
21896 {
21902 velocity.X *= 0.95f;
21903 velocity.Y -= 0.1f;
21905 {
21906 velocity.Y = -8f;
21907 }
21908 if (
position.
Y < Main.npc[(
int)this.ai[1]].position.Y - 200f)
21909 {
21911 this.ai[2] = 2f;
21920 }
21921 }
21922 else if (this.ai[2] == 2f)
21923 {
21925 {
21926 this.ai[2] = 3f;
21927 }
21928 }
21929 else if (this.ai[2] == 4f)
21930 {
21940 {
21942 {
21943 velocity.X *= 0.97f;
21944 }
21945 velocity.X -= 0.05f;
21946 }
21948 {
21950 {
21951 velocity.X *= 0.97f;
21952 }
21953 velocity.X += 0.05f;
21954 }
21956 {
21958 {
21959 velocity.Y *= 0.97f;
21960 }
21961 velocity.Y -= 0.05f;
21962 }
21964 {
21966 {
21967 velocity.Y *= 0.97f;
21968 }
21969 velocity.Y += 0.05f;
21970 }
21971 this.ai[3] += 1f;
21972 if (this.ai[3] >= 600f)
21973 {
21974 this.ai[2] = 0f;
21975 this.ai[3] = 0f;
21977 }
21983 }
21984 else if (this.ai[2] == 5f && ((
velocity.
X > 0f &&
position.
X + (
float)(
width / 2) > Main.player[
target].position.X + (
float)(Main.player[
target].width / 2)) || (velocity.X < 0f && position.X + (float)(
width / 2) < Main.player[
target].position.X + (float)(Main.player[
target].width / 2))))
21985 {
21986 this.ai[2] = 0f;
21987 }
21988 }
21990 {
21996 if (this.ai[2] != 99f)
21997 {
21999 {
22000 this.ai[2] = 99f;
22001 }
22002 }
22004 {
22005 this.ai[2] = 0f;
22006 }
22007 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 32)
22008 {
22009 this.ai[2] += 10f;
22010 if (this.ai[2] > 50f || Main.netMode != 2)
22011 {
22015 }
22016 }
22017 if (this.ai[2] == 99f)
22018 {
22019 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y)
22020 {
22022 {
22023 velocity.Y *= 0.96f;
22024 }
22025 velocity.Y -= 0.1f;
22027 {
22028 velocity.Y = 8f;
22029 }
22030 }
22031 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y)
22032 {
22034 {
22035 velocity.Y *= 0.96f;
22036 }
22037 velocity.Y += 0.1f;
22039 {
22040 velocity.Y = -8f;
22041 }
22042 }
22043 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2))
22044 {
22046 {
22047 velocity.X *= 0.96f;
22048 }
22049 velocity.X -= 0.5f;
22051 {
22052 velocity.X = 12f;
22053 }
22054 }
22055 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2))
22056 {
22058 {
22059 velocity.X *= 0.96f;
22060 }
22061 velocity.X += 0.5f;
22063 {
22064 velocity.X = -12f;
22065 }
22066 }
22067 }
22068 else if (this.ai[2] == 0f || this.ai[2] == 3f)
22069 {
22070 if (Main.npc[(int)this.ai[1]].ai[1] == 3f)
22071 {
22073 }
22074 if (Main.npc[(int)this.ai[1]].ai[1] != 0f)
22075 {
22078 if (Main.player[
target].dead)
22079 {
22080 velocity.Y += 0.1f;
22082 {
22083 velocity.Y = 16f;
22084 }
22085 }
22086 else
22087 {
22097 {
22102 }
22103 else
22104 {
22106 }
22107 this.ai[3] += 1f;
22108 if (this.ai[3] >= 600f)
22109 {
22110 this.ai[2] = 0f;
22111 this.ai[3] = 0f;
22113 }
22114 }
22115 }
22116 else
22117 {
22118 this.ai[3] += 1f;
22119 if (this.ai[3] >= 600f)
22120 {
22121 this.ai[2] += 1f;
22122 this.ai[3] = 0f;
22124 }
22125 if (
position.
Y > Main.npc[(
int)this.ai[1]].position.Y + 300f)
22126 {
22128 {
22129 velocity.Y *= 0.96f;
22130 }
22131 velocity.Y -= 0.1f;
22133 {
22134 velocity.Y = 3f;
22135 }
22136 }
22137 else if (
position.
Y < Main.npc[(
int)this.ai[1]].position.Y + 230f)
22138 {
22140 {
22141 velocity.Y *= 0.96f;
22142 }
22143 velocity.Y += 0.1f;
22145 {
22146 velocity.Y = -3f;
22147 }
22148 }
22149 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) + 250f)
22150 {
22152 {
22153 velocity.X *= 0.94f;
22154 }
22155 velocity.X -= 0.3f;
22157 {
22158 velocity.X = 9f;
22159 }
22160 }
22161 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2))
22162 {
22164 {
22165 velocity.X *= 0.94f;
22166 }
22167 velocity.X += 0.2f;
22169 {
22170 velocity.X = -8f;
22171 }
22172 }
22173 }
22179 }
22180 else if (this.ai[2] == 1f)
22181 {
22183 {
22184 velocity.Y *= 0.9f;
22185 }
22191 velocity.X = (velocity.X * 5f + Main.npc[(int)this.ai[1]].
velocity.
X) / 6f;
22192 velocity.X += 0.5f;
22193 velocity.Y -= 0.5f;
22195 {
22196 velocity.Y = -9f;
22197 }
22198 if (
position.
Y < Main.npc[(
int)this.ai[1]].position.Y - 280f)
22199 {
22201 this.ai[2] = 2f;
22210 }
22211 }
22212 else if (this.ai[2] == 2f)
22213 {
22215 {
22216 if (this.ai[3] >= 4f)
22217 {
22218 this.ai[2] = 3f;
22219 this.ai[3] = 0f;
22220 }
22221 else
22222 {
22223 this.ai[2] = 1f;
22224 this.ai[3] += 1f;
22225 }
22226 }
22227 }
22228 else if (this.ai[2] == 4f)
22229 {
22235 velocity.Y = (velocity.Y * 5f + Main.npc[(int)this.ai[1]].
velocity.
Y) / 6f;
22236 velocity.X += 0.5f;
22238 {
22239 velocity.X = 12f;
22240 }
22241 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) - 500f ||
position.
X + (
float)(
width / 2) > Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) + 500f)
22242 {
22244 this.ai[2] = 5f;
22253 }
22254 }
22255 else if (this.ai[2] == 5f &&
position.
X + (
float)(
width / 2) < Main.player[
target].position.X + (
float)(Main.player[
target].width / 2) - 100f)
22256 {
22257 if (this.ai[3] >= 4f)
22258 {
22259 this.ai[2] = 0f;
22260 this.ai[3] = 0f;
22261 }
22262 else
22263 {
22264 this.ai[2] = 4f;
22265 this.ai[3] += 1f;
22266 }
22267 }
22268 }
22270 {
22272 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 32)
22273 {
22274 this.ai[2] += 10f;
22275 if (this.ai[2] > 50f || Main.netMode != 2)
22276 {
22280 }
22281 }
22282 if (this.ai[2] == 0f)
22283 {
22284 if (Main.npc[(int)this.ai[1]].ai[1] == 3f)
22285 {
22287 }
22288 if (Main.npc[(int)this.ai[1]].ai[1] != 0f)
22289 {
22291 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y - 100f)
22292 {
22294 {
22295 velocity.Y *= 0.96f;
22296 }
22297 velocity.Y -= 0.07f;
22299 {
22300 velocity.Y = 6f;
22301 }
22302 }
22303 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y - 100f)
22304 {
22306 {
22307 velocity.Y *= 0.96f;
22308 }
22309 velocity.Y += 0.07f;
22311 {
22312 velocity.Y = -6f;
22313 }
22314 }
22315 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120f *
this.ai[0])
22316 {
22318 {
22319 velocity.X *= 0.96f;
22320 }
22321 velocity.X -= 0.1f;
22323 {
22324 velocity.X = 8f;
22325 }
22326 }
22327 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120f *
this.ai[0])
22328 {
22330 {
22331 velocity.X *= 0.96f;
22332 }
22333 velocity.X += 0.1f;
22335 {
22336 velocity.X = -8f;
22337 }
22338 }
22339 }
22340 else
22341 {
22342 this.ai[3] += 1f;
22343 if (this.ai[3] >= 1100f)
22344 {
22346 this.ai[2] = 1f;
22347 this.ai[3] = 0f;
22349 }
22350 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y - 150f)
22351 {
22353 {
22354 velocity.Y *= 0.96f;
22355 }
22356 velocity.Y -= 0.04f;
22358 {
22359 velocity.Y = 3f;
22360 }
22361 }
22362 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y - 150f)
22363 {
22365 {
22366 velocity.Y *= 0.96f;
22367 }
22368 velocity.Y += 0.04f;
22370 {
22371 velocity.Y = -3f;
22372 }
22373 }
22374 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) + 200f)
22375 {
22377 {
22378 velocity.X *= 0.96f;
22379 }
22380 velocity.X -= 0.2f;
22382 {
22383 velocity.X = 8f;
22384 }
22385 }
22386 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) + 160f)
22387 {
22389 {
22390 velocity.X *= 0.96f;
22391 }
22392 velocity.X += 0.2f;
22394 {
22395 velocity.X = -8f;
22396 }
22397 }
22398 }
22404 if (Main.netMode != 1)
22405 {
22408 {
22416 num545 += (float)Main.rand.Next(-40, 41) * 0.01f;
22417 num546 += (float)Main.rand.Next(-40, 41) * 0.01f;
22418 vector66.X +=
num545 * 4f;
22419 vector66.Y +=
num546 * 4f;
22421 }
22422 }
22423 }
22424 else
22425 {
22426 if (this.ai[2] != 1f)
22427 {
22428 return;
22429 }
22430 this.ai[3] += 1f;
22431 if (this.ai[3] >= 300f)
22432 {
22434 this.ai[2] = 0f;
22435 this.ai[3] = 0f;
22437 }
22447 {
22449 {
22450 velocity.X *= 0.9f;
22451 }
22452 velocity.X -= 0.04f;
22453 }
22455 {
22457 {
22458 velocity.X *= 0.9f;
22459 }
22460 velocity.X += 0.04f;
22461 }
22463 {
22465 {
22466 velocity.Y *= 0.9f;
22467 }
22468 velocity.Y -= 0.08f;
22469 }
22471 {
22473 {
22474 velocity.Y *= 0.9f;
22475 }
22476 velocity.Y += 0.08f;
22477 }
22484 if (Main.netMode != 1)
22485 {
22488 {
22496 num552 += (float)Main.rand.Next(-40, 41) * 0.01f;
22497 num553 += (float)Main.rand.Next(-40, 41) * 0.01f;
22498 vector67.X +=
num552 * 4f;
22499 vector67.Y +=
num553 * 4f;
22501 }
22502 }
22503 }
22504 }
22506 {
22508 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 32)
22509 {
22510 this.ai[2] += 10f;
22511 if (this.ai[2] > 50f || Main.netMode != 2)
22512 {
22516 }
22517 }
22518 if (this.ai[2] == 0f || this.ai[2] == 3f)
22519 {
22520 if (Main.npc[(int)this.ai[1]].ai[1] == 3f)
22521 {
22523 }
22524 if (Main.npc[(int)this.ai[1]].ai[1] != 0f)
22525 {
22527 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y - 100f)
22528 {
22530 {
22531 velocity.Y *= 0.96f;
22532 }
22533 velocity.Y -= 0.07f;
22535 {
22536 velocity.Y = 6f;
22537 }
22538 }
22539 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y - 100f)
22540 {
22542 {
22543 velocity.Y *= 0.96f;
22544 }
22545 velocity.Y += 0.07f;
22547 {
22548 velocity.Y = -6f;
22549 }
22550 }
22551 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120f *
this.ai[0])
22552 {
22554 {
22555 velocity.X *= 0.96f;
22556 }
22557 velocity.X -= 0.1f;
22559 {
22560 velocity.X = 8f;
22561 }
22562 }
22563 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 120f *
this.ai[0])
22564 {
22566 {
22567 velocity.X *= 0.96f;
22568 }
22569 velocity.X += 0.1f;
22571 {
22572 velocity.X = -8f;
22573 }
22574 }
22575 }
22576 else
22577 {
22578 this.ai[3] += 1f;
22579 if (this.ai[3] >= 800f)
22580 {
22581 this.ai[2] += 1f;
22582 this.ai[3] = 0f;
22584 }
22585 if (
position.
Y > Main.npc[(
int)
this.ai[1]].position.Y - 100f)
22586 {
22588 {
22589 velocity.Y *= 0.96f;
22590 }
22591 velocity.Y -= 0.1f;
22593 {
22594 velocity.Y = 3f;
22595 }
22596 }
22597 else if (
position.
Y < Main.npc[(
int)
this.ai[1]].position.Y - 100f)
22598 {
22600 {
22601 velocity.Y *= 0.96f;
22602 }
22603 velocity.Y += 0.1f;
22605 {
22606 velocity.Y = -3f;
22607 }
22608 }
22609 if (
position.
X + (
float)(
width / 2) > Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 180f *
this.ai[0])
22610 {
22612 {
22613 velocity.X *= 0.96f;
22614 }
22615 velocity.X -= 0.14f;
22617 {
22618 velocity.X = 8f;
22619 }
22620 }
22621 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)
this.ai[1]].position.X + (
float)(Main.npc[(
int)
this.ai[1]].width / 2) - 180f *
this.ai[0])
22622 {
22624 {
22625 velocity.X *= 0.96f;
22626 }
22627 velocity.X += 0.14f;
22629 {
22630 velocity.X = -8f;
22631 }
22632 }
22633 }
22640 if (Main.netMode != 1)
22641 {
22644 {
22652 num559 += (float)Main.rand.Next(-40, 41) * 0.05f;
22653 num560 += (float)Main.rand.Next(-40, 41) * 0.05f;
22654 vector68.X +=
num559 * 8f;
22655 vector68.Y +=
num560 * 8f;
22657 }
22658 }
22659 }
22660 else
22661 {
22662 if (this.ai[2] != 1f)
22663 {
22664 return;
22665 }
22666 this.ai[3] += 1f;
22667 if (this.ai[3] >= 200f)
22668 {
22670 this.ai[2] = 0f;
22671 this.ai[3] = 0f;
22673 }
22682 {
22684 {
22685 velocity.X *= 0.9f;
22686 }
22687 velocity.X -= 0.1f;
22688 }
22690 {
22692 {
22693 velocity.X *= 0.9f;
22694 }
22695 velocity.X += 0.1f;
22696 }
22698 {
22700 {
22701 velocity.Y *= 0.9f;
22702 }
22703 velocity.Y -= 0.03f;
22704 }
22706 {
22708 {
22709 velocity.Y *= 0.9f;
22710 }
22711 velocity.Y += 0.03f;
22712 }
22719 if (Main.netMode == 1)
22720 {
22723 {
22731 num566 += (float)Main.rand.Next(-40, 41) * 0.05f;
22732 num567 += (float)Main.rand.Next(-40, 41) * 0.05f;
22733 vector69.X +=
num566 * 8f;
22734 vector69.Y +=
num567 * 8f;
22736 }
22737 }
22738 }
22739 }
22741 {
22743 }
22745 {
22749 {
22752 }
22754 {
22757 }
22759 {
22760 this.ai[2] += 1f;
22761 if (this.ai[2] >= 120f)
22762 {
22763 this.ai[2] = 0f;
22764 if (Main.netMode != 1)
22765 {
22769 if (Main.netMode != 1)
22770 {
22774 Main.projectile[
num577].ai[0] = 2f;
22775 Main.projectile[
num577].timeLeft = 300;
22776 Main.projectile[
num577].friendly =
false;
22777 NetMessage.SendData(27, -1, -1,
null,
num577);
22779 }
22780 }
22781 }
22782 }
22783 if (
type == 144 && this.ai[1] >= 3f)
22784 {
22788 {
22789 velocity.X *= 0.9f;
22790 this.ai[2] += 1f;
22792 {
22793 velocity.X = 0f;
22794 }
22795 if (this.ai[2] >= 200f)
22796 {
22797 this.ai[2] = 0f;
22798 this.ai[1] = 0f;
22799 }
22800 }
22801 }
22802 else if (
type == 145 && this.ai[1] >= 3f)
22803 {
22806 {
22807 velocity.X *= 0.9f;
22808 this.ai[2] += 1f;
22810 {
22811 velocity.X = 0f;
22812 }
22813 if (this.ai[2] >= 16f)
22814 {
22815 this.ai[2] = 0f;
22816 this.ai[1] = 0f;
22817 }
22818 }
22820 {
22829 if (Main.netMode != 1)
22830 {
22834 Main.projectile[
num584].ai[0] = 2f;
22835 Main.projectile[
num584].timeLeft = 300;
22836 Main.projectile[
num584].friendly =
false;
22837 NetMessage.SendData(27, -1, -1,
null,
num584);
22839 }
22840 }
22841 }
22842 else
22843 {
22845 {
22847 {
22849 this.ai[3] = 60f;
22850 }
22852 if (this.ai[3] == 0f)
22853 {
22855 }
22856 this.ai[0] += 1f;
22857 if (this.ai[0] > 2f)
22858 {
22859 this.ai[0] = 0f;
22860 this.ai[1] += 1f;
22861 velocity.Y = -8.2f;
22863 }
22864 else
22865 {
22866 velocity.Y = -6f;
22868 }
22870 }
22872 }
22873 if (this.ai[3] > 0f)
22874 {
22875 this.ai[3] -= 1f;
22876 }
22878 {
22880 }
22882 {
22883 velocity.X = 0f -
num573;
22884 }
22885 }
22887 {
22889 {
22891 }
22895 {
22897 }
22899 {
22901 }
22907 {
22915 {
22918 {
22920 }
22922 {
22924 }
22926 {
22928 if ((
double)
num589 <= 16.1)
22929 {
22933 {
22935 }
22936 else
22937 {
22939 }
22940 }
22941 }
22942 }
22943 }
22945 {
22946 this.ai[0] = 0f;
22947 this.ai[1] = 0f;
22949 }
22951 {
22953 if (Main.rand.Next(10) == 0)
22954 {
22956 Main.dust[
num590].noGravity =
true;
22957 Dust dust = Main.dust[
num590];
22958 dust.velocity *= 0.2f;
22959 }
22961 }
22962 if (this.ai[0] == 0f)
22963 {
22965 {
22967 }
22969 {
22971 }
22979 {
22981 {
22982 this.ai[1] += 2f;
22983 }
22985 {
22986 this.ai[1] += 4f;
22987 }
22988 }
22989 else
22990 {
22992 {
22993 this.ai[1] += 4f;
22994 }
22996 {
22997 this.ai[1] += 10f;
22998 }
23000 {
23001 this.ai[1] = 1000f;
23002 }
23003 }
23007 {
23008 knockBackResist = 0.75f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
23009 }
23010 else
23011 {
23012 knockBackResist = 0.3f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
23013 }
23014 this.ai[1] += 1f;
23015 if (this.ai[1] >= 400f)
23016 {
23017 this.ai[1] = 0f;
23018 this.ai[0] = 1f;
23019 }
23021 {
23023 }
23025 {
23029 {
23030 num594 = (int)(((
double)position.X + (double)
width * 0.5) / 16.0);
23032 }
23033 else
23034 {
23035 num595 = (int)(((
double)position.X + (double)
width * 0.5) / 16.0);
23037 }
23042 {
23044 {
23046 {
23048 }
23049 }
23050 }
23052 {
23055 }
23056 }
23058 {
23061 {
23063 {
23065 }
23066 }
23068 {
23069 velocity.X += 0.07f;
23071 {
23073 }
23074 }
23076 {
23077 velocity.X -= 0.07f;
23079 {
23080 velocity.X = 0f -
num600;
23081 }
23082 }
23083 return;
23084 }
23087 {
23089 {
23091 {
23093 }
23094 }
23096 {
23097 velocity.X += 0.07f;
23099 {
23101 }
23102 }
23104 {
23105 velocity.X -= 0.07f;
23107 {
23108 velocity.X = 0f -
num601;
23109 }
23110 }
23111 }
23113 {
23115 {
23117 }
23118 }
23120 {
23121 velocity.X += 0.07f;
23123 {
23124 velocity.X = 1.5f;
23125 }
23126 }
23128 {
23129 velocity.X -= 0.07f;
23131 {
23132 velocity.X = -1.5f;
23133 }
23134 }
23135 }
23136 else if (this.ai[0] == 1f)
23137 {
23138 velocity.X *= 0.5f;
23140 {
23141 this.ai[1] += 0.5f;
23142 }
23143 else
23144 {
23145 this.ai[1] += 1f;
23146 }
23147 if (this.ai[1] >= 30f)
23148 {
23151 this.ai[1] = 0f;
23152 this.ai[2] = 0f;
23153 this.ai[0] = 3f;
23155 {
23159 this.ai[0] = 6f;
23160 this.ai[2] = Main.rand.Next(2, 5);
23161 }
23162 }
23163 }
23164 else if (this.ai[0] == 3f)
23165 {
23166 if (
type == 154 && Main.rand.Next(3) < 2)
23167 {
23170 Main.dust[
num602].noGravity =
true;
23171 Dust dust = Main.dust[
num602];
23172 dust.velocity *= 0.2f;
23174 }
23177 {
23179 }
23182 this.ai[1] += 1f;
23183 if (this.ai[1] == 1f)
23184 {
23187 this.ai[2] += 0.3f;
23189 this.ai[1] += 1f;
23193 {
23195 }
23197 {
23199 }
23204 {
23206 }
23214 {
23216 }
23220 }
23221 else
23222 {
23224 {
23225 velocity.X *= 0.8f;
23226 this.ai[3] = 0f;
23228 {
23229 velocity.Y += 0.2f;
23230 }
23231 }
23232 if (this.ai[3] != 0f)
23233 {
23234 velocity.X = this.ai[3];
23235 velocity.Y -= 0.22f;
23236 }
23237 if (this.ai[1] >= 90f)
23238 {
23240 this.ai[1] = 0f;
23241 this.ai[0] = 4f;
23242 }
23243 }
23245 {
23246 velocity.Y -= 0.3f;
23247 }
23249 }
23250 else if (this.ai[0] == 4f)
23251 {
23253 {
23254 velocity.Y -= 0.3f;
23255 }
23256 velocity.X *= 0.96f;
23257 if (this.ai[2] > 0f)
23258 {
23259 this.ai[2] -= 0.01f;
23261 }
23263 {
23265 }
23267 {
23270 this.ai[2] = 0f;
23271 this.ai[1] = 0f;
23272 this.ai[0] = 5f;
23273 }
23274 }
23275 else if (this.ai[0] == 6f)
23276 {
23280 if (Main.rand.Next(3) < 2)
23281 {
23284 Main.dust[
num609].noGravity =
true;
23285 Dust dust = Main.dust[
num609];
23286 dust.velocity *= 0.2f;
23287 Main.dust[
num609].fadeIn = 1f;
23289 }
23290 this.ai[1] += 1f;
23291 if (this.ai[3] > 0f)
23292 {
23294 if (this.ai[3] == 1f)
23295 {
23298 {
23300 Main.dust[
num611].noGravity =
true;
23301 Dust dust = Main.dust[
num611];
23302 dust.velocity *= 3f;
23304 dust = Main.dust[
num611];
23305 dust.velocity *= 2f;
23306 Main.dust[
num611].noGravity =
true;
23307 }
23309 {
23310 int num613 = Gore.NewGore(
vector75 +
new Vector2((
float)(50 * Main.rand.Next(100)) / 100f, (
float)(50 * Main.rand.Next(100)) / 100f) -
Vector2.
One * 10f,
default(
Vector2), Main.rand.Next(61, 64));
23311 Gore gore = Main.gore[
num613];
23312 gore.velocity *= 0.3f;
23313 Main.gore[
num613].velocity.X += (float)Main.rand.Next(-10, 11) * 0.05f;
23314 Main.gore[
num613].velocity.Y += (float)Main.rand.Next(-10, 11) * 0.05f;
23315 }
23316 }
23318 {
23320 Main.dust[
num615].velocity = Main.dust[
num615].velocity * Main.rand.NextFloat();
23321 }
23322 this.ai[3]++;
23323 if (this.ai[3] >= 10f)
23324 {
23325 this.ai[3] = 0f;
23326 }
23328 }
23329 if (this.ai[1] == 1f)
23330 {
23336 {
23338 }
23343 {
23345 }
23353 {
23355 }
23358 }
23359 else
23360 {
23362 {
23363 velocity.X *= 0.9f;
23365 {
23366 velocity.Y += 0.2f;
23367 }
23368 }
23369 if (this.ai[2] == 0f || this.ai[1] >= 1200f)
23370 {
23371 this.ai[1] = 0f;
23372 this.ai[0] = 5f;
23373 }
23374 }
23376 {
23377 velocity.Y -= 0.3f;
23378 }
23380 }
23381 else if (this.ai[0] == 5f)
23382 {
23384 {
23388 }
23390 velocity.X = 0f;
23392 {
23393 this.ai[1] += 0.5f;
23394 }
23395 else
23396 {
23397 this.ai[1] += 1f;
23398 }
23399 if (this.ai[1] >= 30f)
23400 {
23403 this.ai[1] = 0f;
23404 this.ai[0] = 0f;
23405 }
23407 {
23408 this.ai[0] = 3f;
23409 this.ai[1] = 0f;
23410 }
23411 }
23412 }
23414 {
23416 {
23418 }
23422 {
23425 }
23427 {
23430 }
23432 float num623 = Main.player[
target].position.X + (float)(Main.player[
target].width / 2);
23433 float num624 = Main.player[
target].position.Y + (float)(Main.player[
target].height / 2);
23436 vector77.X = (int)(
vector77.X / 8f) * 8;
23437 vector77.Y = (int)(
vector77.Y / 8f) * 8;
23441 {
23444 }
23448 {
23451 }
23452 else
23453 {
23457 }
23458 if (Main.player[
target].dead)
23459 {
23462 }
23465 {
23466 this.ai[0] += 1f;
23467 if (this.ai[0] > 0f)
23468 {
23469 velocity.Y += 0.023f;
23470 }
23471 else
23472 {
23473 velocity.Y -= 0.023f;
23474 }
23475 if (this.ai[0] < -100f || this.ai[0] > 100f)
23476 {
23477 velocity.X += 0.023f;
23478 }
23479 else
23480 {
23481 velocity.X -= 0.023f;
23482 }
23483 if (this.ai[0] > 200f)
23484 {
23485 this.ai[0] = -200f;
23486 }
23487 velocity.X +=
num623 * 0.007f;
23488 velocity.Y +=
num624 * 0.007f;
23490 if ((double)velocity.X > 1.5)
23491 {
23492 velocity.X *= 0.9f;
23493 }
23494 if ((double)velocity.X < -1.5)
23495 {
23496 velocity.X *= 0.9f;
23497 }
23498 if ((double)velocity.Y > 1.5)
23499 {
23500 velocity.Y *= 0.9f;
23501 }
23502 if ((double)velocity.Y < -1.5)
23503 {
23504 velocity.Y *= 0.9f;
23505 }
23507 {
23508 velocity.X = 3f;
23509 }
23511 {
23512 velocity.X = -3f;
23513 }
23515 {
23516 velocity.Y = 3f;
23517 }
23519 {
23520 velocity.Y = -3f;
23521 }
23522 }
23523 else
23524 {
23526 {
23529 {
23531 }
23532 }
23534 {
23537 {
23539 }
23540 }
23542 {
23545 {
23547 }
23548 }
23550 {
23553 {
23555 }
23556 }
23558 }
23560 {
23562 }
23565 {
23567 velocity.X = oldVelocity.X * (0f -
num627);
23569 {
23570 velocity.X = 2f;
23571 }
23573 {
23574 velocity.X = -2f;
23575 }
23576 }
23578 {
23580 velocity.Y = oldVelocity.Y * (0f -
num627);
23581 if (
velocity.
Y > 0f && (
double)velocity.Y < 1.5)
23582 {
23583 velocity.Y = 2f;
23584 }
23585 if (
velocity.
Y < 0f && (
double)velocity.Y > -1.5)
23586 {
23587 velocity.Y = -2f;
23588 }
23589 }
23591 {
23593 }
23594 if (Main.netMode == 1)
23595 {
23596 return;
23597 }
23598 if (Main.netMode != 1 && Main.expertMode &&
target >= 0 && (
type == 163 ||
type == 238 ||
type == 236 ||
type == 237) && Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
23599 {
23602 {
23603 localAI[0] -= Main.rand.Next(20, 60);
23605 {
23607 }
23608 }
23609 if (
localAI[0] > (
float)Main.rand.Next(180, 900))
23610 {
23617 }
23618 }
23620 {
23623 {
23624 case 165:
23626 break;
23627 case 237:
23629 break;
23630 case 238:
23632 break;
23633 case 240:
23635 break;
23636 case 531:
23638 break;
23639 }
23641 }
23642 }
23644 {
23645 if (this.ai[2] > 1f)
23646 {
23647 this.ai[2] -= 1f;
23648 }
23649 if (this.ai[2] == 0f)
23650 {
23651 this.ai[0] = -100f;
23652 this.ai[2] = 1f;
23655 }
23657 {
23660 if (this.ai[1] != 5f && Main.rand.Next(3) == 0)
23661 {
23664 Main.dust[
num629].scale = 1.5f;
23665 Main.dust[
num629].noGravity =
true;
23669 }
23670 if (this.ai[1] == 5f)
23671 {
23673 position.X +=
width / 2;
23674 position.Y +=
height / 2;
23677 position.X -=
width / 2;
23678 position.Y -=
height / 2;
23681 if (this.ai[2] > 7f)
23682 {
23684 {
23686 }
23688 {
23690 Main.dust[
num633].noGravity =
true;
23691 Dust dust = Main.dust[
num633];
23692 dust.velocity *= 3f;
23694 dust = Main.dust[
num633];
23695 dust.velocity *= 2f;
23696 Main.dust[
num633].noGravity =
true;
23697 }
23699 {
23701 Gore gore = Main.gore[
num635];
23702 gore.velocity *= 0.3f;
23703 Main.gore[
num635].velocity.X += (float)Main.rand.Next(-10, 11) * 0.05f;
23704 Main.gore[
num635].velocity.Y += (float)Main.rand.Next(-10, 11) * 0.05f;
23705 }
23706 if (this.ai[2] == 9f)
23707 {
23709 }
23710 }
23711 if (this.ai[2] == 1f)
23712 {
23716 }
23718 return;
23719 }
23720 }
23721 if (
type == 378 && this.ai[1] != 5f)
23722 {
23724 {
23725 this.ai[1] = 5f;
23726 this.ai[2] = 10f;
23728 return;
23729 }
23730 }
23732 {
23734 {
23737 }
23739 {
23742 {
23743 velocity.Y = 5f;
23744 }
23745 else
23746 {
23747 velocity.Y -= 2f;
23748 }
23750 }
23752 {
23753 velocity.Y *= 0.95f;
23754 }
23755 velocity.Y -= 0.3f;
23757 {
23758 velocity.Y = -4f;
23759 }
23760 }
23762 {
23764 {
23766 this.ai[2] = 300f;
23767 }
23768 this.ai[3] = 0f;
23769 velocity.X *= 0.8f;
23771 {
23772 velocity.X = 0f;
23773 }
23775 {
23776 this.ai[0] += 2f;
23777 }
23778 else
23779 {
23780 this.ai[0] += 5f;
23781 }
23789 {
23791 }
23792 this.ai[0] += (int)
num639;
23793 if (this.ai[0] >= 0f)
23794 {
23796 if (this.ai[2] == 1f)
23797 {
23799 }
23801 {
23802 if (this.ai[1] == 2f)
23803 {
23804 velocity.Y = -11.5f;
23807 {
23809 }
23810 this.ai[0] = -200f;
23811 this.ai[1] = 0f;
23813 }
23814 else
23815 {
23816 velocity.Y = -7.5f;
23819 {
23821 }
23822 this.ai[0] = -120f;
23823 this.ai[1] += 1f;
23824 }
23825 }
23826 else
23827 {
23829 {
23831 }
23832 if (this.ai[1] == 3f)
23833 {
23834 velocity.Y = -9f;
23837 {
23839 }
23840 this.ai[0] = -200f;
23841 this.ai[1] = 0f;
23843 }
23844 else
23845 {
23846 velocity.Y = -5f;
23849 {
23851 }
23852 this.ai[0] = -120f;
23853 this.ai[1] += 1f;
23854 }
23855 }
23856 }
23857 else if (this.ai[0] >= -30f)
23858 {
23860 }
23862 }
23863 else
23864 {
23866 {
23867 return;
23868 }
23870 {
23873 {
23875 velocity.X *= 0.92f;
23877 {
23878 velocity.Y *= 0.9f;
23879 velocity.Y += 0.1f;
23880 }
23881 }
23883 {
23885 {
23887 }
23888 else
23889 {
23890 velocity.X *= 0.93f;
23891 }
23892 }
23893 }
23895 {
23897 {
23899 }
23900 else
23901 {
23902 velocity.X *= 0.93f;
23903 }
23904 }
23905 }
23906 }
23908 {
23910 if (this.ai[0] == 0f)
23911 {
23913 {
23919 {
23920 this.ai[0] = 1f;
23921 }
23922 }
23924 {
23925 this.ai[0] = 1f;
23926 }
23927 }
23928 else
23929 {
23930 this.ai[0] += 1f;
23931 if (this.ai[0] >= 21f)
23932 {
23933 this.ai[0] = 21f;
23935 }
23936 }
23937 }
23939 {
23940 if (Main.expertMode)
23941 {
23944 }
23946 {
23948 }
23951 if ((
double)(
position.
Y / 16f) < Main.worldSurface)
23952 {
23954 }
23955 if (!Main.player[
target].ZoneJungle)
23956 {
23958 }
23959 if (Main.getGoodWorld)
23960 {
23962 }
23964 if (this.ai[0] != 5f)
23965 {
23967 {
23969 }
23971 {
23972 this.ai[0] = 4f;
23974 }
23975 }
23977 {
23978 this.ai[0] = 5f;
23980 }
23981 if (this.ai[0] == 5f)
23982 {
23983 velocity.Y *= 0.98f;
23985 {
23987 }
23988 else
23989 {
23991 }
23993 if (
position.
X < (
float)(Main.maxTilesX * 8))
23994 {
23996 {
23997 velocity.X *= 0.98f;
23998 }
23999 else
24000 {
24002 }
24003 velocity.X -= 0.08f;
24004 }
24005 else
24006 {
24008 {
24009 velocity.X *= 0.98f;
24010 }
24011 else
24012 {
24014 }
24015 velocity.X += 0.08f;
24016 }
24018 }
24019 else if (this.ai[0] == -1f)
24020 {
24021 if (Main.netMode == 1)
24022 {
24023 return;
24024 }
24025 float num646 = this.ai[1];
24027 do
24028 {
24029 num647 = Main.rand.Next(3);
24031 {
24032 case 1:
24034 break;
24035 case 2:
24037 break;
24038 }
24039 }
24042 this.ai[1] = 0f;
24043 this.ai[2] = 0f;
24045 }
24046 else if (this.ai[0] == 0f)
24047 {
24049 if (Main.expertMode)
24050 {
24052 {
24054 }
24056 {
24058 }
24060 {
24062 }
24063 }
24065 if (this.ai[1] > (
float)(2 *
num648) && this.ai[1] % 2f == 0f)
24066 {
24067 this.ai[0] = -1f;
24068 this.ai[1] = 0f;
24069 this.ai[2] = 0f;
24071 return;
24072 }
24073 if (this.ai[1] % 2f == 0f)
24074 {
24079 {
24081 this.ai[1] += 1f;
24082 this.ai[2] = 0f;
24085 if (Main.expertMode)
24086 {
24089 {
24091 }
24093 {
24095 }
24097 {
24099 }
24101 {
24103 }
24104 }
24115 return;
24116 }
24120 if (Main.expertMode)
24121 {
24123 {
24126 }
24128 {
24131 }
24133 {
24136 }
24138 {
24141 }
24142 }
24146 {
24148 }
24149 else
24150 {
24152 }
24154 {
24155 velocity.Y = 0f -
num654;
24156 }
24158 {
24160 }
24162 {
24163 velocity.X += 0.15f * (float)
direction;
24164 }
24166 {
24167 velocity.X -= 0.15f * (float)
direction;
24168 }
24169 else
24170 {
24171 velocity.X *= 0.8f;
24172 }
24174 {
24175 velocity.X = -16f;
24176 }
24178 {
24179 velocity.X = 16f;
24180 }
24182 return;
24183 }
24185 {
24187 }
24188 else
24189 {
24191 }
24194 if (Main.expertMode)
24195 {
24197 {
24199 }
24201 {
24203 }
24205 {
24207 }
24209 {
24211 }
24212 }
24215 {
24217 }
24221 {
24222 this.ai[2] = 1f;
24224 }
24226 {
24227 this.ai[2] = 1f;
24229 }
24231 {
24233 }
24234 if (this.ai[2] == 1f)
24235 {
24241 if (Main.expertMode)
24242 {
24244 {
24247 }
24249 {
24252 }
24254 {
24257 }
24258 }
24260 {
24262 }
24264 {
24265 this.ai[2] = 0f;
24266 this.ai[1] += 1f;
24268 }
24269 }
24270 else
24271 {
24273 }
24274 }
24275 else if (this.ai[0] == 2f)
24276 {
24281 if (Main.expertMode)
24282 {
24284 }
24290 {
24291 this.ai[0] = 1f;
24292 this.ai[1] = 0f;
24294 return;
24295 }
24298 {
24301 {
24303 }
24304 }
24306 {
24309 {
24311 }
24312 }
24314 {
24317 {
24319 }
24320 }
24322 {
24325 {
24327 }
24328 }
24329 }
24330 else if (this.ai[0] == 1f)
24331 {
24339 this.ai[1] += 1f;
24340 if (Main.expertMode)
24341 {
24344 {
24345 if (Main.player[
num668].active && !Main.player[
num668].dead && (
base.Center - Main.player[
num668].Center).Length() < 1000f)
24346 {
24348 }
24349 }
24350 this.ai[1] +=
num667 / 2;
24352 {
24353 this.ai[1] += 0.25f;
24354 }
24356 {
24357 this.ai[1] += 0.25f;
24358 }
24360 {
24361 this.ai[1] += 0.25f;
24362 }
24364 {
24365 this.ai[1] += 0.25f;
24366 }
24367 }
24370 if (this.ai[1] > (
float)
num669)
24371 {
24372 this.ai[1] = 0f;
24373 this.ai[2]++;
24375 }
24377 {
24379 if (Main.netMode != 1)
24380 {
24381 int num670 = Main.rand.Next(210, 212);
24384 Main.npc[
num671].velocity.Normalize();
24386 nPC3.velocity *= 5f;
24387 Main.npc[
num671].CanBeReplacedByOtherNPCs =
true;
24388 Main.npc[
num671].localAI[0] = 60f;
24389 Main.npc[
num671].netUpdate =
true;
24390 }
24391 }
24393 {
24402 {
24405 {
24407 }
24408 }
24410 {
24413 {
24415 }
24416 }
24418 {
24421 {
24423 }
24424 }
24426 {
24429 {
24431 }
24432 }
24433 }
24434 else
24435 {
24437 }
24439 if (this.ai[2] > 5f)
24440 {
24441 this.ai[0] = -1f;
24442 this.ai[1] = 1f;
24444 }
24445 }
24446 else if (this.ai[0] == 3f)
24447 {
24450 if (Main.expertMode)
24451 {
24454 }
24462 this.ai[1] += 1f;
24465 if (Main.expertMode)
24466 {
24468 }
24471 {
24473 if (Main.netMode != 1)
24474 {
24476 if (Main.expertMode)
24477 {
24479 }
24480 if (Main.expertMode && (
double)
life < (double)
lifeMax * 0.1)
24481 {
24483 }
24488 {
24490 }
24492 {
24494 }
24504 Main.projectile[
num688].timeLeft = 300;
24505 }
24506 }
24508 {
24512 {
24514 }
24521 {
24524 {
24526 }
24527 }
24529 {
24532 {
24534 }
24535 }
24537 {
24540 {
24542 }
24543 }
24545 {
24548 {
24550 }
24551 }
24552 }
24554 {
24559 {
24562 {
24563 velocity.X +=
num675 * 2f;
24564 }
24565 }
24567 {
24570 {
24571 velocity.X -=
num675 * 2f;
24572 }
24573 }
24575 {
24578 {
24579 velocity.Y +=
num675 * 2f;
24580 }
24581 }
24583 {
24586 {
24587 velocity.Y -=
num675 * 2f;
24588 }
24589 }
24590 }
24594 {
24595 this.ai[0] = -1f;
24596 this.ai[1] = 3f;
24598 }
24599 }
24600 else if (this.ai[0] == 4f)
24601 {
24610 {
24612 }
24613 else
24614 {
24616 }
24619 {
24620 this.ai[0] = -1f;
24622 }
24623 }
24624 }
24626 {
24629 {
24631 {
24633 }
24634 else
24635 {
24637 }
24639 }
24641 {
24643 {
24645 }
24646 else
24647 {
24649 }
24651 }
24653 {
24656 {
24657 velocity.Y = -6f;
24660 {
24663 dust.velocity *= 0.5f;
24664 dust2.scale = 1f + Main.rand.NextFloat() * 0.5f;
24665 dust2.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
24668 }
24669 }
24672 {
24674 }
24676 {
24678 {
24681 dust.velocity *= 1f;
24682 dust3.scale = 1f + Main.rand.NextFloat() * 0.5f;
24683 dust3.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
24686 }
24687 }
24688 if (Main.rand.Next(3) == 0)
24689 {
24692 dust.velocity *= 0f;
24693 dust4.alpha = 120;
24694 dust4.scale = 0.7f + Main.rand.NextFloat() * 0.5f;
24697 }
24699 }
24702 if (
target == 255 || (
type != 587 && Main.player[
target].wet) || Main.player[
target].dead || Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
24703 {
24704 this.ai[0] = 90f;
24706 }
24707 else if (this.ai[0] > 0f)
24708 {
24709 this.ai[0] -= 1f;
24711 }
24713 {
24715 }
24725 {
24735 {
24737 {
24739 {
24740 velocity.X -= 0.05f;
24741 }
24742 else
24743 {
24744 velocity.X += 0.05f;
24745 }
24747 {
24748 velocity.Y -= 0.05f;
24749 }
24750 else
24751 {
24752 velocity.Y += 0.05f;
24753 }
24754 }
24755 }
24756 }
24757 else if (
type == 581)
24758 {
24768 {
24770 {
24772 {
24773 velocity.X -= 0.05f;
24774 }
24775 else
24776 {
24777 velocity.X += 0.05f;
24778 }
24780 {
24781 velocity.Y -= 0.05f;
24782 }
24783 else
24784 {
24785 velocity.Y += 0.05f;
24786 }
24787 }
24788 }
24789 }
24790 else if (
type == 587)
24791 {
24799 if (Main.dayTime)
24800 {
24803 }
24804 }
24805 if (this.ai[0] <= 0f)
24806 {
24811 {
24813 }
24815 {
24817 }
24818 }
24820 {
24822 {
24825 {
24827 }
24829 {
24830 velocity.X -=
num696 / 2f;
24831 }
24833 {
24834 velocity.X = 0f -
num698;
24835 }
24836 }
24838 {
24841 {
24843 }
24845 {
24846 velocity.X +=
num696 / 2f;
24847 }
24849 {
24851 }
24852 }
24853 }
24855 {
24857 }
24859 {
24862 {
24864 }
24865 }
24866 else
24867 {
24870 {
24872 }
24873 }
24875 {
24876 velocity.Y = 0f -
num699;
24877 }
24879 {
24881 }
24883 {
24885 {
24886 velocity.Y *= 0.95f;
24887 }
24888 velocity.Y -= 0.5f;
24890 {
24891 velocity.Y = -4f;
24892 }
24893 }
24894 }
24896 {
24898 }
24900 {
24902 if (Main.getGoodWorld)
24903 {
24905 }
24906 if ((!Main.player[
target].ZoneLihzhardTemple && !Main.player[
target].ZoneJungle) || (
double)Main.player[
target].Center.Y < Main.worldSurface * 16.0)
24907 {
24909 }
24912 {
24914 return;
24915 }
24924 {
24928 }
24929 else
24930 {
24935 }
24937 {
24940 {
24942 }
24943 this.ai[1] = 30f;
24944 }
24945 if (this.ai[0] == 0f)
24946 {
24947 this.ai[1] += 1f;
24949 if (this.ai[1] < 20f || this.ai[1] > (
float)(
num711 - 20))
24950 {
24951 this.ai[1] += 2f * (
num706 - 1f) / 3f;
24953 }
24954 else
24955 {
24956 this.ai[1] += 1f * (
num706 - 1f) / 2f;
24958 }
24959 if (this.ai[1] >= (
float)
num711)
24960 {
24962 this.ai[1] = 0f;
24973 if (Main.netMode != 1)
24974 {
24976 }
24977 }
24978 }
24979 else if (this.ai[0] == 1f)
24980 {
24984 {
24986 vector91.X -= 40f *
scale;
24987 }
24988 else if (Main.player[
target].Center.X >
base.Center.X + (
float)
width)
24989 {
24991 vector91.X += 40f *
scale;
24992 }
24993 else
24994 {
24996 }
25000 {
25002 }
25004 {
25006 }
25008 if (this.ai[1] < 20f || this.ai[1] > (
float)(
num720 - 20))
25009 {
25011 }
25012 else
25013 {
25015 }
25016 if (this.ai[1] >= (
float)
num720)
25017 {
25019 this.ai[1] = 0f;
25029 if (Main.netMode != 1)
25030 {
25032 }
25033 }
25036 {
25038 }
25040 {
25042 }
25044 {
25046 }
25047 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
25048 {
25049 this.ai[2] += 4f;
25050 }
25051 if (this.ai[2] > (float)(60 + Main.rand.Next(600)))
25052 {
25053 this.ai[2] = 0f;
25057 {
25059 {
25062 {
25063 vector91.X -= 18f *
scale;
25064 }
25065 else
25066 {
25067 vector91.X += 18f *
scale;
25068 }
25076 vector91.X +=
num732 * 3f;
25077 vector91.Y +=
num733 * 3f;
25078 if (Main.netMode != 1)
25079 {
25081 Main.projectile[
num735].timeLeft = 300;
25082 }
25083 }
25084 }
25086 {
25089 {
25090 vector91.X -= 30f *
scale;
25091 }
25093 {
25094 vector91.X += 30f *
scale;
25095 }
25103 vector91.X +=
num737 * 3f;
25104 vector91.Y +=
num738 * 3f;
25105 if (Main.netMode != 1)
25106 {
25108 Main.projectile[
num740].timeLeft = 300;
25109 }
25110 }
25111 }
25112 }
25114 {
25115 this.ai[0] = 1f;
25116 }
25117 else
25118 {
25119 this.ai[0] = 0f;
25120 }
25121 }
25123 {
25125 }
25127 {
25130 if (Main.getGoodWorld)
25131 {
25133 }
25134 if ((!Main.player[
target].ZoneLihzhardTemple && !Main.player[
target].ZoneJungle) || (
double)Main.player[
target].Center.Y < Main.worldSurface * 16.0)
25135 {
25137 }
25138 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
25139 {
25142 }
25144 {
25146 }
25148 {
25150 return;
25151 }
25157 float num745 = Main.player[
target].Center.Y - vector92.Y - 300f;
25163 {
25166 {
25168 }
25169 }
25171 {
25174 {
25176 }
25177 }
25179 {
25182 {
25184 }
25185 }
25187 {
25190 {
25192 }
25193 }
25197 {
25199 }
25201 {
25203 }
25205 {
25207 }
25209 {
25211 }
25213 if (this.ai[1] < 20f || this.ai[1] > (
float)(
num748 - 20))
25214 {
25216 }
25217 else
25218 {
25220 }
25222 {
25223 this.ai[1] = 20f;
25224 }
25225 if (this.ai[1] >= (
float)
num748)
25226 {
25228 this.ai[1] = 0f;
25239 if (Main.netMode != 1)
25240 {
25242 }
25243 }
25247 {
25249 }
25251 {
25253 }
25255 {
25257 }
25259 {
25261 }
25263 {
25265 }
25267 {
25269 }
25271 {
25273 }
25275 if (!Collision.CanHit(Main.npc[
golemBoss].Center, 1, 1, Main.player[
target].Center, 1, 1))
25276 {
25278 }
25280 {
25281 this.ai[2] +=
num756 * 10f;
25282 }
25283 if (this.ai[2] > (float)(100 + Main.rand.Next(4800)))
25284 {
25285 this.ai[2] = 0f;
25287 {
25290 {
25291 case 0:
25292 vector94.X -= 14f *
scale;
25293 break;
25294 case 1:
25295 vector94.X += 14f *
scale;
25296 break;
25297 }
25302 {
25305 }
25307 {
25310 }
25312 {
25315 }
25317 {
25320 }
25322 {
25325 }
25326 float num761 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f;
25327 float num762 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f;
25329 {
25332 num761 += Main.player[
target].velocity.X * Main.rand.NextFloat() * 50f;
25333 num762 += Main.player[
target].velocity.Y * Main.rand.NextFloat() * 50f;
25334 }
25341 vector94.X +=
num761 * 3f;
25342 vector94.Y +=
num762 * 3f;
25343 if (Main.netMode != 1)
25344 {
25346 Main.projectile[
num764].timeLeft = 300;
25347 }
25348 }
25349 }
25350 if (!Main.getGoodWorld)
25351 {
25353 int num765 = Main.rand.Next(2) * 2 - 1;
25355 Dust
dust5 = Dust.NewDustPerfect(
vector95, 228, ((
float)
Math.
PI / 2f + -(
float)
Math.
PI / 2f * (
float)
num765 + Main.rand.NextFloatDirection() * ((
float)
Math.
PI / 4f)).ToRotationVector2() * (2f + Main.rand.NextFloat()));
25358 dust5.noGravity = true;
25359 dust5 = Dust.NewDustPerfect(
base.Bottom +
new Vector2(Main.rand.NextFloatDirection() * 6f *
scale, (Main.rand.NextFloat() * -4f - 8f) *
scale), 228,
Vector2.
UnitY * (2f + Main.rand.NextFloat()));
25360 dust5.fadeIn = 0f;
25361 dust5.scale = 0.7f + Main.rand.NextFloat() * 0.5f;
25362 dust5.noGravity = true;
25366 }
25367 }
25369 {
25376 float num769 = Main.player[
target].Center.Y - vector96.Y - 200f;
25379 {
25382 }
25383 else
25384 {
25388 }
25390 {
25393 {
25394 velocity.X +=
num767 * 2f;
25395 }
25396 }
25398 {
25401 {
25402 velocity.X -=
num767 * 2f;
25403 }
25404 }
25406 {
25409 {
25410 velocity.Y +=
num767 * 2f;
25411 }
25412 }
25414 {
25417 {
25418 velocity.Y -=
num767 * 2f;
25419 }
25420 }
25422 {
25423 this.ai[0] += 1f;
25424 if (this.ai[0] > 8f)
25425 {
25426 this.ai[0] = 0f;
25430 }
25431 }
25432 }
25434 {
25437 {
25440 {
25444 return;
25445 }
25446 }
25447 else
25448 {
25450 }
25451 velocity.Y += 0.02f;
25454 {
25455 velocity.Y *= 0.95f;
25456 }
25458 {
25459 velocity.Y = 1f;
25460 }
25462 {
25464 {
25465 velocity.X *= 0.98f;
25466 }
25467 if (Main.expertMode &&
velocity.
X < 0f)
25468 {
25469 velocity.X *= 0.98f;
25470 }
25471 velocity.X += 0.1f;
25472 if (Main.expertMode)
25473 {
25474 velocity.X += 0.1f;
25475 }
25476 }
25478 {
25480 {
25481 velocity.X *= 0.98f;
25482 }
25483 if (Main.expertMode &&
velocity.
X > 0f)
25484 {
25485 velocity.X *= 0.98f;
25486 }
25487 velocity.X -= 0.1f;
25488 if (Main.expertMode)
25489 {
25490 velocity.X -= 0.1f;
25491 }
25492 }
25494 {
25495 velocity.X *= 0.97f;
25496 }
25498 }
25500 {
25504 if (Main.player[
target].dead)
25505 {
25508 }
25509 else if (Main.netMode != 1 &&
target >= 0 &&
target < 255)
25510 {
25513 {
25515 }
25516 }
25518 if (
localAI[0] == 0f && Main.netMode != 1)
25519 {
25524 }
25525 int[]
array2 =
new int[3];
25530 {
25531 if (Main.npc[
num778].active && Main.npc[
num778].aiStyle == 52)
25532 {
25538 {
25539 break;
25540 }
25541 }
25542 }
25548 {
25551 }
25553 {
25555 }
25556 if (!Main.player[
target].ZoneJungle || (
double)Main.player[
target].position.Y < Main.worldSurface * 16.0 || Main.player[
target].position.Y > (float)(Main.UnderworldLayer * 16))
25557 {
25561 }
25562 if (Main.expertMode)
25563 {
25568 }
25569 if (Main.getGoodWorld)
25570 {
25573 }
25578 {
25582 }
25586 {
25588 }
25589 if (Main.expertMode)
25590 {
25592 }
25594 {
25598 }
25606 {
25609 }
25610 else
25611 {
25615 }
25617 {
25620 {
25621 velocity.X +=
num780 * 2f;
25622 }
25623 }
25625 {
25628 {
25629 velocity.X -=
num780 * 2f;
25630 }
25631 }
25633 {
25636 {
25637 velocity.Y +=
num780 * 2f;
25638 }
25639 }
25641 {
25644 {
25645 velocity.Y -=
num780 * 2f;
25646 }
25647 }
25653 {
25657 {
25660 }
25662 if (Main.netMode == 1)
25663 {
25664 return;
25665 }
25668 {
25670 }
25672 {
25674 }
25676 {
25678 }
25680 {
25682 }
25684 {
25686 }
25687 if (Main.expertMode)
25688 {
25690 }
25691 if (Main.expertMode &&
justHit && Main.rand.Next(2) == 0)
25692 {
25694 }
25695 if (Main.getGoodWorld)
25696 {
25698 }
25700 {
25701 return;
25702 }
25706 {
25709 }
25711 {
25714 if (Main.expertMode)
25715 {
25717 }
25728 if (Main.expertMode)
25729 {
25732 }
25734 {
25738 }
25740 {
25744 }
25746 {
25748 }
25750 vector99.X +=
num789 * 3f;
25751 vector99.Y +=
num790 * 3f;
25754 {
25755 Main.projectile[
num794].timeLeft = 300;
25756 }
25757 }
25758 return;
25759 }
25763 {
25766 }
25768 if (Main.netMode != 1)
25769 {
25771 {
25774 if (Main.getGoodWorld)
25775 {
25777 }
25779 {
25781 }
25782 if (Main.expertMode)
25783 {
25785 {
25786 if (Main.npc[
num799].active && Main.npc[
num799].aiStyle == 52)
25787 {
25789 {
25792 }
25793 }
25794 }
25795 }
25796 }
25797 else if (Main.expertMode && Main.rand.Next(60) == 0)
25798 {
25801 {
25802 if (Main.npc[
num803].active && Main.npc[
num803].type == 264 && Main.npc[
num803].ai[3] == 0f)
25803 {
25805 }
25806 }
25807 if (
num802 < 8 && Main.rand.Next((
num802 + 1) * 10) <= 1)
25808 {
25810 }
25811 }
25812 }
25814 {
25819 }
25820 if (Main.netMode == 1)
25821 {
25822 return;
25823 }
25826 {
25828 }
25830 {
25832 }
25834 {
25836 }
25838 {
25840 }
25842 {
25845 float num806 = Main.player[
target].position.X + (float)Main.player[
target].width * 0.5f -
vector100.X + (
float)Main.rand.Next(-10, 11);
25847 float num808 = Main.player[
target].position.Y + (float)Main.player[
target].height * 0.5f -
vector100.Y + (
float)Main.rand.Next(-10, 11);
25849 {
25851 }
25860 Main.npc[
num810].netUpdate =
true;
25862 }
25863 }
25865 {
25869 {
25872 return;
25873 }
25874 if (Main.player[Main.npc[
plantBoss].target].dead)
25875 {
25877 }
25878 if ((
plantBoss != -1 && !Main.player[Main.npc[
plantBoss].target].ZoneJungle) || (
double)Main.player[Main.npc[
plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[
plantBoss].target].position.Y > (
float)(Main.UnderworldLayer * 16) ||
flag43)
25879 {
25882 }
25883 if (Main.netMode == 1)
25884 {
25885 if (this.ai[0] == 0f)
25886 {
25887 this.ai[0] = (int)(
base.Center.X / 16f);
25888 }
25889 if (this.ai[1] == 0f)
25890 {
25891 this.ai[1] = (int)(
base.Center.X / 16f);
25892 }
25893 }
25894 if (Main.netMode != 1)
25895 {
25896 if (this.ai[0] == 0f || this.ai[1] == 0f)
25897 {
25899 }
25902 {
25904 }
25906 {
25908 }
25910 {
25912 }
25914 {
25916 {
25918 {
25919 localAI[0] = Main.rand.Next(60, 300);
25920 }
25921 }
25922 }
25924 {
25925 localAI[0] = Main.rand.Next(300, 600);
25929 {
25931 int num813 = (int)(Main.player[Main.npc[
plantBoss].target].Center.X / 16f);
25932 int num814 = (int)(Main.player[Main.npc[
plantBoss].target].Center.Y / 16f);
25933 if (this.ai[0] == 0f)
25934 {
25937 }
25939 {
25942 }
25947 if (Main.npc[
plantBoss].life < Main.npc[
plantBoss].lifeMax / 2 && Main.rand.Next(6) == 0)
25948 {
25950 int num818 = (int)(Main.player[
target].Center.X / 16f);
25951 int num819 = (int)(Main.player[
target].Center.Y / 16f);
25953 {
25956 }
25957 }
25958 try
25959 {
25961 {
25966 }
25967 }
25968 catch
25969 {
25970 }
25971 }
25972 }
25973 }
25974 if (!(this.ai[0] > 0f) || !(this.ai[1] > 0f))
25975 {
25976 return;
25977 }
25980 {
25982 }
25984 {
25986 }
25987 if (Main.expertMode)
25988 {
25990 }
25992 {
25994 }
25996 {
25998 }
26000 {
26002 }
26008 {
26009 if (Main.netMode != 1 && Main.getGoodWorld &&
localAI[3] == 1f)
26010 {
26013 }
26016 }
26017 else
26018 {
26019 if (Main.netMode != 1 && Main.getGoodWorld)
26020 {
26022 }
26026 }
26031 }
26033 {
26034 if (Main.getGoodWorld)
26035 {
26036 if (Main.rand.Next(10) == 0)
26037 {
26039 }
26040 else
26041 {
26043 }
26044 }
26046 {
26049 return;
26050 }
26052 if (this.ai[3] > 0f)
26053 {
26054 num826 = (int)this.ai[3] - 1;
26055 }
26056 if (Main.netMode != 1)
26057 {
26060 {
26061 localAI[0] = Main.rand.Next(120, 480);
26062 this.ai[0] = Main.rand.Next(-100, 101);
26063 this.ai[1] = Main.rand.Next(-100, 101);
26065 }
26066 }
26071 {
26073 }
26075 {
26077 }
26078 if (Main.expertMode)
26079 {
26083 }
26084 if (Main.getGoodWorld)
26085 {
26087 }
26089 {
26091 return;
26092 }
26105 {
26108 {
26109 velocity.X *= 0.9f;
26110 }
26111 }
26113 {
26116 {
26117 velocity.X *= 0.9f;
26118 }
26119 }
26121 {
26124 {
26125 velocity.Y *= 0.9f;
26126 }
26127 }
26129 {
26132 {
26133 velocity.Y *= 0.9f;
26134 }
26135 }
26137 {
26138 velocity.X = 8f;
26139 }
26141 {
26142 velocity.X = -8f;
26143 }
26145 {
26146 velocity.Y = 8f;
26147 }
26149 {
26150 velocity.Y = -8f;
26151 }
26153 {
26156 }
26158 {
26161 }
26162 }
26164 {
26166 if (Main.netMode != 1 &&
localAI[0] == 0f)
26167 {
26171 {
26172 float x2 =
base.Center.X;
26173 float y4 =
base.Center.Y;
26177 Main.npc[
num838].velocity =
new Vector2((
float)Main.rand.Next(-30, 31) * 0.1f, (
float)Main.rand.Next(-30, 31) * 0.1f);
26178 Main.npc[
num838].netUpdate =
true;
26179 }
26180 }
26181 if (Main.netMode != 1)
26182 {
26186 {
26189 if (Main.netMode == 2)
26190 {
26191 NetMessage.SendData(23, -1, -1,
null,
whoAmI);
26192 }
26193 }
26194 }
26195 if (this.ai[0] < 0f)
26196 {
26197 if (Main.getGoodWorld)
26198 {
26200 }
26202 {
26205 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 392);
26206 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 393);
26207 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 394);
26208 Gore.NewGore(
position,
new Vector2((
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f), 395);
26210 {
26211 Dust.NewDust(
position,
width,
height, 5, (
float)Main.rand.Next(-30, 31) * 0.2f, (
float)Main.rand.Next(-30, 31) * 0.2f);
26212 }
26214 }
26225 velocity.X = (velocity.X * 50f +
num841) / 51f;
26226 velocity.Y = (velocity.Y * 50f +
num842) / 51f;
26227 if (this.ai[0] == -1f)
26228 {
26229 if (Main.netMode != 1)
26230 {
26233 {
26234 localAI[1] -= Main.rand.Next(5);
26235 }
26236 int num845 = 60 + Main.rand.Next(120);
26237 if (Main.netMode != 0)
26238 {
26239 num845 += Main.rand.Next(30, 90);
26240 }
26242 {
26247 do
26248 {
26257 if (Main.rand.Next(2) == 0)
26258 {
26260 }
26261 if (Main.rand.Next(2) == 0)
26262 {
26264 }
26267 {
26269 }
26273 {
26274 this.ai[3] = 0f;
26275 this.ai[0] = -2f;
26280 break;
26281 }
26282 }
26284 }
26285 }
26286 }
26287 else if (this.ai[0] == -2f)
26288 {
26290 if (Main.netMode != 0)
26291 {
26292 this.ai[3] += 15f;
26293 }
26294 else
26295 {
26296 this.ai[3] += 25f;
26297 }
26298 if (this.ai[3] >= 255f)
26299 {
26300 this.ai[3] = 255f;
26301 position.X = this.ai[1] * 16f - (float)(
width / 2);
26302 position.Y = this.ai[2] * 16f - (float)(
height / 2);
26304 this.ai[0] = -3f;
26307 }
26308 alpha = (int)this.ai[3];
26309 }
26310 else if (this.ai[0] == -3f)
26311 {
26312 if (Main.netMode != 0)
26313 {
26314 this.ai[3] -= 15f;
26315 }
26316 else
26317 {
26318 this.ai[3] -= 25f;
26319 }
26320 if (this.ai[3] <= 0f)
26321 {
26322 this.ai[3] = 0f;
26323 this.ai[0] = -1f;
26326 }
26327 alpha = (int)this.ai[3];
26328 }
26329 }
26330 else
26331 {
26338 if (Main.getGoodWorld)
26339 {
26341 }
26343 {
26346 }
26347 else
26348 {
26352 }
26353 if (this.ai[0] == 0f)
26354 {
26355 if (Main.netMode != 1)
26356 {
26359 {
26360 if (Main.npc[
num858].active && Main.npc[
num858].type == 267)
26361 {
26363 }
26364 }
26366 {
26367 this.ai[0] = -1f;
26371 }
26373 if (
localAI[1] >= (
float)(120 + Main.rand.Next(300)))
26374 {
26379 do
26380 {
26389 if (Main.rand.Next(2) == 0)
26390 {
26392 }
26393 if (Main.rand.Next(2) == 0)
26394 {
26396 }
26399 {
26401 }
26405 {
26406 this.ai[0] = 1f;
26410 break;
26411 }
26412 }
26414 }
26415 }
26416 }
26417 else if (this.ai[0] == 1f)
26418 {
26421 {
26424 position.X = this.ai[1] * 16f - (float)(
width / 2);
26425 position.Y = this.ai[2] * 16f - (float)(
height / 2);
26426 this.ai[0] = 2f;
26427 }
26428 }
26429 else if (this.ai[0] == 2f)
26430 {
26433 {
26435 this.ai[0] = 0f;
26436 }
26437 }
26438 }
26439 if (Main.player[
target].dead || !Main.player[
target].ZoneCrimson)
26440 {
26442 {
26444 }
26446 {
26447 velocity.Y += (
localAI[3] - 60f) * 0.25f;
26448 }
26449 this.ai[0] = 2f;
26451 }
26453 {
26455 }
26456 }
26458 {
26460 {
26463 return;
26464 }
26465 if (this.ai[0] == 0f)
26466 {
26467 this.ai[1] = 0f;
26473 {
26477 velocity.X = (velocity.X * 15f +
num866) / 16f;
26478 velocity.Y = (velocity.Y * 15f +
num867) / 16f;
26479 return;
26480 }
26482 {
26483 velocity.Y *= 1.05f;
26484 velocity.X *= 1.05f;
26485 }
26486 if (Main.netMode != 1 && ((Main.expertMode && Main.rand.Next(100) == 0) || Main.rand.Next(200) == 0))
26487 {
26496 this.ai[0] = 1f;
26498 }
26499 return;
26500 }
26501 if (Main.expertMode)
26502 {
26505 if (Main.getGoodWorld)
26506 {
26509 }
26510 else
26511 {
26514 }
26515 }
26521 {
26522 this.ai[0] = 0f;
26523 }
26524 else
26525 {
26527 {
26528 return;
26529 }
26531 {
26532 this.ai[1] += 1f;
26533 if (this.ai[1] > 5f)
26534 {
26535 this.ai[0] = 0f;
26536 }
26537 }
26538 else
26539 {
26540 this.ai[0] = 0f;
26541 }
26542 }
26543 }
26545 {
26555 velocity.X = (velocity.X * 100f +
num872) / 101f;
26556 velocity.Y = (velocity.Y * 100f +
num873) / 101f;
26560 Dust dust = Main.dust[
num876];
26561 dust.velocity *= 0.1f;
26562 Main.dust[
num876].scale = 1.3f;
26563 Main.dust[
num876].noGravity =
true;
26565 }
26567 {
26571 if (!Main.dayTime)
26572 {
26574 }
26577 {
26579 }
26581 {
26583 }
26585 {
26586 Lighting.AddLight(
base.Bottom +
new Vector2(0f, -30f), 0.3f, 0.16f, 0.125f);
26587 }
26589 {
26590 Lighting.AddLight(
base.Bottom +
new Vector2(0f, -30f), 0.3f, 0.125f, 0.06f);
26591 }
26592 if (Main.dayTime)
26593 {
26596 }
26597 else if (this.ai[0] == 0f)
26598 {
26599 this.ai[1] += 1f;
26601 {
26602 this.ai[1] += 1f;
26603 }
26605 {
26606 this.ai[1] += 1f;
26607 }
26608 if (this.ai[1] >= 300f && Main.netMode != 1)
26609 {
26610 this.ai[1] = 0f;
26612 {
26613 this.ai[0] = Main.rand.Next(3, 5);
26614 }
26615 else
26616 {
26617 this.ai[0] = Main.rand.Next(1, 3);
26618 }
26620 }
26621 }
26622 else if (this.ai[0] == 1f)
26623 {
26625 {
26626 if (Main.rand.Next(5) == 0)
26627 {
26628 int num878 = Dust.NewDust(
position + Main.rand.NextVector2Square(0f, 1f) *
base.Size -
new Vector2(1f, 2f), 10, 14, 245, 0f, 0f, 254,
Color.
Transparent, 0.25f);
26629 Dust dust = Main.dust[
num878];
26630 dust.velocity *= 0.2f;
26631 }
26633 this.ai[1] += 1f;
26634 if (this.ai[1] % 5f == 0f)
26635 {
26639 num879 += (float)Main.rand.Next(-50, 51);
26640 num880 += (float)Main.rand.Next(-50, 51);
26647 num879 *= 1f + (float)Main.rand.Next(-20, 21) * 0.02f;
26648 num880 *= 1f + (float)Main.rand.Next(-20, 21) * 0.02f;
26649 int num883 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector110.X,
vector110.Y,
num879,
num880, 345, 43, 0f, Main.myPlayer, Main.rand.Next(0, 31));
26650 }
26651 if (this.ai[1] >= 180f)
26652 {
26653 this.ai[1] = 0f;
26654 this.ai[0] = 0f;
26655 }
26656 }
26657 else
26658 {
26660 this.ai[1] += 1f;
26661 if (this.ai[1] % 15f == 0f)
26662 {
26671 num884 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
26672 num885 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
26674 }
26675 if (this.ai[1] >= 120f)
26676 {
26677 this.ai[1] = 0f;
26678 this.ai[0] = 0f;
26679 }
26680 }
26681 }
26682 else if (this.ai[0] == 2f)
26683 {
26685 {
26687 this.ai[1] += 1f;
26688 if (this.ai[1] > 60f && this.ai[1] < 240f && this.ai[1] % 15f == 0f)
26689 {
26696 num890 += (float)Main.rand.Next(-50, 51);
26697 num891 -= (float)Main.rand.Next(50, 201);
26702 num890 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
26703 num891 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
26704 int num893 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector112.X,
vector112.Y,
num890,
num891, 346, 57, 0f, Main.myPlayer, 0f, Main.rand.Next(2));
26705 }
26706 if (this.ai[1] >= 300f)
26707 {
26708 this.ai[1] = 0f;
26709 this.ai[0] = 0f;
26710 }
26711 }
26712 else
26713 {
26715 this.ai[1] += 1f;
26716 if (this.ai[1] > 60f && this.ai[1] < 240f && this.ai[1] % 8f == 0f)
26717 {
26725 {
26727 }
26728 num895 += (float)Main.rand.Next(-50, 51);
26729 num896 -= (float)Main.rand.Next(50, 201);
26734 num895 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
26735 num896 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
26737 }
26738 if (this.ai[1] >= 300f)
26739 {
26740 this.ai[1] = 0f;
26741 this.ai[0] = 0f;
26742 }
26743 }
26744 }
26745 else if (this.ai[0] == 3f)
26746 {
26748 this.ai[1] += 1f;
26749 if (this.ai[1] % 30f == 0f)
26750 {
26759 num899 *= 1f + (float)Main.rand.Next(-20, 21) * 0.001f;
26760 num900 *= 1f + (float)Main.rand.Next(-20, 21) * 0.001f;
26762 }
26763 if (this.ai[1] >= 120f)
26764 {
26765 this.ai[1] = 0f;
26766 this.ai[0] = 0f;
26767 }
26768 }
26769 else if (this.ai[0] == 4f)
26770 {
26772 this.ai[1] += 1f;
26773 if (this.ai[1] % 10f == 0f)
26774 {
26782 {
26784 }
26785 num905 += (float)Main.rand.Next(-50, 51);
26786 num906 -= (float)Main.rand.Next(50, 201);
26791 num905 *= 1f + (float)Main.rand.Next(-30, 31) * 0.005f;
26792 num906 *= 1f + (float)Main.rand.Next(-30, 31) * 0.005f;
26794 }
26795 if (this.ai[1] >= 240f)
26796 {
26797 this.ai[1] = 0f;
26798 this.ai[0] = 0f;
26799 }
26800 }
26802 {
26804 }
26806 {
26807 velocity.X *= 0.9f;
26808 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
26809 {
26810 velocity.X = 0f;
26811 }
26812 }
26813 else
26814 {
26816 {
26817 velocity.X = (velocity.X * 20f +
num877) / 21f;
26818 }
26820 {
26821 velocity.X = (velocity.X * 20f -
num877) / 21f;
26822 }
26823 }
26829 {
26831 }
26833 {
26834 velocity.Y += 0.5f;
26835 }
26837 {
26839 {
26840 velocity.Y = 0f;
26841 }
26843 {
26844 velocity.Y -= 0.025f;
26845 }
26846 else
26847 {
26848 velocity.Y -= 0.2f;
26849 }
26851 {
26852 velocity.Y = -4f;
26853 }
26854 }
26855 else
26856 {
26858 {
26859 velocity.Y = 0f;
26860 }
26862 {
26863 velocity.Y += 0.025f;
26864 }
26865 else
26866 {
26867 velocity.Y += 0.5f;
26868 }
26869 }
26871 {
26872 velocity.Y = 10f;
26873 }
26874 }
26876 {
26879 {
26883 {
26885 }
26886 }
26888 {
26889 Lighting.AddLight(
base.Center, 0.4f, 0.4f, 0.2f);
26890 }
26891 if (Main.netMode != 1)
26892 {
26895 {
26896 this.ai[3] = Main.rand.Next(3);
26898 }
26899 else if (this.ai[3] == 0f &&
localAI[2] % 30f == 0f &&
localAI[2] > 30f)
26900 {
26904 {
26907 num912 += (float)Main.rand.Next(-50, 51);
26908 num913 += (float)Main.rand.Next(50, 201);
26914 num912 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
26915 num913 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
26917 }
26918 }
26919 }
26920 if (this.ai[0] == 0f && Main.netMode != 1)
26921 {
26923 this.ai[0] = 1f;
26925 Main.npc[
num916].ai[0] = -1f;
26928 Main.npc[
num916].netUpdate =
true;
26930 Main.npc[
num916].ai[0] = 1f;
26932 Main.npc[
num916].ai[3] = 150f;
26934 Main.npc[
num916].netUpdate =
true;
26935 }
26937 {
26940 {
26941 this.ai[1] = 2f;
26942 }
26943 }
26944 if (Main.dayTime)
26945 {
26946 velocity.Y += 0.3f;
26947 velocity.X *= 0.9f;
26948 }
26949 else if (this.ai[1] == 0f)
26950 {
26951 this.ai[2] += 1f;
26952 if (this.ai[2] >= 300f)
26953 {
26954 if (this.ai[3] != 1f)
26955 {
26956 this.ai[1] = 0f;
26957 this.ai[2] = 0f;
26958 }
26959 else
26960 {
26961 this.ai[2] = 0f;
26962 this.ai[1] = 1f;
26965 }
26966 }
26972 if (this.ai[3] == 1f)
26973 {
26975 {
26977 }
26979 {
26981 }
26983 {
26985 }
26986 }
26988 {
26990 velocity.X = (velocity.X * 14f +
num917 *
num919) / 15f;
26991 velocity.Y = (velocity.Y * 14f +
num918 *
num919) / 15f;
26992 }
26993 }
26994 else if (this.ai[1] == 1f)
26995 {
26996 this.ai[2] += 1f;
26997 if (this.ai[2] >= 600f || this.ai[3] != 1f)
26998 {
26999 this.ai[2] = 0f;
27000 this.ai[1] = 0f;
27001 }
27007 velocity.X = (velocity.X * 49f +
num921 *
num923) / 50f;
27008 velocity.Y = (velocity.Y * 49f +
num922 *
num923) / 50f;
27009 }
27010 else if (this.ai[1] == 2f)
27011 {
27012 this.ai[1] = 3f;
27013 velocity.Y += 0.1f;
27015 {
27016 velocity.Y *= 0.95f;
27017 }
27018 velocity.X *= 0.95f;
27020 }
27022 }
27024 {
27026 if (!Main.npc[(
int)this.ai[1]].active || Main.npc[(int)this.ai[1]].
aiStyle != 58)
27027 {
27028 this.ai[2] += 10f;
27029 if (this.ai[2] > 50f || Main.netMode != 2)
27030 {
27034 }
27035 }
27036 if (Main.netMode != 1 && Main.npc[(int)this.ai[1]].ai[3] == 2f)
27037 {
27040 {
27050 int num928 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
num925,
num926, 329, 60, 0f, Main.myPlayer,
rotation,
spriteDirection);
27051 }
27052 }
27053 if (Main.dayTime)
27054 {
27055 velocity.Y += 0.3f;
27056 velocity.X *= 0.9f;
27057 }
27058 else if (this.ai[2] == 0f || this.ai[2] == 3f)
27059 {
27060 if (Main.npc[(int)this.ai[1]].ai[1] == 3f)
27061 {
27063 }
27064 this.ai[3] += 1f;
27065 if (this.ai[3] >= 180f)
27066 {
27067 this.ai[2] += 1f;
27068 this.ai[3] = 0f;
27070 }
27076 float num931 =
Math.
Abs(Main.player[
target].Center.X - Main.npc[(
int)this.ai[1]].Center.X) +
Math.
Abs(Main.player[
target].Center.Y - Main.npc[(
int)this.ai[1]].Center.Y);
27078 {
27081 }
27085 {
27087 }
27089 {
27091 }
27093 {
27095 }
27097 {
27099 }
27101 {
27103 }
27104 if (this.ai[0] < 0f &&
base.Center.X > Main.npc[(
int)this.ai[1]].Center.X)
27105 {
27107 }
27108 if (this.ai[0] > 0f &&
base.Center.X < Main.npc[(
int)this.ai[1]].Center.X)
27109 {
27111 }
27113 velocity.X = (velocity.X * 14f +
num929 *
num932) / 15f;
27114 velocity.Y = (velocity.Y * 14f +
num930 *
num932) / 15f;
27117 {
27119 }
27120 }
27121 else if (this.ai[2] == 1f)
27122 {
27128 velocity.X *= 0.95f;
27129 velocity.Y -= 0.3f;
27131 {
27132 velocity.Y = -14f;
27133 }
27134 if (
position.
Y < Main.npc[(
int)this.ai[1]].position.Y - 200f)
27135 {
27137 this.ai[2] = 2f;
27146 }
27147 }
27148 else if (this.ai[2] == 2f)
27149 {
27150 float num937 =
Math.
Abs(
base.Center.X - Main.npc[(
int)this.ai[1]].Center.X) +
Math.
Abs(
base.Center.Y - Main.npc[(
int)this.ai[1]].Center.Y);
27152 {
27153 this.ai[2] = 3f;
27154 }
27155 }
27156 else if (this.ai[2] == 4f)
27157 {
27163 velocity.Y *= 0.95f;
27164 velocity.X += 0.3f * (0f - this.ai[0]);
27166 {
27167 velocity.X = -14f;
27168 }
27170 {
27171 velocity.X = 14f;
27172 }
27173 if (
position.
X + (
float)(
width / 2) < Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) - 500f ||
position.
X + (
float)(
width / 2) > Main.npc[(
int)this.ai[1]].position.X + (float)(Main.npc[(
int)this.ai[1]].width / 2) + 500f)
27174 {
27176 this.ai[2] = 5f;
27185 }
27186 }
27187 else if (this.ai[2] == 5f)
27188 {
27189 float num941 =
Math.
Abs(
base.Center.X - Main.npc[(
int)this.ai[1]].Center.X) +
Math.
Abs(
base.Center.Y - Main.npc[(
int)this.ai[1]].Center.Y);
27191 {
27192 this.ai[2] = 0f;
27193 }
27194 }
27195 }
27197 {
27198 if (Main.dayTime)
27199 {
27201 {
27202 velocity.X += 0.25f;
27203 }
27204 else
27205 {
27206 velocity.X -= 0.25f;
27207 }
27208 velocity.Y -= 0.1f;
27210 }
27211 else if (this.ai[0] == 0f)
27212 {
27213 if (this.ai[2] == 0f)
27214 {
27216 if (
base.Center.X < Main.player[
target].Center.X)
27217 {
27218 this.ai[2] = 1f;
27219 }
27220 else
27221 {
27222 this.ai[2] = -1f;
27223 }
27224 }
27229 {
27230 this.ai[2] = 0f;
27231 }
27233 {
27234 this.ai[2] = 0f;
27235 }
27239 {
27242 }
27244 {
27247 }
27249 {
27252 }
27253 velocity.X += this.ai[2] *
num944;
27255 {
27257 }
27259 {
27260 velocity.X = 0f -
num945;
27261 }
27264 {
27265 velocity.Y -= 0.2f;
27266 }
27268 {
27269 velocity.Y += 0.2f;
27270 }
27272 {
27273 velocity.Y = 8f;
27274 }
27276 {
27277 velocity.Y = -8f;
27278 }
27280 if ((
num943 < 500f || this.ai[3] < 0f) && position.Y < Main.player[
target].position.Y)
27281 {
27282 this.ai[3] += 1f;
27285 {
27287 }
27289 {
27291 }
27293 {
27295 }
27297 if (this.ai[3] > (
float)
num947)
27298 {
27300 }
27301 if (this.ai[3] == 0f && Main.netMode != 1)
27302 {
27304 vector124.X += velocity.X * 7f;
27310 {
27312 }
27314 {
27316 }
27318 {
27320 }
27325 }
27326 }
27327 else if (this.ai[3] < 0f)
27328 {
27329 this.ai[3] += 1f;
27330 }
27331 if (Main.netMode != 1)
27332 {
27333 this.ai[1] += Main.rand.Next(1, 4);
27334 if (this.ai[1] > 800f &&
num943 < 600f)
27335 {
27336 this.ai[0] = -1f;
27337 }
27338 }
27339 }
27340 else if (this.ai[0] == 1f)
27341 {
27346 {
27349 }
27351 {
27354 }
27356 {
27359 }
27362 if (
base.Center.X < Main.player[
target].Center.X)
27363 {
27366 {
27367 velocity.X *= 0.98f;
27368 }
27369 }
27370 if (
base.Center.X > Main.player[
target].Center.X)
27371 {
27374 {
27375 velocity.X *= 0.98f;
27376 }
27377 }
27379 {
27380 velocity.X *= 0.95f;
27381 }
27384 {
27385 velocity.Y -= 0.1f;
27386 }
27388 {
27389 velocity.Y += 0.1f;
27390 }
27392 {
27393 velocity.Y = 6f;
27394 }
27396 {
27397 velocity.Y = -6f;
27398 }
27400 if (Main.netMode != 1)
27401 {
27402 this.ai[3] += 1f;
27405 {
27407 }
27409 {
27411 }
27413 {
27415 }
27417 {
27419 }
27421 if (this.ai[3] >= (
float)
num956)
27422 {
27423 this.ai[3] = 0f;
27428 {
27431 {
27433 }
27435 float speedX2 = velocity.X * 0.25f;
27437 }
27438 }
27439 }
27440 if (Main.netMode != 1)
27441 {
27442 this.ai[1] += Main.rand.Next(1, 4);
27443 if (this.ai[1] > 600f)
27444 {
27445 this.ai[0] = -1f;
27446 }
27447 }
27448 }
27449 else if (this.ai[0] == 2f)
27450 {
27453 float num959 = Main.rand.Next(-1000, 1001);
27454 float num960 = Main.rand.Next(-1000, 1001);
27462 vector126.X +=
num959 * 4f;
27463 vector126.Y +=
num960 * 4f;
27464 this.ai[3] += 1f;
27467 {
27469 }
27471 {
27473 }
27475 {
27477 }
27479 {
27481 }
27482 if (this.ai[3] > (
float)
num963)
27483 {
27484 this.ai[3] = 0f;
27486 }
27487 if (Main.netMode != 1)
27488 {
27489 this.ai[1] += Main.rand.Next(1, 4);
27490 if (this.ai[1] > 500f)
27491 {
27492 this.ai[0] = -1f;
27493 }
27494 }
27495 }
27496 if (this.ai[0] == -1f)
27497 {
27498 int num965 = Main.rand.Next(3);
27501 {
27503 }
27505 this.ai[1] = 0f;
27506 this.ai[2] = 0f;
27507 this.ai[3] = 0f;
27508 }
27509 }
27511 {
27515 if (!Main.dayTime)
27516 {
27518 }
27521 {
27523 }
27525 {
27527 }
27529 {
27531 }
27535 {
27536 Lighting.AddLight(
center4, 0.3f, 0.26f, 0.05f);
27537 }
27538 if (Main.dayTime)
27539 {
27543 {
27544 velocity.X = 0.1f;
27545 }
27546 }
27547 else if (this.ai[0] == 0f)
27548 {
27549 this.ai[1] += 1f;
27550 if (this.ai[1] >= 300f && Main.netMode != 1)
27551 {
27553 this.ai[1] = 0f;
27554 this.ai[0] = 1f;
27556 }
27557 }
27558 else if (this.ai[0] == 1f)
27559 {
27560 this.ai[1] += 1f;
27564 {
27566 }
27568 {
27570 }
27572 {
27574 }
27575 if (this.ai[1] % (
float)
num967 == 0f)
27576 {
27580 num968 += (float)Main.rand.Next(-40, 41);
27581 num969 += (float)Main.rand.Next(-40, 41);
27587 num968 *= 1f + (float)Main.rand.Next(-20, 21) * 0.015f;
27588 num969 *= 1f + (float)Main.rand.Next(-20, 21) * 0.015f;
27590 }
27591 if (this.ai[1] > 240f)
27592 {
27593 this.ai[0] = 0f;
27594 this.ai[1] = 0f;
27595 }
27596 }
27597 if (Main.netMode != 1)
27598 {
27603 {
27607 }
27609 {
27613 }
27615 {
27619 }
27620 if (Main.rand.Next(
num973) == 0)
27621 {
27631 }
27632 if (Main.rand.Next(
num974) == 0)
27633 {
27635 }
27637 {
27641 {
27645 num982 += (float)Main.rand.Next(-50, 51);
27646 num983 += (float)Main.rand.Next(-50, 51);
27652 num982 *= 1f + (float)Main.rand.Next(-20, 21) * 0.015f;
27653 num983 *= 1f + (float)Main.rand.Next(-20, 21) * 0.015f;
27655 }
27657 {
27659 }
27660 }
27661 if (Main.rand.Next(
num975) == 0)
27662 {
27664 }
27666 {
27670 {
27672 float num988 = Main.rand.Next(-100, 101);
27679 num988 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
27680 num989 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
27682 }
27684 {
27686 }
27687 }
27688 }
27690 {
27692 }
27694 {
27695 velocity.X *= 0.9f;
27696 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
27697 {
27698 velocity.X = 0f;
27699 }
27700 }
27701 else
27702 {
27704 {
27705 velocity.X = (velocity.X * 20f +
num966) / 21f;
27706 }
27708 {
27709 velocity.X = (velocity.X * 20f -
num966) / 21f;
27710 }
27711 }
27717 {
27719 }
27721 {
27722 velocity.Y += 0.5f;
27723 }
27725 {
27727 {
27728 velocity.Y = 0f;
27729 }
27731 {
27732 velocity.Y -= 0.025f;
27733 }
27734 else
27735 {
27736 velocity.Y -= 0.2f;
27737 }
27739 {
27740 velocity.Y = -4f;
27741 }
27742 }
27743 else
27744 {
27746 {
27747 velocity.Y = 0f;
27748 }
27750 {
27751 velocity.Y += 0.025f;
27752 }
27753 else
27754 {
27755 velocity.Y += 0.5f;
27756 }
27757 }
27759 {
27760 velocity.Y = 10f;
27761 }
27762 }
27764 {
27776 bool flag49 = Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1);
27777 if (Main.dayTime)
27778 {
27783 return;
27784 }
27786 {
27790 return;
27791 }
27794 {
27797 {
27801 num996 += (float)Main.rand.Next(-35, 36);
27802 num997 += (float)Main.rand.Next(-35, 36);
27803 num996 *= 1f + (float)Main.rand.Next(-20, 21) * 0.015f;
27804 num997 *= 1f + (float)Main.rand.Next(-20, 21) * 0.015f;
27810 num996 *= 1f + (float)Main.rand.Next(-20, 21) * 0.0125f;
27811 num997 *= 1f + (float)Main.rand.Next(-20, 21) * 0.0125f;
27813 }
27814 }
27815 }
27817 {
27827 if (Main.dayTime)
27828 {
27831 }
27832 this.ai[0] -= 1f;
27833 if (
num1006 < 200f || this.ai[0] > 0f)
27834 {
27836 {
27837 this.ai[0] = 20f;
27838 }
27840 {
27842 }
27843 else
27844 {
27846 }
27848 return;
27849 }
27850 velocity.X = (velocity.X * 50f +
num1004) / 51f;
27851 velocity.Y = (velocity.Y * 50f +
num1005) / 51f;
27853 {
27854 velocity.X = (velocity.X * 10f +
num1004) / 11f;
27855 velocity.Y = (velocity.Y * 10f +
num1005) / 11f;
27856 }
27858 {
27859 velocity.X = (velocity.X * 7f +
num1004) / 8f;
27860 velocity.Y = (velocity.Y * 7f +
num1005) / 8f;
27861 }
27863 }
27865 {
27868 if (Main.netMode != 1)
27869 {
27871 if (this.ai[3] == 0f)
27872 {
27873 this.ai[3] = (float)Main.rand.Next(75, 111) * 0.01f;
27874 }
27876 {
27878 localAI[0] = Main.rand.Next(60, 180);
27881 {
27882 float num1011 = (float)Main.rand.Next(50, 151) * 0.01f;
27884 {
27885 num1011 = (float)Main.rand.Next(150, 201) * 0.01f;
27886 }
27888 {
27889 num1011 = (float)Main.rand.Next(100, 151) * 0.01f;
27890 }
27892 int num1013 = Main.rand.Next(-50, 51);
27894 {
27895 num1013 -= Main.rand.Next(100, 251);
27896 }
27900 }
27901 else
27902 {
27904 float num1015 = (float)Main.rand.Next(5, 151) * 0.01f;
27905 int num1016 = Main.rand.Next(-100, 101);
27906 int num1017 = Main.rand.Next(-100, 101);
27910 }
27912 }
27913 }
27914 scale = this.ai[3];
27916 {
27921 {
27924 {
27926 }
27928 }
27930 {
27933 {
27935 }
27937 }
27939 {
27942 {
27943 velocity.Y = 3f;
27944 }
27946 }
27948 {
27951 {
27953 }
27955 }
27957 {
27959 }
27961 {
27966 {
27968 if (
nPC4.active &&
nPC4.damage > 0 && !
nPC4.friendly &&
nPC4.Hitbox.Distance(
base.Center) <= 100f)
27969 {
27972 }
27973 }
27975 {
27978 {
27981 }
27982 }
27984 {
27990 {
27992 }
27996 }
27997 }
27998 }
28000 {
28001 int i3 = (int)
base.Center.X / 16;
28002 int j3 = (int)
base.Center.Y / 16;
28004 {
28006 {
28008 }
28009 else if (
type == 654)
28010 {
28012 }
28013 else
28014 {
28016 }
28017 }
28019 }
28021 {
28023 }
28024 else
28025 {
28026 localAI[1] = Main.rand.Next(30, 180);
28027 if (!Main.dayTime || (
double)(
position.
Y / 16f) > Main.worldSurface + 10.0)
28028 {
28029 localAI[2] = Main.rand.Next(10, 30);
28030 }
28031 }
28036 {
28041 {
28043 {
28046 {
28047 velocity.Y *= 0.9f;
28048 }
28049 }
28050 }
28051 }
28053 {
28059 {
28061 {
28063 }
28064 }
28066 {
28069 {
28070 velocity.Y *= 0.9f;
28071 }
28072 }
28073 }
28075 {
28077 velocity.X *= -0.2f;
28078 }
28080 {
28082 }
28084 {
28086 }
28088 {
28090 }
28093 }
28095 {
28097 }
28099 {
28101 {
28102 float num1033 = (float)Main.rand.Next(90, 111) * 0.01f;
28103 num1033 *= (Main.essScale + 0.5f) / 2f;
28105 }
28107 {
28108 if (this.ai[0] == 1f)
28109 {
28111 {
28113 }
28115 {
28117 }
28120 {
28122 }
28124 {
28126 }
28128 {
28130 }
28133 {
28134 velocity.X *= 3f;
28135 }
28136 }
28137 else
28138 {
28139 velocity.X = 0f;
28140 }
28141 if (Main.netMode != 1)
28142 {
28145 {
28146 if (this.ai[0] == 1f)
28147 {
28148 this.ai[0] = 0f;
28149 localAI[1] = Main.rand.Next(300, 900);
28150 }
28151 else
28152 {
28153 this.ai[0] = 1f;
28154 localAI[1] = Main.rand.Next(600, 1800);
28155 }
28157 }
28158 }
28159 }
28161 {
28164 {
28166 }
28167 }
28169 {
28170 return;
28171 }
28175 {
28178 {
28180 break;
28181 }
28182 }
28185 {
28186 this.ai[1]++;
28187 }
28188 if (this.ai[1] == (
float)
num1036 && Main.netMode != 1)
28189 {
28190 position.Y += 16f;
28193 }
28194 }
28196 {
28197 if (Main.netMode != 1)
28198 {
28202 if (tile.shimmer() && tile.liquid > 30)
28203 {
28205 return;
28206 }
28207 }
28209 {
28210 if (this.ai[3] != 0f)
28211 {
28212 scale = this.ai[3];
28216 {
28217 position.X = position.X + (float)(
width / 2) - (float)
num1039 - 2f;
28219 }
28221 {
28224 }
28225 }
28226 if (this.ai[3] == 0f && Main.netMode != 1)
28227 {
28228 this.ai[3] = (float)Main.rand.Next(80, 111) * 0.01f;
28230 }
28231 }
28233 {
28234 Lighting.AddLight((
int)base.Center.X / 16, (int)
base.Center.Y / 16, 0.1f, 0.2f, 0.7f);
28235 }
28237 {
28238 Lighting.AddLight((
int)base.Center.X / 16, (int)
base.Center.Y / 16, 0.6f, 0.3f, 0.1f);
28239 }
28242 {
28244 }
28245 if (this.ai[0] == 0f)
28246 {
28249 this.ai[0] = 1f;
28251 {
28253 }
28254 }
28256 if (Main.netMode != 1)
28257 {
28258 if (this.ai[2] == 0f && Main.rand.Next(7200) == 0)
28259 {
28260 this.ai[2] = 2f;
28262 }
28264 {
28267 {
28268 this.ai[2] = 2f;
28270 }
28271 }
28272 else
28273 {
28275 }
28276 }
28277 if (this.ai[2] > 0f)
28278 {
28279 this.ai[1] = 0f;
28280 this.ai[0] = 1f;
28283 {
28285 }
28286 else
28287 {
28289 }
28296 {
28297 this.ai[2] -= 1f;
28298 }
28302 {
28304 }
28306 {
28308 this.ai[2] = 0f;
28310 this.ai[1] = 1f;
28311 }
28313 {
28315 {
28318 {
28322 }
28323 }
28324 else
28325 {
28328 }
28329 }
28330 }
28331 if (this.ai[2] != 0f)
28332 {
28333 return;
28334 }
28336 if (this.ai[1] == 0f)
28337 {
28339 {
28340 this.ai[0] = 2f;
28341 }
28342 if (!
collideY && this.ai[0] == 2f)
28343 {
28345 this.ai[1] = 1f;
28346 this.ai[0] = 1f;
28347 }
28349 {
28351 this.ai[1] = 1f;
28352 }
28353 }
28354 else
28355 {
28357 {
28358 this.ai[0] = 2f;
28359 }
28360 if (!
collideX && this.ai[0] == 2f)
28361 {
28363 this.ai[1] = 0f;
28364 this.ai[0] = 1f;
28365 }
28367 {
28369 this.ai[1] = 0f;
28370 }
28371 }
28373 {
28376 {
28378 {
28380 {
28383 }
28385 {
28388 }
28389 }
28391 {
28394 }
28396 {
28399 }
28400 }
28402 {
28404 {
28407 }
28409 {
28412 }
28413 }
28415 {
28418 }
28420 {
28423 }
28427 {
28429 }
28431 {
28433 }
28437 {
28439 {
28441 }
28442 else
28443 {
28446 {
28448 }
28449 }
28450 }
28452 {
28454 {
28456 }
28457 else
28458 {
28461 {
28463 }
28464 }
28465 }
28466 }
28469 }
28471 {
28473 if (this.ai[0] == 0f)
28474 {
28480 {
28482 }
28484 {
28492 {
28494 }
28496 {
28498 }
28500 {
28502 }
28505 {
28506 velocity.Y *= 0.5f;
28507 }
28513 {
28515 }
28517 {
28519 }
28521 {
28523 }
28525 {
28528 }
28530 {
28533 }
28535 {
28538 }
28541 {
28542 velocity.Y -= 0.1f;
28544 {
28545 velocity.Y = -8f;
28546 }
28548 {
28550 }
28551 }
28552 else
28553 {
28555 }
28556 }
28557 if (Main.netMode == 1)
28558 {
28559 return;
28560 }
28562 {
28563 this.ai[0] = 1f;
28566 return;
28567 }
28570 {
28571 this.ai[0] = 1f;
28572 velocity.Y -= 6f;
28575 }
28576 }
28577 else
28578 {
28579 if (Main.player[
target].dead)
28580 {
28581 return;
28582 }
28584 this.ai[1] += 1f;
28585 if (this.ai[1] >= 300f)
28586 {
28588 }
28590 {
28592 {
28593 velocity.X = 0f;
28594 velocity.Y = 0f;
28595 this.ai[0] = 0f;
28596 this.ai[1] = 0f;
28597 if (Main.netMode != 1)
28598 {
28600 {
28605 this.ai[0] = 0f;
28606 this.ai[1] = 200 + Main.rand.Next(200);
28607 }
28609 }
28610 }
28611 else
28612 {
28613 velocity.X *= 0.98f;
28614 velocity.Y += 0.1f;
28616 {
28617 velocity.Y = 2f;
28618 }
28619 }
28620 return;
28621 }
28623 {
28625 velocity.X = oldVelocity.X * -0.5f;
28627 {
28628 velocity.X = 2f;
28629 }
28631 {
28632 velocity.X = -2f;
28633 }
28634 }
28636 {
28637 velocity.Y = oldVelocity.Y * -0.5f;
28639 {
28640 velocity.Y = 1f;
28641 }
28643 {
28644 velocity.Y = -1f;
28645 }
28646 }
28648 {
28649 velocity.X -= 0.1f;
28651 {
28652 velocity.X -= 0.1f;
28653 }
28655 {
28656 velocity.X -= 0.05f;
28657 }
28659 {
28660 velocity.X = -3f;
28661 }
28662 }
28664 {
28665 velocity.X += 0.1f;
28667 {
28668 velocity.X += 0.1f;
28669 }
28671 {
28672 velocity.X += 0.05f;
28673 }
28675 {
28676 velocity.X = 3f;
28677 }
28678 }
28685 {
28687 {
28689 }
28691 {
28693 {
28695 }
28697 break;
28698 }
28699 }
28701 {
28702 velocity.Y += 0.1f;
28703 }
28704 else
28705 {
28706 velocity.Y -= 0.1f;
28707 }
28709 {
28710 velocity.Y -= 0.2f;
28711 }
28713 {
28714 velocity.Y = 3f;
28715 }
28717 {
28718 velocity.Y = -4f;
28719 }
28720 }
28721 }
28723 {
28725 }
28727 {
28729 {
28731 this.ai[3] = (float)Main.rand.Next(80, 121) / 100f;
28732 float num1060 = (float)Main.rand.Next(165, 265) / 15f;
28735 }
28738 scale = this.ai[3];
28741 {
28743 }
28745 velocity.X = (velocity.X * 50f + Main.windSpeedCurrent * 2f + (float)Main.rand.Next(-10, 11) * 0.1f) / 51f;
28746 velocity.Y = (velocity.Y * 50f + -0.25f + (float)Main.rand.Next(-10, 11) * 0.2f) / 51f;
28748 {
28749 velocity.Y -= 0.04f;
28750 }
28751 if (this.ai[0] == 0f)
28752 {
28760 {
28763 {
28764 this.ai[0] = 1f;
28765 this.ai[1] = 4f;
28767 break;
28768 }
28769 }
28770 }
28771 if (this.ai[0] == 0f)
28772 {
28773 this.ai[1]++;
28774 if (this.ai[1] >= 150f)
28775 {
28776 this.ai[0] = 1f;
28777 this.ai[1] = 4f;
28778 }
28779 }
28780 if (this.ai[0] == 1f)
28781 {
28782 this.ai[1]--;
28783 if (this.ai[1] <= 0f)
28784 {
28788 return;
28789 }
28790 }
28791 if (
justHit || this.ai[0] == 1f)
28792 {
28798 }
28799 }
28801 {
28805 {
28809 }
28810 if (this.ai[0] == 0f)
28811 {
28812 this.ai[1]++;
28817 velocity.Y = this.ai[3];
28819 {
28828 {
28830 }
28833 {
28835 }
28837 {
28839 }
28842 {
28844 }
28845 }
28846 if (this.ai[1] >= (
float)
num1063)
28847 {
28848 this.ai[0] = 1f;
28849 this.ai[1] = 0f;
28851 {
28852 this.ai[1] = 1f;
28853 }
28862 {
28864 }
28866 }
28867 }
28868 else
28869 {
28870 if (this.ai[0] != 1f)
28871 {
28872 return;
28873 }
28876 {
28877 if (this.ai[1] < 1f)
28878 {
28879 this.ai[1] = 1f;
28880 }
28881 }
28882 else
28883 {
28886 {
28888 }
28889 }
28890 if (this.ai[1] >= 1f)
28891 {
28894 {
28896 }
28898 this.ai[1]++;
28900 {
28902 {
28904 }
28908 return;
28909 }
28910 }
28911 if (this.ai[1] >= 60f)
28912 {
28914 }
28917 {
28919 }
28920 }
28921 }
28923 {
28925 {
28926 int num1067 = (int)this.ai[0];
28928 {
28931 position.X -=
width / 2;
28932 position.Y -=
height / 2;
28934 Lighting.AddLight((
int)base.Center.X / 16, (int)
base.Center.Y / 16, 0.1f, 0.5f, 0.7f);
28935 }
28936 else
28937 {
28941 }
28942 }
28943 }
28945 {
28948 velocity.X *= 0.93f;
28950 {
28951 velocity.X = 0f;
28952 }
28954 {
28958 {
28959 this.ai[1]++;
28960 if (this.ai[1] > 60f)
28961 {
28964 }
28965 else
28966 {
28968 }
28971 frame.Y = 0;
28976 {
28980 {
28983 }
28985 {
28988 }
28990 {
28993 }
28995 {
28998 }
28999 int num1074 = Dust.NewDust(
base.Center, 0, 0, 226, 0f, 0f, 100,
default(
Color), 0.5f);
29000 Main.dust[
num1074].noGravity =
true;
29004 num1074 = Dust.NewDust(
base.Center, 0, 0, 226, 0f, 0f, 100,
default(
Color), 0.5f);
29005 Main.dust[
num1074].noGravity =
true;
29008 }
29010 return;
29011 }
29013 {
29014 this.ai[1]++;
29016 }
29017 Lighting.AddLight((
int)
base.Center.X / 16, (
int)(
base.Center.Y - 10f) / 16, 0.1f, 0.5f, 0.7f);
29019 }
29020 if (this.ai[0] < 60f)
29021 {
29022 this.ai[0]++;
29023 }
29025 {
29026 this.ai[0] = -30f;
29028 }
29029 if (this.ai[0] == 60f && Main.netMode != 1)
29030 {
29031 this.ai[0] = -120f;
29036 vector139.X += Main.rand.Next(-100, 101);
29037 vector139.Y += Main.rand.Next(-100, 101);
29038 vector139.X *= (float)Main.rand.Next(70, 131) * 0.01f;
29039 vector139.Y *= (float)Main.rand.Next(70, 131) * 0.01f;
29042 {
29044 }
29049 {
29051 }
29054 }
29055 }
29057 {
29061 {
29063 }
29065 {
29067 }
29069 {
29071 }
29073 {
29075 }
29094 {
29112 }
29114 if (Main.expertMode)
29115 {
29116 num1077 *= Main.GameModeInfo.KnockbackToEnemiesMultiplier;
29117 }
29118 if (
type == 388 && this.ai[0] != 3f)
29119 {
29122 Main.dust[
num1093].noGravity =
true;
29126 {
29127 spinningpoint2.X *= -1f;
29128 }
29132 }
29134 {
29135 int num1094 = ((this.ai[0] != 2f) ? 1 : 2);
29136 int num1095 = ((this.ai[0] == 2f) ? 30 : 20);
29138 {
29139 if (Main.rand.Next(3) <
num1094)
29140 {
29143 Main.dust[
num1097].noGravity =
true;
29144 Dust dust = Main.dust[
num1097];
29145 dust.velocity *= 0.2f;
29146 Main.dust[
num1097].fadeIn = 1f;
29148 }
29149 }
29150 }
29151 if (this.ai[0] == 0f)
29152 {
29163 bool flag58 = Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1);
29164 if (this.ai[3] >= 120f)
29165 {
29167 }
29173 {
29177 {
29179 {
29180 this.ai[3]++;
29181 }
29182 if (this.ai[3] == 120f)
29183 {
29185 }
29186 }
29187 else
29188 {
29189 this.ai[3] = 0f;
29190 }
29191 }
29192 else
29193 {
29194 this.ai[0] = 1f;
29198 }
29199 }
29200 else if (this.ai[0] == 1f)
29201 {
29205 {
29208 {
29211 }
29212 }
29214 {
29216 }
29217 this.ai[1]++;
29219 {
29220 this.ai[0] = 2f;
29221 this.ai[1] = 0f;
29227 }
29228 if (
type == 388 && Main.rand.Next(4) == 0)
29229 {
29232 Main.dust[
num1101].noGravity =
true;
29233 Dust dust = Main.dust[
num1101];
29234 dust.velocity *= 2f;
29237 }
29238 }
29239 else if (this.ai[0] == 2f)
29240 {
29243 this.ai[1]++;
29246 {
29247 this.ai[0] = 0f;
29248 this.ai[1] = 0f;
29249 this.ai[2] = 0f;
29250 this.ai[3] = 0f;
29254 {
29255 this.ai[1] = 45f;
29256 this.ai[0] = 4f;
29257 }
29258 }
29259 else
29260 {
29266 {
29268 }
29270 }
29272 {
29273 this.ai[0] = 3f;
29274 this.ai[1] = 0f;
29275 this.ai[2] = 0f;
29276 this.ai[3] = 0f;
29278 }
29279 }
29280 else if (this.ai[0] == 4f)
29281 {
29282 this.ai[1] -= 3f;
29283 if (this.ai[1] <= 0f)
29284 {
29285 this.ai[0] = 0f;
29286 this.ai[1] = 0f;
29288 }
29290 }
29292 {
29293 this.ai[0] = 3f;
29294 this.ai[1] = 0f;
29295 this.ai[2] = 0f;
29296 this.ai[3] = 0f;
29298 }
29299 if (this.ai[0] != 3f)
29300 {
29301 return;
29302 }
29305 position.X -=
width / 2;
29306 position.Y -=
height / 2;
29310 Lighting.AddLight((
int)
base.Center.X / 16, (
int)
base.Center.Y / 16, 0.2f, 0.7f, 1.1f);
29312 {
29314 Dust dust = Main.dust[
num1104];
29315 dust.velocity *= 1.4f;
29316 Main.dust[
num1104].position = ((float)Main.rand.NextDouble() * ((float)
Math.
PI * 2f)).ToRotationVector2() * ((float)Main.rand.NextDouble() * 96f) +
base.Center;
29317 }
29319 {
29321 Main.dust[
num1106].noGravity =
true;
29322 Dust dust = Main.dust[
num1106];
29323 dust.velocity *= 2f;
29324 Main.dust[
num1106].position = ((float)Main.rand.NextDouble() * ((float)
Math.
PI * 2f)).ToRotationVector2() * ((float)Main.rand.NextDouble() * 96f) +
base.Center;
29326 if (Main.rand.Next(2) == 0)
29327 {
29329 Main.dust[
num1106].noGravity =
true;
29331 dust.velocity *= 1.2f;
29332 Main.dust[
num1106].position = ((float)Main.rand.NextDouble() * ((float)
Math.
PI * 2f)).ToRotationVector2() * ((float)Main.rand.NextDouble() * 96f) +
base.Center;
29334 }
29335 if (Main.rand.Next(4) == 0)
29336 {
29339 dust.velocity *= 1.2f;
29340 Main.dust[
num1106].position = ((float)Main.rand.NextDouble() * ((float)
Math.
PI * 2f)).ToRotationVector2() * ((float)Main.rand.NextDouble() * 96f) +
base.Center;
29342 }
29343 }
29344 this.ai[1]++;
29345 if (this.ai[1] >= 3f)
29346 {
29351 }
29352 }
29354 {
29359 {
29360 if (
localAI[0] == 0f && Main.netMode != 1)
29361 {
29366 }
29367 int num1110 = (int)this.ai[0];
29369 {
29373 }
29374 }
29376 {
29377 if (
localAI[0] == 0f && Main.netMode != 1)
29378 {
29383 }
29384 int num1112 = (int)this.ai[0];
29386 {
29390 }
29391 }
29392 else if (
type == 392)
29393 {
29394 int num1113 = (int)this.ai[0];
29396 {
29404 if (Main.netMode != 1)
29405 {
29407 if (Main.npc[
num1113].ai[0] >= 1f || Main.npc[
num1113].ai[0] < 0f)
29408 {
29410 }
29412 {
29414 {
29416 {
29418 }
29419 }
29421 {
29423 {
29425 }
29426 }
29427 }
29428 if (Main.npc[
num1113].ai[3] % 200f == 0f && Main.npc[
num1113].ai[0] != 1f)
29429 {
29431 {
29433 {
29435 }
29436 }
29438 {
29440 {
29442 }
29443 }
29445 }
29447 {
29448 if (!Main.expertMode)
29449 {
29450 Main.npc[
num1113].ai[0] = 3f;
29451 Main.npc[
num1113].ai[1] = 0f;
29452 Main.npc[
num1113].ai[2] = 0f;
29453 Main.npc[
num1113].ai[3] = 0f;
29454 Main.npc[
num1113].netUpdate =
true;
29455 }
29456 else
29457 {
29458 Main.npc[
num1113].ai[0] = 1f;
29459 Main.npc[
num1113].ai[1] = 0f;
29460 Main.npc[
num1113].ai[2] = 0f;
29461 Main.npc[
num1113].ai[3] = 0f;
29462 Main.npc[
num1113].netUpdate =
true;
29463 }
29464 }
29465 }
29466 }
29467 }
29468 else if (
type == 393)
29469 {
29470 int num1119 = (int)this.ai[0];
29472 {
29480 }
29481 }
29482 else if (
type == 394)
29483 {
29484 int num1121 = (int)this.ai[0];
29486 {
29494 num1108 = ((this.ai[1] == 1f) ? 1 : (-1));
29495 }
29496 }
29497 else if (
type == 492)
29498 {
29499 int num1123 = (int)this.ai[0];
29501 {
29504 vector144 =
new Vector2((-122f + 68f * this.ai[1]) * (
float)((Main.npc[
num1123].spriteDirection != 1) ? 1 : (-1)), -6f);
29509 }
29510 }
29512 {
29516 position.X -=
width / 2;
29517 position.Y -=
height / 2;
29522 {
29524 }
29525 else
29526 {
29528 }
29530 {
29534 if (this.ai[1] < 60f)
29535 {
29536 this.ai[1]++;
29537 }
29539 {
29540 this.ai[1] = -30f;
29541 }
29546 {
29552 {
29554 }
29556 {
29558 }
29560 {
29562 {
29563 this.ai[1] = -60f;
29567 vector148.X += Main.rand.Next(-50, 51);
29568 vector148.Y += Main.rand.Next(-50, 51);
29569 vector148.X *= (float)Main.rand.Next(80, 121) * 0.01f;
29570 vector148.Y *= (float)Main.rand.Next(80, 121) * 0.01f;
29573 {
29575 }
29579 }
29580 else
29581 {
29583 velocity.X *= 0.5f;
29584 this.ai[2] = 3f;
29586 {
29588 {
29589 this.ai[2] = 1f;
29590 }
29591 else
29592 {
29593 this.ai[2] = 5f;
29594 }
29595 }
29597 {
29598 this.ai[2] = 3f;
29599 }
29601 {
29602 this.ai[2] = 2f;
29603 }
29604 else
29605 {
29606 this.ai[2] = 4f;
29607 }
29609 {
29611 }
29612 }
29613 }
29614 }
29615 }
29617 {
29620 if (this.ai[3] < 240f)
29621 {
29622 this.ai[3]++;
29623 }
29624 if (this.ai[3] == 2f)
29625 {
29627 }
29629 {
29632 if (this.ai[3] >= 240f)
29633 {
29634 this.ai[3] = 0f;
29639 {
29641 }
29644 if (Main.netMode != 1)
29645 {
29647 }
29649 }
29650 else
29651 {
29653 float[]
array3 =
new float[8];
29655 {
29657 }
29660 {
29662 {
29664 }
29665 }
29668 {
29669 this.ai[2] = 9f - this.ai[2];
29670 }
29672 {
29674 }
29675 }
29676 }
29677 else
29678 {
29679 if (this.ai[2] != 0f)
29680 {
29682 }
29683 this.ai[2] = 0f;
29684 }
29685 }
29687 {
29690 this.ai[3] =
nPC5.ai[3];
29694 {
29697 {
29698 if (Main.netMode != 1)
29699 {
29704 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector152.X,
vector152.Y,
spinningpoint3.X,
spinningpoint3.Y, 448,
attackDamage_ForProjectiles9, 0f, Main.myPlayer, 0f, 20f);
29705 }
29707 }
29708 }
29709 }
29711 {
29714 this.ai[3] =
nPC5.ai[3];
29719 {
29724 {
29725 v3.Y = 0f;
29726 }
29728 if (
float.IsNaN(
v3.X) ||
float.IsNaN(
v3.Y))
29729 {
29731 }
29732 this.ai[2] =
v3.ToRotation();
29733 }
29735 {
29738 {
29739 if (Main.netMode != 1)
29740 {
29746 }
29748 }
29749 }
29750 }
29752 {
29753 return;
29754 }
29757 this.ai[3] =
nPC5.ai[3];
29761 {
29764 {
29765 if (Main.netMode != 1)
29766 {
29769 }
29771 }
29772 }
29778 if (
nPC5.ai[0] == 2f)
29779 {
29783 }
29785 {
29790 {
29793 }
29794 }
29796 {
29801 {
29804 }
29805 }
29811 {
29813 }
29815 {
29817 }
29819 {
29821 }
29823 {
29825 }
29827 {
29830 {
29831 if (Main.netMode != 1)
29832 {
29836 Vector2 vector154 = -1f * Vector2.UnitX * Main.rand.Next(50, 70) + base.Center + Vector2.UnitY * Main.rand.Next(30, 45);
29838 }
29840 }
29842 {
29843 if (Main.netMode != 1)
29844 {
29848 Vector2 vector155 = 1f * Vector2.UnitX * Main.rand.Next(50, 70) + base.Center + Vector2.UnitY * Main.rand.Next(30, 45);
29850 }
29852 }
29853 }
29855 {
29858 {
29859 if (Main.netMode != 1)
29860 {
29864 Vector2 vector156 = -1f * Vector2.UnitX * Main.rand.Next(30, 60) + base.Center + Vector2.UnitY * Main.rand.Next(-30, -10);
29866 }
29868 }
29870 {
29871 if (Main.netMode != 1)
29872 {
29876 Vector2 vector157 = 1f * Vector2.UnitX * Main.rand.Next(30, 60) + base.Center + Vector2.UnitY * Main.rand.Next(-30, -10);
29878 }
29880 }
29881 }
29882 if (
flag66 && Main.rand.Next(8) == 0)
29883 {
29884 int num1145 = Dust.NewDust(-1f *
Vector2.
UnitX * Main.rand.Next(50, 70) +
base.Center +
Vector2.
UnitY * Main.rand.Next(15, 30), 4, 16, (Main.rand.Next(4) != 0) ? 31 : 228, 0f, 0f, 100,
default(
Color), 1.2f);
29885 Main.dust[
num1145].velocity =
new Vector2(-1f * (
float)Main.rand.NextDouble() * 3f, 1f).RotatedBy((Main.rand.NextDouble() - 0.5) * 0.7853981852531433);
29886 Dust dust = Main.dust[
num1145];
29887 dust.velocity *= 0.5f;
29889 }
29890 if (
flag67 && Main.rand.Next(8) == 0)
29891 {
29892 int num1146 = Dust.NewDust(
Vector2.
UnitX * Main.rand.Next(50, 70) +
base.Center +
Vector2.
UnitY * Main.rand.Next(15, 30), 4, 16, (Main.rand.Next(4) != 0) ? 31 : 228, 0f, 0f, 100,
default(
Color), 1.2f);
29893 Main.dust[
num1146].velocity =
new Vector2((
float)Main.rand.NextDouble() * 3f, 1f).RotatedBy((Main.rand.NextDouble() - 0.5) * 0.7853981852531433);
29894 Dust dust = Main.dust[
num1146];
29895 dust.velocity *= 0.5f;
29897 }
29898 if (
flag68 && Main.rand.Next(8) == 0)
29899 {
29900 int num1147 = Dust.NewDust(-1f *
Vector2.
UnitX * Main.rand.Next(30, 60) +
base.Center +
Vector2.
UnitY * Main.rand.Next(-30, -10), 4, 16, (Main.rand.Next(4) != 0) ? 31 : 228, 0f, 0f, 100,
default(
Color), 1.2f);
29901 Main.dust[
num1147].velocity =
new Vector2(-1f * (
float)Main.rand.NextDouble() * 2f, 1f).RotatedBy((Main.rand.NextDouble() - 0.5) * 0.7853981852531433);
29902 Dust dust = Main.dust[
num1147];
29903 dust.velocity *= 0.5f;
29905 }
29906 if (
flag69 && Main.rand.Next(8) == 0)
29907 {
29908 int num1148 = Dust.NewDust(
Vector2.
UnitX * Main.rand.Next(30, 60) +
base.Center +
Vector2.
UnitY * Main.rand.Next(-30, -10), 4, 16, (Main.rand.Next(4) != 0) ? 31 : 228, 0f, 0f, 100,
default(
Color), 1.2f);
29909 Main.dust[
num1148].velocity =
new Vector2((
float)Main.rand.NextDouble() * 2f, 1f).RotatedBy((Main.rand.NextDouble() - 0.5) * 0.7853981852531433);
29910 Dust dust = Main.dust[
num1148];
29911 dust.velocity *= 0.5f;
29913 }
29914 }
29915 else if (
type == 390)
29916 {
29918 }
29919 else if (
type == 416)
29920 {
29922 }
29923 else
29924 {
29928 }
29929 }
29931 {
29932 if (
localAI[3] == 0f && Main.netMode != 1 &&
type == 395)
29933 {
29935 int[]
array4 =
new int[4];
29938 {
29941 Main.npc[
num1151].netUpdate =
true;
29943 }
29945 {
29948 Main.npc[
num1153].netUpdate =
true;
29950 }
29953 Main.npc[
num1154].netUpdate =
true;
29955 {
29957 }
29959 {
29961 }
29962 }
29963 if (this.ai[0] == 3f)
29964 {
29966 return;
29967 }
29972 {
29976 }
29978 {
29979 if (this.ai[0] == 0f)
29980 {
29981 this.ai[0] = -1f;
29982 }
29983 if (this.ai[0] == 2f)
29984 {
29985 this.ai[0] = -2f;
29986 }
29988 }
29989 if (this.ai[0] == -1f || this.ai[0] == -2f)
29990 {
29991 velocity.Y -= 0.4f;
29994 {
29996 if (this.ai[0] == -2f)
29997 {
29998 this.ai[0] = 2f;
29999 }
30000 if (this.ai[0] == 0f)
30001 {
30002 this.ai[0] = 0f;
30003 }
30004 this.ai[1] = 0f;
30005 this.ai[2] = 0f;
30006 this.ai[3] = 0f;
30008 }
30009 }
30010 else if (this.ai[0] == 0f)
30011 {
30014 if (this.ai[3] >= 580f)
30015 {
30017 }
30018 else if (this.ai[3] >= 440f)
30019 {
30021 }
30022 else if (this.ai[3] >= 420f)
30023 {
30025 }
30026 else if (this.ai[3] >= 280f)
30027 {
30029 }
30030 else if (this.ai[3] >= 260f)
30031 {
30033 }
30034 else if (this.ai[3] >= 20f)
30035 {
30037 }
30038 this.ai[3]++;
30039 if (this.ai[3] >= 600f)
30040 {
30041 this.ai[3] = 0f;
30042 }
30044 if (this.ai[3] >= 580f)
30045 {
30047 }
30048 else if (this.ai[3] >= 440f)
30049 {
30051 }
30052 else if (this.ai[3] >= 420f)
30053 {
30055 }
30056 else if (this.ai[3] >= 280f)
30057 {
30059 }
30060 else if (this.ai[3] >= 260f)
30061 {
30063 }
30064 else if (this.ai[3] >= 20f)
30065 {
30067 }
30069 {
30071 {
30072 this.ai[2] = 0f;
30073 }
30075 {
30077 }
30079 {
30080 this.ai[2] = 0f;
30081 }
30083 }
30085 {
30086 if (this.ai[2] == 0f)
30087 {
30089 }
30092 {
30093 this.ai[3] = 19f;
30094 }
30095 else
30096 {
30099 }
30100 }
30102 {
30107 {
30109 }
30110 else
30111 {
30113 {
30116 {
30118 break;
30119 }
30120 }
30121 }
30125 {
30128 {
30130 }
30132 }
30133 else
30134 {
30135 velocity.Y *= 0.95f;
30136 }
30137 velocity.X = 3.5f * this.ai[2];
30138 }
30140 {
30141 case 2:
30142 {
30143 if (this.ai[2] == 0f)
30144 {
30146 }
30152 {
30154 }
30155 else
30156 {
30158 {
30161 {
30163 break;
30164 }
30165 }
30166 }
30170 {
30172 }
30174 {
30175 this.ai[3] = 279f;
30176 break;
30177 }
30180 break;
30181 }
30182 case 3:
30183 {
30189 {
30191 }
30192 else
30193 {
30195 {
30198 {
30200 break;
30201 }
30202 }
30203 }
30207 {
30210 {
30212 }
30214 }
30215 else
30216 {
30218 }
30220 break;
30221 }
30222 }
30224 {
30225 case 4:
30226 {
30229 {
30230 this.ai[3] = 439f;
30231 break;
30232 }
30235 break;
30236 }
30237 case 5:
30239 break;
30240 }
30241 }
30242 else if (this.ai[0] == 1f)
30243 {
30247 this.ai[1]++;
30249 {
30250 this.ai[0] = 2f;
30251 this.ai[1] = 0f;
30254 }
30255 else if (this.ai[1] < 40f)
30256 {
30258 }
30259 else if (this.ai[1] < 80f)
30260 {
30262 }
30263 else if (this.ai[1] < 120f)
30264 {
30266 }
30267 else
30268 {
30269 rotation = (this.ai[1] - 120f) / 30f * ((
float)Math.PI * 2f);
30270 }
30271 }
30272 else if (this.ai[0] == 2f)
30273 {
30280 {
30282 }
30285 this.ai[3]++;
30287 {
30289 }
30291 {
30293 {
30295 if (Main.netMode != 1)
30296 {
30299 }
30301 }
30303 }
30305 {
30306 this.ai[0] = 2f;
30307 this.ai[1] = 0f;
30308 this.ai[2] = 0f;
30309 this.ai[3] = 0f;
30311 }
30313 {
30317 }
30318 else
30319 {
30324 {
30326 }
30327 else
30328 {
30330 {
30333 {
30335 break;
30336 }
30337 }
30338 }
30342 {
30345 {
30347 }
30349 }
30350 else
30351 {
30352 velocity.Y *= 0.95f;
30353 }
30354 velocity.X = 8f * this.ai[2];
30355 }
30357 }
30360 {
30362 }
30364 {
30366 }
30367 if (
position.
Y > (
float)(Main.maxTilesY * 16 + 100))
30368 {
30370 }
30371 if (
position.
X > (
float)(Main.maxTilesX * 16 + 100))
30372 {
30374 }
30376 {
30380 }
30381 }
30383 {
30384 if (this.ai[0] != -1f && this.ai[0] != 2f && Main.rand.Next(200) == 0)
30385 {
30387 }
30389 {
30392 this.ai[0] = -1f;
30393 }
30394 if (this.ai[0] == -2f)
30395 {
30397 this.ai[1]++;
30398 if (this.ai[1] == 30f)
30399 {
30401 }
30402 if (this.ai[1] < 60f)
30403 {
30405 }
30406 if (this.ai[1] == 60f)
30407 {
30408 this.ai[1] = 0f;
30409 this.ai[0] = 0f;
30410 if (Main.netMode != 1 &&
type == 398)
30411 {
30412 this.ai[2] = Main.rand.Next(3);
30413 this.ai[2] = 0f;
30415 }
30416 }
30417 }
30418 if (this.ai[0] == -1f)
30419 {
30421 this.ai[1]++;
30422 if (this.ai[1] == 30f)
30423 {
30425 }
30426 if (this.ai[1] < 60f)
30427 {
30429 }
30430 if (this.ai[1] == 60f)
30431 {
30432 this.ai[1] = 0f;
30433 this.ai[0] = 0f;
30434 if (Main.netMode != 1 &&
type == 398)
30435 {
30436 this.ai[2] = Main.rand.Next(3);
30437 this.ai[2] = 0f;
30439 int[]
array5 =
new int[3];
30442 {
30445 Main.npc[
num1197].netUpdate =
true;
30447 }
30449 Main.npc[
num1198].netUpdate =
true;
30452 {
30454 }
30456 {
30458 }
30459 }
30460 }
30461 }
30462 if (this.ai[0] == 0f)
30463 {
30468 {
30473 }
30474 if (Main.netMode != 1)
30475 {
30478 {
30480 }
30481 else if (!Main.npc[(
int)
localAI[0]].active || Main.npc[(
int)
localAI[0]].type != 397)
30482 {
30484 }
30485 else if (!Main.npc[(
int)
localAI[1]].active || Main.npc[(
int)
localAI[1]].type != 397)
30486 {
30488 }
30489 else if (!Main.npc[(
int)
localAI[2]].active || Main.npc[(
int)
localAI[2]].type != 396)
30490 {
30492 }
30494 {
30498 }
30500 if (Main.npc[(
int)
localAI[0]].ai[0] != -2f)
30501 {
30503 }
30504 if (Main.npc[(
int)
localAI[1]].ai[0] != -2f)
30505 {
30507 }
30508 if (Main.npc[(
int)
localAI[2]].ai[0] != -2f)
30509 {
30511 }
30513 {
30514 this.ai[0] = 1f;
30517 }
30518 }
30519 }
30520 else if (this.ai[0] == 1f)
30521 {
30526 {
30531 }
30532 }
30533 else if (this.ai[0] == 2f)
30534 {
30537 this.ai[1]++;
30538 if (this.ai[1] < 60f)
30539 {
30541 }
30542 if (this.ai[1] == 60f)
30543 {
30545 {
30546 Projectile projectile = Main.projectile[
num1201];
30547 if (projectile.active && (projectile.type == 456 || projectile.type == 462 || projectile.type == 455 || projectile.type == 452 || projectile.type == 454))
30548 {
30549 projectile.Kill();
30550 }
30551 }
30553 {
30555 if (
nPC6.active &&
nPC6.type == 400)
30556 {
30557 nPC6.HitEffect(0, 9999.0);
30558 nPC6.active = false;
30559 }
30560 }
30561 }
30562 if (this.ai[1] % 3f == 0f && this.ai[1] < 580f && this.ai[1] > 60f)
30563 {
30566 {
30568 }
30569 vector164 *= 20f + Main.rand.NextFloat() * 400f;
30574 {
30576 }
30578 {
30580 }
30581 float num1203 = Main.rand.Next(6, 19);
30583 float num1205 = (float)
Math.
PI * 2f * Main.rand.NextFloat();
30584 float num1206 = 1f + Main.rand.NextFloat() * 2f;
30585 float num1207 = 1f + Main.rand.NextFloat();
30586 float fadeIn = 0.4f + Main.rand.NextFloat();
30587 int num1208 = Utils.SelectRandom<
int>(Main.rand, 31, 229);
30588 if (
flag75 && !Main.dedServ)
30589 {
30592 {
30594 dust6.noGravity = true;
30597 dust6.fadeIn = fadeIn;
30599 }
30600 }
30602 {
30605 {
30607 }
30608 vector166 *= 20f + Main.rand.NextFloat() * 800f;
30613 {
30615 }
30617 {
30619 }
30621 {
30623 dust7.noGravity = true;
30624 dust7.position =
vec;
30625 dust7.velocity = -Vector2.UnitY *
num1206 * (Main.rand.NextFloat() * 0.9f + 1.6f);
30626 dust7.fadeIn = fadeIn;
30628 }
30629 }
30630 }
30631 if (this.ai[1] % 15f == 0f && this.ai[1] < 480f && this.ai[1] >= 90f && Main.netMode != 1)
30632 {
30635 {
30637 }
30638 vector167 *= 20f + Main.rand.NextFloat() * 400f;
30643 {
30645 }
30647 {
30649 }
30651 {
30652 float num1211 = (float)(Main.rand.Next(4) < 2).ToDirectionInt() * ((float)
Math.
PI / 8f + (
float)Math.PI / 4f * Main.rand.NextFloat());
30655 }
30656 }
30657 if (this.ai[1] == 1f)
30658 {
30660 }
30661 if (this.ai[1] >= 480f)
30662 {
30664 }
30665 if (this.ai[1] >= 600f)
30666 {
30670 return;
30671 }
30672 }
30673 else if (this.ai[0] == 3f)
30674 {
30677 this.ai[1]++;
30678 if (this.ai[1] < 60f)
30679 {
30681 }
30682 if (this.ai[1] == 40f)
30683 {
30685 {
30688 {
30689 projectile2.active = false;
30690 if (Main.netMode != 1)
30691 {
30692 NetMessage.SendData(27, -1, -1,
null,
num1212);
30693 }
30694 }
30695 }
30697 {
30699 if (
nPC7.active &&
nPC7.type == 400)
30700 {
30701 nPC7.active = false;
30702 if (Main.netMode != 1)
30703 {
30704 NetMessage.SendData(23, -1, -1,
null,
nPC7.whoAmI);
30705 }
30706 }
30707 }
30709 {
30712 {
30713 gore2.active = false;
30714 }
30715 }
30716 }
30717 if (this.ai[1] >= 60f)
30718 {
30720 {
30722 if (
nPC8.active && (
nPC8.type == 400 ||
nPC8.type == 397 ||
nPC8.type == 396))
30723 {
30724 nPC8.active = false;
30725 if (Main.netMode != 1)
30726 {
30727 NetMessage.SendData(23, -1, -1,
null,
nPC8.whoAmI);
30728 }
30729 }
30730 }
30732 if (Main.netMode != 1)
30733 {
30734 NetMessage.SendData(23, -1, -1,
null,
whoAmI);
30735 }
30737 if (Main.netMode == 2)
30738 {
30739 NetMessage.SendData(7);
30740 }
30741 return;
30742 }
30743 }
30745 if (this.ai[0] == -2f || this.ai[0] == -1f || this.ai[0] == 2f || this.ai[0] == 3f)
30746 {
30748 }
30749 if (Main.player[
target].active && !Main.player[
target].dead)
30750 {
30752 }
30754 {
30756 {
30758 {
30760 break;
30761 }
30762 }
30763 }
30765 {
30766 this.ai[0] = 3f;
30767 this.ai[1] = 0f;
30769 }
30770 if (!(this.ai[0] >= 0f) || !(this.ai[0] < 2f) || Main.netMode == 1 || !(
Distance(Main.player[
target].Center) > 2400f))
30771 {
30772 return;
30773 }
30774 this.ai[0] = -2f;
30778 if (Main.npc[(
int)
localAI[0]].active)
30779 {
30783 }
30784 if (Main.npc[(
int)
localAI[1]].active)
30785 {
30789 }
30790 if (Main.npc[(
int)
localAI[2]].active)
30791 {
30795 }
30797 {
30799 if (
nPC9.active &&
nPC9.type == 400)
30800 {
30803 nPC9.netUpdate = true;
30804 }
30805 }
30806 }
30808 {
30810 if (!Main.npc[(int)this.ai[3]].active || Main.npc[(int)this.ai[3]].type != 398)
30811 {
30815 }
30816 bool flag79 = this.ai[2] == 0f;
30820 {
30822 }
30829 if (this.ai[0] != -2f)
30830 {
30832 this.ai[1]++;
30833 int num1223 = (int)Main.npc[(
int)this.ai[3]].ai[2];
30838 {
30841 {
30842 break;
30843 }
30845 }
30847 {
30849 this.ai[1] = 0f;
30852 }
30856 {
30858 }
30859 }
30860 if (this.ai[0] == -2f)
30861 {
30865 this.ai[1]++;
30866 if (this.ai[1] >= 32f)
30867 {
30868 this.ai[1] = 0f;
30869 }
30870 if (this.ai[1] < 0f)
30871 {
30872 this.ai[1] = 0f;
30873 }
30878 {
30883 {
30885 }
30887 }
30888 }
30889 else if (this.ai[0] == 0f)
30890 {
30894 {
30896 }
30901 {
30906 {
30908 }
30910 }
30911 }
30912 else if (this.ai[0] == 1f)
30913 {
30918 {
30921 {
30923 }
30924 }
30926 {
30929 {
30931 }
30935 {
30941 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector177.X,
vector177.Y,
vector178.X,
vector178.Y, 452, 30, 0f, Main.myPlayer, 0f,
ai);
30942 }
30943 }
30944 else
30945 {
30948 {
30950 }
30953 }
30954 }
30955 else if (this.ai[0] == 2f)
30956 {
30959 {
30961 }
30967 {
30970 {
30974 }
30975 }
30977 {
30980 if (
num1231 % 30 == 0 && Main.netMode != 1)
30981 {
30985 vector183.Y += ((float)
num1232 - 4.5f) * 1f;
30987 int num1233 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector183.X,
vector183.Y, 454, 40, 1f, Main.myPlayer, 0f,
whoAmI);
30988 }
30991 {
30995 }
30996 }
30998 {
31001 }
31003 {
31006 }
31008 {
31011 }
31013 {
31015 if (
num1219 == 292f && Main.netMode != 1)
31016 {
31020 {
31022 }
31025 {
31028 {
31031 projectile3.netUpdate = true;
31032 NetMessage.SendData(27, -1, -1,
null,
num1235);
31033 }
31034 }
31035 }
31038 {
31042 }
31043 }
31044 else
31045 {
31049 {
31053 }
31054 }
31055 }
31056 else if (this.ai[0] == 3f)
31057 {
31059 {
31062 }
31067 {
31069 }
31071 {
31073 }
31075 {
31079 }
31080 }
31082 {
31088 {
31090 }
31092 {
31094 }
31097 {
31099 }
31100 }
31103 {
31105 }
31107 {
31109 }
31111 {
31113 }
31115 {
31117 }
31120 {
31122 }
31124 {
31125 case 1:
31126 if (this.ai[0] == 0f)
31127 {
31128 if ((this.ai[1] += 1f) >= 20f)
31129 {
31130 this.ai[1] = 0f;
31131 this.ai[0] = 1f;
31133 }
31135 }
31136 else if (this.ai[0] == 1f)
31137 {
31138 if ((this.ai[1] += 1f) >= 20f)
31139 {
31140 this.ai[1] = 0f;
31141 this.ai[0] = 2f;
31143 }
31145 }
31146 else if (this.ai[0] == 2f || this.ai[0] == 4f)
31147 {
31148 if ((this.ai[1] += 1f) >= 20f)
31149 {
31150 this.ai[1] = 0f;
31151 this.ai[0]++;
31153 }
31155 }
31156 else
31157 {
31158 if (this.ai[0] != 3f && this.ai[0] != 5f)
31159 {
31160 break;
31161 }
31162 if ((this.ai[1] += 1f) >= 20f)
31163 {
31164 this.ai[1] = 0f;
31165 this.ai[0]++;
31166 if (this.ai[0] == 6f)
31167 {
31168 this.ai[0] = 0f;
31169 }
31171 }
31173 }
31174 break;
31175 case 2:
31176 {
31182 {
31184 }
31188 {
31190 }
31194 break;
31195 }
31196 case 3:
31197 {
31200 this.ai[1]++;
31202 {
31203 this.ai[1] = 0f;
31204 break;
31205 }
31207 {
31210 {
31212 }
31213 break;
31214 }
31217 {
31219 }
31222 if (this.ai[1] % (
float)
num1245 == 0f)
31223 {
31229 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector209.X,
vector209.Y,
vector210.X,
vector210.Y, 452, 5, 0f, Main.myPlayer, 0f,
ai2);
31230 }
31231 break;
31232 }
31233 case 4:
31234 {
31239 this.ai[1]++;
31240 if (this.ai[1] < 30f)
31241 {
31244 {
31248 }
31249 }
31250 else if (this.ai[1] < 210f)
31251 {
31252 int num1239 = (int)this.ai[1] - 30;
31253 if (
num1239 % 30 == 0 && Main.netMode != 1)
31254 {
31258 vector201.Y += ((float)
num1240 - 4.5f) * 1f;
31260 int num1241 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector201.X,
vector201.Y, 454, 1, 1f, Main.myPlayer, 0f,
whoAmI);
31261 }
31264 {
31268 }
31269 }
31270 else if (this.ai[1] < 270f)
31271 {
31273 }
31274 else if (this.ai[1] < 300f)
31275 {
31276 if (this.ai[1] == 270f && Main.netMode != 1)
31277 {
31281 {
31283 }
31286 {
31289 {
31292 projectile4.netUpdate = true;
31293 }
31294 }
31295 }
31298 {
31302 }
31303 }
31304 else
31305 {
31306 this.ai[1] = 0f;
31307 }
31308 break;
31309 }
31310 case 5:
31312 this.ai[1]++;
31313 if (this.ai[1] >= 40f)
31314 {
31315 this.ai[1] = 0f;
31316 }
31317 break;
31318 }
31319 }
31321 {
31322 if (!Main.npc[(int)this.ai[3]].active || Main.npc[(int)this.ai[3]].type != 398)
31323 {
31327 }
31329 {
31331 }
31334 base.Center = Main.npc[(int)this.ai[3]].
Center +
new Vector2(0f, -400f);
31340 if (this.ai[0] >= 0f)
31341 {
31343 this.ai[1]++;
31344 int num1252 = (int)Main.npc[(
int)this.ai[3]].ai[2];
31349 {
31352 {
31353 break;
31354 }
31356 }
31358 {
31360 this.ai[1] = 0f;
31363 }
31367 {
31369 }
31370 }
31371 if (this.ai[0] == -3f)
31372 {
31376 this.ai[1]++;
31377 if (this.ai[1] >= 32f)
31378 {
31379 this.ai[1] = 0f;
31380 }
31381 if (this.ai[1] < 0f)
31382 {
31383 this.ai[1] = 0f;
31384 }
31386 {
31388 }
31389 }
31390 else if (this.ai[0] == -2f)
31391 {
31392 if (Main.npc[(int)this.ai[3]].ai[0] == 2f)
31393 {
31394 this.ai[0] = -3f;
31395 return;
31396 }
31399 this.ai[1]++;
31400 if (this.ai[1] >= 32f)
31401 {
31402 this.ai[1] = 0f;
31403 }
31404 if (this.ai[1] < 0f)
31405 {
31406 this.ai[1] = 0f;
31407 }
31408 this.ai[2]++;
31409 if (this.ai[2] >= 555f)
31410 {
31411 this.ai[2] = 0f;
31412 }
31413 if (this.ai[2] >= 120f)
31414 {
31419 if (
num1247 == 0f && Main.netMode != 1)
31420 {
31423 {
31426 {
31429 {
31431 }
31432 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector213.X,
vector213.Y,
vector214.X,
vector214.Y, 456, 0, 0f, Main.myPlayer,
whoAmI + 1,
num1256);
31433 }
31434 }
31435 }
31437 {
31439 {
31442 {
31445 Main.npc[
num1258].netUpdate =
true;
31448 }
31449 }
31450 }
31451 }
31452 }
31453 else if (this.ai[0] == 0f)
31454 {
31460 {
31462 }
31466 {
31468 }
31472 }
31473 if (this.ai[0] == 1f)
31474 {
31476 {
31479 {
31481 }
31483 {
31487 {
31489 }
31491 {
31495 {
31498 }
31502 Main.dust[
num1264].noGravity =
true;
31504 Main.dust[
num1264].customData =
this;
31505 }
31506 }
31507 }
31509 {
31510 if (
num1247 == 180f && Main.netMode != 1)
31511 {
31517 {
31519 }
31521 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
spinningpoint9.X,
spinningpoint9.Y, 455, 75, 0f, Main.myPlayer,
num1265 * ((
float)
Math.
PI * 2f) / 540f,
whoAmI);
31524 }
31527 {
31529 }
31530 float num1266 = (this.ai[2] >= 0f).ToDirectionInt();
31533 {
31535 }
31540 }
31541 else
31542 {
31545 {
31547 if (Main.netMode != 1 && Main.getGoodWorld && Main.remixWorld)
31548 {
31550 {
31551 if (!
WorldGen.SolidTile((
int)(base.Center.X / 16f), (
int)(base.Center.Y / 16f)))
31552 {
31553 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y, (float)Main.rand.Next(-1599, 1600) * 0.01f, (float)Main.rand.Next(-1599, 1) * 0.01f, 1021, 70, 10f);
31554 }
31555 }
31556 }
31557 }
31559 }
31560 }
31561 else if (this.ai[0] == 2f)
31562 {
31566 if (
num1247 == 0f && Main.netMode != 1)
31567 {
31570 {
31573 {
31576 {
31578 }
31579 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector217.X,
vector217.Y,
vector218.X,
vector218.Y, 456, 0, 0f, Main.myPlayer,
whoAmI + 1,
num1269);
31580 }
31581 }
31582 }
31584 {
31586 {
31589 {
31592 Main.npc[
num1271].netUpdate =
true;
31595 }
31596 }
31597 }
31598 }
31599 else if (this.ai[0] == 3f)
31600 {
31602 {
31605 }
31610 {
31612 }
31614 {
31616 }
31618 {
31622 }
31623 }
31626 {
31628 }
31630 {
31632 }
31634 {
31636 }
31638 {
31640 }
31643 {
31645 }
31647 {
31649 }
31651 {
31653 }
31655 {
31657 }
31660 {
31666 {
31668 }
31672 {
31674 }
31678 }
31680 {
31682 float num1276 = (float)
Math.
PI * 2f * ((
float)Main.timeForVisualEffects % 600f) / 600f;
31685 if (this.ai[1] == 0f)
31686 {
31689 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector223.X,
vector223.Y, 455, 1, 0f, Main.myPlayer, (
float)
Math.
PI / 300f,
whoAmI);
31690 }
31691 this.ai[1]++;
31692 if (this.ai[1] >= 600f)
31693 {
31694 this.ai[1] = 0f;
31695 }
31696 }
31698 {
31700 if (this.ai[1] == 0f)
31701 {
31705 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X +
vector224.X,
base.Center.Y +
vector224.Y,
vector225.X,
vector225.Y, 456, 0, 0f, Main.myPlayer,
whoAmI + 1,
target);
31706 }
31707 this.ai[1]++;
31708 if (this.ai[1] >= 600f)
31709 {
31710 this.ai[1] = 0f;
31711 }
31712 }
31714 {
31720 this.ai[1]++;
31721 if (this.ai[1] == 55f)
31722 {
31724 }
31725 if (this.ai[1] == 76f || this.ai[1] == 83f || this.ai[1] == 90f)
31726 {
31730 }
31731 if (this.ai[1] >= 90f)
31732 {
31733 this.ai[1] = 0f;
31734 }
31735 }
31736 }
31738 {
31739 if (this.ai[0] == 0f)
31740 {
31742 {
31745 }
31747 {
31750 }
31756 {
31758 {
31760 {
31762 break;
31763 }
31764 }
31765 }
31767 {
31769 }
31771 {
31772 velocity.Y *= 0.95f;
31773 }
31774 else
31775 {
31777 }
31781 {
31782 return;
31783 }
31785 {
31786 this.ai[0] = 1f;
31787 this.ai[1] = 0f;
31789 }
31790 }
31791 else if (this.ai[0] == 1f)
31792 {
31793 this.ai[1]++;
31795 if (this.ai[1] >= 60f)
31796 {
31797 this.ai[1] = 0f;
31798 this.ai[0] = 2f;
31801 {
31802 this.ai[3] = ((Main.player[
num1280].Center.X >
base.Center.X) ? (-1f) : 1f);
31803 }
31804 else
31805 {
31806 this.ai[3] = 1f;
31807 }
31809 }
31810 }
31811 else if (this.ai[0] == 2f)
31812 {
31814 this.ai[1]++;
31817 if ((
position.
Y < (
float)(-
height) || this.ai[1] >= 180f) && Main.netMode != 1)
31818 {
31819 Main.StartInvasion(4);
31822 }
31823 }
31825 if (this.ai[0] == 2f)
31826 {
31828 }
31830 Lighting.AddLight(
base.Center,
rgb);
31831 }
31833 {
31834 if (Main.rand.Next(420) == 0)
31835 {
31837 }
31839 if (!Main.npc[(int)this.ai[3]].active || Main.npc[(int)this.ai[3]].type != 398)
31840 {
31844 }
31848 this.ai[1]++;
31852 {
31855 {
31856 break;
31857 }
31859 }
31861 {
31863 this.ai[1] = 0f;
31866 }
31870 {
31872 }
31873 if (this.ai[0] == -1f)
31874 {
31875 this.ai[1]++;
31876 if (this.ai[1] > 180f)
31877 {
31878 this.ai[1] = 0f;
31879 }
31881 if (this.ai[1] < 60f)
31882 {
31885 localAI[1] = (float)
Math.
Sin(
this.ai[1] * ((
float)Math.PI * 2f) / 15f) * 0.35f;
31887 {
31889 }
31890 }
31891 else if (this.ai[1] < 120f)
31892 {
31895 {
31897 }
31899 }
31900 else
31901 {
31905 {
31907 }
31908 }
31910 }
31911 if (this.ai[0] == 0f)
31912 {
31918 {
31920 }
31933 {
31935 {
31937 {
31939 }
31940 else
31941 {
31943 }
31945 {
31947 }
31948 else
31949 {
31951 }
31952 }
31953 }
31954 }
31955 else if (this.ai[0] == 1f)
31956 {
31958 {
31961 }
31964 {
31966 }
31971 {
31973 }
31975 {
31977 }
31978 else
31979 {
31981 }
31983 {
31985 }
31987 {
31991 }
31992 }
31993 else if (this.ai[0] == 2f)
31994 {
31996 {
31999 {
32001 }
32005 {
32007 }
32008 }
32010 {
32015 {
32016 case 0:
32019 break;
32020 case 1:
32023 break;
32024 case 2:
32027 break;
32028 case 3:
32031 break;
32032 case 4:
32035 break;
32036 case 5:
32039 break;
32040 }
32049 {
32051 Dust dust = Main.dust[
num1295];
32053 Main.dust[
num1295].noGravity =
true;
32054 }
32055 if ((
num1281 - 15f) % 10f == 0f && Main.netMode != 1)
32056 {
32058 if (
vec3.HasNaNs())
32059 {
32060 vec3 = Vector2.UnitY * -1f;
32061 }
32063 int num1296 = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(), base.Center.X +
vector234.X, base.Center.Y +
vector234.Y,
vec3.X,
vec3.Y, 454, 40, 0f, Main.myPlayer, 30f,
whoAmI);
32064 }
32065 }
32067 {
32068 localAI[0] =
localAI[0].AngleLerp(this.ai[2] - (
float)Math.PI / 2f, 0.2f);
32071 {
32076 {
32079 {
32082 projectile7.netUpdate = true;
32083 }
32084 }
32085 }
32086 velocity.Y *= 0.96f;
32087 this.ai[2] = (Main.player[
target].Center -
base.Center).ToRotation() + (float)
Math.
PI / 2f;
32089 }
32091 {
32094 {
32096 }
32100 {
32103 {
32106 projectile9.netUpdate = true;
32107 }
32108 }
32109 }
32110 else
32111 {
32114 }
32115 }
32116 else if (this.ai[0] == 3f)
32117 {
32119 {
32122 {
32124 }
32128 {
32130 }
32131 }
32133 {
32137 {
32139 }
32140 }
32142 {
32144 {
32145 this.ai[2] = (float)(Main.rand.Next(2) == 0).ToDirectionInt() * ((float)
Math.
PI * 2f) / 40f;
32147 }
32148 if ((
num1281 - 15f - 30f) % 40f == 0f)
32149 {
32150 this.ai[2] *= 0.95f;
32151 }
32155 {
32157 }
32162 if ((
num1281 - 15f - 30f) % 10f == 0f && Main.netMode != 1)
32163 {
32166 float ai3 = ((float)
Math.
PI * 2f * (
float)Main.rand.NextDouble() - (float)
Math.
PI) / 30f + (float)
Math.
PI / 180f *
this.ai[2];
32167 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector237.X,
vector237.Y,
vector238.X,
vector238.Y, 452, 35, 0f, Main.myPlayer, 0f,
ai3);
32168 }
32169 }
32170 else
32171 {
32176 {
32178 }
32180 }
32181 }
32182 else
32183 {
32184 if (this.ai[0] != 4f)
32185 {
32186 return;
32187 }
32189 {
32192 }
32194 {
32198 {
32200 }
32203 {
32205 }
32207 {
32208 return;
32209 }
32213 {
32215 }
32217 {
32221 {
32224 }
32228 Main.dust[
num1304].noGravity =
true;
32230 Main.dust[
num1304].customData =
this;
32231 }
32232 }
32234 {
32235 if (
num1281 == 180f && Main.netMode != 1)
32236 {
32242 {
32244 }
32246 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
spinningpoint11.X,
spinningpoint11.Y, 455, 50, 0f, Main.myPlayer,
num1305 * ((
float)
Math.
PI * 2f) / 540f,
whoAmI);
32249 }
32252 {
32254 }
32255 float num1306 = (this.ai[2] >= 0f).ToDirectionInt();
32258 {
32260 }
32265 }
32266 else
32267 {
32270 {
32272 }
32273 }
32274 }
32275 }
32277 {
32281 int num1310 = (int)this.ai[1];
32283 {
32287 return;
32288 }
32289 this.ai[2]++;
32291 {
32292 if (Main.netMode != 1)
32293 {
32299 {
32301 {
32303 {
32305 }
32307 {
32309 }
32311 {
32312 break;
32313 }
32314 }
32315 }
32322 {
32325 {
32327 }
32333 }
32335 {
32338 {
32340 }
32346 }
32348 {
32351 {
32353 }
32359 }
32361 {
32364 {
32366 }
32372 }
32373 }
32377 }
32378 else
32379 {
32384 {
32387 Main.dust[
num1330].noGravity =
true;
32388 Main.dust[
num1330].scale = 0.7f;
32389 Main.dust[
num1330].customData =
this;
32390 }
32393 {
32395 Main.dust[
num1332].noGravity =
true;
32396 Main.dust[
num1332].scale = 1.5f;
32397 Main.dust[
num1332].customData =
this;
32398 }
32399 }
32400 }
32402 {
32404 {
32405 if (
localAI[3] == 0f && Main.netMode != 1)
32406 {
32411 {
32415 return;
32416 }
32420 {
32426 {
32429 }
32430 else
32431 {
32434 }
32435 Main.npc[
num1337].netUpdate =
true;
32436 }
32437 }
32438 if (
localAI[0] == 1f && Main.netMode != 1)
32439 {
32442 {
32445 Main.npc[(int)this.ai[
num1338] - 1].
ai[3] = 0f;
32448 }
32449 }
32450 if (this.ai[0] != -1f && Main.netMode != 1)
32451 {
32454 {
32456 {
32458 }
32459 if (Main.npc[(
int)this.ai[
num1339] - 1].active && Main.npc[(int)this.ai[
num1339] - 1].
type == 379)
32460 {
32462 }
32463 }
32465 {
32466 this.ai[0] = -1f;
32467 this.ai[1] = 0f;
32468 this.ai[3] = 0f;
32469 int num1340 = (int)
base.Center.X / 16 + 11 * (Main.rand.Next(2) == 0).ToDirectionInt();
32472 {
32476 {
32478 break;
32479 }
32481 {
32483 }
32484 }
32490 }
32491 }
32492 if (this.ai[0] == -1f)
32493 {
32494 this.ai[3]++;
32495 if (this.ai[3] > 300f)
32496 {
32500 if (Main.netMode != 1)
32501 {
32503 {
32504 float num1347 = 3f + Main.rand.NextFloat() * 6f;
32508 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
center28.X,
center28.Y,
vector241.X *
num1347,
vector241.Y *
num1347, 526, 0, 0f, Main.myPlayer, Main.npc[(
int)
this.ai[2]].Center.X, Main.npc[(
int)
this.ai[2]].Center.Y);
32509 }
32511 {
32512 if (Main.rand.Next(2) != 0)
32513 {
32514 float num1349 = 3f + Main.rand.NextFloat() * 6f;
32519 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
center29.X,
center29.Y,
vector242.X *
num1349, -20f, 526, 0, 0f, Main.myPlayer,
vector243.X,
vector243.Y);
32520 }
32521 }
32522 }
32523 }
32524 else if (this.ai[3] % 10f == 1f && this.ai[3] > 120f && Main.netMode != 1)
32525 {
32526 float num1350 = 3f + Main.rand.NextFloat() * 6f;
32530 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
center30.X,
center30.Y,
vector244.X *
num1350,
vector244.Y *
num1350, 526, 0, 0f, Main.myPlayer, Main.npc[(
int)
this.ai[2]].Center.X, Main.npc[(
int)
this.ai[2]].Center.Y);
32531 }
32532 }
32533 }
32535 {
32536 velocity.X *= 0.93f;
32538 {
32539 velocity.X = 0f;
32540 }
32541 int num1351 = (int)(0f - this.ai[3] - 1f);
32543 {
32547 return;
32548 }
32551 {
32552 velocity.X = 0f;
32555 }
32556 if (
justHit && Main.netMode != 1 && Main.npc[
num1351].localAI[0] == 0f)
32557 {
32558 Main.npc[
num1351].localAI[0] = 1f;
32559 }
32560 if ((this.ai[0] += 1f) >= 300f)
32561 {
32562 this.ai[0] = 0f;
32564 }
32565 }
32567 {
32568 Lighting.AddLight(
base.Center, 0.8f, 0.75f, 0.55f);
32569 }
32570 }
32572 {
32574 }
32576 {
32578 if (this.ai[0] == 0f)
32579 {
32581 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
32582 {
32583 this.ai[0] = 1f;
32584 }
32585 else
32586 {
32588 vector245.Y -= Main.player[
target].height / 4;
32591 {
32592 this.ai[0] = 2f;
32593 }
32594 else
32595 {
32597 center31.X = Main.player[
target].Center.X;
32600 {
32601 this.ai[0] = 3f;
32605 center32.Y = Main.player[
target].Center.Y;
32606 if (
vector246.Length() > 8f && Collision.CanHit(
base.Center, 1, 1,
center32, 1, 1) && Collision.CanHit(
center32, 1, 1, Main.player[
target].position, 1, 1))
32607 {
32608 this.ai[0] = 3f;
32611 }
32612 }
32613 else
32614 {
32616 center31.Y = Main.player[
target].Center.Y;
32618 {
32619 this.ai[0] = 3f;
32622 }
32623 }
32624 if (this.ai[0] == 0f)
32625 {
32630 this.ai[0] = 4f;
32631 this.ai[1] = 0f;
32632 }
32633 }
32634 }
32635 }
32636 else if (this.ai[0] == 1f)
32637 {
32641 {
32643 }
32647 {
32649 }
32655 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
32656 {
32657 this.ai[0] = 0f;
32658 this.ai[1] = 0f;
32659 }
32661 {
32664 {
32667 {
32669 break;
32670 }
32671 }
32673 {
32674 base.Center = Main.player[
target].Top;
32676 this.ai[0] = 5f;
32677 this.ai[1] = 0f;
32679 }
32680 }
32681 }
32682 else if (this.ai[0] == 2f)
32683 {
32690 {
32692 }
32698 {
32699 this.ai[0] = 0f;
32700 }
32701 }
32702 else if (this.ai[0] == 3f)
32703 {
32710 {
32712 }
32718 {
32719 this.ai[0] = 4f;
32720 this.ai[1] = 0f;
32721 }
32723 {
32724 this.ai[0] = 0f;
32725 }
32726 }
32727 else if (this.ai[0] == 4f)
32728 {
32731 {
32732 velocity.X *= -0.8f;
32733 }
32735 {
32736 velocity.Y *= -0.8f;
32737 }
32740 {
32742 vector251.Y -= Main.player[
target].height / 4;
32745 }
32748 {
32750 }
32756 this.ai[1] += 1f;
32757 if (this.ai[1] > 180f)
32758 {
32759 this.ai[0] = 0f;
32760 this.ai[1] = 0f;
32761 }
32762 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
32763 {
32764 this.ai[0] = 0f;
32765 }
32768 {
32771 center33.X = Main.player[
target].Center.X;
32772 if (Collision.CanHit(
base.Center, 1, 1,
center33, 1, 1) && Collision.CanHit(
base.Center, 1, 1,
center33, 1, 1) && Collision.CanHit(Main.player[
target].Center, 1, 1,
center33, 1, 1))
32773 {
32774 this.ai[0] = 3f;
32777 }
32778 else
32779 {
32781 center33.Y = Main.player[
target].Center.Y;
32782 if (Collision.CanHit(
base.Center, 1, 1,
center33, 1, 1) && Collision.CanHit(Main.player[
target].Center, 1, 1,
center33, 1, 1))
32783 {
32784 this.ai[0] = 3f;
32787 }
32788 }
32789 }
32790 }
32791 else if (this.ai[0] == 5f)
32792 {
32795 {
32796 this.ai[0] = 0f;
32797 this.ai[1] = 0f;
32799 }
32800 else
32801 {
32806 {
32808 }
32809 }
32810 }
32812 {
32815 {
32817 {
32819 {
32820 velocity.X -= 0.05f;
32821 }
32822 else
32823 {
32824 velocity.X += 0.05f;
32825 }
32827 {
32828 velocity.Y -= 0.05f;
32829 }
32830 else
32831 {
32832 velocity.Y += 0.05f;
32833 }
32834 }
32835 }
32836 }
32837 else
32838 {
32840 {
32841 return;
32842 }
32843 hide = this.ai[0] == 5f;
32846 {
32848 {
32850 {
32851 velocity.X -= 0.05f;
32852 }
32853 else
32854 {
32855 velocity.X += 0.05f;
32856 }
32858 {
32859 velocity.Y -= 0.05f;
32860 }
32861 else
32862 {
32863 velocity.Y += 0.05f;
32864 }
32865 }
32866 }
32867 }
32868 }
32870 {
32872 {
32875 {
32877 }
32878 }
32883 {
32885 {
32886 continue;
32887 }
32890 {
32891 continue;
32892 }
32895 {
32897 {
32898 vector252.X = 1f;
32899 }
32900 else
32901 {
32902 vector252.X = -1f;
32903 }
32904 }
32909 }
32911 {
32914 {
32916 {
32920 {
32921 velocity.X += 2f;
32922 }
32923 else
32924 {
32925 velocity.X -= 2f;
32926 }
32929 {
32931 center34.Y -= 18f;
32934 vector253 *= (float)Main.rand.Next(0, 100) * 0.1f;
32937 vector253 *= (float)Main.rand.Next(50, 90) * 0.2f;
32940 Main.dust[
num1371].alpha = 100;
32941 if (Main.rand.Next(2) == 0)
32942 {
32943 Main.dust[
num1371].noGravity =
true;
32944 Dust dust = Main.dust[
num1371];
32945 dust.scale += 0.3f;
32946 }
32947 }
32949 }
32954 {
32955 if (Main.rand.Next(5) == 0)
32956 {
32959 Main.dust[
num1375].alpha = 100;
32960 Dust dust = Main.dust[
num1375];
32961 dust.velocity *= 0.3f;
32963 dust.velocity +=
velocity * 0.75f;
32964 Main.dust[
num1375].noGravity =
true;
32966 }
32967 }
32968 }
32969 }
32971 {
32974 {
32976 {
32980 {
32981 velocity.X += 2f;
32982 }
32983 else
32984 {
32985 velocity.X -= 2f;
32986 }
32987 }
32991 {
32994 Main.dust[
num1379].noGravity =
true;
32995 Main.dust[
num1379].noLight =
true;
32997 }
32998 }
32999 }
33000 if (this.ai[0] == 0f)
33001 {
33003 this.ai[0] = 1f;
33005 }
33006 else if (this.ai[0] == 1f)
33007 {
33015 {
33021 }
33022 velocity.X += this.ai[1] *
num1380;
33024 {
33026 }
33028 {
33030 }
33033 {
33035 }
33037 {
33039 }
33041 {
33043 }
33045 if ((this.ai[1] > 0f && Main.player[
target].Center.X -
base.Center.X < 0f -
num1383) || (this.ai[1] < 0f && Main.player[
target].Center.X - base.Center.X >
num1383))
33046 {
33047 this.ai[0] = 2f;
33048 this.ai[1] = 0f;
33049 if (
base.Center.Y + 20f > Main.player[
target].Center.Y)
33050 {
33051 this.ai[1] = -1f;
33052 }
33053 else
33054 {
33055 this.ai[1] = 1f;
33056 }
33057 }
33058 }
33059 else if (this.ai[0] == 2f)
33060 {
33065 {
33069 }
33070 velocity.Y += this.ai[1] *
num1386;
33072 {
33074 }
33076 {
33078 this.ai[0] = 3f;
33080 }
33081 }
33082 else if (this.ai[0] == 3f)
33083 {
33089 {
33094 }
33095 velocity.X += this.ai[1] *
num1389;
33096 if (
base.Center.Y > Main.player[
target].Center.Y)
33097 {
33099 }
33100 else
33101 {
33103 }
33105 {
33107 }
33109 {
33111 this.ai[0] = 0f;
33113 }
33114 }
33116 {
33120 {
33122 Main.dust[
num1395].noGravity =
true;
33123 Main.dust[
num1395].noLight =
true;
33124 }
33126 }
33127 }
33129 {
33130 knockBackResist = 0.2f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
33135 if (this.ai[0] != 7f && Main.player[
target].dead)
33136 {
33138 if (Main.player[
target].dead)
33139 {
33140 this.ai[0] = 7f;
33141 this.ai[1] = 0f;
33142 this.ai[2] = 0f;
33143 this.ai[3] = 0f;
33145 }
33146 }
33147 if (this.ai[0] == 0f)
33148 {
33152 {
33153 this.ai[0] = 1f;
33154 this.ai[1] = 0f;
33156 }
33157 }
33158 else if (this.ai[0] == 1f)
33159 {
33160 this.ai[1] += 1f;
33161 if (Main.netMode != 1 && this.ai[1] > 36f)
33162 {
33163 this.ai[0] = 2f;
33164 this.ai[1] = 0f;
33166 }
33167 }
33168 else if (this.ai[0] == 2f)
33169 {
33171 if (Main.netMode != 1 &&
vector255.Length() > 600f)
33172 {
33173 this.ai[0] = 5f;
33174 this.ai[1] = 0f;
33175 this.ai[2] = 0f;
33176 this.ai[3] = 0f;
33178 }
33180 {
33182 velocity.X *= 0.85f;
33183 this.ai[1] += 1f;
33187 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
33188 {
33190 }
33191 if (Main.netMode != 1 &&
this.ai[1] >
num1396)
33192 {
33193 this.ai[3] += 1f;
33194 if (this.ai[3] >= 3f)
33195 {
33196 this.ai[3] = 0f;
33199 }
33200 this.ai[1] = 0f;
33204 }
33205 }
33206 else
33207 {
33209 velocity.X *= 0.99f;
33211 {
33212 velocity.X = -1f;
33213 }
33215 {
33216 velocity.X = 1f;
33217 }
33218 }
33219 this.ai[2] += 1f;
33220 if ((double)this.ai[2] > 210.0 && velocity.Y == 0f && Main.netMode != 1)
33221 {
33222 switch (Main.rand.Next(3))
33223 {
33224 case 0:
33225 this.ai[0] = 3f;
33226 break;
33227 case 1:
33228 this.ai[0] = 4f;
33230 velocity.Y = -8f;
33231 break;
33232 case 2:
33233 this.ai[0] = 6f;
33234 break;
33235 default:
33236 this.ai[0] = 2f;
33237 break;
33238 }
33239 if (Main.tenthAnniversaryWorld &&
type == 476 &&
this.ai[0] == 3f && Main.rand.Next(2) == 0)
33240 {
33241 this.ai[0] = 8f;
33242 }
33243 this.ai[1] = 0f;
33244 this.ai[2] = 0f;
33245 this.ai[3] = 0f;
33247 }
33248 }
33249 else if (this.ai[0] == 3f)
33250 {
33251 velocity.X *= 0.85f;
33253 this.ai[1] += 1f;
33254 if (Main.netMode != 1 && this.ai[1] >= 180f)
33255 {
33256 this.ai[0] = 2f;
33257 this.ai[1] = 0f;
33259 }
33260 if (Main.expertMode)
33261 {
33264 }
33265 }
33266 else if (this.ai[0] == 4f)
33267 {
33272 {
33274 }
33275 else
33276 {
33278 }
33282 center35.Y -= 350f;
33284 if (this.ai[2] == 1f)
33285 {
33286 this.ai[1] += 1f;
33291 if (Main.netMode != 1 && this.ai[1] > 6f)
33292 {
33293 this.ai[1] = 0f;
33294 this.ai[0] = 4.1f;
33295 this.ai[2] = 0f;
33298 }
33299 }
33300 else if (
Math.
Abs(
base.Center.X - Main.player[
target].Center.X) < 40f && base.Center.Y < Main.player[
target].Center.Y - 300f)
33301 {
33302 if (Main.netMode != 1)
33303 {
33304 this.ai[1] = 0f;
33305 this.ai[2] = 1f;
33307 }
33308 }
33309 else
33310 {
33314 }
33315 }
33316 else if (this.ai[0] == 4.1f)
33317 {
33319 if (this.ai[2] == 0f && Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1) && !Collision.SolidCollision(
position,
width,
height))
33320 {
33321 this.ai[2] = 1f;
33322 }
33324 {
33325 this.ai[1] += 1f;
33326 if (Main.netMode != 1 && this.ai[1] > 10f)
33327 {
33328 this.ai[0] = 2f;
33329 this.ai[1] = 0f;
33330 this.ai[2] = 0f;
33331 this.ai[3] = 0f;
33334 {
33335 this.ai[0] = 5f;
33336 }
33337 }
33338 }
33339 else if (this.ai[2] == 0f)
33340 {
33344 }
33345 velocity.Y += 0.2f;
33347 {
33348 velocity.Y = 16f;
33349 }
33350 }
33351 else if (this.ai[0] == 5f)
33352 {
33354 {
33356 }
33357 else
33358 {
33360 }
33366 vector257.Y -= 4f;
33368 {
33369 this.ai[0] = 2f;
33370 this.ai[1] = 0f;
33371 this.ai[2] = 0f;
33372 this.ai[3] = 0f;
33374 }
33376 {
33379 }
33381 }
33382 else if (this.ai[0] == 6f)
33383 {
33386 {
33388 velocity.X *= 0.8f;
33389 this.ai[1] += 1f;
33390 if (this.ai[1] > 5f)
33391 {
33392 this.ai[1] = 0f;
33393 velocity.Y -= 4f;
33394 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y)
33395 {
33396 velocity.Y -= 1.25f;
33397 }
33398 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 40f)
33399 {
33400 velocity.Y -= 1.5f;
33401 }
33402 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 80f)
33403 {
33404 velocity.Y -= 1.75f;
33405 }
33406 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 120f)
33407 {
33408 velocity.Y -= 2f;
33409 }
33410 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 160f)
33411 {
33412 velocity.Y -= 2.25f;
33413 }
33414 if (Main.player[
target].position.Y + (
float)Main.player[
target].height <
base.Center.Y - 200f)
33415 {
33416 velocity.Y -= 2.5f;
33417 }
33418 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
33419 {
33420 velocity.Y -= 2f;
33421 }
33423 this.ai[2] += 1f;
33425 }
33426 }
33427 else
33428 {
33429 velocity.X *= 0.98f;
33431 {
33432 velocity.X = -8f;
33433 }
33435 {
33436 velocity.X = 8f;
33437 }
33438 }
33439 if (Main.netMode != 1 &&
this.ai[2] >= 3f &&
velocity.
Y == 0f)
33440 {
33441 this.ai[0] = 2f;
33442 this.ai[1] = 0f;
33443 this.ai[2] = 0f;
33444 this.ai[3] = 0f;
33446 }
33447 }
33448 else if (this.ai[0] == 7f)
33449 {
33456 {
33458 }
33459 velocity.X *= 0.98f;
33460 }
33461 else
33462 {
33463 if (this.ai[0] != 8f)
33464 {
33465 return;
33466 }
33467 velocity.X *= 0.85f;
33468 this.ai[1] += 1f;
33469 if (Main.netMode != 1)
33470 {
33471 if (!Main.tenthAnniversaryWorld || this.ai[1] >= 180f)
33472 {
33473 this.ai[0] = 2f;
33474 this.ai[1] = 0f;
33476 }
33477 else if (this.ai[1] % 20f == 0f)
33478 {
33480 }
33481 }
33482 }
33483 }
33485 {
33489 knockBackResist = 0.2f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
33491 if (!Main.eclipse && Main.netMode != 1)
33492 {
33493 if (this.ai[0] != -1f)
33494 {
33496 }
33497 this.ai[0] = -1f;
33498 }
33500 {
33503 if (Main.netMode != 1 && (Main.player[
target].dead ||
vector258.Length() > 3000f))
33504 {
33505 if (this.ai[0] != -1f)
33506 {
33508 }
33509 this.ai[0] = -1f;
33510 }
33511 }
33512 else
33513 {
33515 if (Main.netMode != 1 &&
this.ai[0] > 1f &&
vector259.Length() > 1000f)
33516 {
33517 if (this.ai[0] != 1f)
33518 {
33520 }
33521 this.ai[0] = 1f;
33522 }
33523 }
33524 if (this.ai[0] == -1f)
33525 {
33530 }
33531 else if (this.ai[0] == 0f)
33532 {
33534 if (
base.Center.X < Main.player[
target].Center.X - 2f)
33535 {
33537 }
33538 if (
base.Center.X > Main.player[
target].Center.X + 2f)
33539 {
33541 }
33545 {
33548 {
33549 velocity.X = 4f;
33550 }
33552 {
33553 velocity.X = -4f;
33554 }
33555 }
33557 {
33560 {
33561 velocity.Y = 4f;
33562 }
33564 {
33565 velocity.Y = -4f;
33566 }
33567 }
33569 vector261.Y -= 200f;
33571 {
33572 this.ai[0] = 1f;
33573 this.ai[1] = 0f;
33574 this.ai[2] = 0f;
33575 this.ai[3] = 0f;
33577 }
33579 {
33585 }
33587 {
33589 }
33591 {
33593 }
33594 if (Main.netMode == 1)
33595 {
33596 return;
33597 }
33598 this.ai[1] += 1f;
33600 {
33601 this.ai[1] += Main.rand.Next(10, 30);
33602 }
33603 if (!(this.ai[1] >= 180f))
33604 {
33605 return;
33606 }
33607 this.ai[1] = 0f;
33608 this.ai[2] = 0f;
33609 this.ai[3] = 0f;
33611 while (this.ai[0] == 0f)
33612 {
33613 int num1402 = Main.rand.Next(3);
33614 if (
num1402 == 0 && Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
33615 {
33616 this.ai[0] = 2f;
33617 continue;
33618 }
33620 {
33621 case 1:
33622 this.ai[0] = 3f;
33623 break;
33624 case 2:
33626 {
33627 this.ai[0] = 4f;
33628 }
33629 break;
33630 }
33631 }
33632 }
33633 else if (this.ai[0] == 1f)
33634 {
33640 {
33642 }
33644 {
33646 }
33648 {
33650 }
33655 {
33656 this.ai[0] = 0f;
33657 this.ai[1] = 0f;
33658 this.ai[2] = 0f;
33659 this.ai[3] = 0f;
33661 }
33667 }
33668 else if (this.ai[0] == 2f)
33669 {
33673 {
33675 this.ai[0] = 0f;
33676 this.ai[1] = 0f;
33677 this.ai[2] = 0f;
33678 this.ai[3] = 0f;
33680 }
33681 if (Main.player[
target].Center.X - 10f <
base.Center.X)
33682 {
33684 }
33685 else if (Main.player[
target].Center.X + 10f >
base.Center.X)
33686 {
33688 }
33692 {
33695 {
33696 velocity.X = 4f;
33697 }
33699 {
33700 velocity.X = -4f;
33701 }
33702 }
33704 {
33707 {
33708 velocity.Y = 4f;
33709 }
33711 {
33712 velocity.Y = -4f;
33713 }
33714 }
33716 vector263.Y -= 20f;
33717 this.ai[2] += 1f / 45f;
33718 if (Main.expertMode)
33719 {
33720 this.ai[2] += 1f / 60f;
33721 }
33727 if (Main.netMode != 1)
33728 {
33729 this.ai[1] += 1f;
33730 if (this.ai[1] > 240f || !Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
33731 {
33732 this.ai[0] = 0f;
33733 this.ai[1] = 0f;
33734 this.ai[2] = 0f;
33735 this.ai[3] = 0f;
33737 }
33738 }
33739 }
33740 else if (this.ai[0] == 3f)
33741 {
33745 {
33747 }
33748 else
33749 {
33751 }
33755 vector264.Y -= 12f;
33756 if (
base.Center.X > Main.player[
target].Center.X)
33757 {
33758 vector264.X += 400f;
33759 }
33760 else
33761 {
33762 vector264.X -= 400f;
33763 }
33765 {
33766 this.ai[0] = 3.1f;
33767 this.ai[1] = 0f;
33769 }
33770 this.ai[1] += 1f / 30f;
33771 float num1407 = 8f + this.ai[1];
33776 }
33777 else if (this.ai[0] == 3.1f)
33778 {
33783 vector265.Y -= 12f;
33790 {
33792 }
33793 else
33794 {
33796 }
33798 this.ai[1] += 1f;
33799 if (Main.netMode != 1 && this.ai[1] > 10f)
33800 {
33803 {
33805 }
33806 else
33807 {
33809 }
33810 this.ai[0] = 3.2f;
33811 this.ai[1] = 0f;
33814 }
33815 }
33816 else if (this.ai[0] == 3.2f)
33817 {
33823 this.ai[2] += 1f / 30f;
33824 velocity.X = (16f + this.ai[2]) * this.ai[1];
33825 if ((this.ai[1] > 0f &&
base.Center.X > Main.player[
target].Center.X + 260f) || (this.ai[1] < 0f && base.Center.X < Main.player[
target].Center.X - 260f))
33826 {
33828 {
33829 this.ai[0] = 0f;
33830 this.ai[1] = 0f;
33831 this.ai[2] = 0f;
33832 this.ai[3] = 0f;
33834 }
33835 else if (Main.netMode != 1 &&
Math.
Abs(
base.Center.X - Main.player[
target].Center.X) > 800f)
33836 {
33837 this.ai[0] = 1f;
33838 this.ai[1] = 0f;
33839 this.ai[2] = 0f;
33840 this.ai[3] = 0f;
33842 }
33843 }
33845 }
33846 else if (this.ai[0] == 4f)
33847 {
33848 bool flag84 = (double)(
base.Center.Y / 16f) < Main.worldSurface;
33850 if (Main.netMode != 1)
33851 {
33852 this.ai[0] = 0f;
33853 this.ai[1] = 0f;
33854 this.ai[2] = 0f;
33856 {
33864 {
33865 continue;
33866 }
33870 {
33873 {
33875 break;
33876 }
33879 {
33881 break;
33882 }
33884 {
33886 break;
33887 }
33890 {
33892 break;
33893 }
33895 {
33897 break;
33898 }
33900 {
33901 break;
33902 }
33904 }
33906 {
33907 this.ai[0] = 4.1f;
33910 break;
33911 }
33912 }
33913 }
33915 }
33916 else if (this.ai[0] == 4.1f)
33917 {
33919 {
33921 }
33923 {
33925 }
33929 int num1417 = (int)this.ai[1];
33930 int num1418 = (int)this.ai[2];
33937 {
33939 }
33941 if (
v12.Length() < 10f)
33942 {
33943 this.ai[0] = 4.2f;
33945 }
33950 {
33953 }
33954 }
33955 else
33956 {
33957 if (this.ai[0] != 4.2f)
33958 {
33959 return;
33960 }
33964 int num1421 = (int)this.ai[1];
33965 int num1422 = (int)this.ai[2];
33972 if (Main.netMode != 1 &&
vector266.Length() < 4f)
33973 {
33975 if (Main.expertMode)
33976 {
33978 }
33979 this.ai[3] += 1f;
33980 if (this.ai[3] == (
float)
num1425)
33981 {
33983 Main.npc[
num1426].netUpdate =
true;
33984 }
33985 else if (this.ai[3] == (
float)(
num1425 * 2))
33986 {
33987 this.ai[0] = 0f;
33988 this.ai[1] = 0f;
33989 this.ai[2] = 0f;
33990 this.ai[3] = 0f;
33993 {
33994 this.ai[0] = 4f;
33995 }
33997 {
33998 this.ai[0] = 1f;
33999 }
34000 }
34001 }
34003 {
34006 }
34009 {
34012 }
34013 }
34014 }
34016 {
34018 {
34019 velocity.X *= 0.9f;
34021 }
34022 else
34023 {
34024 velocity.X *= 0.99f;
34026 }
34028 if (Main.expertMode)
34029 {
34031 }
34033 {
34034 this.ai[0] -= Main.rand.Next(10, 21);
34035 if (!Main.expertMode)
34036 {
34037 this.ai[0] -= Main.rand.Next(10, 21);
34038 }
34039 }
34040 this.ai[0] += 1f;
34041 if (this.ai[0] >= (
float)
num1427)
34042 {
34044 }
34046 {
34049 if ((
float)Main.rand.Next(-10, 120) <
num1428 * 100f)
34050 {
34051 velocity.Y -= (float)Main.rand.Next(20, 40) * 0.025f;
34052 velocity.X += (float)Main.rand.Next(-20, 20) * 0.025f;
34055 }
34056 }
34057 }
34059 {
34061 knockBackResist = 0.4f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
34064 if (!Main.eclipse)
34065 {
34067 velocity.Y -= 0.2f;
34069 {
34070 velocity.Y = -8f;
34071 }
34073 return;
34074 }
34075 if (this.ai[0] == 0f || this.ai[0] == 1f)
34076 {
34078 {
34080 {
34083 {
34089 }
34090 }
34091 }
34092 }
34094 {
34098 {
34099 this.ai[0] = -1f;
34100 }
34101 }
34102 else
34103 {
34105 if (this.ai[0] > 1f &&
vector269.Length() > 1000f)
34106 {
34107 this.ai[0] = 1f;
34108 }
34109 }
34110 if (this.ai[0] == -1f)
34111 {
34116 }
34117 else if (this.ai[0] == 0f)
34118 {
34122 {
34125 {
34126 velocity.X = 4f;
34127 }
34129 {
34130 velocity.X = -4f;
34131 }
34132 }
34134 {
34137 {
34138 velocity.Y = 4f;
34139 }
34141 {
34142 velocity.Y = -4f;
34143 }
34144 }
34147 {
34148 this.ai[0] = 1f;
34149 this.ai[1] = 0f;
34150 this.ai[2] = 0f;
34151 this.ai[3] = 0f;
34152 }
34154 {
34160 }
34162 {
34164 }
34166 {
34168 }
34169 this.ai[1] += 1f;
34170 if (this.ai[1] >= 90f)
34171 {
34172 this.ai[1] = 0f;
34173 this.ai[0] = 2f;
34174 }
34175 }
34176 else if (this.ai[0] == 1f)
34177 {
34183 {
34185 }
34187 {
34189 }
34191 {
34193 }
34198 {
34199 this.ai[0] = 0f;
34200 this.ai[1] = 0f;
34201 this.ai[2] = 0f;
34202 this.ai[3] = 0f;
34203 }
34204 this.ai[2] += 1f / 60f;
34210 }
34211 else if (this.ai[0] == 2f)
34212 {
34214 {
34216 }
34218 {
34220 }
34226 vector273.Y -= 8f;
34233 {
34235 }
34236 else
34237 {
34239 }
34241 this.ai[1] += 1f;
34242 if (this.ai[1] > 10f)
34243 {
34246 {
34248 }
34249 else
34250 {
34252 }
34253 this.ai[0] = 2.1f;
34254 this.ai[1] = 0f;
34255 }
34256 }
34257 else
34258 {
34259 if (this.ai[0] != 2.1f)
34260 {
34261 return;
34262 }
34264 {
34266 }
34268 {
34270 }
34275 this.ai[1] += 1f;
34277 if (this.ai[1] > (
float)
num1436)
34278 {
34280 {
34281 this.ai[0] = 0f;
34282 this.ai[1] = 0f;
34283 this.ai[2] = 0f;
34284 }
34285 else if (this.ai[1] > (
float)(
num1436 * 2))
34286 {
34287 this.ai[0] = 1f;
34288 this.ai[1] = 0f;
34289 this.ai[2] = 0f;
34290 }
34291 }
34292 }
34293 }
34295 {
34299 if (
justHit && Main.netMode != 1 && Main.expertMode && Main.rand.Next(6) == 0)
34300 {
34302 this.ai[0] = -1f;
34303 this.ai[1] = 0f;
34304 }
34305 if (this.ai[0] == -1f)
34306 {
34309 velocity.X *= 0.98f;
34310 this.ai[1] += 1f;
34311 if (this.ai[1] >= 120f)
34312 {
34313 this.ai[0] = (this.ai[1] = (this.ai[2] = (this.ai[3] = 0f)));
34314 }
34315 }
34316 else if (this.ai[0] == 0f)
34317 {
34319 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
34320 {
34321 this.ai[0] = 1f;
34322 return;
34323 }
34325 vector274.Y -= Main.player[
target].height / 4;
34328 center36.X = Main.player[
target].Center.X;
34331 {
34332 this.ai[0] = 3f;
34336 center37.Y = Main.player[
target].Center.Y;
34337 if (
vector275.Length() > 8f && Collision.CanHit(
base.Center, 1, 1,
center37, 1, 1) && Collision.CanHit(
center37, 1, 1, Main.player[
target].position, 1, 1))
34338 {
34339 this.ai[0] = 3f;
34342 }
34343 }
34344 else
34345 {
34347 center36.Y = Main.player[
target].Center.Y;
34349 {
34350 this.ai[0] = 3f;
34353 }
34354 }
34355 if (this.ai[0] == 0f)
34356 {
34361 this.ai[0] = 4f;
34362 this.ai[1] = 0f;
34363 }
34364 }
34365 else if (this.ai[0] == 1f)
34366 {
34375 if (!Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
34376 {
34377 this.ai[0] = 0f;
34378 this.ai[1] = 0f;
34379 }
34380 }
34381 else if (this.ai[0] == 2f)
34382 {
34392 {
34393 this.ai[0] = 0f;
34394 }
34395 }
34396 else if (this.ai[0] == 3f)
34397 {
34407 {
34408 this.ai[0] = 4f;
34409 this.ai[1] = 0f;
34410 }
34412 {
34413 this.ai[0] = 0f;
34414 }
34415 }
34416 else
34417 {
34418 if (this.ai[0] != 4f)
34419 {
34420 return;
34421 }
34423 {
34424 velocity.X *= -0.8f;
34425 }
34427 {
34428 velocity.Y *= -0.8f;
34429 }
34432 {
34434 vector280.Y -= Main.player[
target].height / 4;
34437 }
34444 this.ai[1] += 1f;
34445 if (this.ai[1] > 180f)
34446 {
34447 this.ai[0] = 0f;
34448 this.ai[1] = 0f;
34449 }
34450 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
34451 {
34452 this.ai[0] = 0f;
34453 }
34456 {
34457 return;
34458 }
34461 center38.X = Main.player[
target].Center.X;
34462 if (Collision.CanHit(
base.Center, 1, 1,
center38, 1, 1) && Collision.CanHit(
base.Center, 1, 1,
center38, 1, 1) && Collision.CanHit(Main.player[
target].Center, 1, 1,
center38, 1, 1))
34463 {
34464 this.ai[0] = 3f;
34467 return;
34468 }
34470 center38.Y = Main.player[
target].Center.Y;
34471 if (Collision.CanHit(
base.Center, 1, 1,
center38, 1, 1) && Collision.CanHit(Main.player[
target].Center, 1, 1,
center38, 1, 1))
34472 {
34473 this.ai[0] = 3f;
34476 }
34477 }
34478 }
34480 {
34481 if (Main.rand.Next(20) == 0)
34482 {
34483 switch (Main.rand.Next(15, 18))
34484 {
34485 case 15:
34487 break;
34488 case 16:
34490 break;
34491 case 17:
34493 break;
34494 }
34495 }
34496 if (Main.netMode == 1)
34497 {
34498 return;
34499 }
34501 int num1449 = (int)this.ai[0];
34502 int num1450 = (int)this.ai[1];
34504 {
34506 }
34508 {
34511 {
34513 }
34514 }
34516 {
34522 {
34524 }
34525 }
34526 }
34528 {
34529 if (Main.netMode != 1 &&
localAI[0] == 0f)
34530 {
34533 {
34536 Main.npc[
num1453].timeLeft = 600;
34537 Main.npc[
num1453].netUpdate =
true;
34539 }
34541 }
34544 {
34545 if (this.ai[
num1454] >= 0f && (!Main.npc[(
int)
this.ai[
num1454]].active || Main.npc[(
int)
this.ai[
num1454]].type != 492))
34546 {
34549 }
34550 else if (this.ai[
num1454] >= 0f)
34551 {
34553 }
34554 }
34556 {
34558 return;
34559 }
34560 if (Main.netMode != 1 && Main.rand.Next(300) == 0)
34561 {
34566 Main.npc[
num1455].netUpdate =
true;
34567 Main.npc[
num1455].timeLeft = 600;
34568 }
34569 if ((
localAI[3] += 1f) >= 64f)
34570 {
34572 }
34578 {
34580 }
34581 else
34582 {
34584 {
34587 {
34589 break;
34590 }
34591 }
34592 }
34595 {
34598 {
34600 }
34602 }
34604 {
34607 {
34609 }
34611 }
34612 else
34613 {
34614 velocity.Y *= 0.95f;
34615 }
34618 {
34619 velocity.X += (float)
direction * 0.06f;
34620 }
34624 {
34625 if (Main.rand.Next(2) != 0)
34626 {
34628 Dust
dust8 = Main.dust[Dust.NewDust(
base.Center, 0, 0, 228)];
34629 dust8.position = base.Center +
vector282;
34631 dust8.noGravity = true;
34632 dust8.noLight = true;
34633 dust8.fadeIn = 1.5f;
34634 dust8.scale = 0.5f;
34635 }
34636 }
34637 }
34639 {
34640 if (this.ai[2] == 1f)
34641 {
34644 {
34645 velocity.Y += 0.02f;
34646 }
34648 {
34649 velocity.Y -= 0.02f;
34650 }
34652 this.ai[1]++;
34653 if (this.ai[1] > 120f)
34654 {
34655 Opacity = 1f - (this.ai[1] - 120f) / 60f;
34656 }
34659 {
34660 case 517:
34662 break;
34663 case 422:
34665 break;
34666 case 507:
34668 break;
34669 case 493:
34671 break;
34672 }
34673 if (Main.rand.Next(5) == 0 && this.ai[1] < 120f)
34674 {
34676 {
34678 dust9.position = base.Center +
Vector2.
UnitY.RotatedByRandom(4.188790321350098) *
new Vector2((
float)
width * 1.5f, (
float)
height * 1.1f) * 0.8f * (0.8f + Main.rand.NextFloat() * 0.2f);
34679 dust9.velocity.X = 0f;
34680 dust9.velocity.Y = (0f -
Math.
Abs(
dust9.velocity.Y - (
float)
num1466 + velocity.Y - 4f)) * 3f;
34681 dust9.noGravity = true;
34682 dust9.fadeIn = 1f;
34683 dust9.scale = 1f + Main.rand.NextFloat() + (float)
num1466 * 0.3f;
34684 }
34685 }
34686 if (this.ai[1] < 150f)
34687 {
34689 {
34690 if (Main.rand.Next(4) == 0)
34691 {
34693 dust10.velocity.X = 0f;
34694 dust10.velocity.Y = (0f -
Math.
Abs(
dust10.velocity.Y - (
float)
num1467 + velocity.Y - 4f)) * (1f + this.ai[1] / 180f * 0.5f);
34695 dust10.noGravity = true;
34696 dust10.fadeIn = 1f;
34697 dust10.scale = 1f + Main.rand.NextFloat() + (float)
num1467 * 0.3f;
34698 }
34699 }
34700 }
34701 if (Main.rand.Next(5) == 0 && this.ai[1] < 150f)
34702 {
34704 {
34706 float num1469 = 1f + Main.rand.NextFloat() * 2f + this.ai[1] / 180f * 4f;
34708 {
34711 dust11.velocity.X *=
num1469;
34713 dust11.noGravity = true;
34714 dust11.fadeIn = 1f;
34715 dust11.scale = 1.5f + Main.rand.NextFloat() + (float)
num1470 * 0.13f;
34716 }
34718 }
34719 }
34720 if (Main.rand.Next(3) != 0 && this.ai[1] < 150f)
34721 {
34723 dust12.position = base.Center +
Vector2.
UnitY.RotatedByRandom(4.188790321350098) *
new Vector2(
width / 2,
height / 2) * (0.8f + Main.rand.NextFloat() * 0.2f);
34724 dust12.velocity.X = 0f;
34726 }
34727 if (this.ai[1] % 60f == 1f)
34728 {
34730 }
34731 if (this.ai[1] >= 180f)
34732 {
34736 }
34737 return;
34738 }
34739 if (this.ai[3] > 0f)
34740 {
34743 {
34744 case 517:
34746 break;
34747 case 422:
34749 break;
34750 case 507:
34752 break;
34753 case 493:
34755 break;
34756 }
34758 {
34760 }
34761 else if (this.ai[3] == 1f)
34762 {
34764 }
34765 this.ai[3]++;
34766 if (this.ai[3] > 120f)
34767 {
34768 this.ai[3] = 0f;
34769 }
34770 }
34772 {
34773 case 517:
34775 break;
34776 case 422:
34778 break;
34779 case 507:
34781 break;
34782 case 493:
34784 break;
34785 }
34787 if (Main.player[
target].Distance(
base.Center) > 2000f)
34788 {
34790 }
34791 if (
localAI[0] >= 60f && Main.netMode != 1)
34792 {
34796 }
34797 else
34798 {
34800 }
34802 Point origin =
base.Bottom.ToTileCoordinates();
34806 if (
WorldGen.InWorld(origin.
X, origin.
Y, 20) && Main.tile[origin.
X, origin.
Y] !=
null)
34807 {
34809 {
34811 position.Y -= 1.5f *
num1473;
34812 }
34814 {
34817 {
34819 }
34820 position.Y += 1.5f *
num1474;
34821 }
34822 }
34823 if (!Main.remixWorld && !Main.getGoodWorld && (double)base.Bottom.Y > Main.worldSurface * 16.0 - 100.0)
34824 {
34825 position.Y = (float)Main.worldSurface * 16f - (
float)
height - 100f;
34826 }
34827 this.ai[0]++;
34828 if (this.ai[0] >= 300f)
34829 {
34830 this.ai[0] = 0f;
34832 }
34834 {
34835 if (Main.rand.Next(5) == 0)
34836 {
34838 dust13.position = base.Center +
Vector2.
UnitY.RotatedByRandom(2.094395160675049) *
new Vector2(
width / 2,
height / 2) * (0.8f + Main.rand.NextFloat() * 0.2f);
34839 dust13.velocity.X = 0f;
34841 }
34843 {
34844 if (Main.rand.Next(5) == 0)
34845 {
34847 dust14.velocity.X = 0f;
34848 dust14.velocity.Y = (0f -
Math.
Abs(
dust14.velocity.Y - (
float)
num1475 + velocity.Y - 4f)) * 1f;
34849 dust14.noGravity = true;
34850 dust14.fadeIn = 1f;
34851 dust14.scale = 1f + Main.rand.NextFloat() + (float)
num1475 * 0.3f;
34852 }
34853 }
34854 if (this.ai[1] > 0f)
34855 {
34856 this.ai[1]--;
34857 }
34858 if (Main.netMode != 1 &&
this.ai[1] <= 0f && Main.player[
target].active && !Main.player[
target].dead &&
Distance(Main.player[
target].Center) < 1080f && Main.player[
target].position.Y - position.Y < 400f)
34859 {
34861 }
34862 }
34864 {
34865 if (Main.rand.Next(5) == 0)
34866 {
34868 dust15.position = base.Center +
Vector2.
UnitY.RotatedByRandom(2.094395160675049) *
new Vector2(
width / 2,
height / 2) * (0.8f + Main.rand.NextFloat() * 0.2f);
34869 dust15.velocity.X = 0f;
34871 }
34873 {
34874 if (Main.rand.Next(5) == 0)
34875 {
34877 dust16.velocity.X = 0f;
34878 dust16.velocity.Y = (0f -
Math.
Abs(
dust16.velocity.Y - (
float)
num1476 + velocity.Y - 4f)) * 1f;
34879 dust16.noGravity = true;
34880 dust16.fadeIn = 1f;
34882 dust16.scale = 1f + Main.rand.NextFloat() + (float)
num1476 * 0.3f;
34883 }
34884 }
34885 }
34887 {
34888 if (Main.rand.Next(5) == 0)
34889 {
34891 dust17.position = base.Center +
Vector2.
UnitY.RotatedByRandom(2.094395160675049) *
new Vector2(
width / 2,
height / 2) * (0.8f + Main.rand.NextFloat() * 0.2f);
34892 dust17.velocity.X = 0f;
34894 }
34896 {
34897 if (Main.rand.Next(5) == 0)
34898 {
34900 dust18.velocity.X = 0f;
34901 dust18.velocity.Y = (0f -
Math.
Abs(
dust18.velocity.Y - (
float)
num1477 + velocity.Y - 4f)) * 1f;
34902 dust18.noGravity = true;
34903 dust18.fadeIn = 1f;
34905 dust18.scale = 1f + Main.rand.NextFloat() + (float)
num1477 * 0.3f;
34906 }
34907 }
34908 if (this.ai[1] > 0f)
34909 {
34910 this.ai[1]--;
34911 }
34912 if (Main.netMode != 1 &&
this.ai[1] <= 0f && Main.player[
target].active && !Main.player[
target].dead &&
Distance(Main.player[
target].Center) < 3240f && !Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
34913 {
34914 this.ai[1] = 60 + Main.rand.Next(120);
34918 {
34920 {
34921 break;
34922 }
34924 {
34925 break;
34926 }
34928 }
34930 {
34932 }
34933 else
34934 {
34936 }
34937 }
34939 {
34940 this.ai[1] = 420 + Main.rand.Next(360);
34951 {
34953 }
34955 {
34960 {
34963 {
34965 }
34967 {
34969 }
34970 if (
flag91 && !Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
34971 {
34973 }
34975 {
34978 break;
34979 }
34980 }
34981 }
34982 }
34983 }
34985 {
34986 return;
34987 }
34988 if (Main.rand.Next(5) == 0)
34989 {
34991 dust19.position = base.Center +
Vector2.
UnitY.RotatedByRandom(2.094395160675049) *
new Vector2(
width / 2,
height / 2) * (0.8f + Main.rand.NextFloat() * 0.2f);
34992 dust19.velocity.X = 0f;
34994 }
34996 {
34997 if (Main.rand.Next(5) == 0)
34998 {
35000 dust20.velocity.X = 0f;
35001 dust20.velocity.Y = (0f -
Math.
Abs(
dust20.velocity.Y - (
float)
num1486 + velocity.Y - 4f)) * 1f;
35002 dust20.noGravity = true;
35003 dust20.fadeIn = 1f;
35004 dust20.scale = 1f + Main.rand.NextFloat() + (float)
num1486 * 0.3f;
35005 }
35006 }
35007 if (this.ai[1] > 0f)
35008 {
35009 this.ai[1]--;
35010 }
35011 if (Main.netMode != 1 &&
this.ai[1] <= 0f && Main.player[
target].active && !Main.player[
target].dead &&
Distance(Main.player[
target].Center) < 1080f && Main.player[
target].position.Y - position.Y < 700f)
35012 {
35017 Main.npc[
num1487].netUpdate =
true;
35018 this.ai[1] = 60f;
35019 }
35020 }
35022 {
35025 {
35027 }
35029 this.ai[0]++;
35033 {
35034 if (Main.netMode != 1)
35035 {
35038 }
35039 return;
35040 }
35042 if (!(this.ai[0] > 20f))
35043 {
35044 return;
35045 }
35049 {
35050 if (Main.rand.Next(2) != 0)
35051 {
35055 {
35058 }
35061 Dust dust = Main.dust[
num1494];
35062 dust.position -=
new Vector2(2f);
35064 Main.dust[
num1494].noGravity =
true;
35066 Main.dust[
num1494].customData =
this;
35067 }
35068 }
35069 }
35071 {
35073 float moveSpeed = 0.15f;
35078 {
35080 }
35082 {
35085 }
35087 {
35090 }
35091 else
35092 {
35095 }
35098 if (!((this.ai[0] += 1f) >= 70f))
35099 {
35100 return;
35101 }
35102 this.ai[0] = 0f;
35103 if (Main.netMode != 1)
35104 {
35107 {
35109 }
35110 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector288.X,
vector288.Y, 539, 60, 0f, Main.myPlayer, 0f,
whoAmI);
35111 }
35112 }
35114 {
35120 {
35122 if (Main.netMode != 1 &&
localAI[2] % 60f == 0f)
35123 {
35126 {
35128 }
35129 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y,
vector289.X,
vector289.Y, 574, 0, 0f, Main.myPlayer, 0f,
whoAmI);
35130 }
35131 }
35133 {
35136 {
35138 }
35139 }
35141 if (Main.netMode != 1 && (!Main.player[
target].active || Main.player[
target].dead))
35142 {
35143 this.ai[0] = 0f;
35144 this.ai[1] = 1f;
35145 this.ai[2] = 0f;
35146 this.ai[3] = 0f;
35148 }
35153 bool flag92 = Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1);
35155 if (this.ai[1] == 1f)
35156 {
35158 {
35160 this.ai[3] = 3f;
35163 {
35165 Dust dust = Main.dust[
num1501];
35166 dust.velocity *= 3f;
35167 Main.dust[
num1501].noGravity =
true;
35168 Main.dust[
num1501].scale = 2.5f;
35169 }
35170 }
35171 this.ai[3]--;
35172 if (this.ai[3] <= 0f)
35173 {
35176 }
35177 return;
35178 }
35180 {
35183 {
35186 }
35189 }
35190 else
35191 {
35194 }
35195 if (this.ai[2] != 0f && this.ai[3] != 0f)
35196 {
35199 {
35201 Dust dust = Main.dust[
num1504];
35202 dust.velocity *= 3f;
35203 Main.dust[
num1504].noGravity =
true;
35204 Main.dust[
num1504].scale = 2.5f;
35205 }
35206 base.Center =
new Vector2(this.ai[2] * 16f, this.ai[3] * 16f);
35208 this.ai[2] = 0f;
35209 this.ai[3] = 0f;
35212 {
35214 Dust dust = Main.dust[
num1506];
35215 dust.velocity *= 3f;
35216 Main.dust[
num1506].noGravity =
true;
35217 Main.dust[
num1506].scale = 2.5f;
35218 }
35219 }
35220 this.ai[0]++;
35221 if (this.ai[0] >= (
float)
num1498 && Main.netMode != 1)
35222 {
35223 this.ai[0] = 0f;
35228 {
35229 this.ai[1] = 20f;
35234 {
35237 {
35239 break;
35240 }
35241 }
35243 {
35245 {
35248 {
35250 }
35251 }
35252 }
35253 }
35255 }
35257 {
35261 }
35262 }
35264 {
35266 if (this.ai[0] == 0f)
35267 {
35269 this.ai[0] = 1f;
35270 this.ai[1] = 0f;
35271 this.ai[2] = 0f;
35272 this.ai[3] = 0f;
35273 }
35274 bool flag95 = Collision.CanHit(
base.Center, 1, 1, Main.player[
target].position, 1, 1);
35277 {
35279 }
35280 else
35281 {
35285 {
35287 {
35289 {
35291 }
35292 }
35293 }
35294 }
35295 if (this.ai[0] < 0f)
35296 {
35299 if (this.ai[0] == -1f)
35300 {
35303 {
35305 }
35309 {
35311 }
35313 {
35315 }
35320 {
35322 {
35325 {
35329 }
35330 }
35331 }
35334 {
35336 }
35338 {
35340 }
35342 {
35344 }
35346 {
35348 }
35350 }
35351 this.ai[1] += 1f;
35352 if (this.ai[1] >= 60f && !
flag96)
35353 {
35354 this.ai[0] = 0f;
35355 }
35356 }
35357 else if (this.ai[0] == 2f)
35358 {
35361 {
35363 }
35367 {
35368 velocity.X *= 0.96f;
35369 velocity.Y *= 0.96f;
35370 this.ai[1] += 1f;
35371 if (this.ai[1] == 20f)
35372 {
35373 if (Main.netMode != 1)
35374 {
35376 }
35377 }
35378 else if (this.ai[1] >= 30f)
35379 {
35380 this.ai[1] = 0f;
35381 }
35383 {
35385 {
35388 {
35392 }
35393 }
35394 }
35395 }
35396 else
35397 {
35398 this.ai[0] = 0f;
35399 }
35400 if (Main.player[
target].Center.X <
base.Center.X)
35401 {
35403 }
35404 else if (Main.player[
target].Center.X >
base.Center.X)
35405 {
35407 }
35409 }
35410 if (this.ai[0] != 1f)
35411 {
35412 return;
35413 }
35416 {
35418 }
35420 {
35421 this.ai[0] = -1f;
35422 this.ai[1] = 0f;
35423 this.ai[2] = 0f;
35424 this.ai[3] = 0f;
35425 }
35428 {
35430 {
35433 {
35437 velocity.X -= vector296.X * 1f;
35438 }
35439 }
35440 }
35444 {
35445 this.ai[0] = 2f;
35446 this.ai[1] = 0f;
35447 }
35448 else
35449 {
35451 {
35452 velocity.X *= -0.5f;
35453 this.ai[1] = 60f;
35455 }
35456 if (this.ai[1] > 0f)
35457 {
35458 this.ai[1] -= 1f;
35459 }
35461 {
35462 if (
base.Center.X > Main.player[
target].Center.X)
35463 {
35465 }
35466 else
35467 {
35469 }
35470 }
35472 {
35473 if (
base.Center.X > Main.player[
target].Center.X)
35474 {
35476 }
35477 else
35478 {
35480 }
35481 }
35485 {
35487 {
35489 {
35491 }
35492 else
35493 {
35495 }
35496 }
35497 else
35498 {
35499 velocity.X *= 0.99f;
35500 }
35501 }
35502 else
35503 {
35505 }
35507 }
35509 {
35510 this.ai[2] = 60f;
35512 velocity.Y *= -0.5f;
35513 }
35514 if (this.ai[2] > 0f)
35515 {
35516 this.ai[2] -= 1f;
35517 }
35518 else
35519 {
35526 {
35528 {
35530 {
35532 break;
35533 }
35534 }
35536 {
35537 break;
35538 }
35539 }
35541 {
35543 }
35545 {
35547 }
35548 }
35552 {
35554 {
35556 {
35558 }
35559 else
35560 {
35562 }
35563 }
35564 else
35565 {
35566 velocity.Y *= 0.99f;
35567 }
35568 }
35569 else
35570 {
35572 }
35573 }
35575 {
35576 if (
velocity.
Y == 0f &&
this.ai[0] == 0f)
35577 {
35578 this.ai[0] = 1f;
35579 this.ai[1] = 0f;
35581 return;
35582 }
35583 if (this.ai[0] == 1f)
35584 {
35587 this.ai[1]++;
35588 if (this.ai[1] >= 5f)
35589 {
35592 }
35593 return;
35594 }
35595 velocity.Y += 0.2f;
35597 {
35598 velocity.Y = 12f;
35599 }
35602 {
35603 return;
35604 }
35606 {
35609 {
35611 Main.dust[
num1538].noGravity =
true;
35612 Main.dust[
num1538].fadeIn = 1f;
35613 Dust dust = Main.dust[
num1538];
35614 dust.velocity *= 4f;
35615 Main.dust[
num1538].noLight =
true;
35616 }
35617 }
35619 {
35620 if (Main.rand.Next(3) < 2)
35621 {
35623 Main.dust[
num1540].noGravity =
true;
35624 Dust dust = Main.dust[
num1540];
35625 dust.velocity *= 0.2f;
35626 Main.dust[
num1540].fadeIn = 1f;
35627 if (Main.rand.Next(6) == 0)
35628 {
35630 dust.velocity *= 30f;
35631 Main.dust[
num1540].noGravity =
false;
35632 Main.dust[
num1540].noLight =
true;
35633 }
35634 else
35635 {
35637 }
35638 }
35639 }
35640 }
35642 {
35643 if (
velocity.
Y == 0f &&
this.ai[0] >= 0f)
35644 {
35645 this.ai[0] = -1f;
35646 this.ai[1] = 0f;
35648 return;
35649 }
35650 if (this.ai[0] == -1f)
35651 {
35654 this.ai[1]++;
35655 if (this.ai[1] >= 5f)
35656 {
35659 }
35660 return;
35661 }
35664 {
35665 return;
35666 }
35668 {
35670 velocity.X = this.ai[2];
35671 velocity.Y = this.ai[3];
35673 {
35675 Main.dust[
num1542].noGravity =
true;
35676 Main.dust[
num1542].fadeIn = 1f;
35677 Dust dust = Main.dust[
num1542];
35678 dust.velocity *= 4f;
35679 Main.dust[
num1542].noLight =
true;
35680 }
35681 }
35683 {
35685 {
35687 Main.dust[
num1544].noGravity =
true;
35688 Dust dust = Main.dust[
num1544];
35689 dust.velocity *= 0.2f;
35690 Main.dust[
num1544].fadeIn = 0.4f;
35691 if (Main.rand.Next(6) == 0)
35692 {
35694 dust.velocity *= 5f;
35695 Main.dust[
num1544].noLight =
true;
35696 }
35697 else
35698 {
35700 }
35701 }
35702 }
35703 if (this.ai[0] >= 0f)
35704 {
35705 this.ai[0]++;
35706 if (this.ai[0] > 60f)
35707 {
35709 }
35710 if (this.ai[0] > 120f)
35711 {
35713 }
35715 {
35717 }
35718 }
35719 }
35721 {
35728 bool flag97 = !(this.ai[1] >= 0f) || !Main.npc[(
int)this.ai[0]].active;
35729 if (Main.npc[(int)this.ai[0]].type == 439)
35730 {
35731 if (Main.npc[(
int)this.ai[0]].life < Main.npc[(int)this.ai[0]].
lifeMax / 2)
35732 {
35734 }
35735 if (Main.npc[(
int)this.ai[0]].life < Main.npc[(int)this.ai[0]].
lifeMax / 4)
35736 {
35738 }
35739 }
35740 else
35741 {
35743 }
35751 if (Main.rand.Next(6) == 0)
35752 {
35755 dust21.noGravity = true;
35756 dust21.position = base.Center -
vector297 * Main.rand.Next(10, 21) *
scale;
35757 dust21.velocity =
vector297.RotatedBy(1.5707963705062866) * 4f;
35758 dust21.scale = 0.5f + Main.rand.NextFloat();
35759 dust21.fadeIn = 0.5f;
35760 }
35761 if (Main.rand.Next(6) == 0)
35762 {
35765 dust22.noGravity = true;
35767 dust22.velocity =
vector298.RotatedBy(-1.5707963705062866) * 2f;
35768 dust22.scale = 0.5f + Main.rand.NextFloat();
35769 dust22.fadeIn = 0.5f;
35770 }
35771 if (Main.rand.Next(6) == 0)
35772 {
35777 dust23.scale = 0.5f + Main.rand.NextFloat();
35778 dust23.fadeIn = 0.5f;
35779 dust23.noLight = true;
35780 }
35784 {
35786 if (Main.netMode != 1)
35787 {
35789 {
35792 }
35793 }
35794 }
35796 {
35799 }
35800 }
35802 {
35823 {
35834 {
35836 }
35844 {
35845 if (Main.rand.Next(2) != 0)
35846 {
35847 Dust
dust24 = Main.dust[Dust.NewDust(
base.Bottom, 0, 0, 268)];
35850 {
35851 dust24.position = base.Bottom + Utils.RandomVector2(Main.rand, -6f, 6f);
35852 }
35853 dust24.color =
color;
35854 dust24.scale = 0.8f;
35855 dust24.velocity.Y +=
num1564;
35857 }
35858 }
35861 if (this.ai[0] < 0f)
35862 {
35864 }
35865 if (this.ai[0] > 0f)
35866 {
35869 this.ai[0]++;
35870 if (this.ai[0] >= 135f)
35871 {
35872 this.ai[0] = -300f;
35874 }
35877 if (this.ai[0] == 54f && Main.netMode != 1)
35878 {
35882 {
35885 {
35886 if (
list.Count >= 3)
35887 {
35888 break;
35889 }
35893 {
35895 {
35897 break;
35898 }
35899 }
35901 {
35902 int startY = point16.Y - 20;
35905 {
35907 }
35908 }
35909 }
35911 {
35913 }
35914 }
35915 else
35916 {
35917 this.ai[0] = -200f;
35919 }
35920 }
35922 if (this.ai[0] < 114f && this.ai[0] > 0f)
35923 {
35926 {
35929 {
35931 }
35932 }
35934 float num1569 = (this.ai[0] - 54f) / 30f;
35936 {
35938 {
35943 {
35945 }
35948 {
35950 }
35952 {
35954 }
35956 {
35959 dust25.noLight = true;
35960 dust25.scale = 0.3f +
num1569;
35961 }
35962 }
35963 }
35964 }
35967 }
35968 if (this.ai[0] == 0f)
35969 {
35970 this.ai[0] = 1f;
35973 }
35974 }
35976 {
35978 }
35980 {
35982 {
35987 {
35989 }
35991 {
35994 }
35996 {
35998 }
36000 {
36003 {
36005 }
36007 {
36010 velocity.X *= -1f;
36012 }
36013 }
36014 else
36015 {
36019 }
36021 {
36023 }
36024 }
36025 else
36026 {
36029 }
36030 }
36036 {
36038 return;
36039 }
36041 {
36043 {
36045 }
36047 {
36049 {
36051 }
36053 break;
36054 }
36055 }
36057 {
36059 {
36061 }
36063 {
36066 break;
36067 }
36068 }
36070 {
36072 {
36074 {
36076 }
36078 {
36081 break;
36082 }
36083 }
36084 }
36086 {
36089 }
36091 {
36094 {
36096 }
36097 }
36098 else
36099 {
36101 {
36103 }
36105 {
36107 }
36108 }
36110 {
36111 velocity.X = oldVelocity.X * -0.4f;
36113 {
36114 velocity.X = 1f;
36115 }
36117 {
36118 velocity.X = -1f;
36119 }
36120 }
36122 {
36123 velocity.Y = oldVelocity.Y * -0.25f;
36125 {
36126 velocity.Y = 1f;
36127 }
36129 {
36130 velocity.Y = -1f;
36131 }
36132 }
36134 {
36137 {
36139 }
36141 {
36143 }
36145 {
36147 }
36148 }
36150 {
36153 {
36155 }
36157 {
36159 }
36161 {
36163 }
36164 }
36166 {
36169 {
36170 velocity.Y -=
num1561 * 1.25f;
36171 }
36173 {
36174 velocity.Y +=
num1561 * 0.75f;
36175 }
36177 {
36179 }
36180 }
36182 {
36185 {
36186 velocity.Y +=
num1561 * 1.25f;
36187 }
36189 {
36190 velocity.Y -=
num1561 * 0.75f;
36191 }
36193 {
36195 }
36196 }
36197 }
36199 {
36201 {
36203 }
36213 {
36215 }
36217 {
36219 }
36221 {
36223 }
36225 {
36227 {
36230 {
36232 }
36234 {
36236 }
36239 }
36242 pt = (base.Center +
new Vector2(0f, 24f)).ToTileCoordinates();
36245 {
36247 }
36248 this.ai[1] =
flag110.ToInt();
36249 if (this.ai[2] < 30f)
36250 {
36251 this.ai[2]++;
36252 }
36254 {
36256 velocity.X += (float)
direction * 0.15f;
36259 {
36260 velocity.X = 5f;
36261 }
36263 {
36264 velocity.X = -5f;
36265 }
36267 {
36268 velocity.Y = 3f;
36269 }
36271 {
36272 velocity.Y = -3f;
36273 }
36275 pt =
vec4.ToTileCoordinates();
36279 {
36280 flag111 = tileSafely7.liquid > 0;
36281 }
36283 if (Main.remixWorld)
36284 {
36286 }
36288 {
36290 {
36293 }
36294 this.ai[2] = -30f;
36297 }
36298 }
36299 else
36300 {
36302 {
36303 velocity.X *= -1f;
36306 }
36308 {
36310 velocity.Y *= -1f;
36313 }
36317 {
36318 velocity.X *= 0.95f;
36319 }
36321 {
36322 this.ai[0] = -1f;
36323 }
36324 else
36325 {
36326 this.ai[0] = 1f;
36327 }
36330 if (this.ai[0] == -1f)
36331 {
36334 {
36335 this.ai[0] = 1f;
36336 }
36337 }
36338 else
36339 {
36342 {
36343 this.ai[0] = -1f;
36344 }
36345 }
36347 {
36348 velocity.Y *= 0.95f;
36349 }
36350 }
36351 }
36352 else
36353 {
36355 {
36357 {
36359 }
36363 {
36364 velocity.X *= 0.95f;
36365 }
36366 }
36367 velocity.Y += 0.3f;
36369 {
36370 velocity.Y = 10f;
36371 }
36372 this.ai[0] = 1f;
36373 }
36376 {
36378 }
36380 {
36382 }
36383 }
36385 {
36387 }
36389 {
36391 {
36392 Lighting.AddLight(
base.Center, 1.3f, 0.5f, 1.5f);
36393 }
36394 if (this.ai[1] == 0f)
36395 {
36396 if (this.ai[0] > 0f)
36397 {
36398 this.ai[0]--;
36399 }
36400 if (this.ai[0] != 0f)
36401 {
36402 return;
36403 }
36404 this.ai[0] = 180f;
36407 {
36410 xLeftEnd.X += 2;
36411 xRightEnd.X -= 2;
36416 if (Main.netMode != 1)
36417 {
36419 }
36420 }
36421 }
36422 else if (this.ai[1] == 2f)
36423 {
36426 if (this.ai[0] == 3f)
36427 {
36430 {
36433 {
36436 nPC11.netUpdate = true;
36437 }
36438 }
36439 if (Main.netMode != 1)
36440 {
36442 }
36443 }
36444 this.ai[0]++;
36446 if (this.ai[0] <= 120f)
36447 {
36448 float num1590 = this.ai[0] / 120f;
36450 }
36451 else
36452 {
36453 velocity.Y = 0f;
36454 }
36457 {
36459 }
36460 if (this.ai[0] >= 600f)
36461 {
36467 }
36468 if (true)
36469 {
36472 if (this.ai[0] >= 60f)
36473 {
36475 }
36476 if (this.ai[0] >= 120f)
36477 {
36479 }
36480 if (this.ai[0] >= 180f)
36481 {
36483 }
36484 if (this.ai[0] >= 240f)
36485 {
36487 }
36488 if (this.ai[0] >= 540f)
36489 {
36491 }
36493 {
36494 if (!(Main.rand.NextFloat() <
num1591))
36495 {
36496 float num1593 = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
36497 float num1594 = Main.rand.NextFloat();
36501 dust26.scale = 0.9f;
36502 dust26.fadeIn = 1.15f +
num1594 * 0.3f;
36504 dust26.noGravity = true;
36505 dust26.noLight = true;
36506 }
36507 }
36508 }
36509 if (this.ai[0] == 100f || this.ai[0] == 160f || this.ai[0] == 220f || this.ai[0] == 280f || this.ai[0] == 340f || this.ai[0] == 370f || this.ai[0] == 400f || this.ai[0] == 430f || this.ai[0] == 460f || this.ai[0] == 500f || this.ai[0] == 520f || this.ai[0] == 540f)
36510 {
36511 float num1595 = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
36514 {
36516 float num1599 = Main.rand.NextFloat();
36520 dust27.scale = 0.9f;
36521 dust27.fadeIn = 1.15f +
num1599 * 0.3f;
36522 dust27.color =
new Color(1f, 1f, 1f, 0f);
36523 dust27.noGravity = true;
36524 dust27.noLight = true;
36525 }
36526 }
36527 }
36528 else
36529 {
36530 if (this.ai[1] != 1f)
36531 {
36532 return;
36533 }
36536 if (this.ai[0] == 0f)
36537 {
36539 {
36542 {
36545 nPC12.netUpdate = true;
36546 }
36547 }
36548 if (Main.netMode != 1)
36549 {
36552 }
36553 }
36554 this.ai[0]++;
36557 {
36559 }
36562 {
36564 }
36566 {
36569 {
36571 }
36572 }
36573 if (true)
36574 {
36577 if (this.ai[0] >= 60f)
36578 {
36580 }
36581 if (this.ai[0] >= 120f)
36582 {
36584 }
36585 if (this.ai[0] >= 180f)
36586 {
36588 }
36589 if (this.ai[0] >= 240f)
36590 {
36592 }
36593 if (this.ai[0] >= 300f)
36594 {
36596 }
36597 if (this.ai[0] >= 360f)
36598 {
36600 }
36601 if (this.ai[0] >= 420f)
36602 {
36604 }
36605 if (this.ai[0] >= 450f)
36606 {
36608 }
36610 {
36611 if (!(Main.rand.NextFloat() <
num1602))
36612 {
36613 float num1604 = Main.rand.NextFloat() * ((float)
Math.
PI * 2f);
36614 float num1605 = Main.rand.NextFloat();
36618 dust28.scale = 0.8f;
36619 dust28.fadeIn = 0.95f +
num1605 * 0.3f;
36620 dust28.noGravity = true;
36621 }
36622 }
36623 }
36624 if (this.ai[0] >= 600f)
36625 {
36627 if (!Main.dedServ)
36628 {
36632 }
36637 }
36638 }
36639 }
36641 {
36643 {
36644 Lighting.AddLight(
base.Center, 0.5f, 0.1f, 0.3f);
36645 }
36647 if (this.ai[1] == 0f)
36648 {
36650 {
36655 }
36657 {
36660 {
36664 }
36665 }
36667 {
36668 this.ai[0]++;
36669 }
36671 {
36672 if (this.ai[0] >= (float)(DD2Event.LaneSpawnRate * 3))
36673 {
36674 this.ai[0] = 0f;
36675 }
36677 if (Main.netMode != 1 && (int)this.ai[0] % DD2Event.LaneSpawnRate == 0)
36678 {
36681 {
36682 this.ai[0] += 1f;
36683 }
36684 }
36685 }
36688 {
36690 }
36691 if (Main.netMode != 1 &&
localAI[0] >= 180f)
36692 {
36694 {
36696 return;
36697 }
36698 this.ai[1] = 1f;
36699 this.ai[0] = 0f;
36701 }
36702 }
36703 else if (this.ai[1] == 1f)
36704 {
36705 this.ai[0]++;
36709 {
36713 }
36716 {
36717 activeSound2.Volume =
scale;
36718 }
36719 if (this.ai[0] >= 550f)
36720 {
36726 }
36727 }
36728 }
36730 {
36732 }
36734 {
36736 }
36738 {
36740 }
36742 {
36744 }
36746 {
36748 }
36750 {
36752 }
36754 {
36756 }
36758 {
36760 }
36762 {
36764 }
36766 {
36768 }
36770 {
36772 }
36774 {
36776 }
36778 {
36780 }
36782 {
36784 }
36786 {
36788 }
36790 {
36792 }
36794 {
36796 }
36798 {
36800 }
36802 {
36804 }
36805 }
static float Lerp(float value1, float value2, float amount)
static float Max(float value1, float value2)
static float Clamp(float value, float min, float max)
static float Min(float value1, float value2)
void Add(TKey key, TValue value)
static double Cos(double d)
static byte Min(byte val1, byte val2)
static double Atan2(double y, double x)
static double Sqrt(double d)
static double Abs(double value)
static double Sin(double a)
static int Sign(decimal value)
static byte Max(byte val1, byte val2)
static SlotId PlayTrackedSound(SoundStyle style, Vector2 position)
static void PlaySound(int type, Vector2 position, int style=1)
static ActiveSound GetActiveSound(SlotId id)
static Dictionary< int, TileEntity > ByID
Vector2 DirectionFrom(Vector2 Source)
float Distance(Vector2 Other)
Vector2 DirectionTo(Vector2 Destination)
static void TabletDestroyed()
static bool CheckFloor(Vector2 Center, out Point[] spawnPoints)
static void SpawnMonsterFromGate(Vector2 gateBottom)
static void FindArenaHitbox()
static bool EnemySpawningIsOnHold
static void StopInvasion(bool win=false)
static void RequestLight(float light, Vector2 spot)
static void AddExplosion(Vector2 spot)
static void ProtectSpot(int x, int y)
static int Find(int x, int y)
static FilterManager Scene
static readonly LegacySoundStyle NPCHit16
static readonly LegacySoundStyle DD2_EtherianPortalOpen
static readonly LegacySoundStyle Item39
static readonly LegacySoundStyle DD2_WinScene
static readonly LegacySoundStyle Item14
static readonly LegacySoundStyle NPCHit17
static readonly LegacySoundStyle Item34
static readonly LegacySoundStyle Item17
static readonly LegacySoundStyle Item5
static readonly LegacySoundStyle Item12
static readonly LegacySoundStyle NPCHit15
static readonly LegacySoundStyle NPCDeath3
static readonly LegacySoundStyle NPCDeath61
static readonly LegacySoundStyle Item8
static readonly LegacySoundStyle NPCDeath58
static readonly LegacySoundStyle NPCHit4
static readonly LegacySoundStyle DD2_EtherianPortalIdleLoop
static bool[] HardenedSand
void AI_114_Dragonflies()
void AI_117_BloodNautilus()
void HealEffect(int healAmount, bool broadcast=true)
static int CountNPCS(int Type)
void AI_107_ImprovedWalkers()
void DiscourageDespawn(int despawnTime)
static int ShieldStrengthTowerNebula
void EncourageDespawn(int despawnTime)
static int ShieldStrengthTowerSolar
void AI_108_DivingFlyer()
void TargetClosest(bool faceTarget=true)
static readonly int[,] MoonLordAttacksArray2
static int FindFirstNPC(int Type)
void AI_111_DD2LightningBug()
void AI_112_FairyCritter()
void AI_87_BigMimic_FireStuffCannonBurst()
bool dontTakeDamageFromHostiles
void TargetClosest_WOF(bool faceTarget=true)
void PopAllAttachedProjectilesAndTakeDamageForThem()
void AI_002_FloatingEye()
static int ShieldStrengthTowerStardust
void AI_007_TownEntities()
static int ShieldStrengthTowerVortex
static bool IsMechQueenUp
void AI_065_Butterflies()
static bool AnyNPCs(int Type)
void AI_069_DukeFishron()
void AI_124_ElderSlimeChest()
int GetAttackDamage_LerpBetweenFinalValues(float normalDamage, float expertDamage)
LegacySoundStyle DeathSound
IEntitySource GetSpawnSourceForProjectileNPC()
double StrikeNPCNoInteraction(int Damage, float knockBack, int hitDirection, bool crit=false, bool noEffect=false, bool fromNet=false)
void AI_122_PirateGhost()
bool AI_AttemptToFindTeleportSpot(ref Vector2 chosenTile, int targetTileX, int targetTileY, int rangeFromTargetTile=20, int telefragPreventionDistanceInTiles=5, int solidTileCheckFluff=1, bool solidTileCheckCentered=false, bool teleportInAir=false)
void AI_000_TransformBoundNPC(int playerID, int npcType)
void AI_125_ClumsySlimeBalloon()
IEntitySource GetSpawnSourceForNPCFromNPCAI()
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
void AI_084_LunaticCultist()
void AI_116_WaterStriders()
int GetAttackDamage_ScaledByStrength(float normalDamage)
void AI_113_WindyBalloon()
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
void HitEffect(int hitDirection=0, double dmg=10.0)
void SpawnStardustMark_StardustTower()
static bool LunarApocalypseIsUp
void ReflectProjectiles(Rectangle myRect)
void Transform(int newType)
static readonly int[,,,] MoonLordAttacksArray
IEntitySource GetSpawnSource_ForProjectile()
static bool[] npcsFoundForCheckActive
bool NPCCanStickToWalls()
static IEntitySource GetSpawnSourceForNaturalSpawn()
void AI_005_EaterOfSouls()
static int brainOfGravity
void SimpleFlyMovement(Vector2 desiredVelocity, float moveSpeed)
static int GetBrainOfCthuluCreepersCount()
LegacySoundStyle HitSound
static int[,,,] InitializeMoonLordAttacks()
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
static bool Find(Point origin, GenSearch search, out Point result)
bool Intersects(Rectangle value)
static float Dot(Vector2 value1, Vector2 value2)
static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max)
static Vector2 CatmullRom(Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount)
static Vector2 SmoothStep(Vector2 value1, Vector2 value2, float amount)
static float Distance(Vector2 value1, Vector2 value2)
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
static readonly SlotId Invalid
static SlotId FromFloat(float value)