56688 {
56689 if (this.
ai[0] != -1f && Main.rand.Next(1000) == 0)
56690 {
56692 }
56693 bool expertMode = Main.expertMode;
56695 int num = 120;
56697 if (expertMode)
56698 {
56699 num = 90;
56700 }
56701 if (Main.getGoodWorld)
56702 {
56703 num -= 30;
56704 }
56708 if (expertMode)
56709 {
56712 }
56713 if (Main.getGoodWorld)
56714 {
56717 }
56720 if (expertMode)
56721 {
56723 }
56724 if (Main.getGoodWorld)
56725 {
56727 }
56730 if (expertMode)
56731 {
56734 }
56738 bool flag3 =
false;
56739 bool flag4 =
false;
56740 if (flag)
56741 {
56743 }
56745 {
56746 if (this.
ai[3] < 0f || !Main.npc[(
int)this.
ai[3]].active || Main.npc[(int)this.
ai[3]].
type != 439)
56747 {
56751 return;
56752 }
56753 this.
ai[0] = Main.npc[(int)this.
ai[3]].
ai[0];
56754 this.
ai[1] = Main.npc[(int)this.
ai[3]].
ai[1];
56755 if (this.
ai[0] == 5f)
56756 {
56758 {
56762 if (Main.netMode != 1)
56763 {
56764 NetMessage.SendData(23, -1, -1,
null,
whoAmI);
56765 }
56766 NPC obj = Main.npc[(int)this.
ai[3]];
56767 obj.ai[0] = 6f;
56769 obj.netUpdate = true;
56770 }
56771 }
56772 else
56773 {
56776 }
56777 }
56778 else if (this.
ai[0] == 5f && this.
ai[1] >= 120f && this.
ai[1] < 420f &&
justHit)
56779 {
56786 for (
int i = 0;
i < 200;
i++)
56787 {
56788 if (Main.npc[i].active && Main.npc[i].type == 440 && Main.npc[i].ai[3] == (
float)
whoAmI)
56789 {
56791 }
56792 }
56794 if (Main.expertMode)
56795 {
56797 }
56799 {
56802 {
56804 nPC.life = 0;
56806 nPC.active = false;
56807 if (Main.netMode != 1)
56808 {
56809 NetMessage.SendData(23, -1, -1,
null,
item);
56810 }
56811 }
56813 {
56815 nPC.life = 0;
56817 nPC.active = false;
56818 }
56819 }
56820 Main.projectile[(int)this.
ai[2]].
ai[1] = -1f;
56821 Main.projectile[(int)this.
ai[2]].
netUpdate =
true;
56822 }
56825 float num10 = 5600f;
56827 {
56829 player = Main.player[
target];
56831 }
56833 {
56837 if (Main.netMode != 1)
56838 {
56839 NetMessage.SendData(28, -1, -1,
null,
whoAmI, -1f);
56840 }
56842 for (
int j = 0;
j < 200;
j++)
56843 {
56844 if (Main.npc[
j].active && Main.npc[
j].type == 440 && Main.npc[
j].ai[3] == (
float)
whoAmI)
56845 {
56846 Main.npc[
j].life = 0;
56847 Main.npc[
j].HitEffect();
56848 Main.npc[
j].active =
false;
56849 if (Main.netMode != 1)
56850 {
56851 NetMessage.SendData(28, -1, -1,
null,
whoAmI, -1f);
56852 }
56853 }
56854 }
56855 }
56858 {
56863 if (Main.netMode != 1)
56864 {
56867 }
56868 }
56869 if (this.
ai[0] == -1f)
56870 {
56873 {
56875 }
56877 if (this.
ai[1] >= 420f)
56878 {
56882 }
56883 else if (this.
ai[1] > 360f)
56884 {
56887 {
56889 }
56891 }
56892 else if (this.
ai[1] > 300f)
56893 {
56896 }
56897 else if (this.
ai[1] > 120f)
56898 {
56900 }
56901 else
56902 {
56904 }
56907 }
56908 if (this.
ai[0] == 0f)
56909 {
56910 if (this.
ai[1] == 0f)
56911 {
56913 }
56917 {
56919 }
56921 if (this.
ai[1] >= 40f &&
flag2)
56922 {
56924 if (flag)
56925 {
56926 switch ((
int)this.
ai[3])
56927 {
56928 case 0:
56929 num13 = 0;
56930 break;
56931 case 1:
56933 break;
56934 case 2:
56936 break;
56937 case 3:
56939 break;
56940 case 4:
56942 break;
56943 case 5:
56945 break;
56946 case 6:
56948 break;
56949 case 7:
56951 break;
56952 case 8:
56954 break;
56955 case 9:
56957 break;
56958 case 10:
56960 break;
56961 case 11:
56963 break;
56964 case 12:
56966 break;
56967 case 13:
56970 break;
56971 default:
56973 break;
56974 }
56975 }
56976 else
56977 {
56978 switch ((
int)this.
ai[3])
56979 {
56980 case 0:
56981 num13 = 0;
56982 break;
56983 case 1:
56985 break;
56986 case 2:
56988 break;
56989 case 3:
56991 break;
56992 case 4:
56994 break;
56995 case 5:
56997 break;
56998 case 6:
57000 break;
57001 case 7:
57003 break;
57004 case 8:
57006 break;
57007 case 9:
57009 break;
57010 case 10:
57012 break;
57013 case 11:
57016 break;
57017 default:
57019 break;
57020 }
57021 }
57024 {
57026 }
57028 {
57030 }
57032 {
57034 }
57036 {
57039 {
57041 }
57045 for (
int k = 0;
k < 200;
k++)
57046 {
57047 if (Main.npc[
k].active && Main.npc[
k].type == 440 && Main.npc[
k].ai[3] == (
float)
whoAmI)
57048 {
57050 }
57051 }
57052 bool flag5 = list2.Count % 2 == 0;
57054 {
57058 if (
num15 % 2 == 1)
57059 {
57061 }
57063 {
57065 }
57072 {
57073 nPC2.position -=
nPC2.velocity;
57074 }
57075 nPC2.netUpdate = true;
57077 }
57078 }
57080 {
57081 case 1:
57084 break;
57085 case 2:
57088 break;
57089 case 3:
57092 break;
57093 case 4:
57096 break;
57097 }
57099 {
57102 }
57104 {
57107 }
57109 }
57110 }
57111 else if (this.
ai[0] == 1f)
57112 {
57115 if ((
float)(
int)this.
ai[1] % 2f != 0f && this.
ai[1] != 1f)
57116 {
57118 }
57120 if (this.
ai[1] <= 0f)
57121 {
57127 }
57128 }
57129 else if (this.
ai[0] == 2f)
57130 {
57134 {
57136 }
57137 if (this.
ai[1] >= 4f &&
flag2 && (
int)(this.
ai[1] - 4f) % num == 0)
57138 {
57139 if (Main.netMode != 1)
57140 {
57142 for (
int l = 0;
l < 200;
l++)
57143 {
57144 if (Main.npc[
l].active && Main.npc[
l].type == 440 && Main.npc[
l].ai[3] == (
float)
whoAmI)
57145 {
57147 }
57148 }
57150 {
57155 {
57156 nPC3.direction = (nPC3.spriteDirection =
num17);
57157 }
57158 if (Main.netMode != 1)
57159 {
57162 {
57164 }
57166 for (
int m = 0;
m < 1;
m++)
57167 {
57171 }
57172 }
57173 }
57174 }
57175 if (Main.netMode != 1)
57176 {
57179 {
57181 }
57183 for (
int n = 0;
n < 1;
n++)
57184 {
57186 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
vector4.X,
vector4.Y,
vector5.X,
vector5.Y, 464,
attackDamage_ForProjectiles, 0f, Main.myPlayer, 0f, 1f);
57187 }
57188 }
57189 }
57191 if (this.
ai[1] >= (
float)(4 + num))
57192 {
57198 }
57199 }
57200 else if (this.
ai[0] == 3f)
57201 {
57204 if (
vec2.HasNaNs())
57205 {
57207 }
57208 if (this.
ai[1] >= 4f &&
flag2 && (
int)(this.
ai[1] - 4f) %
num2 == 0)
57209 {
57210 if ((
int)(this.
ai[1] - 4f) /
num2 == 2)
57211 {
57214 {
57215 if (Main.npc[
num18].active && Main.npc[
num18].type == 440 && Main.npc[
num18].ai[3] == (
float)
whoAmI)
57216 {
57218 }
57219 }
57220 if (Main.netMode != 1)
57221 {
57223 {
57228 {
57229 nPC4.direction = (nPC4.spriteDirection =
num19);
57230 }
57231 if (Main.netMode != 1)
57232 {
57234 if (
vec2.HasNaNs())
57235 {
57237 }
57240 {
57244 }
57245 }
57246 }
57247 }
57248 }
57251 {
57253 }
57254 if (Main.netMode != 1)
57255 {
57257 if (
vec2.HasNaNs())
57258 {
57260 }
57263 {
57267 }
57268 }
57269 }
57271 if (this.
ai[1] >= (
float)(4 + num2 *
num3))
57272 {
57278 }
57279 }
57280 else if (this.
ai[0] == 4f)
57281 {
57283 {
57285 }
57286 else
57287 {
57289 }
57290 if (this.
ai[1] == 20f &&
flag2 && Main.netMode != 1)
57291 {
57294 {
57295 if (Main.npc[
num23].active && Main.npc[
num23].type == 440 && Main.npc[
num23].ai[3] == (
float)
whoAmI)
57296 {
57298 }
57299 }
57301 {
57306 {
57307 nPC5.direction = (nPC5.spriteDirection =
num24);
57308 }
57309 if (Main.netMode != 1)
57310 {
57313 {
57315 }
57318 {
57322 }
57323 }
57324 }
57325 if ((
int)(this.
ai[1] - 20f) %
num4 == 0)
57326 {
57328 }
57329 }
57331 if (this.
ai[1] >= (
float)(20 + num4))
57332 {
57338 }
57339 }
57340 else if (this.
ai[0] == 5f)
57341 {
57344 {
57346 }
57347 if (this.
ai[1] >= 0f && this.
ai[1] < 30f)
57348 {
57351 float num26 = (this.
ai[1] - 0f) / 30f;
57353 }
57354 else if (this.
ai[1] >= 30f && this.
ai[1] < 90f)
57355 {
57356 if (this.
ai[1] == 30f && Main.netMode != 1 &&
flag2)
57357 {
57362 {
57363 if (Main.npc[
num27].active && Main.npc[
num27].type == 440 && Main.npc[
num27].ai[3] == (
float)
whoAmI)
57364 {
57366 }
57367 }
57370 {
57372 }
57376 {
57378 }
57381 {
57383 {
57385 }
57386 }
57390 {
57392 {
57395 {
57398 Main.npc[
num35].netUpdate =
true;
57400 }
57401 else
57402 {
57405 NetMessage.SendData(23, -1, -1,
null,
num36);
57406 }
57407 }
57408 }
57409 this.
ai[2] = Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
base.Center.X,
base.Center.Y, 0f, 0f, 490, 0, 0f, Main.myPlayer, 0f,
whoAmI);
57413 }
57418 {
57420 vector10 -=
base.Center;
57422 {
57424 }
57427 {
57429 }
57431 {
57433 }
57434 else
57435 {
57437 }
57440 {
57442 }
57443 }
57444 else
57445 {
57446 Vector2 vector11 = Main.projectile[(int)Main.npc[(
int)this.
ai[3]].ai[2]].Center;
57447 vector11 -=
base.Center;
57449 {
57451 }
57454 {
57456 }
57458 {
57460 }
57461 else
57462 {
57464 }
57467 {
57469 }
57470 }
57471 }
57472 else if (this.
ai[1] >= 90f && this.
ai[1] < 120f)
57473 {
57476 float num39 = (this.
ai[1] - 90f) / 30f;
57478 }
57479 else if (this.
ai[1] >= 120f && this.
ai[1] < 420f)
57480 {
57484 {
57486 vector12 -=
base.Center;
57488 {
57490 }
57493 {
57495 }
57497 {
57499 }
57500 else
57501 {
57503 }
57506 {
57508 }
57509 }
57510 else
57511 {
57512 Vector2 vector13 = Main.projectile[(int)Main.npc[(
int)this.
ai[3]].ai[2]].Center;
57513 vector13 -=
base.Center;
57515 {
57517 }
57520 {
57522 }
57524 {
57526 }
57527 else
57528 {
57530 }
57533 {
57535 }
57536 }
57537 }
57539 if (this.
ai[1] >= 420f)
57540 {
57547 }
57548 }
57549 else if (this.
ai[0] == 6f)
57550 {
57553 if (this.
ai[1] >= 120f)
57554 {
57560 }
57561 }
57562 else if (this.
ai[0] == 7f)
57563 {
57566 if (
vec3.HasNaNs())
57567 {
57569 }
57570 if (this.
ai[1] >= 4f &&
flag2 && (
int)(this.
ai[1] - 4f) %
num5 == 0)
57571 {
57572 if ((
int)(this.
ai[1] - 4f) /
num5 == 2)
57573 {
57576 {
57577 if (Main.npc[
num42].active && Main.npc[
num42].type == 440 && Main.npc[
num42].ai[3] == (
float)
whoAmI)
57578 {
57580 }
57581 }
57583 {
57588 {
57589 nPC6.direction = (nPC6.spriteDirection =
num43);
57590 }
57591 if (Main.netMode != 1)
57592 {
57594 if (
vec3.HasNaNs())
57595 {
57597 }
57600 {
57604 }
57605 }
57606 }
57607 }
57610 {
57612 }
57613 if (Main.netMode != 1)
57614 {
57616 if (
vec3.HasNaNs())
57617 {
57619 }
57624 {
57627 float ai = (Main.rand.NextFloat() - 0.5f) * 0.3f * ((
float)Math.PI * 2f) / 60f;
57630 Main.npc[
num49].netUpdate =
true;
57631 }
57632 }
57633 }
57634 this.ai[1] += 1f;
57635 if (this.ai[1] >= (
float)(4 +
num5 *
num6))
57636 {
57637 this.ai[0] = 0f;
57638 this.ai[1] = 0f;
57639 this.ai[3] += 1f;
57642 }
57643 }
57644 else if (this.ai[0] == 8f)
57645 {
57647 if (this.ai[1] >= 4f &&
flag2 && (
int)(this.ai[1] - 4f) %
num7 == 0)
57648 {
57651 {
57652 if (Main.npc[
num50].active && Main.npc[
num50].type == 440 && Main.npc[
num50].ai[3] == (
float)
whoAmI)
57653 {
57655 }
57656 }
57657 int num51 = list8.Count + 1;
57659 {
57661 }
57664 {
57666 }
57667 if (Main.netMode != 1)
57668 {
57670 {
57671 Point point =
base.Center.ToTileCoordinates();
57679 bool flag6 =
false;
57681 {
57683 }
57685 {
57690 {
57693 {
57695 }
57697 {
57700 break;
57701 }
57702 }
57703 }
57704 }
57705 }
57706 }
57707 this.ai[1] += 1f;
57708 if (this.ai[1] >= (
float)(4 +
num7 *
num8))
57709 {
57710 this.ai[0] = 0f;
57711 this.ai[1] = 0f;
57712 this.ai[3] += 1f;
57715 }
57716 }
57718 {
57719 this.ai[3] =
num11;
57720 }
57723 }
void Add(TKey key, TValue value)
static double Ceiling(double a)
static double Abs(double value)
static int Sign(decimal value)
static void PlaySound(int type, Vector2 position, int style=1)
static int CountNPCS(int Type)
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)
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
void HitEffect(int hitDirection=0, double dmg=10.0)
IEntitySource GetSpawnSource_ForProjectile()
static float Distance(Vector2 value1, Vector2 value2)