48966 {
48968 {
48970 }
48971 bool flag = false;
48973 {
48974 int num = (int)(
base.Center.X / 16f);
48975 int num2 = (int)(
base.Bottom.Y / 16f);
48978 Main.dust[
num3].velocity *= 0.2f;
48981 {
48982 for (
int i = 0;
i < 5;
i++)
48983 {
48986 Main.dust[
num4].velocity *= 0.2f;
48988 }
48989 if (Main.netMode != 1 && TileObject.CanPlace(num,
num2 - 1, 567, 0,
direction,
out var _,
onlyCheck:
true) &&
WorldGen.PlaceTile(num,
num2 - 1, 567,
mute:
false,
forced:
false, -1, Main.rand.
Next(5)))
48990 {
48991 if (Main.netMode == 2)
48992 {
48993 NetMessage.SendTileSquare(-1, num,
num2 - 2, 1, 2);
48994 }
48995 if (Main.netMode != 1)
48996 {
48998 {
48999 Main.BestiaryTracker.Kills.RegisterKill(this);
49000 }
49002 }
49006 return;
49007 }
49008 }
49009 }
49011 {
49014 {
49017 if (!Main.player[
target].dead && (Main.player[
target].Center -
base.Center).Length() < 170f)
49018 {
49020 }
49022 {
49024 }
49025 return;
49026 }
49028 {
49030 {
49033 {
49035 }
49036 }
49039 {
49042 }
49043 return;
49044 }
49046 }
49048 {
49049 if (Main.netMode != 1 && Main.rand.Next(240) == 0)
49050 {
49051 ai[2] = Main.rand.Next(-480, -60);
49053 }
49055 {
49058 {
49060 }
49061 if (Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
49062 {
49064 }
49065 }
49067 {
49068 velocity.X *= 0.9f;
49070 {
49071 velocity.X = 0f;
49072 }
49075 {
49077 }
49078 return;
49079 }
49080 }
49082 {
49084 {
49091 position.X = center.X - (float)(
width / 2);
49092 position.Y = center.Y - (float)(
height / 2);
49095 {
49097 }
49099 {
49101 }
49103 {
49105 }
49107 {
49112 return;
49113 }
49116 {
49118 }
49120 {
49122 }
49127 {
49129 }
49130 else
49131 {
49133 }
49134 return;
49135 }
49136 knockBackResist = 0.4f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
49141 position.X = center2.X - (float)(
width / 2);
49142 position.Y = center2.Y - (float)(
height / 2);
49143 if (
ai[3] == -0.10101f)
49144 {
49149 {
49151 }
49155 {
49157 }
49159 {
49161 }
49163 }
49164 }
49166 {
49168 {
49171 velocity.Y = -6f;
49173 for (
int j = 0;
j < 35;
j++)
49174 {
49176 dust.velocity *= 1f;
49177 dust.scale = 1f + Main.rand.NextFloat() * 0.5f;
49178 dust.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
49180 }
49181 }
49184 {
49186 }
49189 {
49190 for (
int k = 0;
k < 2;
k++)
49191 {
49193 dust2.velocity *= 1f;
49194 dust2.scale = 1f + Main.rand.NextFloat() * 0.5f;
49195 dust2.fadeIn = 1.5f + Main.rand.NextFloat() * 0.5f;
49196 dust2.velocity +=
velocity * 0.3f;
49197 }
49198 }
49199 if (Main.rand.Next(3) == 0)
49200 {
49202 dust3.velocity *= 0f;
49203 dust3.alpha = 120;
49204 dust3.scale = 0.7f + Main.rand.NextFloat() * 0.5f;
49205 dust3.velocity +=
velocity * 0.3f;
49206 }
49209 {
49214 position.X = center3.X - (float)(
width / 2);
49215 position.Y = center3.Y - (float)(
height / 2);
49218 {
49220 }
49222 {
49224 }
49226 {
49228 }
49230 {
49238 {
49240 }
49241 else
49242 {
49244 }
49245 return;
49246 }
49249 {
49251 }
49253 {
49255 }
49260 {
49262 }
49263 else
49264 {
49266 }
49267 return;
49268 }
49271 position.X = center4.X - (float)(
width / 2);
49272 position.Y = center4.Y - (float)(
height / 2);
49273 if (
ai[3] == -0.10101f)
49274 {
49279 {
49281 }
49285 {
49287 }
49289 {
49291 }
49293 }
49294 }
49296 {
49298 {
49300 flag = false;
49302 velocity.X *= 0.93f;
49304 {
49305 velocity.X = 0f;
49306 }
49307 int num11 = (int)(0f -
ai[3] - 1f);
49310 {
49311 velocity.X = 0f;
49314 }
49315 if (
justHit && Main.netMode != 1 && Main.npc[
num11].localAI[0] == 0f)
49316 {
49317 Main.npc[
num11].localAI[0] = 1f;
49318 }
49320 {
49322 }
49323 if ((
ai[0] += 1f) >= 1300f)
49324 {
49327 }
49328 return;
49329 }
49330 if (
ai[0] >= 1000f)
49331 {
49333 }
49335 }
49336 if (
type == 383 &&
ai[2] == 0f &&
localAI[0] == 0f && Main.netMode != 1)
49337 {
49343 Main.npc[
num13].netUpdate =
true;
49344 }
49346 {
49348 if (
num14 != -1 && Main.npc[
num14].active && Main.npc[
num14].type == 384)
49349 {
49351 }
49352 else
49353 {
49357 {
49359 }
49361 {
49363 }
49364 }
49365 }
49367 {
49372 {
49375 velocity.X *= 0.9f;
49377 {
49378 velocity.X = 0.001f * (float)
direction;
49379 }
49381 {
49383 }
49385 {
49388 }
49389 return;
49390 }
49392 {
49394 {
49396 }
49398 }
49400 {
49403 }
49404 }
49406 {
49408 {
49410 }
49412 bool flag2 = !player.dead && player.active &&
base.Center.Distance(player.Center) < 320f;
49416 {
49418 if (
flag2 && Collision.CanHit(player,
this))
49419 {
49424 }
49425 }
49426 else
49427 {
49429 {
49431 velocity.X *= 0.9f;
49433 {
49434 velocity.X = 0f;
49435 }
49437 {
49439 }
49440 if (
ai[2] == (
float)(
num17 -
num18 / 2) && Main.netMode != 1 && !player.Hitbox.Intersects(
base.Hitbox) && Collision.CanHit(player,
this))
49441 {
49446 {
49448 }
49450 Vector2 v =
vector5 + Utils.RandomVector2(Main.rand, -0.8f, 0.8f);
49454 }
49456 {
49461 }
49462 return;
49463 }
49464 if (
velocity.
Y == 0f &&
flag2 && (player.Hitbox.Intersects(
base.Hitbox) || Collision.CanHit(player,
this)))
49465 {
49468 }
49469 }
49470 }
49472 {
49479 {
49484 }
49486 {
49488 }
49489 else if (
ai[2] == 0f)
49490 {
49492 {
49495 }
49496 }
49497 else
49498 {
49499 if (
ai[2] < 0f &&
ai[2] < (
float)(-
num23))
49500 {
49502 velocity.X *= 0.9f;
49504 {
49506 }
49507 else
49508 {
49511 {
49513 }
49514 }
49517 {
49519 }
49521 {
49524 Main.rand.NextFloat();
49526 {
49528 Dust
obj = Main.dust[Dust.NewDust(
vector6, 0, 0, 228)];
49530 obj.noGravity = true;
49532 obj.scale = 0.5f + Main.rand.NextFloat() * 0.5f;
49533 }
49534 }
49535 Lighting.AddLight(
base.Center, 0.9f, 0.75f, 0.1f);
49537 return;
49538 }
49539 if (
ai[2] < 0f &&
ai[2] >= (
float)(-
num23))
49540 {
49542 Lighting.AddLight(
base.Center, 0.9f, 0.75f, 0.1f);
49543 velocity.X *= 0.9f;
49545 {
49547 }
49548 else
49549 {
49552 {
49554 }
49555 }
49557 if (
num29 < 180f && (Main.rand.Next(3) == 0 ||
ai[2] % 3f == 0f))
49558 {
49561 Main.rand.NextFloat();
49563 {
49565 Dust
obj2 = Main.dust[Dust.NewDust(
vector8, 0, 0, 228)];
49567 obj2.noGravity = true;
49568 obj2.velocity =
vector9 * 4f;
49569 obj2.scale = 0.5f + Main.rand.NextFloat();
49570 }
49571 }
49573 if (Main.netMode == 2)
49574 {
49575 return;
49576 }
49580 {
49581 return;
49582 }
49585 {
49586 return;
49587 }
49590 {
49591 float x = ((float)
Math.
PI / 4f).ToRotationVector2().X;
49594 {
49596 }
49597 }
49598 if (((
player2.Center.X <
base.Center.X &&
direction < 0 && player2.direction > 0) || (player2.Center.X > base.Center.X &&
direction > 0 && player2.direction < 0)) &&
flag3 && (Collision.CanHitLine(
base.Center, 1, 1,
player2.Center, 1, 1) || Collision.CanHitLine(
base.Center -
Vector2.
UnitY * 16f, 1, 1,
player2.Center, 1, 1) || Collision.CanHitLine(
base.Center +
Vector2.
UnitY * 8f, 1, 1,
player2.Center, 1, 1)) && !
player2.creativeGodMode)
49599 {
49601 }
49602 return;
49603 }
49604 }
49605 }
49607 {
49609 {
49615 {
49617 }
49619 {
49621 }
49623 if (Main.netMode != 1)
49624 {
49626 if (
localAI[3] > (
float)Main.rand.Next(20, 180))
49627 {
49632 }
49633 }
49634 }
49635 else
49636 {
49638 knockBackResist = 0.35f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
49643 }
49645 {
49648 }
49650 {
49661 {
49664 }
49665 return;
49666 }
49668 {
49669 velocity.Y -= 0.2f;
49671 {
49672 velocity.Y = -10f;
49673 }
49674 if (Main.player[
target].Center.Y -
base.Center.Y > 200f)
49675 {
49678 if (Main.player[
target].Center.X >
base.Center.X)
49679 {
49681 }
49682 else
49683 {
49685 }
49686 }
49687 velocity.X *= 0.99f;
49688 return;
49689 }
49691 {
49693 {
49695 }
49697 {
49699 }
49700 velocity.Y *= 0.9f;
49701 velocity.X +=
ai[2] * 0.3f;
49703 {
49704 velocity.X = 10f;
49705 }
49707 {
49708 velocity.X = -10f;
49709 }
49711 if ((
ai[2] < 0f &&
num35 > 300f) || (
ai[2] > 0f &&
num35 < -300f))
49712 {
49715 }
49717 {
49720 }
49721 return;
49722 }
49724 {
49726 velocity.Y += 0.1f;
49728 {
49730 }
49733 bool flag4 =
false;
49735 {
49736 if (Main.tile[
l,
num37] ==
null)
49737 {
49739 }
49740 if (Main.tile[
l,
num37].active() && Main.tileSolid[Main.tile[
l,
num37].type])
49741 {
49743 }
49744 }
49746 {
49749 }
49750 else if (
ai[2] > 300f ||
base.Center.Y > Main.player[
target].Center.Y + 200f)
49751 {
49754 }
49755 }
49756 else
49757 {
49759 {
49761 center7.Y -= 70f;
49762 velocity.X *= 0.8f;
49765 {
49766 if (Main.netMode != 1)
49767 {
49769 }
49770 }
49771 else if (
ai[2] >= 90f)
49772 {
49775 }
49776 for (
int m = 0;
m < 2;
m++)
49777 {
49781 vector14 *= (float)Main.rand.Next(0, 100) * 0.1f;
49784 vector14 *= (float)Main.rand.Next(50, 90) * 0.1f;
49787 Main.dust[
num38].alpha = 100;
49788 if (Main.rand.Next(2) == 0)
49789 {
49790 Main.dust[
num38].noGravity =
true;
49791 Main.dust[
num38].scale += 0.3f;
49792 }
49793 }
49794 return;
49795 }
49799 {
49801 {
49804 }
49805 }
49806 else
49807 {
49809 {
49811 }
49813 {
49816 velocity.Y -= 3f;
49817 }
49818 }
49819 if (
target >= 0 && !Main.player[
target].dead && (Main.player[
target].Center -
base.Center).Length() > 800f)
49820 {
49823 }
49824 }
49825 if (Main.player[
target].dead)
49826 {
49828 if (Main.player[
target].dead)
49829 {
49831 }
49832 }
49833 }
49835 {
49842 {
49844 }
49846 {
49848 {
49852 }
49853 }
49854 else
49855 {
49856 if (
ai[2] < 0f &&
ai[2] > (
float)(-
num40))
49857 {
49859 velocity.X *= 0.9f;
49860 return;
49861 }
49862 if (
ai[2] == (
float)(-
num40))
49863 {
49868 {
49870 }
49873 return;
49874 }
49876 {
49879 {
49881 }
49883 {
49884 velocity.Y += 0.15f;
49886 {
49887 velocity.Y = 24f;
49888 }
49889 }
49893 {
49896 }
49897 return;
49898 }
49899 }
49900 }
49902 {
49906 {
49909 }
49911 {
49913 }
49915 {
49917 for (
int n = 0;
n < 200;
n++)
49918 {
49919 if (Main.npc[
n].active && Main.npc[
n].type == 516)
49920 {
49922 }
49923 }
49925 {
49927 }
49929 {
49933 }
49934 }
49935 else if (
ai[2] < 0f &&
ai[2] > (
float)(-
num43))
49936 {
49938 if (
ai[2] == (
float)(-
num43))
49939 {
49940 ai[2] = 180 + 30 * Main.rand.Next(10);
49941 }
49942 velocity.X *= 0.8f;
49944 {
49947 {
49949 Dust
obj3 = Main.dust[Dust.NewDust(
vector17, 0, 0, 259)];
49954 obj3.fadeIn = 0.7f;
49955 obj3.noGravity = true;
49956 }
49959 {
49960 velocity.X = 0f;
49961 }
49962 if (Main.netMode != 1)
49963 {
49965 }
49966 }
49967 return;
49968 }
49969 }
49971 {
49974 {
49975 int num47 = (int)
base.Center.X / 16 - 1;
49976 int num48 = (int)
base.Center.Y / 16 - 1;
49978 {
49982 return;
49983 }
49984 }
49987 if (Main.rand.Next(
num49) == 0)
49988 {
49991 dust4.noGravity = true;
49992 dust4.scale = 1f;
49993 dust4.noLight = true;
49995 dust4.position -= dust4.velocity * 5f;
49997 dust4.position.Y += 4f;
49999 }
50000 }
50002 {
50005 if (
localAI[0] >= 1200f && Main.netMode != 1)
50006 {
50007 int num50 = (int)
base.Center.X / 16 - 2;
50008 int num51 = (int)
base.Center.Y / 16 - 3;
50010 {
50014 return;
50015 }
50016 }
50019 if (Main.rand.Next(
num52) == 0)
50020 {
50023 obj4.noGravity = true;
50024 obj4.scale = 1f;
50025 obj4.noLight = true;
50027 }
50028 }
50030 {
50034 {
50035 int num54 = (int)(
base.Center.X - 22f) / 16;
50038 if (
WorldGen.InWorld(
num54,
num53) && tileSafely2.liquid == 0 && tileSafely.liquid == 0)
50039 {
50040 Lighting.AddLight(
num54,
num53, 1f, 0.95f, 0.8f);
50041 if (Main.rand.Next(30) == 0)
50042 {
50044 }
50045 }
50046 }
50047 else
50048 {
50049 int num55 = (int)(
base.Center.X + 14f) / 16;
50052 if (
WorldGen.InWorld(
num55,
num53) && tileSafely4.liquid == 0 && tileSafely3.liquid == 0)
50053 {
50054 Lighting.AddLight(
num55,
num53, 1f, 0.95f, 0.8f);
50055 if (Main.rand.Next(30) == 0)
50056 {
50058 }
50059 }
50060 }
50062 }
50063 else if (
type == 591)
50064 {
50067 {
50069 {
50071 if (
ai[2] == 0f && Main.rand.Next(30) == 0)
50072 {
50074 }
50075 }
50076 else
50077 {
50079 if (
ai[2] == 0f && Main.rand.Next(30) == 0)
50080 {
50082 }
50083 }
50084 }
50086 }
50087 bool flag5 =
false;
50088 bool flag6 =
false;
50090 {
50092 }
50094 {
50096 }
50097 if (Main.netMode != 1 &&
type == 198 && (
double)
life <= (double)
lifeMax * 0.55)
50098 {
50100 }
50101 if (Main.netMode != 1 &&
type == 348 && (
double)
life <= (
double)
lifeMax * 0.55)
50102 {
50104 }
50107 {
50109 if (
ai[3] == -120f)
50110 {
50123 {
50125 Main.dust[
num61].noGravity =
true;
50126 Main.dust[
num61].velocity.X *= 2f;
50127 }
50129 {
50131 Main.dust[
num63].noGravity =
true;
50132 Main.dust[
num63].velocity.X *= 2f;
50133 }
50135 }
50136 }
50137 bool flag7 =
false;
50140 {
50142 }
50143 bool flag9 =
false;
50146 {
50148 }
50151 {
50152 case 110:
50153 case 111:
50154 case 206:
50155 case 214:
50156 case 215:
50157 case 216:
50158 case 291:
50159 case 292:
50160 case 293:
50161 case 350:
50162 case 379:
50163 case 380:
50164 case 381:
50165 case 382:
50166 case 409:
50167 case 411:
50168 case 424:
50169 case 426:
50170 case 466:
50171 case 498:
50172 case 499:
50173 case 500:
50174 case 501:
50175 case 502:
50176 case 503:
50177 case 504:
50178 case 505:
50179 case 506:
50180 case 520:
50182 {
50184 }
50185 break;
50186 }
50188 {
50190 {
50192 }
50194 {
50196 }
50198 {
50200 }
50201 if (
ai[3] > (
float)(
num56 * 10))
50202 {
50204 }
50206 {
50208 }
50210 {
50212 }
50213 if (Main.player[
target].Hitbox.Intersects(
base.Hitbox))
50214 {
50216 }
50217 }
50218 if (
type == 463 && Main.netMode != 1)
50219 {
50221 {
50223 }
50225 {
50227 int num65 = Main.rand.Next(3, 6);
50231 {
50233 {
50237 {
50238 break;
50239 }
50240 }
50241 }
50243 {
50245 {
50249 {
50250 }
50254 }
50255 }
50258 {
50262 }
50265 {
50266 float num74 = Main.rand.Next(8, 13);
50270 {
50273 }
50276 {
50281 }
50283 }
50284 }
50285 }
50287 {
50289 {
50291 }
50292 else
50293 {
50294 knockBackResist = 0.25f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
50295 }
50296 }
50298 {
50299 knockBackResist = 0.45f * Main.GameModeInfo.KnockbackToEnemiesMultiplier;
50301 {
50303 }
50308 {
50310 {
50312 {
50314 break;
50315 }
50316 }
50318 {
50319 break;
50320 }
50321 }
50323 {
50325 {
50326 flag = true;
50327 velocity.Y = -4.6f;
50328 velocity.X *= 1.3f;
50329 }
50331 {
50333 }
50334 }
50335 if (
flag11 &&
ai[2] == 1f && !Main.player[
target].dead && Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
50336 {
50344 return;
50345 }
50348 }
50350 {
50351 flag = true;
50352 velocity.X *= 1.75f;
50353 velocity.Y -= 4.5f;
50354 if (
base.Center.Y - Main.player[
target].Center.Y > 20f)
50355 {
50356 velocity.Y -= 0.5f;
50357 }
50358 if (
base.Center.Y - Main.player[
target].Center.Y > 40f)
50359 {
50360 velocity.Y -= 1f;
50361 }
50362 if (
base.Center.Y - Main.player[
target].Center.Y > 80f)
50363 {
50364 velocity.Y -= 1.5f;
50365 }
50366 if (
base.Center.Y - Main.player[
target].Center.Y > 100f)
50367 {
50368 velocity.Y -= 1.5f;
50369 }
50371 {
50373 {
50374 velocity.X = -7f;
50375 }
50376 else
50377 {
50378 velocity.X = 7f;
50379 }
50380 }
50381 }
50383 {
50385 {
50389 {
50390 velocity.X *= 0.95f;
50391 if ((
double)velocity.X > -0.1 && (double)
velocity.
X < 0.1)
50392 {
50393 velocity.X = 0f;
50394 }
50395 return;
50396 }
50397 }
50398 else if (Main.player[
target].Center.Y >
base.Center.Y - 128f)
50399 {
50401 }
50402 }
50404 {
50406 {
50408 {
50410 }
50411 if ((
type == 489 ||
type == 586) && Main.rand.Next(800) == 0)
50412 {
50414 }
50415 if ((
type == 78 ||
type == 79 ||
type == 80 ||
type == 630) && Main.rand.Next(500) == 0)
50416 {
50418 }
50419 if (
type == 159 && Main.rand.Next(500) == 0)
50420 {
50422 }
50423 if (
type == 162 && Main.rand.Next(500) == 0)
50424 {
50426 }
50427 if (
type == 181 && Main.rand.Next(500) == 0)
50428 {
50430 }
50431 if (
type >= 269 &&
type <= 280 && Main.rand.Next(1000) == 0)
50432 {
50434 }
50435 }
50438 {
50440 }
50441 }
50443 {
50444 if (Main.IsItDay() && (
double)(
position.
Y / 16f) < Main.worldSurface &&
type != 624 &&
type != 631)
50445 {
50447 }
50449 {
50451 {
50454 {
50458 }
50459 }
50460 }
50461 else
50462 {
50464 }
50466 {
50468 }
50469 }
50471 {
50473 {
50474 velocity.X *= 0.95f;
50475 }
50477 {
50479 {
50481 }
50482 }
50484 {
50486 {
50487 velocity.X *= 0.99f;
50488 }
50489 velocity.X += 0.07f;
50491 {
50492 velocity.X = 6f;
50493 }
50494 }
50496 {
50498 {
50499 velocity.X *= 0.99f;
50500 }
50501 velocity.X -= 0.07f;
50503 {
50504 velocity.X = -6f;
50505 }
50506 }
50507 }
50508 else if (
type == 199)
50509 {
50511 {
50513 {
50515 }
50516 }
50518 {
50520 {
50521 velocity.X *= 0.8f;
50522 }
50523 velocity.X += 0.1f;
50525 {
50526 velocity.X = 4f;
50527 }
50528 }
50530 {
50532 {
50533 velocity.X *= 0.8f;
50534 }
50535 velocity.X -= 0.1f;
50537 {
50538 velocity.X = -4f;
50539 }
50540 }
50541 }
50543 {
50545 {
50547 {
50549 }
50550 }
50552 {
50554 {
50555 velocity.X *= 0.99f;
50556 }
50557 velocity.X += 0.07f;
50559 {
50560 velocity.X = 3f;
50561 }
50562 }
50564 {
50566 {
50567 velocity.X *= 0.99f;
50568 }
50569 velocity.X -= 0.07f;
50571 {
50572 velocity.X = -3f;
50573 }
50574 }
50575 }
50577 {
50579 {
50581 {
50583 }
50584 }
50586 {
50587 velocity.X += 0.07f;
50589 {
50590 velocity.X = 2f;
50591 }
50592 }
50594 {
50595 velocity.X -= 0.07f;
50597 {
50598 velocity.X = -2f;
50599 }
50600 }
50601 }
50602 else if (
type == 109)
50603 {
50605 {
50607 {
50609 }
50610 }
50612 {
50613 velocity.X += 0.04f;
50615 {
50616 velocity.X = 2f;
50617 }
50618 }
50620 {
50621 velocity.X -= 0.04f;
50623 {
50624 velocity.X = -2f;
50625 }
50626 }
50627 }
50629 {
50630 float num80 = 1.5f;
50631 if (
type == 181 && Main.remixWorld)
50632 {
50634 }
50635 else if (
type == 294)
50636 {
50638 }
50639 else if (
type == 295)
50640 {
50642 }
50643 else if (
type == 296)
50644 {
50646 }
50647 else if (
type == 201)
50648 {
50650 }
50651 else if (
type == 202)
50652 {
50654 }
50655 else if (
type == 203)
50656 {
50658 }
50659 else if (
type == 338)
50660 {
50662 }
50663 else if (
type == 339)
50664 {
50666 }
50667 else if (
type == 340)
50668 {
50670 }
50671 else if (
type == 385)
50672 {
50674 }
50675 else if (
type == 389)
50676 {
50678 }
50679 else if (
type == 462)
50680 {
50682 }
50683 else if (
type == 463)
50684 {
50686 }
50687 else if (
type == 466)
50688 {
50690 }
50691 else if (
type == 469)
50692 {
50694 }
50695 else if (
type == 480)
50696 {
50698 }
50699 else if (
type == 425)
50700 {
50702 }
50703 else if (
type == 429)
50704 {
50706 }
50707 else if (
type == 631)
50708 {
50710 }
50711 else if (
type == 586)
50712 {
50714 }
50716 {
50718 }
50720 {
50722 {
50724 }
50725 }
50727 {
50729 {
50730 velocity.X *= 0.9f;
50731 }
50733 {
50734 velocity.X *= 0.9f;
50735 }
50736 velocity.X += 0.07f;
50738 {
50739 velocity.X =
num80;
50740 }
50741 }
50743 {
50745 {
50746 velocity.X *= 0.9f;
50747 }
50749 {
50750 velocity.X *= 0.9f;
50751 }
50752 velocity.X -= 0.07f;
50754 {
50755 velocity.X = 0f -
num80;
50756 }
50757 }
50759 {
50760 velocity.X *= 0.9f;
50761 }
50762 }
50763 else if (
type >= 269 &&
type <= 280)
50764 {
50765 float num81 = 1.5f;
50767 {
50769 }
50771 {
50773 }
50775 {
50777 }
50779 {
50781 }
50783 {
50785 }
50787 {
50789 }
50791 {
50793 }
50795 {
50797 }
50799 {
50801 }
50803 {
50805 }
50807 {
50809 }
50811 {
50813 }
50816 {
50818 {
50820 }
50821 }
50823 {
50824 velocity.X += 0.07f;
50826 {
50827 velocity.X =
num81;
50828 }
50829 }
50831 {
50832 velocity.X -= 0.07f;
50834 {
50835 velocity.X = 0f -
num81;
50836 }
50837 }
50838 }
50839 else if (
type >= 305 &&
type <= 314)
50840 {
50841 float num82 = 1.5f;
50843 {
50845 }
50847 {
50849 }
50851 {
50853 }
50855 {
50857 }
50859 {
50861 }
50863 {
50865 {
50866 velocity.X *= 0.85f;
50867 if ((
double)velocity.X > -0.3 && (double)
velocity.
X < 0.3)
50868 {
50869 flag = true;
50870 velocity.Y = -7f;
50872 }
50873 }
50875 {
50876 velocity.X = (velocity.X * 10f +
num82 * (float)
direction) / 11f;
50877 }
50878 }
50880 {
50882 {
50884 }
50885 }
50887 {
50888 velocity.X += 0.07f;
50890 {
50891 velocity.X =
num82;
50892 }
50893 }
50895 {
50896 velocity.X -= 0.07f;
50898 {
50899 velocity.X = 0f -
num82;
50900 }
50901 }
50902 }
50904 {
50906 {
50908 {
50910 }
50911 }
50913 {
50914 velocity.X += 0.03f;
50916 {
50917 velocity.X = 0.5f;
50918 }
50919 }
50921 {
50922 velocity.X -= 0.03f;
50924 {
50925 velocity.X = -0.5f;
50926 }
50927 }
50928 }
50930 {
50932 float num84 = 0.05f;
50934 {
50937 }
50939 {
50941 }
50943 {
50945 {
50947 }
50948 }
50950 {
50951 velocity.X +=
num84;
50953 {
50954 velocity.X =
num83;
50955 }
50956 }
50958 {
50959 velocity.X -=
num84;
50961 {
50962 velocity.X = 0f -
num83;
50963 }
50964 }
50965 }
50966 else if (
type == 287)
50967 {
50969 float num86 = 0.2f;
50971 {
50973 {
50975 }
50976 }
50978 {
50979 velocity.X +=
num86;
50981 {
50982 velocity.X =
num85;
50983 }
50984 }
50986 {
50987 velocity.X -=
num86;
50989 {
50990 velocity.X = 0f -
num85;
50991 }
50992 }
50993 }
50994 else if (
type == 243)
50995 {
50997 float num88 = 0.07f;
51001 {
51003 {
51005 }
51006 }
51008 {
51009 velocity.X +=
num88;
51011 {
51012 velocity.X =
num87;
51013 }
51014 }
51016 {
51017 velocity.X -=
num88;
51019 {
51020 velocity.X = 0f -
num87;
51021 }
51022 }
51023 }
51024 else if (
type == 251)
51025 {
51027 float num90 = 0.08f;
51031 {
51033 {
51035 }
51036 }
51038 {
51039 velocity.X +=
num90;
51041 {
51042 velocity.X =
num89;
51043 }
51044 }
51046 {
51047 velocity.X -=
num90;
51049 {
51050 velocity.X = 0f -
num89;
51051 }
51052 }
51053 }
51054 else if (
type == 386)
51055 {
51057 {
51059 {
51060 velocity.X *= 0.8f;
51061 }
51062 }
51063 else
51064 {
51065 float num91 = 0.15f;
51066 float num92 = 1.5f;
51068 {
51070 {
51072 }
51073 }
51075 {
51076 velocity.X +=
num91;
51078 {
51079 velocity.X =
num92;
51080 }
51081 }
51083 {
51084 velocity.X -=
num91;
51086 {
51087 velocity.X = 0f -
num92;
51088 }
51089 }
51090 }
51091 }
51092 else if (
type == 460)
51093 {
51095 float num94 = 0.1f;
51097 {
51099 }
51101 {
51103 }
51105 {
51107 }
51109 {
51111 }
51113 {
51115 }
51117 {
51119 }
51121 {
51123 }
51125 {
51127 }
51130 {
51132 {
51134 }
51135 }
51137 {
51139 {
51140 velocity.X *= 0.93f;
51141 }
51142 velocity.X +=
num94;
51144 {
51145 velocity.X =
num93;
51146 }
51147 }
51149 {
51151 {
51152 velocity.X *= 0.93f;
51153 }
51154 velocity.X -=
num94;
51156 {
51157 velocity.X = 0f -
num93;
51158 }
51159 }
51160 }
51162 {
51163 float num95 = 2.5f;
51167 {
51171 {
51174 }
51175 else if (
num97 > 2f)
51176 {
51179 }
51180 }
51181 else if (
num97 > 2.75f)
51182 {
51185 }
51186 else if ((
double)
num97 > 2.25)
51187 {
51190 }
51192 {
51194 {
51196 }
51198 {
51200 }
51201 }
51203 {
51206 {
51208 }
51210 }
51212 {
51214 }
51216 {
51218 }
51220 {
51221 velocity.X *= 0.99f;
51222 velocity.X += (float)
direction * 0.025f;
51223 }
51224 }
51226 {
51231 {
51235 }
51236 else if (
type == 415)
51237 {
51241 }
51242 else if (
type == 419)
51243 {
51247 }
51248 else if (
type == 518)
51249 {
51253 }
51254 else if (
type == 532)
51255 {
51259 }
51261 {
51263 {
51265 }
51266 }
51268 {
51271 {
51272 velocity.X =
num99;
51273 }
51274 }
51276 {
51279 {
51280 velocity.X = 0f -
num99;
51281 }
51282 }
51283 }
51285 {
51287 {
51292 {
51294 {
51296 }
51297 }
51299 {
51300 velocity.X += 0.07f;
51302 {
51304 }
51305 }
51307 {
51308 velocity.X -= 0.07f;
51310 {
51311 velocity.X = 0f -
num102;
51312 }
51313 }
51314 if (
velocity.
Y == 0f && (!Main.IsItDay() || (double)
position.
Y > Main.worldSurface * 16.0) && !Main.player[
target].dead)
51315 {
51319 {
51321 }
51323 {
51324 velocity.X *= 0.7f;
51326 }
51327 }
51328 }
51329 else
51330 {
51333 velocity.X *= 0.9f;
51335 {
51336 velocity.X = 0f;
51337 }
51339 if (
ai[2] >= 20f ||
velocity.
Y != 0f || (Main.IsItDay() && (double)
position.
Y < Main.worldSurface * 16.0))
51340 {
51342 }
51343 }
51344 }
51346 {
51349 {
51351 }
51353 {
51355 }
51357 {
51359 }
51361 {
51363 }
51365 {
51367 }
51369 {
51371 }
51373 {
51375 }
51377 {
51379 }
51381 {
51383 }
51385 {
51388 if ((
double)
num105 > 1.5)
51389 {
51391 }
51394 }
51396 {
51398 }
51400 {
51402 {
51404 }
51405 }
51407 {
51408 velocity.X += 0.07f;
51410 {
51412 }
51413 }
51415 {
51416 velocity.X -= 0.07f;
51418 {
51419 velocity.X = 0f -
num104;
51420 }
51421 }
51422 }
51424 {
51425 Lighting.AddLight((
int)base.Center.X / 16, (int)
base.Center.Y / 16, 0.2f, 0.1f, 0f);
51426 }
51427 else if (
type == 520)
51428 {
51429 Lighting.AddLight(
base.Top +
new Vector2(0f, 20f), 0.3f, 0.3f, 0.7f);
51430 }
51431 else if (
type == 525)
51432 {
51435 }
51436 else if (
type == 526)
51437 {
51440 }
51441 else if (
type == 527)
51442 {
51445 }
51446 else if (
type == 415)
51447 {
51450 {
51452 {
51454 break;
51455 }
51456 }
51457 }
51458 else if (
type == 258)
51459 {
51461 {
51465 {
51466 velocity.X *= 0.95f;
51467 }
51469 {
51470 velocity.X *= 0.95f;
51471 }
51473 {
51474 velocity.X -= 0.1f;
51475 }
51477 {
51478 velocity.X += 0.1f;
51479 }
51480 }
51482 {
51483 flag = true;
51484 velocity.Y = -7f;
51485 }
51486 }
51487 else if (
type == 425)
51488 {
51490 {
51493 }
51495 {
51497 }
51499 {
51502 if (Collision.CanHit(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
51503 {
51511 {
51512 velocity.X *= 0.9f;
51513 }
51515 {
51516 velocity.X *= 0.9f;
51517 }
51519 {
51521 }
51523 {
51525 }
51527 {
51529 }
51531 {
51532 velocity.X = 0f -
num110;
51533 }
51535 {
51536 velocity.Y *= 0.8f;
51537 }
51539 {
51540 velocity.Y *= 0.8f;
51541 }
51543 {
51545 }
51547 {
51549 }
51550 }
51551 if (Main.rand.Next(3) == 0)
51552 {
51557 obj5.noGravity = true;
51559 obj5.customData = this;
51561 }
51563 {
51565 {
51567 {
51568 velocity.X -= 0.15f;
51569 }
51570 else
51571 {
51572 velocity.X += 0.15f;
51573 }
51575 {
51576 velocity.Y -= 0.15f;
51577 }
51578 else
51579 {
51580 velocity.Y += 0.15f;
51581 }
51582 }
51583 }
51584 }
51586 {
51587 flag = true;
51588 velocity.Y = -5f;
51590 }
51592 {
51594 }
51599 {
51604 }
51606 {
51609 }
51610 if (Main.netMode != 1 &&
ai[3] == (
float)
num114)
51611 {
51618 {
51620 }
51624 {
51628 }
51631 {
51634 }
51635 }
51636 }
51637 else if (
type == 427)
51638 {
51640 {
51643 }
51644 else
51645 {
51647 }
51649 {
51652 if (Collision.CanHit(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
51653 {
51657 {
51658 velocity.X *= 0.98f;
51659 }
51661 {
51662 velocity.X *= 0.98f;
51663 }
51665 {
51666 velocity.X -= 0.015f;
51667 }
51669 {
51670 velocity.X += 0.015f;
51671 }
51673 {
51674 velocity.X = 6f;
51675 }
51677 {
51678 velocity.X = -6f;
51679 }
51681 {
51682 velocity.Y *= 0.98f;
51683 }
51685 {
51686 velocity.Y *= 0.98f;
51687 }
51689 {
51690 velocity.Y -= 0.15f;
51691 }
51693 {
51694 velocity.Y += 0.15f;
51695 }
51696 }
51698 {
51700 {
51702 {
51703 velocity.X -= 0.05f;
51704 }
51705 else
51706 {
51707 velocity.X += 0.05f;
51708 }
51710 {
51711 velocity.Y -= 0.05f;
51712 }
51713 else
51714 {
51715 velocity.Y += 0.05f;
51716 }
51717 }
51718 }
51719 }
51721 {
51722 flag = true;
51723 velocity.Y = -5f;
51725 }
51726 }
51727 else if (
type == 426)
51728 {
51733 {
51734 velocity.Y *= 0.85f;
51736 {
51737 velocity.Y = -0.4f;
51738 }
51739 }
51741 {
51744 if (Collision.CanHit(
base.Center, 0, 0, Main.player[
target].Center, 0, 0))
51745 {
51748 {
51749 velocity.X *= 0.98f;
51750 }
51752 {
51753 velocity.X *= 0.98f;
51754 }
51756 {
51758 }
51760 {
51762 }
51764 {
51766 }
51768 {
51769 velocity.X = 0f -
num123;
51770 }
51771 }
51772 }
51774 {
51775 flag = true;
51776 velocity.Y = 0f -
num125;
51777 }
51779 {
51781 {
51783 {
51784 velocity.X -= 0.1f;
51785 }
51786 else
51787 {
51788 velocity.X += 0.1f;
51789 }
51791 {
51792 velocity.Y -= 0.1f;
51793 }
51794 else
51795 {
51796 velocity.Y += 0.1f;
51797 }
51798 }
51799 }
51800 if (Main.rand.Next(6) == 0 &&
ai[1] <= 20f)
51801 {
51804 obj6.velocity = obj6.velocity / 4f +
velocity / 2f;
51805 obj6.scale = 0.6f;
51806 obj6.noLight = true;
51808 }
51810 {
51812 int num128 = Utils.SelectRandom<
int>(Main.rand, 161, 229);
51815 obj7.scale = 1.2f;
51816 obj7.noLight = true;
51818 }
51819 if (Main.rand.Next(6) == 0)
51820 {
51822 Dust
dust5 = Main.dust[Dust.NewDust(
base.Center, 2, 2, 229)];
51824 dust5.velocity.X = 0f;
51825 if (
dust5.velocity.Y < 0f)
51826 {
51827 dust5.velocity.Y = 0f;
51828 }
51829 dust5.noGravity = true;
51830 dust5.scale = 1f;
51831 dust5.noLight = true;
51833 }
51834 }
51835 else if (
type == 185)
51836 {
51838 {
51841 }
51843 {
51845 }
51846 }
51847 else if (
type == 428)
51848 {
51850 {
51852 }
51853 else
51854 {
51856 }
51857 }
51858 if (
type == 159 && Main.netMode != 1)
51859 {
51864 {
51866 }
51867 }
51868 if (Main.netMode != 1)
51869 {
51870 if (Main.expertMode &&
target >= 0 && (
type == 163 ||
type == 238 ||
type == 236 ||
type == 237) && Collision.CanHit(
base.Center, 1, 1, Main.player[
target].Center, 1, 1))
51871 {
51874 {
51875 localAI[0] -= Main.rand.Next(20, 60);
51877 {
51879 }
51880 }
51881 if (
localAI[0] > (
float)Main.rand.Next(180, 900))
51882 {
51889 }
51890 }
51892 {
51895 {
51896 case 164:
51898 break;
51899 case 236:
51901 break;
51902 case 163:
51904 break;
51905 case 239:
51907 break;
51908 case 530:
51910 break;
51911 }
51913 {
51915 }
51916 }
51917 }
51919 {
51920 if (
justHit && Main.rand.Next(3) == 0)
51921 {
51922 ai[2] -= Main.rand.Next(30);
51923 }
51925 {
51927 }
51929 {
51931 }
51933 float num132 = Main.rand.Next(30, 900);
51937 {
51942 num133 += (float)Main.rand.Next(-40, 41);
51943 num134 += (float)Main.rand.Next(-40, 41);
51951 vector33.X +=
num133 * 3f;
51952 vector33.Y +=
num134 * 3f;
51955 }
51956 }
51958 {
51960 {
51961 ai[2] -= Main.rand.Next(30);
51962 }
51964 {
51966 }
51968 {
51970 }
51972 float num138 = Main.rand.Next(60, 1800);
51976 {
51981 num139 += (float)Main.rand.Next(-40, 41);
51982 num140 += (float)Main.rand.Next(-30, 0);
51990 vector34.X +=
num139 * 3f;
51991 vector34.Y +=
num140 * 3f;
51994 }
51995 }
51997 {
51999 {
52001 }
52002 else
52003 {
52005 {
52007 }
52009 {
52011 }
52013 {
52015 }
52017 {
52028 {
52032 {
52034 {
52037 {
52039 }
52041 {
52046 break;
52047 }
52048 }
52049 }
52050 }
52051 }
52053 {
52055 }
52056 }
52057 }
52059 {
52061 {
52063 }
52064 else
52065 {
52067 {
52069 }
52071 {
52073 }
52074 if (
ai[2] == 20f && Main.netMode != 1)
52075 {
52076 ai[2] = -10 + Main.rand.Next(3) * -10;
52078 }
52079 }
52080 }
52082 {
52089 {
52094 {
52096 }
52097 }
52099 {
52101 }
52103 {
52106 }
52109 {
52111 }
52113 {
52115 }
52117 {
52119 }
52121 {
52123 }
52125 {
52127 }
52129 {
52131 }
52133 {
52135 }
52137 {
52139 }
52141 {
52143 }
52145 {
52147 }
52149 {
52151 }
52153 {
52155 }
52157 {
52159 }
52161 {
52163 }
52165 {
52167 }
52169 {
52171 }
52173 {
52175 }
52178 {
52180 {
52182 }
52184 }
52187 {
52189 }
52191 {
52193 }
52195 {
52197 }
52199 {
52201 }
52203 {
52205 {
52207 }
52209 {
52211 {
52213 }
52216 {
52218 }
52220 {
52222 }
52224 {
52226 }
52228 {
52230 }
52232 {
52234 }
52236 {
52238 }
52240 {
52242 }
52244 {
52246 }
52248 {
52250 }
52252 {
52254 }
52256 {
52258 }
52260 {
52262 }
52264 {
52266 }
52268 {
52270 }
52273 {
52274 chaserPosition2.Y -= 14f;
52275 }
52277 {
52278 chaserPosition2.Y -= 10f;
52279 }
52281 {
52282 chaserPosition2.Y -= 10f;
52283 }
52285 {
52286 chaserPosition2.Y += 6f;
52287 }
52289 {
52290 chaserPosition2.Y = position.Y + 20f;
52291 }
52293 {
52294 chaserPosition2.Y -= 8f;
52295 }
52297 {
52300 }
52304 {
52306 }
52308 {
52310 }
52312 {
52314 }
52316 {
52318 }
52320 {
52322 }
52324 {
52326 }
52328 {
52330 }
52332 {
52334 }
52337 {
52338 num160 += (float)Main.rand.Next(-40, 41) * 0.2f;
52339 num162 += (float)Main.rand.Next(-40, 41) * 0.2f;
52340 }
52342 {
52343 num160 += (float)Main.rand.Next(-100, 101) * 0.4f;
52344 num162 += (float)Main.rand.Next(-100, 101) * 0.4f;
52345 num160 *= (float)Main.rand.Next(85, 116) * 0.01f;
52346 num162 *= (float)Main.rand.Next(85, 116) * 0.01f;
52348 {
52349 num160 += (float)Main.rand.Next(-100, 101) * 0.6f;
52350 num162 += (float)Main.rand.Next(-100, 101) * 0.6f;
52351 num160 *= (float)Main.rand.Next(85, 116) * 0.015f;
52352 num162 *= (float)Main.rand.Next(85, 116) * 0.015f;
52353 }
52354 }
52355 else if (
type == 481)
52356 {
52357 num160 += (float)Main.rand.Next(-40, 41) * 0.4f;
52358 num162 += (float)Main.rand.Next(-40, 41) * 0.4f;
52359 }
52360 else if (
type >= 498 &&
type <= 506)
52361 {
52362 num160 += (float)Main.rand.Next(-40, 41) * 0.3f;
52363 num162 += (float)Main.rand.Next(-40, 41) * 0.3f;
52364 }
52365 else if (
type == 426)
52366 {
52367 num160 += (float)Main.rand.Next(-30, 31) * 0.3f;
52368 num162 += (float)Main.rand.Next(-30, 31) * 0.3f;
52369 }
52370 else if (
type != 292)
52371 {
52372 num160 += (float)Main.rand.Next(-40, 41);
52373 num162 += (float)Main.rand.Next(-40, 41);
52374 }
52383 {
52385 }
52387 {
52389 }
52391 {
52393 }
52395 {
52397 }
52399 {
52401 }
52403 {
52405 }
52407 {
52409 }
52411 {
52414 }
52416 {
52419 }
52421 {
52424 }
52426 {
52429 }
52431 {
52434 }
52436 {
52439 }
52441 {
52443 }
52445 {
52447 }
52449 {
52452 }
52454 {
52457 }
52459 {
52462 }
52464 {
52467 }
52469 {
52472 }
52474 {
52477 }
52479 {
52482 }
52484 {
52487 }
52489 {
52492 }
52494 {
52498 {
52502 }
52503 }
52507 {
52509 }
52511 {
52514 {
52518 }
52519 }
52520 chaserPosition2.X +=
num160;
52521 chaserPosition2.Y +=
num162;
52523 {
52525 }
52527 {
52529 }
52530 if (Main.netMode != 1)
52531 {
52533 {
52535 {
52545 }
52546 }
52547 else if (
type == 411)
52548 {
52549 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(),
chaserPosition2.X,
chaserPosition2.Y,
num160,
num162,
num165,
num164, 0f, Main.myPlayer, 0f,
whoAmI);
52550 }
52551 else if (
type == 424)
52552 {
52554 {
52555 Projectile.NewProjectile(
GetSpawnSource_ForProjectile(), base.Center.X - (float)(
spriteDirection * 4), base.Center.Y + 6f, (float)(-3 + 2 *
num167) * 0.15f, (float)(-Main.rand.Next(0, 3)) * 0.2f - 0.1f,
num165,
num164, 0f, Main.myPlayer, 0f,
whoAmI);
52556 }
52557 }
52558 else if (
type == 409)
52559 {
52562 }
52563 else
52564 {
52566 }
52567 }
52569 {
52571 {
52573 }
52574 else
52575 {
52577 }
52578 }
52580 {
52582 }
52584 {
52586 }
52587 else
52588 {
52590 }
52591 }
52593 {
52596 }
52598 {
52599 velocity.X *= 0.9f;
52601 }
52602 }
52603 if (
type == 468 && !Main.eclipse)
52604 {
52606 }
52608 {
52611 {
52613 }
52614 if (Main.player[
target].stealth == 0f && Main.player[
target].itemAnimation == 0)
52615 {
52617 }
52619 {
52625 num170 += (float)Main.rand.Next(-40, 41);
52626 num172 += (float)Main.rand.Next(-40, 41);
52630 {
52632 }
52634 {
52636 }
52638 {
52640 }
52642 {
52644 }
52646 {
52648 }
52650 {
52652 }
52654 {
52656 velocity.X *= 0.5f;
52663 {
52665 {
52667 }
52668 else
52669 {
52671 }
52672 }
52674 {
52676 }
52678 {
52680 }
52681 else
52682 {
52684 }
52685 }
52686 }
52687 }
52689 {
52694 {
52697 }
52698 else if (
type == 215)
52699 {
52702 }
52703 else if (
type == 381 ||
type == 382)
52704 {
52707 }
52708 else if (
type == 520)
52709 {
52713 }
52714 else if (
type == 411)
52715 {
52718 }
52719 else if (
type == 409)
52720 {
52723 }
52724 else if (
type == 426)
52725 {
52729 }
52732 {
52735 }
52737 {
52740 }
52742 {
52744 {
52746 }
52747 }
52749 {
52752 {
52754 }
52755 }
52757 {
52760 {
52761 velocity.X = 0f -
num175;
52762 }
52763 }
52764 }
52766 {
52769 {
52772 }
52773 }
52774 }
52775 if (
type == 109 && Main.netMode != 1 && !Main.player[
target].dead)
52776 {
52778 {
52780 }
52783 {
52785 if (Main.rand.Next(5) != 0 ||
AnyNPCs(378))
52786 {
52788 int num179 = Main.rand.Next(-8, -5);
52790 Main.projectile[
num180].timeLeft = 300;
52792 }
52793 else
52794 {
52797 NetMessage.SendData(23, -1, -1,
null,
number);
52798 }
52799 }
52800 }
52802 {
52811 {
52813 {
52815 continue;
52816 }
52818 {
52820 break;
52821 }
52823 {
52825 }
52826 }
52828 {
52829 velocity.Y = 0f;
52830 }
52832 {
52833 return;
52834 }
52835 }
52837 {
52839 }
52841 {
52844 {
52846 }
52848 {
52850 }
52856 {
52858 {
52860 }
52862 {
52864 }
52866 {
52868 }
52870 {
52872 }
52874 {
52876 }
52878 {
52880 }
52881 if ((
float)(
num189 * 16) <
vector39.X + (
float)
width && (
float)(
num189 * 16 + 16) >
vector39.X && ((Main.tile[
num189,
num190].nactive() && !Main.tile[
num189,
num190].topSlope() && !Main.tile[
num189,
num190 - 1].topSlope() && Main.tileSolid[Main.tile[
num189,
num190].type] && !Main.tileSolidTop[Main.tile[
num189,
num190].type]) || (Main.tile[
num189,
num190 - 1].halfBrick() && Main.tile[
num189,
num190 - 1].nactive())) && (!Main.tile[
num189,
num190 - 1].nactive() || !Main.tileSolid[Main.tile[
num189,
num190 - 1].type] || Main.tileSolidTop[Main.tile[
num189,
num190 - 1].type] || (Main.tile[
num189,
num190 - 1].halfBrick() && (!Main.tile[
num189,
num190 - 4].nactive() || !Main.tileSolid[Main.tile[
num189,
num190 - 4].type] || Main.tileSolidTop[Main.tile[
num189,
num190 - 4].type]))) && (!Main.tile[
num189,
num190 - 2].nactive() || !Main.tileSolid[Main.tile[
num189,
num190 - 2].type] || Main.tileSolidTop[Main.tile[
num189,
num190 - 2].type]) && (!Main.tile[
num189,
num190 - 3].nactive() || !Main.tileSolid[Main.tile[
num189,
num190 - 3].type] || Main.tileSolidTop[Main.tile[
num189,
num190 - 3].type]) && (!Main.tile[
num189 -
num188,
num190 - 3].nactive() || !Main.tileSolid[Main.tile[
num189 -
num188,
num190 - 3].type]))
52882 {
52885 {
52887 }
52889 {
52891 }
52893 {
52897 {
52899 }
52901 {
52905 {
52907 }
52908 else
52909 {
52911 }
52912 }
52913 }
52914 }
52915 }
52916 }
52918 {
52922 {
52924 }
52926 {
52928 }
52930 {
52932 }
52934 {
52936 }
52938 {
52940 }
52942 {
52944 }
52946 {
52948 }
52950 {
52952 }
52954 {
52956 }
52959 {
52963 {
52965 bool flag24 = Main.player[
target].ZoneGraveyard && Main.rand.Next(60) == 0;
52966 if ((!Main.bloodMoon || Main.getGoodWorld) && !
flag24 &&
flag23)
52967 {
52969 }
52970 velocity.X = 0.5f * (float)(-
direction);
52973 {
52975 }
52978 {
52980 }
52982 {
52984 }
52988 {
52991 }
52993 {
52995 }
52997 if ((Main.netMode != 1 || !
flag25) &&
flag25 && Main.netMode != 1)
52998 {
53000 {
53002 if (Main.netMode == 2)
53003 {
53004 NetMessage.SendData(17, -1, -1,
null, 0,
num194,
num195 - 1);
53005 }
53006 }
53007 else
53008 {
53010 {
53013 {
53016 }
53017 if (Main.netMode == 2 &&
flag26)
53018 {
53020 }
53021 }
53023 {
53026 {
53029 }
53030 if (Main.netMode == 2 &&
flag27)
53031 {
53032 NetMessage.SendData(19, -1, -1,
null, 4,
num194,
num195 - 1);
53033 }
53034 }
53035 }
53036 }
53037 }
53038 }
53039 else
53040 {
53043 {
53045 }
53047 {
53049 {
53051 {
53052 velocity.Y = -8f;
53054 }
53055 else
53056 {
53057 velocity.Y = -7f;
53059 }
53060 }
53062 {
53064 {
53065 velocity.Y = -8f;
53068 {
53072 }
53073 }
53074 else
53075 {
53076 velocity.Y = -6f;
53077 }
53079 }
53081 {
53082 velocity.Y = -5f;
53084 }
53086 {
53087 velocity.Y = -8f;
53088 velocity.X *= 1.5f;
53090 }
53092 {
53095 }
53097 {
53098 velocity.Y = -5f;
53099 }
53100 if (
velocity.
Y == 0f && (Main.expertMode ||
type == 586) && Main.player[
target].Bottom.Y < base.Top.Y &&
Math.
Abs(
base.Center.X - Main.player[
target].Center.X) < (float)(Main.player[
target].width * 3) && Collision.CanHit(
this, Main.player[
target]))
53101 {
53103 {
53104 int num199 = (int)((
base.Bottom.Y - 16f - Main.player[
target].Bottom.Y) / 16f);
53105 if (
num199 < 14 && Collision.CanHit(
this, Main.player[
target]))
53106 {
53108 {
53109 velocity.Y = -8.8f;
53110 }
53112 {
53113 velocity.Y = -9.2f;
53114 }
53116 {
53117 velocity.Y = -9.7f;
53118 }
53120 {
53121 velocity.Y = -10.3f;
53122 }
53124 {
53125 velocity.Y = -10.6f;
53126 }
53127 else
53128 {
53129 velocity.Y = -11f;
53130 }
53131 }
53132 }
53134 {
53137 {
53138 velocity.Y = -7.9f;
53139 }
53140 else
53141 {
53143 int num202 = (int)(
base.Bottom.Y / 16f) - 1;
53145 {
53147 {
53148 velocity.Y = -7.9f;
53149 break;
53150 }
53151 }
53152 }
53153 }
53154 }
53155 }
53157 {
53161 {
53164 }
53166 {
53168 {
53170 velocity.X *= 2f;
53172 {
53173 velocity.X = 8f;
53174 }
53176 {
53177 velocity.X = -8f;
53178 }
53179 velocity.Y = -4.5f;
53181 {
53182 velocity.Y -= 2f;
53183 }
53185 {
53186 velocity.Y -= 2f;
53187 }
53189 {
53190 velocity.Y -= 2f;
53191 }
53192 }
53193 else
53194 {
53195 velocity.X *= 2f;
53197 {
53198 velocity.X = 3f;
53199 }
53201 {
53202 velocity.X = -3f;
53203 }
53204 velocity.Y = -4f;
53205 }
53207 }
53208 }
53210 {
53211 velocity.Y *= 1.1f;
53212 }
53214 {
53216 velocity.Y = -4f;
53218 }
53220 {
53221 velocity.X *= 1.2f;
53222 velocity.Y *= 1.1f;
53223 }
53225 {
53226 velocity.X *= 1.3f;
53227 velocity.Y *= 1.1f;
53228 }
53229 }
53230 }
53232 {
53235 }
53236 if (Main.netMode != 1 &&
type == 120 &&
ai[3] >= (
float)
num56)
53237 {
53242 {
53243 position.X = chosenTile.X * 16f - (float)(
width / 2);
53244 position.Y = chosenTile.Y * 16f - (float)
height;
53247 }
53248 }
53249 }
static float Lerp(float value1, float value2, float amount)
static float Clamp(float value, float min, float max)
static double Sqrt(double d)
static double Abs(double value)
static int Sign(decimal value)
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 DirectionFrom(Vector2 Source)
float Distance(Vector2 Other)
Vector2 DirectionTo(Vector2 Destination)
static void NotifyProgressionEvent(int eventID)
static readonly LegacySoundStyle Item8
static int CountNPCS(int Type)
void EncourageDespawn(int despawnTime)
void TargetClosest(bool faceTarget=true)
float takenDamageMultiplier
bool AI_003_Gnomes_ShouldTurnToStone()
void CountKillForBannersAndDropThem()
static bool AnyNPCs(int Type)
bool AI_AttemptToFindTeleportSpot(ref Vector2 chosenTile, int targetTileX, int targetTileY, int rangeFromTargetTile=20, int telefragPreventionDistanceInTiles=5, int solidTileCheckFluff=1, bool solidTileCheckCentered=false, bool teleportInAir=false)
IEntitySource GetSpawnSourceForNPCFromNPCAI()
float shimmerTransparency
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 Transform(int newType)
IEntitySource GetSpawnSource_ForProjectile()
bool IsNPCValidForBestiaryKillCredit()
bool NPCCanStickToWalls()
static bool DespawnEncouragement_AIStyle3_Fighters_CanBeBusyWithAction(int npcID)
static bool DespawnEncouragement_AIStyle3_Fighters_NotDiscouraged(int npcID, Vector2 position, NPC npcInstance)
static float Distance(Vector2 value1, Vector2 value2)