41995 {
41996 bool expertMode = Main.expertMode;
41997 float num = (expertMode ? 1.2f : 1f);
41998 bool flag = (double)
life <= (
double)
lifeMax * 0.5;
42004 {
42007 }
42009 {
42012 }
42013 else
42014 {
42017 }
42018 int num2 = (expertMode ? 40 : 60);
42019 float num3 = (expertMode ? 0.55f : 0.45f);
42020 float num4 = (expertMode ? 8.5f : 7.5f);
42022 {
42026 }
42028 {
42029 num3 = (expertMode ? 0.6f : 0.5f);
42030 num4 = (expertMode ? 10f : 8f);
42031 num2 = (expertMode ? 40 : 20);
42032 }
42034 {
42036 }
42037 int num5 = (expertMode ? 28 : 30);
42038 float num6 = (expertMode ? 17f : 16f);
42040 {
42043 }
42045 {
42046 num5 = (expertMode ? 27 : 30);
42047 if (expertMode)
42048 {
42050 }
42051 }
42069 {
42071 player = Main.player[
target];
42073 }
42075 {
42076 velocity.Y -= 0.4f;
42079 {
42081 }
42082 else
42083 {
42085 }
42087 }
42088 bool flag6 = player.position.Y < 800f || (double)player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (
float)(Main.maxTilesX * 16 - 6400));
42090 {
42095 }
42098 {
42102 if (Main.netMode != 1)
42103 {
42106 }
42107 }
42110 {
42112 }
42114 {
42116 }
42118 {
42120 }
42122 {
42124 }
42126 {
42128 }
42130 {
42132 }
42134 {
42136 }
42137 float num22 = 0.04f;
42138 if (
ai[0] == 1f ||
ai[0] == 6f)
42139 {
42141 }
42143 {
42145 }
42147 {
42149 }
42151 {
42153 }
42155 {
42157 }
42159 {
42161 {
42163 }
42164 else
42165 {
42167 }
42168 }
42170 {
42172 {
42174 }
42175 else
42176 {
42178 }
42179 }
42181 {
42183 }
42185 {
42187 }
42189 {
42191 }
42193 {
42195 }
42196 if (
ai[0] != -1f &&
ai[0] < 9f)
42197 {
42199 {
42201 }
42202 else
42203 {
42205 }
42207 {
42209 }
42211 {
42213 }
42214 }
42216 {
42221 {
42224 }
42226 {
42227 velocity.Y = -2f;
42230 {
42232 }
42234 {
42236 }
42238 {
42240 }
42241 }
42242 if (
ai[2] == (
float)(
num11 - 30))
42243 {
42245 for (
int i = 0;
i <
num24;
i++)
42246 {
42250 Main.dust[
num25].noGravity =
true;
42251 Main.dust[
num25].noLight =
true;
42253 }
42255 }
42258 {
42263 }
42264 }
42265 else if (
ai[0] == 0f && !player.dead)
42266 {
42268 {
42270 }
42273 {
42274 velocity.X +=
num3;
42276 {
42277 velocity.X +=
num3;
42278 }
42279 }
42281 {
42282 velocity.X -=
num3;
42284 {
42285 velocity.X -=
num3;
42286 }
42287 }
42289 {
42290 velocity.Y +=
num3;
42292 {
42293 velocity.Y +=
num3;
42294 }
42295 }
42297 {
42298 velocity.Y -=
num3;
42300 {
42301 velocity.Y -=
num3;
42302 }
42303 }
42306 {
42308 {
42310 }
42313 {
42315 }
42317 }
42319 if (
ai[2] >= (
float)
num2)
42320 {
42322 switch ((
int)
ai[3])
42323 {
42324 case 0:
42325 case 1:
42326 case 2:
42327 case 3:
42328 case 4:
42329 case 5:
42330 case 6:
42331 case 7:
42332 case 8:
42333 case 9:
42335 break;
42336 case 10:
42339 break;
42340 case 11:
42343 break;
42344 }
42346 {
42348 }
42349 if (flag)
42350 {
42352 }
42354 {
42355 case 1:
42362 {
42365 {
42367 }
42369 }
42370 break;
42371 case 2:
42375 break;
42376 case 3:
42381 {
42383 }
42384 break;
42385 case 4:
42389 break;
42390 }
42392 }
42393 }
42394 else if (
ai[0] == 1f)
42395 {
42398 {
42400 Vector2 vector5 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - (float)
Math.
PI / 2f).ToRotationVector2() * Main.rand.Next(3, 8);
42402 Main.dust[
num29].noGravity =
true;
42403 Main.dust[
num29].noLight =
true;
42404 Main.dust[
num29].velocity /= 4f;
42406 }
42408 if (
ai[2] >= (
float)
num5)
42409 {
42415 }
42416 }
42417 else if (
ai[0] == 2f)
42418 {
42420 {
42422 }
42425 {
42426 velocity.X +=
num9;
42428 {
42429 velocity.X +=
num9;
42430 }
42431 }
42433 {
42434 velocity.X -=
num9;
42436 {
42437 velocity.X -=
num9;
42438 }
42439 }
42441 {
42442 velocity.Y +=
num9;
42444 {
42445 velocity.Y +=
num9;
42446 }
42447 }
42449 {
42450 velocity.Y -=
num9;
42452 {
42453 velocity.Y -=
num9;
42454 }
42455 }
42457 {
42459 }
42460 if (
ai[2] % (
float)
num8 == 0f)
42461 {
42463 if (Main.netMode != 1)
42464 {
42467 }
42468 }
42471 {
42474 {
42476 }
42478 }
42480 if (
ai[2] >= (
float)
num7)
42481 {
42486 }
42487 }
42488 else if (
ai[0] == 3f)
42489 {
42492 if (
ai[2] == (
float)(
num11 - 30))
42493 {
42495 }
42496 if (Main.netMode != 1 &&
ai[2] == (
float)(
num11 - 30))
42497 {
42501 }
42504 {
42509 }
42510 }
42511 else if (
ai[0] == 4f)
42512 {
42516 if (
ai[2] == (
float)(
num12 - 60))
42517 {
42519 }
42522 {
42528 }
42529 }
42530 else if (
ai[0] == 5f && !player.dead)
42531 {
42533 {
42535 }
42538 {
42539 velocity.X +=
num3;
42541 {
42542 velocity.X +=
num3;
42543 }
42544 }
42546 {
42547 velocity.X -=
num3;
42549 {
42550 velocity.X -=
num3;
42551 }
42552 }
42554 {
42555 velocity.Y +=
num3;
42557 {
42558 velocity.Y +=
num3;
42559 }
42560 }
42562 {
42563 velocity.Y -=
num3;
42565 {
42566 velocity.Y -=
num3;
42567 }
42568 }
42571 {
42573 {
42575 }
42578 {
42580 }
42582 }
42584 if (
ai[2] >= (
float)
num2)
42585 {
42587 switch ((
int)
ai[3])
42588 {
42589 case 0:
42590 case 1:
42591 case 2:
42592 case 3:
42593 case 4:
42594 case 5:
42596 break;
42597 case 6:
42600 break;
42601 case 7:
42604 break;
42605 }
42607 {
42609 }
42611 {
42613 }
42615 {
42616 case 1:
42623 {
42626 {
42628 }
42630 }
42631 break;
42632 case 2:
42636 {
42639 {
42641 }
42643 }
42647 break;
42648 case 3:
42652 break;
42653 case 4:
42657 break;
42658 }
42660 }
42661 }
42662 else if (
ai[0] == 6f)
42663 {
42666 {
42668 Vector2 vector11 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - (float)
Math.
PI / 2f).ToRotationVector2() * Main.rand.Next(3, 8);
42670 Main.dust[
num34].noGravity =
true;
42671 Main.dust[
num34].noLight =
true;
42672 Main.dust[
num34].velocity /= 4f;
42674 }
42676 if (
ai[2] >= (
float)
num5)
42677 {
42683 }
42684 }
42685 else if (
ai[0] == 7f)
42686 {
42688 {
42690 }
42691 if (
ai[2] % (
float)
num16 == 0f)
42692 {
42694 if (Main.netMode != 1)
42695 {
42700 Main.npc[
num35].netUpdate =
true;
42701 Main.npc[
num35].ai[3] = (float)Main.rand.Next(80, 121) / 100f;
42702 }
42703 }
42708 {
42713 }
42714 }
42715 else if (
ai[0] == 8f)
42716 {
42719 if (
ai[2] == (
float)(
num11 - 30))
42720 {
42722 }
42723 if (Main.netMode != 1 &&
ai[2] == (
float)(
num11 - 30))
42724 {
42725 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
center.X,
center.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f,
target + 1,
flag6 ? 1 : 0);
42726 }
42729 {
42734 }
42735 }
42736 else if (
ai[0] == 9f)
42737 {
42739 if (
ai[2] < (
float)(
num13 - 90))
42740 {
42742 {
42744 }
42745 else
42746 {
42748 }
42750 {
42752 }
42754 {
42756 }
42757 }
42758 else if (
alpha < 255)
42759 {
42762 {
42764 }
42765 }
42768 if (
ai[2] == (
float)(
num13 - 60))
42769 {
42771 }
42774 {
42780 }
42781 }
42782 else if (
ai[0] == 10f && !player.dead)
42783 {
42786 {
42789 {
42791 }
42792 }
42794 {
42796 }
42801 {
42803 {
42806 {
42808 }
42809 }
42812 {
42814 }
42816 }
42818 if (
ai[2] >= (
float)
num2)
42819 {
42821 switch ((
int)
ai[3])
42822 {
42823 case 0:
42824 case 2:
42825 case 3:
42826 case 5:
42827 case 6:
42828 case 7:
42830 break;
42831 case 1:
42832 case 4:
42833 case 8:
42835 break;
42836 }
42838 {
42839 case 1:
42846 {
42849 {
42851 }
42853 }
42854 break;
42855 case 2:
42859 break;
42860 case 3:
42864 break;
42865 }
42867 }
42868 }
42869 else if (
ai[0] == 11f)
42870 {
42874 {
42876 }
42879 {
42881 Vector2 vector14 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - (float)
Math.
PI / 2f).ToRotationVector2() * Main.rand.Next(3, 8);
42883 Main.dust[
num39].noGravity =
true;
42884 Main.dust[
num39].noLight =
true;
42885 Main.dust[
num39].velocity /= 4f;
42887 }
42889 if (
ai[2] >= (
float)
num5)
42890 {
42896 }
42897 }
42898 else if (
ai[0] == 12f)
42899 {
42903 {
42906 {
42908 }
42909 }
42912 if (
ai[2] == (
float)(
num14 / 2))
42913 {
42915 }
42916 if (Main.netMode != 1 &&
ai[2] == (
float)(
num14 / 2))
42917 {
42919 {
42921 }
42927 {
42929 {
42932 {
42934 }
42935 }
42938 {
42940 }
42942 }
42943 }
42946 {
42952 {
42954 }
42956 }
42957 }
42958 else if (
ai[0] == 13f)
42959 {
42961 {
42963 }
42968 {
42974 }
42975 }
42977 }
static float Lerp(float value1, float value2, float amount)
static double Atan2(double y, double x)
static int Sign(decimal value)
static void PlaySound(int type, Vector2 position, int style=1)
void EncourageDespawn(int despawnTime)
void TargetClosest(bool faceTarget=true)
IEntitySource GetSpawnSourceForNPCFromNPCAI()
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()
void SimpleFlyMovement(Vector2 desiredVelocity, float moveSpeed)
static float Distance(Vector2 value1, Vector2 value2)