43477 {
43479 {
43481 }
43483 {
43485 }
43487 {
43488 if (Main.dayTime)
43489 {
43490 velocity.Y -= 0.3f;
43492 }
43495 {
43497 velocity.Y = -6f;
43498 for (
int i = 0;
i < 35;
i++)
43499 {
43501 dust.velocity *= 1f;
43502 dust.scale = 1f + Main.rand.NextFloat() * 0.5f;
43503 dust.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
43505 }
43506 }
43509 {
43511 }
43513 {
43514 for (
int j = 0;
j < 2;
j++)
43515 {
43517 dust2.velocity *= 1f;
43518 dust2.scale = 1f + Main.rand.NextFloat() * 0.5f;
43519 dust2.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
43520 dust2.velocity +=
velocity * 0.3f;
43521 }
43522 }
43524 }
43526 bool flag = false;
43528 {
43529 flag = Main.player[
target].dead;
43530 }
43531 float num = 6f;
43532 float num2 = 0.05f;
43534 {
43535 num = 4f;
43537 if (
type == 6 && Main.expertMode)
43538 {
43540 }
43541 if (Main.remixWorld)
43542 {
43544 num = 5f;
43545 }
43546 }
43547 else if (
type == 94)
43548 {
43549 num = 4.2f;
43551 }
43552 else if (
type == 619)
43553 {
43554 num = 6f;
43556 }
43557 else if (
type == 252)
43558 {
43560 {
43561 num = 6f;
43563 }
43564 else
43565 {
43567 num = 2f;
43568 }
43569 }
43571 {
43572 num = 3.5f;
43575 {
43576 num = 3f;
43578 }
43581 if ((
double)(
position.
Y / 16f) < Main.worldSurface)
43582 {
43584 {
43585 velocity.Y *= 0.97f;
43586 }
43588 {
43589 velocity.Y *= 0.97f;
43590 }
43591 }
43592 }
43593 else if (
type == 205)
43594 {
43595 num = 3.25f;
43597 }
43598 else if (
type == 176)
43599 {
43600 num = 4f;
43602 }
43603 else if (
type == 23)
43604 {
43605 num = 1f;
43607 }
43608 else if (
type == 5)
43609 {
43610 num = 5f;
43612 }
43613 else if (
type == 210 ||
type == 211)
43614 {
43616 float num3 = (
ai[1] - 60f) / 60f;
43618 {
43620 }
43621 else
43622 {
43624 {
43625 velocity.X = 6f;
43626 }
43628 {
43629 velocity.X = -6f;
43630 }
43632 {
43633 velocity.Y = 6f;
43634 }
43636 {
43637 velocity.Y = -6f;
43638 }
43639 }
43640 num = 5f;
43643 }
43644 else if (
type == 139 && Main.zenithWorld)
43645 {
43646 num = 3f;
43647 }
43649 float num4 = targetData.Position.X + (float)(
targetData.Width / 2);
43650 float num5 = targetData.Position.Y + (float)(
targetData.Height / 2);
43653 vector.X = (int)(
vector.X / 8f) * 8;
43654 vector.Y = (int)(
vector.Y / 8f) * 8;
43659 bool flag2 =
false;
43661 {
43663 }
43665 {
43668 }
43669 else
43670 {
43674 }
43679 {
43681 {
43684 {
43685 velocity.Y += 0.023f;
43686 }
43687 else
43688 {
43689 velocity.Y -= 0.023f;
43690 }
43691 if (
ai[0] < -100f ||
ai[0] > 100f)
43692 {
43693 velocity.X += 0.023f;
43694 }
43695 else
43696 {
43697 velocity.X -= 0.023f;
43698 }
43700 {
43702 }
43703 }
43705 {
43706 velocity.X +=
num4 * 0.007f;
43707 velocity.Y +=
num5 * 0.007f;
43708 }
43709 }
43710 if (flag)
43711 {
43713 num5 = (0f - num) / 2f;
43714 }
43716 {
43717 velocity.Y -= 0.3f;
43718 }
43719 if (
type == 139 &&
ai[3] != 0f)
43720 {
43722 {
43727 {
43731 }
43733 {
43735 if (!
nPC2.active ||
nPC2.type != 134)
43736 {
43739 {
43741 }
43743 }
43744 else
43745 {
43751 }
43752 }
43753 else
43754 {
43757 {
43759 }
43761 }
43762 }
43763 else
43764 {
43767 {
43769 }
43771 }
43772 }
43773 else
43774 {
43776 {
43778 }
43780 {
43781 velocity.X +=
num2;
43783 {
43784 velocity.X +=
num2;
43785 }
43786 }
43788 {
43789 velocity.X -=
num2;
43791 {
43792 velocity.X -=
num2;
43793 }
43794 }
43796 {
43797 velocity.Y +=
num2;
43799 {
43800 velocity.Y +=
num2;
43801 }
43802 }
43804 {
43805 velocity.Y -=
num2;
43807 {
43808 velocity.Y -=
num2;
43809 }
43810 }
43811 }
43813 {
43815 {
43818 }
43819 else if (
num4 < 0f)
43820 {
43823 }
43824 }
43825 else if (
type == 139)
43826 {
43829 {
43831 }
43833 {
43835 }
43836 float num10 = 120f;
43838 {
43840 }
43842 {
43845 {
43850 {
43851 Vector2 v = targetData.Center - base.Center - targetData.Velocity * 20f;
43854 }
43856 }
43857 }
43863 {
43865 }
43867 {
43870 }
43872 {
43875 }
43876 }
43878 {
43880 }
43882 {
43884 {
43886 }
43888 {
43890 }
43892 }
43893 else
43894 {
43896 }
43898 {
43899 float num15 = 0.7f;
43901 {
43903 }
43905 {
43907 velocity.X = oldVelocity.X * (0f -
num15);
43909 {
43910 velocity.X = 2f;
43911 }
43913 {
43914 velocity.X = -2f;
43915 }
43916 }
43918 {
43920 velocity.Y = oldVelocity.Y * (0f -
num15);
43921 if (
velocity.
Y > 0f && (
double)velocity.Y < 1.5)
43922 {
43923 velocity.Y = 2f;
43924 }
43925 if (
velocity.
Y < 0f && (
double)velocity.Y > -1.5)
43926 {
43927 velocity.Y = -2f;
43928 }
43929 }
43932 {
43934 Main.dust[
num16].velocity *= 0.5f;
43935 }
43937 {
43940 {
43942 }
43944 Main.dust[
num18].velocity.X *= 0.5f;
43945 Main.dust[
num18].velocity.Y *= 0.1f;
43946 }
43948 }
43949 else if (
type != 252 && Main.rand.Next(40) == 0)
43950 {
43952 Main.dust[
num19].velocity.X *= 0.5f;
43953 Main.dust[
num19].velocity.Y *= 0.1f;
43954 }
43956 {
43958 {
43959 velocity.Y *= 0.95f;
43960 }
43961 velocity.Y -= 0.3f;
43963 {
43964 velocity.Y = -2f;
43965 }
43966 }
43968 {
43970 {
43971 velocity.Y *= 0.95f;
43972 }
43973 velocity.Y -= 0.5f;
43975 {
43976 velocity.Y = -4f;
43977 }
43979 }
43981 {
43983 {
43985 {
43986 velocity.Y *= 0.95f;
43987 }
43988 velocity.Y -= 0.5f;
43990 {
43991 velocity.Y = -4f;
43992 }
43994 }
43996 {
43999 }
44000 if (Main.netMode != 1)
44001 {
44002 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f *
scale;
44004 {
44005 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f *
scale;
44006 }
44007 if (Main.getGoodWorld)
44008 {
44009 ai[1] += (float)Main.rand.Next(5, 20) * 0.1f *
scale;
44010 }
44012 {
44014 if (player != null && player.stealth == 0f && player.itemAnimation == 0)
44015 {
44017 }
44018 }
44020 {
44022 {
44025 float num21 = targetData.Center.X - vector4.X + (float)Main.rand.Next(-20, 21);
44026 float num22 = targetData.Center.Y - vector4.Y + (float)Main.rand.Next(-20, 21);
44028 {
44035 {
44037 }
44040 Main.projectile[
num26].timeLeft = 300;
44043 }
44044 else
44045 {
44047 }
44048 }
44049 else
44050 {
44052 }
44053 }
44054 }
44055 }
44057 {
44059 {
44062 {
44064 }
44066 {
44067 velocity.X *= 1.05f;
44068 }
44069 }
44070 else
44071 {
44072 velocity.X *= 0.9f;
44073 }
44074 }
44076 {
44080 if (
v2.Length() < (
float)
num28)
44081 {
44083 }
44084 }
44085 if (Main.netMode != 1)
44086 {
44087 if (Main.getGoodWorld &&
type == 6 &&
AnyNPCs(13))
44088 {
44090 {
44092 }
44095 {
44097 {
44099 }
44101 }
44102 }
44103 if (
type == 94 && !flag)
44104 {
44106 {
44108 }
44111 {
44113 {
44115 }
44117 }
44118 }
44119 if (
type == 619 && !flag)
44120 {
44122 {
44124 }
44127 {
44129 {
44131 {
44138 }
44139 else
44140 {
44142 }
44143 }
44144 else
44145 {
44147 }
44148 }
44149 }
44150 }
44152 {
44153 velocity.Y -=
num2 * 2f;
44155 }
44157 {
44159 }
44160 }
static double Atan2(double y, double x)
static double Sqrt(double d)
static double Abs(double value)
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 DirectionTo(Vector2 Destination)
static readonly LegacySoundStyle Item17
void EncourageDespawn(int despawnTime)
void TargetClosest(bool faceTarget=true)
static int FindFirstNPC(int Type)
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
static bool IsMechQueenUp
static bool AnyNPCs(int Type)
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)
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
IEntitySource GetSpawnSource_ForProjectile()
static void TargetClosestNonBees(NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)