55139 {
55140
55141
55142
55143
55144
55145
55146
55147
55148
55149
55150
55151
55152
55153
55154
55155
55156
55157
55158
55159
55160
55161
55162
55163
55164
55165
55166
55167
55168
55169
55170
55171
55172
55173
55174
55175
55176
55177 bool flag = velocity.X == 0f && velocity.Y == 0f && !
justHit;
55178 bool flag2 =
false;
55179 bool flag3 =
false;
55180 bool flag4 =
false;
55181 int num = 32;
55184 bool flag5 =
false;
55188 bool flag6 =
false;
55191 bool flag8 =
false;
55192 bool flag9 =
false;
55205 float num13 = 700f;
55207 float num15 = 0.1f;
55209 float num16 = 0.5f;
55227 float num24 = 0.07f;
55228 float num25 = 0.8f;
55241 float num31 = 0.025f;
55245 {
55247 }
55249 {
55252 }
55254 {
55256 {
55258 }
55260 }
55262 {
55264 {
55267 }
55268 }
55269 else
55270 {
55273 }
55278 {
55279 case 576:
55280 case 577:
55291 {
55293 }
55295 {
55299 {
55301 {
55303 }
55305 {
55307 }
55309 {
55312 {
55314 }
55315 }
55316 }
55318 {
55320 }
55321 }
55322 else if (
ai[1] == 2f)
55323 {
55325 }
55326 switch ((
int)
ai[1])
55327 {
55328 case 0:
55331 {
55333 }
55334 break;
55335 case 2:
55341 num = 56;
55349 {
55351 }
55352 break;
55353 case 1:
55363 {
55365 }
55366 break;
55367 }
55368 if (
ai[0] < (
float)(-
num6))
55369 {
55371 }
55372 break;
55373 case 552:
55374 case 553:
55375 case 554:
55381 {
55384 }
55386 {
55389 }
55391 {
55393 }
55394 break;
55395 case 570:
55396 case 571:
55403 if (
type == 571 &&
ai[1] > 10f &&
ai[1] <= 40f && (
int)
ai[1] % 6 == 0)
55404 {
55406 }
55407 if (
type == 570 &&
ai[1] > 10f &&
ai[1] <= 40f && (
int)
ai[1] % 9 == 0)
55408 {
55410 }
55420 {
55422 }
55425 {
55427 }
55430 {
55432 {
55434 }
55435 else if (
ai[1] == 60f)
55436 {
55438 }
55439 }
55441 {
55444 }
55445 break;
55446 case 572:
55447 case 573:
55449 {
55456 }
55459 {
55468 for (
int k = 0;
k < 4;
k++)
55469 {
55471 Main.dust[
num37].position = base.Center +
Vector2.
UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() *
width / 2f;
55472 }
55473 for (
int l = 0;
l < 20;
l++)
55474 {
55476 Main.dust[
num38].position = base.Center +
Vector2.
UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() *
width / 2f;
55477 Main.dust[
num38].noGravity =
true;
55478 Main.dust[
num38].velocity *= 3f;
55480 Main.dust[
num38].position = base.Center +
Vector2.
UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() *
width / 4f;
55481 Main.dust[
num38].velocity *= 2f;
55482 Main.dust[
num38].noGravity =
true;
55483 Main.dust[
num38].fadeIn = 2.5f;
55484 }
55485 for (
int m = 0;
m < 6;
m++)
55486 {
55489 Main.dust[
num39].noGravity =
true;
55490 Main.dust[
num39].velocity *= 3f;
55491 }
55492 for (
int n = 0;
n < 12;
n++)
55493 {
55496 Main.dust[
num40].noGravity =
true;
55497 Main.dust[
num40].velocity *= 3f;
55498 }
55500 {
55501 int num42 = Gore.NewGore(
position +
new Vector2((
float)(
width * Main.rand.Next(100)) / 100f, (
float)(
height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f,
default(
Vector2), Main.rand.Next(61, 64));
55502 Main.gore[
num42].position = base.Center +
Vector2.
UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() *
width / 2f;
55503 Main.gore[
num42].velocity *= 0.3f;
55504 Main.gore[
num42].velocity.X += (float)Main.rand.Next(-10, 11) * 0.05f;
55505 Main.gore[
num42].velocity.Y += (float)Main.rand.Next(-10, 11) * 0.05f;
55506 }
55509 {
55514 }
55515 return;
55516 }
55517 if (
ai[0] > 0f &&
ai[1] == 0f &&
life > 0)
55518 {
55521 {
55525 }
55528 {
55535 }
55536 }
55537 if (
ai[0] > 0f &&
ai[1] == 1f)
55538 {
55542 return;
55543 }
55546 {
55548 }
55549 if (
ai[0] == 0f &&
ai[1] == 1f)
55550 {
55553 {
55557 }
55558 else
55559 {
55560 activeSound.Position =
base.Center;
55561 }
55564 {
55568 }
55569 else
55570 {
55571 activeSound2.Position =
base.Center;
55572 }
55573 }
55574 if (
ai[1] > 0f &&
ai[0] == 0f)
55575 {
55582 if (Main.rand.Next(6) == 0)
55583 {
55584 Dust
dust3 = Dust.NewDustDirect(
vector3, 1, 1, 213, Main.rand.Next(-2, 3), Main.rand.Next(-2, 3), 100,
new Color(255, 255, 255, 0));
55585 dust3.noGravity = true;
55586 dust3.fadeIn = dust3.scale + 1f + 0.01f * (float)Main.rand.Next(0, 51);
55587 dust3.velocity *= 0.3f;
55589 dust3.velocity.Y += -3.5f;
55591 }
55592 if (Main.rand.Next(12) == 0)
55593 {
55595 dust4.noGravity = true;
55596 dust4.velocity.Y -= 1f + Main.rand.NextFloat();
55597 dust4.scale = 1.1f;
55598 dust4.fadeIn = 0.5f;
55599 dust4.customData = this;
55600 }
55601 }
55602 else
55603 {
55607 }
55609 {
55611 }
55612 break;
55613 case 568:
55614 case 569:
55615 {
55624 {
55626 }
55628 {
55632 }
55634 {
55635 break;
55636 }
55639 if (Main.rand.Next(10) == 0)
55640 {
55642 dust7.velocity.X /= 2f;
55643 dust7.noGravity = true;
55644 dust7.fadeIn = 1.5f;
55645 dust7.position.Y += 4f;
55646 }
55649 {
55653 }
55654 else
55655 {
55656 activeSound3.Position =
base.Center;
55657 }
55659 if (
localAI[0] > 60f && Main.rand.Next(10) == 0)
55660 {
55661 Vector2 vec = base.Center + (Main.rand.NextFloat() * ((float)
Math.
PI * 2f)).ToRotationVector2() * 400f * (0.3f + 0.7f * Main.rand.NextFloat());
55662 Point point =
vec.ToTileCoordinates();
55663 if (!
WorldGen.SolidTile(point.X, point.Y))
55664 {
55665 Dust
dust8 = Dust.NewDustPerfect(
vec, 27,
new Vector2(0f, -3f), 0,
new Color(255, 255, 255, 127), 1.5f);
55667 dust8.fadeIn = 1.5f;
55668 }
55669 }
55670 if (Main.netMode != 2)
55671 {
55672 Player player = Main.player[Main.myPlayer];
55673 if (!player.dead && player.active && (player.Center -
base.Center).Length() < 400f && !player.creativeGodMode)
55674 {
55676 }
55677 }
55679 {
55681 }
55682 if (!(
ai[1] <= 0f))
55683 {
55684 break;
55685 }
55687 if (Main.netMode != 1)
55688 {
55691 {
55693 }
55695 {
55699 }
55700 }
55701 break;
55702 }
55703 case 561:
55704 case 562:
55705 case 563:
55706 {
55709 {
55713 }
55722 {
55724 }
55725 vector.Y -= 14f;
55731 {
55734 }
55736 {
55742 }
55744 {
55750 }
55752 {
55756 }
55757 break;
55758 }
55759 case 555:
55760 case 556:
55761 case 557:
55762 {
55774 vector.Y -= 14f;
55780 {
55783 }
55785 {
55789 }
55791 {
55795 }
55797 {
55801 }
55802 if (
ai[1] == (
float)
num9)
55803 {
55805 }
55806 break;
55807 }
55808 case 566:
55809 case 567:
55810 {
55811 DelegateMethods.v3_1 =
new Vector3(0.3f, 0.05f, 0.45f) * 1.5f;
55812 Utils.PlotTileLine(
base.Top,
base.Bottom,
width, DelegateMethods.CastLightOpen);
55816 {
55818 }
55820 {
55822 break;
55823 }
55825 velocity.X = 0f;
55830 {
55832 }
55836 {
55839 {
55841 }
55842 }
55844 {
55850 {
55851 if (Main.rand.Next(
maxValue) == 0)
55852 {
55854 dust5.scale = 1f;
55855 dust5.fadeIn = 0.3f;
55856 dust5.velocity =
new Vector2(Main.rand.NextFloatDirection() * 1f, 0f -
dust5.velocity.Length()) * 1.25f *
num46;
55857 }
55858 }
55859 }
55860 else
55861 {
55867 {
55869 {
55871 dust6.scale = 1.1f;
55872 dust6.fadeIn = 0.1f;
55873 dust6.velocity =
new Vector2(Main.rand.NextFloatDirection() * 0.1f, 0f -
dust6.velocity.Length()) * 1.05f *
num49 * Main.rand.NextFloat();
55875 }
55876 }
55877 }
55879 {
55880 Gore.NewGoreDirect(
base.Left,
new Vector2(0f, -3f), Utils.SelectRandom<
int>(Main.rand, 971, 972), 0.85f).velocity.X *= 0.8f;
55881 }
55882 break;
55883 }
55884 case 620:
55885 {
55891 bool dayTime = Main.dayTime;
55898 if (
ai[1] > 10f &&
ai[1] <= 40f && (
int)
ai[1] % 5 == 0)
55899 {
55901 }
55904 vector.Y -= 20f;
55916 {
55918 {
55920 }
55921 else if (
ai[1] == 60f)
55922 {
55924 }
55925 }
55928 {
55930 velocity.Y = -6f;
55932 for (
int i = 0;
i < 35;
i++)
55933 {
55935 dust.velocity *= 1f;
55936 dust.scale = 1f + Main.rand.NextFloat() * 0.5f;
55937 dust.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
55939 }
55940 }
55943 {
55945 }
55947 {
55948 for (
int j = 0;
j < 2;
j++)
55949 {
55951 dust2.velocity *= 1f;
55952 dust2.scale = 1f + Main.rand.NextFloat() * 0.5f;
55953 dust2.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
55954 dust2.velocity +=
velocity * 0.3f;
55955 }
55956 }
55957 if (Main.rand.Next(3) == 0)
55958 {
55960 }
55962 if (dayTime)
55963 {
55967 }
55968 else
55969 {
55971 {
55972 break;
55973 }
55976 {
55978 {
55979 velocity.Y = -11f;
55980 }
55981 else if (
num32 < 15)
55982 {
55983 velocity.Y = -13f;
55984 }
55985 else if (
num32 < 19)
55986 {
55987 velocity.Y = -14f;
55988 }
55989 else
55990 {
55991 velocity.Y = -15.9f;
55992 }
55993 }
55994 }
55995 break;
55996 }
55997 }
55999 {
56000 bool flag31 = velocity.Y == 0f;
56002 {
56004 {
56006 {
56007 velocity.X -=
num31;
56008 }
56009 else
56010 {
56011 velocity.X +=
num31;
56012 }
56014 {
56015 velocity.Y -=
num31;
56016 }
56017 else
56018 {
56019 velocity.Y +=
num31;
56020 }
56021 }
56022 }
56024 {
56025 velocity.Y = 0f;
56026 }
56027 }
56029 {
56031 {
56033 }
56035 {
56037 }
56039 {
56043 {
56045 }
56051 {
56053 }
56055 {
56057 {
56059 dust9.scale = 0.55f;
56060 dust9.fadeIn = 0.7f;
56061 dust9.velocity *= 0.1f *
num54;
56063 }
56064 }
56065 }
56066 }
56068 {
56072 {
56074 }
56076 {
56078 }
56080 {
56085 return;
56086 }
56089 {
56091 }
56093 {
56095 }
56100 {
56102 }
56103 else
56104 {
56106 }
56107 return;
56108 }
56111 {
56113 }
56115 {
56117 }
56119 {
56121 }
56123 {
56125 {
56127 flag = false;
56128 }
56129 if (
ai[0] == 0f && (
velocity.
Y == 0f ||
flag6) &&
targetData.Type != 0 && (Collision.CanHit(
position,
width,
height,
targetData.Position,
targetData.Width,
targetData.Height) || Collision.CanHitLine(
position,
width,
height,
targetData.Position,
targetData.Width,
targetData.Height)) && (
targetData.Center -
base.Center).Length() <
num4)
56130 {
56133 }
56135 {
56138 {
56139 velocity.X *=
num7;
56144 }
56147 {
56150 }
56151 }
56152 }
56154 {
56156 {
56159 }
56160 if (
ai[0] == (
float)
num9)
56161 {
56167 {
56171 {
56173 }
56174 else
56175 {
56177 }
56179 if (Main.netMode != 1)
56180 {
56182 }
56183 }
56184 }
56185 }
56187 {
56189 {
56191 }
56192 if (
ai[0] == (
float)num)
56193 {
56194 velocity.Y = 0f -
num3;
56195 }
56196 }
56198 {
56200 {
56202 }
56204 {
56206 }
56208 {
56210 }
56211 if (
ai[3] > (
float)(
num21 * 10))
56212 {
56214 }
56216 {
56218 }
56220 {
56222 }
56224 {
56227 {
56236 {
56238 }
56240 {
56242 {
56244 dust10.scale = 0.55f;
56245 dust10.fadeIn = 0.7f;
56246 dust10.velocity *= 3f *
num59;
56247 dust10.noGravity = true;
56248 dust10.fadeIn = 1.5f;
56249 dust10.velocity *= 3f;
56250 }
56251 }
56252 return;
56253 }
56254 }
56255 }
56257 {
56259 {
56260 if (
num22 > 0 && Main.rand.Next(
num22) == 0)
56261 {
56263 }
56268 {
56270 }
56271 }
56273 {
56275 {
56277 }
56279 {
56281 {
56284 {
56289 }
56290 }
56291 }
56292 else if (
ai[2] != 0f)
56293 {
56296 }
56298 {
56300 }
56301 }
56302 }
56304 {
56306 {
56308 {
56310 }
56311 }
56313 {
56315 }
56316 }
56318 {
56320 {
56322 }
56323 else
56324 {
56326 {
56328 }
56330 {
56333 }
56335 {
56337 {
56340 }
56341 if (
ai[1] == (
float)
num9)
56342 {
56348 {
56352 {
56354 }
56355 else
56356 {
56358 }
56360 if (Main.netMode != 1)
56361 {
56363 }
56364 }
56366 {
56367 ai[0] = ((vector9.Y > 0f) ? 1 : 5);
56368 }
56370 {
56372 }
56373 else
56374 {
56375 ai[0] = ((vector9.Y > 0f) ? 2 : 4);
56376 }
56378 {
56379 direction = ((vector9.X > 0f) ? 1 : (-1));
56380 }
56381 }
56384 {
56386 if (
num20 != 0f &&
ai[1] <= 0f)
56387 {
56389 }
56392 }
56394 {
56395 velocity.X *= 0.9f;
56397 }
56398 }
56400 {
56403 {
56405 velocity.X *= 0.5f;
56409 {
56410 ai[0] = ((vector12.Y > 0f) ? 1 : 5);
56411 }
56413 {
56415 }
56416 else
56417 {
56418 ai[0] = ((vector12.Y > 0f) ? 2 : 4);
56419 }
56421 {
56422 direction = ((vector12.X > 0f) ? 1 : (-1));
56423 }
56424 }
56425 }
56427 {
56430 {
56432 }
56434 {
56436 {
56437 velocity.X *=
num25;
56438 }
56439 }
56441 {
56443 }
56444 }
56445 }
56446 }
56448 {
56449 int num62 = (int)(
base.Bottom.Y + 7f) / 16;
56454 {
56455 num65 = Utils.Clamp(
num65, 0, Main.maxTilesX);
56456 num62 = Utils.Clamp(
num62, 0, Main.maxTilesY);
56458 if (tile == null)
56459 {
56460 return;
56461 }
56462 if (tile.nactive() && Main.tileSolid[tile.type])
56463 {
56465 break;
56466 }
56467 }
56468 }
56471 {
56476 }
56478 {
56480 int num67 = ((int)
base.Bottom.Y - 15) / 16;
56488 if (
flag8 &&
tileSafely4.nactive() && (tileSafely4.type == 10 || tileSafely4.type == 388))
56489 {
56493 {
56495 {
56497 }
56499 if (Main.tile[
num66,
num67 - 1].type == 388)
56500 {
56502 }
56503 velocity.X = 0.5f * (float)(-
direction);
56507 {
56510 }
56512 {
56514 }
56516 if (Main.netMode != 1 &&
flag37)
56517 {
56519 {
56521 if (Main.netMode == 2)
56522 {
56523 NetMessage.SendData(17, -1, -1,
null, 0,
num66,
num67 - 1);
56524 }
56525 }
56526 else
56527 {
56529 {
56532 {
56535 }
56536 if (Main.netMode == 2 &&
flag38)
56537 {
56539 }
56540 }
56542 {
56545 {
56548 }
56549 if (Main.netMode == 2 &&
flag39)
56550 {
56552 }
56553 }
56554 }
56555 }
56556 }
56557 }
56558 else
56559 {
56562 {
56564 {
56566 velocity.Y = -7f;
56568 {
56569 velocity.Y = -8f;
56570 }
56571 }
56573 {
56574 velocity.Y = -6f;
56576 }
56578 {
56579 velocity.Y = -5f;
56581 }
56583 {
56584 velocity.X *= 1.5f;
56585 velocity.Y = -8f;
56587 }
56589 {
56592 }
56594 {
56595 velocity.Y = -5f;
56597 }
56598 }
56600 {
56602 velocity.Y = -4f;
56604 }
56605 }
56606 }
56608 {
56611 }
56613 {
56614 return;
56615 }
56618 {
56620 {
56622 }
56624 }
56625 bool num70 = velocity.Y == 0f;
56627 {
56630 }
56636 {
56638 }
56640 {
56641 velocity.Y += 0.5f;
56642 }
56644 {
56646 {
56647 velocity.Y = 0f;
56648 }
56650 {
56651 velocity.Y -= 0.025f;
56652 }
56653 else
56654 {
56655 velocity.Y -= 0.2f;
56656 }
56658 {
56659 velocity.Y = -4f;
56660 }
56661 }
56662 else
56663 {
56665 {
56666 velocity.Y = 0f;
56667 }
56669 {
56670 velocity.Y += 0.025f;
56671 }
56672 else
56673 {
56674 velocity.Y += 0.5f;
56675 }
56676 }
56678 {
56679 velocity.Y = 10f;
56680 }
56682 {
56683 velocity.Y = 0f;
56684 }
56685 }
static float Lerp(float value1, float value2, float amount)
static float Clamp(float value, float min, float max)
static double Abs(double value)
static int Sign(decimal value)
static SlotId PlayTrackedSound(SoundStyle style, Vector2 position)
static ActiveSound GetActiveSound(SlotId id)
float Distance(Vector2 Other)
Vector2 DirectionTo(Vector2 Destination)
static bool EnemiesShouldChasePlayers
static bool[] BelongsToInvasionOldOnesArmy
static bool[] FighterUsesDD2PortalAppearEffect
static readonly LegacySoundStyle DD2_WitherBeastAuraPulse
static readonly LegacySoundStyle DD2_OgreGroundPound
static readonly LegacySoundStyle DD2_OgreRoar
static readonly LegacySoundStyle DD2_KoboldIgnite
static readonly LegacySoundStyle DD2_WitherBeastCrystalImpact
static readonly LegacySoundStyle DD2_KoboldScreamChargeLoop
static readonly LegacySoundStyle DD2_GoblinScream
static readonly LegacySoundStyle DD2_KoboldIgniteLoop
static readonly LegacySoundStyle DD2_OgreAttack
static readonly LegacySoundStyle DD2_GoblinBomberScream
static readonly LegacySoundStyle DD2_OgreSpit
static readonly LegacySoundStyle DD2_DrakinShot
static readonly LegacySoundStyle DD2_KoboldExplosion
static readonly LegacySoundStyle DD2_JavelinThrowersTaunt
static readonly LegacySoundStyle DD2_DrakinBreathIn
static readonly LegacySoundStyle DD2_JavelinThrowersAttack
static readonly LegacySoundStyle DD2_EtherianPortalSpawnEnemy
static readonly LegacySoundStyle DD2_GoblinBomberThrow
void GetTileCollisionParameters(out Vector2 cPosition, out int cWidth, out int cHeight)
void HealEffect(int healAmount, bool broadcast=true)
void EncourageDespawn(int despawnTime)
void TargetClosest(bool faceTarget=true)
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
int GetAttackDamage_ScaledByStrength(float normalDamage)
int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage)
void HitEffect(int hitDirection=0, double dmg=10.0)
int TranslatedTargetIndex
IEntitySource GetSpawnSource_ForProjectile()
LegacySoundStyle HitSound
static void TargetClosestCommon(NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
static void TargetClosestOldOnesInvasion(NPC searcher, bool faceTarget=true, Vector2? checkPosition=null)
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
static readonly SlotId Invalid
static SlotId FromFloat(float value)