51343 {
51344
51345
51346 bool flag = (double)
j < Main.rockLayer;
51347 bool flag2 =
j < Main.UnderworldLayer;
51348 if (Main.remixWorld)
51349 {
51350 flag = (double)
j > Main.rockLayer &&
j < Main.UnderworldLayer;
51351 flag2 = (double)
j > Main.worldSurface && (
double)
j < Main.rockLayer;
51352 }
51354 bool flag3 = style >= 34 && style <= 36;
51355 switch (style)
51356 {
51357 case 4:
51358 case 5:
51359 case 6:
51361 break;
51362 case 7:
51363 case 8:
51364 case 9:
51366 break;
51367 default:
51368 if (style >= 10 && style <= 12)
51369 {
51371 }
51372 else if (style >= 13 && style <= 15)
51373 {
51375 }
51376 else if (style >= 16 && style <= 18)
51377 {
51379 }
51380 else if (style >= 19 && style <= 21)
51381 {
51383 }
51384 else if (style >= 22 && style <= 24)
51385 {
51387 }
51388 else if (style >= 25 && style <= 27)
51389 {
51391 }
51392 else if (style >= 28 && style <= 30)
51393 {
51394 if (Main.hardMode)
51395 {
51397 }
51398 }
51399 else if (style >= 31 && style <= 33)
51400 {
51402 }
51403 else if (style >= 34 && style <= 36)
51404 {
51406 }
51407 break;
51408 case 0:
51409 case 1:
51410 case 2:
51411 case 3:
51412 break;
51413 }
51417 {
51418 return;
51419 }
51421 {
51422 if (Main.netMode != 1)
51423 {
51425 }
51426 return;
51427 }
51428 if (
genRand.Next(35) == 0 && Main.wallDungeon[Main.tile[i,
j].wall] && (double)
j > Main.worldSurface)
51429 {
51431 return;
51432 }
51433 if (Main.getGoodWorld &&
genRand.Next(6) == 0)
51434 {
51435 Projectile.NewProjectile(
GetProjectileSource_TileBreak(i,
j), i * 16 + 16,
j * 16 + 8, (float)Main.rand.Next(-100, 101) * 0.002f, 0
f, 28, 0, 0
f, Main.myPlayer, 16
f, 16
f);
51436 return;
51437 }
51438 if (Main.remixWorld && Main.netMode != 1 &&
genRand.Next(5) == 0)
51439 {
51440 Player player = Main.player[
Player.FindClosest(
new Vector2((
float)(i * 16), (
float)(
j * 16)), 16, 16)];
51441 if (Main.rand.Next(2) == 0)
51442 {
51444 }
51445 else if (player.ZoneJungle)
51446 {
51448 num12 =
NPC.NewNPC(
NPC.GetSpawnSourceForNaturalSpawn(),
x2 * 16 + 16,
y2 * 16 + 32, -10);
51450 {
51451 Main.npc[
num12].ai[1] = 75
f;
51452 Main.npc[
num12].netUpdate =
true;
51453 }
51454 }
51455 else if ((
double)
j > Main.rockLayer &&
j < Main.maxTilesY - 350)
51456 {
51458 num13 = ((Main.rand.Next(9) == 0) ?
NPC.NewNPC(
NPC.GetSpawnSourceForNaturalSpawn(),
x2 * 16 + 16,
y2 * 16 + 32, -7) : ((Main.rand.Next(7) == 0) ?
NPC.NewNPC(
NPC.GetSpawnSourceForNaturalSpawn(),
x2 * 16 + 16,
y2 * 16 + 32, -8) : ((Main.rand.Next(6) == 0) ?
NPC.NewNPC(
NPC.GetSpawnSourceForNaturalSpawn(),
x2 * 16 + 16,
y2 * 16 + 32, -9) : ((Main.rand.Next(3) != 0) ?
NPC.NewNPC(
NPC.GetSpawnSourceForNaturalSpawn(),
x2 * 16 + 16,
y2 * 16 + 32, 1) :
NPC.NewNPC(
NPC.GetSpawnSourceForNaturalSpawn(),
x2 * 16 + 16,
y2 * 16 + 32, -3)))));
51460 {
51461 Main.npc[
num13].ai[1] = 75
f;
51462 Main.npc[
num13].netUpdate =
true;
51463 }
51464 }
51465 else if ((
double)
j > Main.worldSurface && (
double)
j <= Main.rockLayer)
51466 {
51468 num14 =
NPC.NewNPC(
NPC.GetSpawnSourceForNaturalSpawn(),
x2 * 16 + 16,
y2 * 16 + 32, -6);
51470 {
51471 Main.npc[
num14].ai[1] = 75
f;
51472 Main.npc[
num14].netUpdate =
true;
51473 }
51474 }
51475 else
51476 {
51478 }
51479 return;
51480 }
51481 if (Main.remixWorld && (
double)i > (
double)Main.maxTilesX * 0.37 && (
double)i < (
double)Main.maxTilesX * 0.63 &&
j > Main.maxTilesY - 220)
51482 {
51483 int stack = Main.rand.Next(20, 41);
51485 return;
51486 }
51487 if (
genRand.Next(45) == 0 || (Main.rand.Next(45) == 0 && Main.expertMode))
51488 {
51489 if ((
double)
j < Main.worldSurface)
51490 {
51493 {
51495 }
51497 {
51499 }
51501 {
51503 }
51505 {
51507 }
51509 {
51511 }
51513 {
51515 }
51517 {
51519 }
51521 {
51523 }
51524 }
51526 {
51529 {
51531 }
51533 {
51535 }
51537 {
51539 }
51541 {
51543 }
51545 {
51547 }
51549 {
51551 }
51553 {
51555 }
51557 {
51559 }
51561 {
51563 }
51565 {
51567 }
51568 }
51570 {
51573 {
51575 }
51577 {
51579 }
51581 {
51583 }
51585 {
51587 }
51589 {
51591 }
51593 {
51595 }
51597 {
51599 }
51601 {
51603 }
51605 {
51607 }
51609 {
51611 }
51613 {
51615 }
51617 {
51619 }
51621 {
51623 }
51625 {
51627 }
51629 {
51631 }
51632 }
51633 else
51634 {
51637 {
51639 }
51641 {
51643 }
51645 {
51647 }
51649 {
51651 }
51653 {
51655 }
51657 {
51659 }
51661 {
51663 }
51665 {
51667 }
51669 {
51671 }
51673 {
51675 }
51677 {
51679 }
51681 {
51683 }
51685 {
51687 }
51689 {
51691 }
51693 {
51695 }
51696 }
51697 return;
51698 }
51699 if (Main.netMode == 2 && Main.rand.Next(30) == 0)
51700 {
51702 return;
51703 }
51704 int num15 = Main.rand.Next(7);
51705 if (Main.expertMode)
51706 {
51708 }
51709 Player player2 = Main.player[
Player.FindClosest(
new Vector2((
float)(i * 16), (
float)(
j * 16)), 16, 16)];
51712 for (
int k = 0;
k < 50;
k++)
51713 {
51715 if (!item.IsAir && item.createTile == 4)
51716 {
51717 num2 += item.stack;
51719 {
51720 break;
51721 }
51722 }
51723 }
51726 {
51728 if (Main.rand.Next(2) == 0)
51729 {
51731 }
51732 if (Main.expertMode)
51733 {
51734 if (Main.rand.Next(2) == 0)
51735 {
51737 }
51738 if (Main.rand.Next(2) == 0)
51739 {
51741 }
51742 }
51743 return;
51744 }
51746 {
51747 int num4 = Main.rand.Next(2, 7);
51748 if (Main.expertMode)
51749 {
51750 num4 += Main.rand.Next(1, 7);
51751 }
51752 int type = 8;
51755 {
51756 num4 += Main.rand.Next(2, 7);
51757 type = 4387;
51758 }
51759 else if ((style >= 22 && style <= 24) ||
player2.ZoneCrimson)
51760 {
51761 num4 += Main.rand.Next(2, 7);
51762 type = 4386;
51763 }
51764 else if ((style >= 16 && style <= 18) ||
player2.ZoneCorrupt)
51765 {
51766 num4 += Main.rand.Next(2, 7);
51767 type = 4385;
51768 }
51769 else if (style >= 7 && style <= 9)
51770 {
51771 num4 += Main.rand.Next(2, 7);
51773 type = 4388;
51774 }
51775 else if (style >= 4 && style <= 6)
51776 {
51777 type = 974;
51779 }
51780 else if (style >= 34 && style <= 36)
51781 {
51782 num4 += Main.rand.Next(2, 7);
51783 type = 4383;
51784 }
51785 else if (
player2.ZoneGlowshroom)
51786 {
51787 num4 += Main.rand.Next(2, 7);
51788 type = 5293;
51789 }
51790 if (Main.tile[i,
j].liquid > 0)
51791 {
51793 }
51794 else
51795 {
51797 }
51798 return;
51799 }
51801 {
51802 case 2:
51803 {
51804 int stack2 = Main.rand.Next(10, 21);
51807 {
51808 type4 = ((!Main.hardMode) ? 42 : 168);
51809 }
51810 if (
j > Main.UnderworldLayer)
51811 {
51813 }
51814 else if (Main.hardMode)
51815 {
51816 type4 = ((Main.rand.Next(2) != 0) ? 47 : ((SavedOreTiers.
Silver != 168) ? 278 : 4915));
51817 }
51819 return;
51820 }
51821 case 3:
51822 {
51824 if (
j > Main.UnderworldLayer || Main.hardMode)
51825 {
51827 }
51829 if (Main.expertMode && Main.rand.Next(3) != 0)
51830 {
51832 }
51834 return;
51835 }
51836 case 4:
51838 {
51841 {
51843 }
51844 int num5 = Main.rand.Next(4) + 1;
51845 if (Main.expertMode)
51846 {
51847 num5 += Main.rand.Next(4);
51848 }
51850 return;
51851 }
51852 break;
51853 }
51854 if ((
num15 == 4 ||
num15 == 5) &&
j < Main.UnderworldLayer && !Main.hardMode)
51855 {
51856 int stack3 = Main.rand.Next(20, 41);
51858 return;
51859 }
51861 if ((
double)
j < Main.worldSurface)
51862 {
51864 }
51866 {
51868 }
51869 else if (
j > Main.maxTilesY - 250)
51870 {
51872 }
51873 num7 *= 1
f + (float)Main.rand.Next(-20, 21) * 0.01f;
51874 if (Main.rand.Next(4) == 0)
51875 {
51876 num7 *= 1
f + (float)Main.rand.Next(5, 11) * 0.01f;
51877 }
51878 if (Main.rand.Next(8) == 0)
51879 {
51880 num7 *= 1
f + (float)Main.rand.Next(10, 21) * 0.01f;
51881 }
51882 if (Main.rand.Next(12) == 0)
51883 {
51884 num7 *= 1
f + (float)Main.rand.Next(20, 41) * 0.01f;
51885 }
51886 if (Main.rand.Next(16) == 0)
51887 {
51888 num7 *= 1
f + (float)Main.rand.Next(40, 81) * 0.01f;
51889 }
51890 if (Main.rand.Next(20) == 0)
51891 {
51892 num7 *= 1
f + (float)Main.rand.Next(50, 101) * 0.01f;
51893 }
51894 if (Main.expertMode)
51895 {
51897 }
51898 if (Main.expertMode && Main.rand.Next(2) == 0)
51899 {
51901 }
51902 if (Main.expertMode && Main.rand.Next(3) == 0)
51903 {
51905 }
51906 if (Main.expertMode && Main.rand.Next(4) == 0)
51907 {
51909 }
51911 if (
NPC.downedBoss1)
51912 {
51914 }
51915 if (
NPC.downedBoss2)
51916 {
51918 }
51919 if (
NPC.downedBoss3)
51920 {
51922 }
51923 if (
NPC.downedMechBoss1)
51924 {
51926 }
51927 if (
NPC.downedMechBoss2)
51928 {
51930 }
51931 if (
NPC.downedMechBoss3)
51932 {
51934 }
51935 if (
NPC.downedPlantBoss)
51936 {
51938 }
51939 if (
NPC.downedQueenBee)
51940 {
51942 }
51943 if (
NPC.downedGolemBoss)
51944 {
51946 }
51947 if (
NPC.downedPirates)
51948 {
51950 }
51951 if (
NPC.downedGoblins)
51952 {
51954 }
51955 if (
NPC.downedFrost)
51956 {
51958 }
51959 while ((
int)
num7 > 0)
51960 {
51961 if (
num7 > 1000000
f)
51962 {
51964 if (
num8 > 50 && Main.rand.Next(2) == 0)
51965 {
51966 num8 /= Main.rand.Next(3) + 1;
51967 }
51968 if (Main.rand.Next(2) == 0)
51969 {
51970 num8 /= Main.rand.Next(3) + 1;
51971 }
51974 continue;
51975 }
51977 {
51979 if (
num9 > 50 && Main.rand.Next(2) == 0)
51980 {
51981 num9 /= Main.rand.Next(3) + 1;
51982 }
51983 if (Main.rand.Next(2) == 0)
51984 {
51985 num9 /= Main.rand.Next(3) + 1;
51986 }
51989 continue;
51990 }
51992 {
51994 if (
num10 > 50 && Main.rand.Next(2) == 0)
51995 {
51996 num10 /= Main.rand.Next(3) + 1;
51997 }
51998 if (Main.rand.Next(2) == 0)
51999 {
52000 num10 /= Main.rand.Next(3) + 1;
52001 }
52004 continue;
52005 }
52007 if (
num11 > 50 && Main.rand.Next(2) == 0)
52008 {
52009 num11 /= Main.rand.Next(3) + 1;
52010 }
52011 if (Main.rand.Next(2) == 0)
52012 {
52013 num11 /= Main.rand.Next(4) + 1;
52014 }
52016 {
52018 }
52021 }
52022 }
static UnifiedRandom genRand
static EntitySource_TileBreak GetProjectileSource_TileBreak(int x, int y)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)