38341 {
38342 int num = 30;
38344 _ = Main.expertMode;
38346 bool flag = false;
38349 {
38354 }
38355 Lighting.AddLight(
base.Center, 1f, 0.7f, 0.9f);
38358 {
38361 {
38363 if (Main.player[
target].Center.X <
base.Center.X)
38364 {
38366 }
38367 else
38368 {
38370 }
38371 }
38372 }
38374 {
38377 if (Main.netMode != 1)
38378 {
38381 Point point =
base.Center.ToTileCoordinates();
38388 bool flag3 =
false;
38389 if (
ai[3] >= 360f ||
vector.Length() > 2000f)
38390 {
38392 {
38394 }
38397 }
38399 {
38404 {
38405 continue;
38406 }
38409 if (Main.tile[
num9,
num11].nactive() && Main.tileSolid[Main.tile[
num9,
num11].type] && !Main.tileSolidTop[Main.tile[
num9,
num11].type])
38410 {
38412 }
38413 else
38414 {
38415 for (;
i < 150 &&
num11 +
i < Main.maxTilesY;
i++)
38416 {
38418 if (Main.tile[
num9,
num12].nactive() && Main.tileSolid[Main.tile[
num9,
num12].type] && !Main.tileSolidTop[Main.tile[
num9,
num12].type])
38419 {
38421 break;
38422 }
38423 }
38424 }
38428 {
38430 }
38431 if (
flag4 && !Collision.CanHitLine(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
38432 {
38434 }
38436 {
38440 break;
38441 }
38442 }
38444 {
38449 }
38450 }
38451 }
38453 {
38455 }
38456 else
38457 {
38461 {
38462 if (Main.netMode != 1 &&
num13 > 0f)
38463 {
38465 }
38467 }
38468 }
38470 {
38472 {
38474 }
38475 else
38476 {
38478 }
38483 }
38487 {
38490 {
38492 }
38493 if (
ai[0] == 4f &&
ai[2] == 1f)
38494 {
38496 }
38497 if (
ai[0] == 5f &&
ai[2] != 1f)
38498 {
38500 }
38501 }
38502 switch ((
int)
ai[0])
38503 {
38504 case 0:
38505 {
38507 {
38509 }
38510 else
38511 {
38515 {
38516 velocity.X *= 0.8f;
38518 {
38519 velocity.X = 0f;
38520 }
38521 }
38522 }
38524 {
38525 break;
38526 }
38530 {
38532 }
38534 {
38535 break;
38536 }
38539 {
38541 int num19 = Main.rand.Next(2);
38543 {
38545 }
38546 else
38547 {
38549 }
38551 {
38553 if (player !=
null && player.active && !player.dead && (player.Bottom.Y <
base.Bottom.Y ||
Math.
Abs(player.Center.X -
base.Center.X) > 250f))
38554 {
38557 }
38558 }
38559 }
38560 else
38561 {
38562 switch (Main.rand.Next(3))
38563 {
38564 default:
38566 break;
38567 case 1:
38569 break;
38570 case 2:
38572 break;
38573 }
38574 }
38576 break;
38577 }
38578 case 1:
38579 {
38584 if (
ai[1] >= 30f && Main.netMode != 1)
38585 {
38590 }
38591 if (Main.netMode == 1 &&
ai[1] >= 60f)
38592 {
38596 }
38598 newColor2.A = 150;
38600 {
38602 Main.dust[
num28].noGravity =
true;
38603 Main.dust[
num28].velocity *= 2f;
38604 }
38605 break;
38606 }
38607 case 2:
38613 {
38614 flag = true;
38615 }
38617 {
38619 }
38620 if (
ai[1] >= 60f && Main.netMode != 1)
38621 {
38626 }
38627 if (Main.netMode == 1 &&
ai[1] >= 120f)
38628 {
38631 }
38632 if (!flag)
38633 {
38635 newColor.A = 150;
38636 for (
int n = 0;
n < 10;
n++)
38637 {
38639 Main.dust[
num26].noGravity =
true;
38640 Main.dust[
num26].velocity *= 0.5f;
38641 }
38642 }
38643 break;
38644 case 3:
38647 {
38648 velocity.X *= 0.8f;
38650 {
38651 velocity.X = 0f;
38652 }
38655 {
38657 }
38659 {
38661 }
38662 if (!(
ai[1] >= 0f))
38663 {
38664 break;
38665 }
38669 {
38670 velocity.Y = -13f;
38675 {
38677 }
38678 else
38679 {
38681 }
38682 }
38683 else if (
ai[2] == 2f)
38684 {
38685 velocity.Y = -6f;
38689 }
38690 else
38691 {
38692 velocity.Y = -8f;
38696 }
38697 }
38698 else
38699 {
38701 {
38702 break;
38703 }
38705 if (Main.getGoodWorld)
38706 {
38708 }
38710 {
38712 {
38714 }
38715 else
38716 {
38717 velocity.X *= 0.93f;
38718 }
38719 }
38720 }
38721 break;
38722 case 4:
38723 {
38728 {
38733 {
38735 }
38736 if (Main.getGoodWorld)
38737 {
38739 }
38743 {
38745 }
38747 {
38753 if (Main.netMode != 1)
38754 {
38756 }
38757 for (
int l = 0;
l < 20;
l++)
38758 {
38760 Main.dust[
num22].noGravity =
true;
38761 Main.dust[
num22].velocity.Y = -5f + Main.rand.NextFloat() * -3f;
38762 Main.dust[
num22].velocity.X *= 7f;
38763 }
38764 }
38765 else if (
ai[1] >= (
float)
num21)
38766 {
38767 for (
int m = 0;
m < 4;
m++)
38768 {
38769 Vector2 vector3 = base.Bottom -
new Vector2(Main.rand.NextFloatDirection() * 16f, Main.rand.Next(8));
38772 Main.dust[
num23].noGravity =
true;
38773 Main.dust[
num23].velocity.Y = velocity.Y * 0.9f;
38774 Main.dust[
num23].velocity.X = ((Main.rand.Next(2) == 0) ? (-10f) : 10f) + Main.rand.NextFloatDirection() * 3f;
38775 }
38776 }
38777 velocity.X *= 0.8f;
38781 {
38783 {
38785 }
38787 {
38791 velocity.Y *= 0.8f;
38793 break;
38794 }
38795 velocity.Y += 1f;
38797 if (Main.getGoodWorld)
38798 {
38799 velocity.Y += 1f;
38801 }
38803 {
38804 velocity.Y = 0.01f;
38805 }
38807 {
38808 velocity.Y =
num25;
38809 }
38810 }
38811 else
38812 {
38813 velocity.Y *= 0.8f;
38814 }
38815 break;
38816 }
38817 if (Main.netMode != 1 &&
ai[1] == 0f)
38818 {
38821 }
38823 if (!(
ai[1] >= 30f))
38824 {
38825 break;
38826 }
38828 {
38830 if (Main.netMode != 1)
38831 {
38834 velocity.Y = -3f;
38836 }
38837 }
38841 {
38843 }
38844 center.Y -= 384f;
38846 {
38850 }
38851 else
38852 {
38853 velocity.Y *= 0.95f;
38854 }
38855 break;
38856 }
38857 case 5:
38858 {
38863 {
38865 }
38867 {
38869 if (!(
ai[1] >= 10f))
38870 {
38871 break;
38872 }
38873 if (Main.netMode != 1)
38874 {
38876 if (Main.getGoodWorld)
38877 {
38879 }
38882 {
38884 }
38886 {
38890 }
38891 }
38896 break;
38897 }
38898 if (Main.netMode != 1 &&
ai[1] == 0f)
38899 {
38902 }
38905 {
38907 if (Main.netMode != 1)
38908 {
38912 }
38913 }
38914 float num16 = 100f;
38915 for (
int k = 0;
k < 4;
k++)
38916 {
38919 {
38921 }
38926 Main.dust[
num17].noGravity =
true;
38927 Main.dust[
num17].alpha = 250;
38928 Main.dust[
num17].velocity = v;
38929 Main.dust[
num17].customData =
this;
38930 }
38932 {
38934 }
38935 break;
38936 }
38937 }
38940 {
38941 position.X +=
width / 2;
38946 position.X -=
width / 2;
38948 }
38950 {
38951 return;
38952 }
38953 if (Main.rand.Next(360) == 0)
38954 {
38956 }
38957 if (Main.netMode == 1)
38958 {
38959 return;
38960 }
38962 {
38968 }
38971 {
38973 }
38975 {
38976 return;
38977 }
38979 int num30 = Main.rand.Next(1, 3);
38981 {
38985 switch (Main.rand.Next(3))
38986 {
38987 case 0:
38989 break;
38990 case 1:
38992 break;
38993 case 2:
38995 break;
38996 }
38999 Main.npc[
num33].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f;
39000 Main.npc[
num33].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f;
39001 Main.npc[
num33].ai[0] = -500 * Main.rand.Next(3);
39002 Main.npc[
num33].ai[1] = 0f;
39003 if (Main.netMode == 2 &&
num33 < 200)
39004 {
39005 NetMessage.SendData(23, -1, -1,
null,
num33);
39006 }
39007 }
39008 }
static float Clamp(float value, float min, float max)
static double Abs(double value)
static void PlaySound(int type, Vector2 position, int style=1)
static readonly LegacySoundStyle Item167
void EncourageDespawn(int despawnTime)
void TargetClosest(bool faceTarget=true)
static Color AI_121_QueenSlime_GetDustColor()
void AI_121_QueenSlime_FlyMovement()
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)
IEntitySource GetSpawnSource_ForProjectile()