28104 {
28105 GenVars.dEnteranceX = 0;
28106 GenVars.numDRooms = 0;
28107 GenVars.numDDoors = 0;
28108 GenVars.numDungeonPlatforms = 0;
28112 {
28114 }
28118 {
28119 case 0:
28122 GenVars.crackedType = 481;
28123 break;
28124 case 1:
28127 GenVars.crackedType = 482;
28128 break;
28129 default:
28132 GenVars.crackedType = 483;
28133 break;
28134 }
28136 GenVars.dungeonLake = true;
28137 GenVars.numDDoors = 0;
28138 GenVars.numDungeonPlatforms = 0;
28139 GenVars.numDRooms = 0;
28140 GenVars.dungeonX = x;
28141 GenVars.dungeonY = y;
28142 GenVars.dMinX = x;
28143 GenVars.dMaxX = x;
28144 GenVars.dMinY = y;
28145 GenVars.dMaxY = y;
28146 GenVars.dxStrength1 =
genRand.Next(25, 30);
28147 GenVars.dyStrength1 =
genRand.Next(20, 25);
28148 GenVars.dxStrength2 =
genRand.Next(35, 50);
28149 GenVars.dyStrength2 =
genRand.Next(10, 15);
28150 double num32 = Main.maxTilesX / 60;
28155 while (
num32 > 0.0)
28156 {
28158 {
28160 }
28162 {
28164 }
28166 {
28168 }
28170 Main.statusText = Lang.gen[58].Value +
" " + (int)((
num43 -
num32) /
num43 * 60.0) +
"%";
28172 {
28174 }
28176 {
28179 {
28184 {
28186 }
28188 GenVars.dungeonX = dungeonX;
28189 GenVars.dungeonY = dungeonY;
28190 }
28191 else
28192 {
28194 }
28195 }
28196 else
28197 {
28199 }
28200 }
28205 {
28207 {
28210 }
28211 }
28212 GenVars.dungeonX =
num63;
28213 GenVars.dungeonY =
num74;
28214 GenVars.dEnteranceX =
num63;
28215 GenVars.dSurface = false;
28218 {
28219 GenVars.dSurface = true;
28220 }
28222 {
28224 {
28226 }
28228 {
28236 }
28238 }
28240 Main.statusText = Lang.gen[58].Value + " 65%";
28241 int num85 = Main.maxTilesX * 2;
28244 {
28247 if ((
double)
num3 < Main.worldSurface)
28248 {
28249 num3 = (int)Main.worldSurface;
28250 }
28253 }
28255 {
28257 {
28259 {
28263 break;
28264 }
28265 }
28267 {
28269 {
28273 break;
28274 }
28275 }
28277 {
28279 {
28284 break;
28285 }
28286 }
28288 {
28290 {
28295 break;
28296 }
28297 }
28298 }
28299 Main.statusText = Lang.gen[58].Value + " 70%";
28303 int num8 = Main.maxTilesX / 100;
28305 {
28307 }
28309 {
28314 {
28316 }
28319 {
28322 {
28324 }
28326 {
28327 }
28329 {
28333 {
28336 {
28343 }
28346 }
28350 {
28353 {
28360 }
28363 }
28364 }
28365 }
28367 {
28370 }
28371 }
28375 Main.statusText = Lang.gen[58].Value + " 75%";
28377 {
28383 {
28386 {
28388 }
28390 {
28391 }
28393 {
28397 {
28400 {
28407 }
28410 }
28414 {
28417 {
28424 }
28427 }
28428 }
28429 }
28431 {
28434 }
28435 }
28436 Main.statusText = Lang.gen[58].Value + " 80%";
28438 {
28446 {
28450 {
28452 }
28453 if (!Main.tileDungeon[Main.tile[
num27,
num28].type])
28454 {
28456 }
28459 {
28460 }
28461 if (!Main.tileDungeon[Main.tile[
num27,
num28].type])
28462 {
28464 }
28467 {
28468 continue;
28469 }
28475 {
28477 {
28479 {
28481 break;
28482 }
28483 }
28484 }
28486 {
28488 {
28490 {
28492 {
28494 break;
28495 }
28496 }
28497 }
28498 }
28500 {
28501 bool flag2 =
false;
28503 {
28505 }
28507 {
28509 }
28511 {
28513 }
28515 {
28518 }
28519 }
28520 }
28522 {
28523 continue;
28524 }
28529 {
28531 }
28533 {
28535 }
28539 {
28544 {
28546 Main.tile[
num37 - 1,
num40].ClearEverything();
28548 }
28550 {
28552 Main.tile[
num37 - 2,
num40].ClearEverything();
28554 }
28556 {
28558 Main.tile[
num37 + 1,
num40].ClearEverything();
28560 }
28562 {
28564 Main.tile[
num37 + 2,
num40].ClearEverything();
28566 }
28567 }
28568 int style = 13;
28570 {
28572 {
28573 case 7:
28574 style = 16;
28575 break;
28576 case 8:
28577 style = 17;
28578 break;
28579 case 9:
28580 style = 18;
28581 break;
28582 }
28583 }
28588 {
28590 }
28592 {
28594 {
28599 {
28601 Main.tile[
num37 - 1,
num42].ClearEverything();
28603 }
28605 {
28607 Main.tile[
num37 - 2,
num42].ClearEverything();
28609 }
28610 }
28611 }
28615 {
28617 }
28619 {
28621 {
28626 {
28628 Main.tile[
num37 + 1,
num44].ClearEverything();
28630 }
28632 {
28634 Main.tile[
num37 + 2,
num44].ClearEverything();
28636 }
28637 }
28638 }
28642 {
28644 {
28646 Main.tile[
num37 + 2,
num45].ClearEverything();
28648 }
28650 {
28652 Main.tile[
num37 + 3,
num45].ClearEverything();
28654 }
28656 {
28658 Main.tile[
num37 - 2,
num45].ClearEverything();
28660 }
28662 {
28664 Main.tile[
num37 - 3,
num45].ClearEverything();
28666 }
28667 }
28674 }
28675 int[] array = new int[3];
28677 {
28678 case 7:
28679 array[0] = 7;
28680 array[1] = 94;
28681 array[2] = 95;
28682 break;
28683 case 9:
28684 array[0] = 9;
28685 array[1] = 96;
28686 array[2] = 97;
28687 break;
28688 default:
28689 array[0] = 8;
28690 array[1] = 98;
28691 array[2] = 99;
28692 break;
28693 }
28695 {
28697 {
28702 {
28704 {
28705 if ((
double)
num52 > Main.worldSurface)
28706 {
28710 {
28712 }
28713 }
28714 }
28715 }
28716 }
28717 }
28718 Main.statusText = Lang.gen[58].Value + " 85%";
28720 {
28723 int num58 = Main.maxTilesX;
28725 if ((
double)
num57 < Main.worldSurface + 50.0)
28726 {
28728 }
28730 {
28733 bool flag3 =
false;
28735 {
28737 }
28738 else
28739 {
28741 {
28744 {
28746 break;
28747 }
28748 }
28750 {
28752 if (!Main.tileDungeon[Main.tile[
num62,
num60].type] ||
num62 == Main.maxTilesX - 1)
28753 {
28755 break;
28756 }
28757 }
28758 }
28760 {
28761 continue;
28762 }
28769 {
28771 {
28773 {
28775 break;
28776 }
28777 }
28778 }
28780 {
28782 {
28784 break;
28785 }
28786 }
28788 {
28790 break;
28791 }
28792 }
28794 {
28795 continue;
28796 }
28801 {
28806 {
28807 case 7:
28809 break;
28810 case 8:
28812 break;
28813 default:
28815 break;
28816 }
28819 }
28821 {
28826 {
28827 case 7:
28829 break;
28830 case 8:
28832 break;
28833 default:
28835 break;
28836 }
28838 }
28839 }
28842 {
28844 }
28846 {
28847 bool flag5 =
false;
28849 {
28853 {
28854 continue;
28855 }
28860 {
28861 case 0:
28864 break;
28865 case 1:
28867 {
28870 }
28871 else
28872 {
28875 }
28876 break;
28877 case 5:
28879 {
28882 }
28883 else
28884 {
28887 }
28888 break;
28889 case 2:
28892 break;
28893 case 3:
28896 break;
28897 case 4:
28901 break;
28902 }
28904 }
28905 }
28906 int[]
array2 =
new int[3]
28907 {
28910 0
28911 };
28913 {
28915 }
28918 {
28920 }
28921 Main.statusText = Lang.gen[58].Value + " 90%";
28925 while (
num7 < Main.maxTilesX / 20)
28926 {
28932 {
28935 {
28937 }
28939 {
28942 {
28944 }
28946 {
28948 }
28949 }
28951 {
28954 {
28956 {
28958 {
28960 break;
28961 }
28962 }
28963 }
28965 {
28969 {
28970 }
28972 bool flag7 =
false;
28974 {
28976 }
28978 {
28980 {
28984 if (Main.tile[
num78,
num79].wall == array[0])
28985 {
28987 }
28988 else if (Main.tile[
num78,
num79].wall == array[1])
28989 {
28991 }
28992 else
28993 {
28995 }
28998 {
29000 if (
genRand.Next(50) == 0 && (
double)
num79 > (Main.worldSurface + Main.rockLayer) / 2.0 && Main.tile[
num78,
num79 - 1].type == 50)
29001 {
29003 }
29004 }
29006 }
29010 {
29015 {
29017 }
29019 {
29020 case 0:
29022 break;
29023 case 1:
29025 break;
29026 }
29029 {
29031 {
29033 }
29034 else
29035 {
29037 }
29038 }
29039 }
29040 }
29041 }
29042 }
29043 }
29045 {
29048 }
29049 }
29050 Main.statusText = Lang.gen[58].Value + " 95%";
29053 {
29055 while (
num90 < 1000)
29056 {
29063 {
29065 }
29067 {
29068 case 2:
29070 break;
29071 case 3:
29073 break;
29074 case 4:
29076 break;
29077 case 5:
29079 break;
29080 case 6:
29082 break;
29083 case 7:
29085 break;
29086 case 8:
29089 break;
29090 default:
29093 break;
29094 }
29095 if ((
double)
num92 < Main.worldSurface + 50.0)
29096 {
29099 }
29101 {
29103 continue;
29104 }
29106 {
29109 }
29111 }
29112 }
29113 GenVars.dMinX -= 25;
29114 GenVars.dMaxX += 25;
29115 GenVars.dMinY -= 25;
29116 GenVars.dMaxY += 25;
29118 {
29119 GenVars.dMinX = 0;
29120 }
29122 {
29123 GenVars.dMaxX = Main.maxTilesX;
29124 }
29126 {
29127 GenVars.dMinY = 0;
29128 }
29130 {
29131 GenVars.dMaxY = Main.maxTilesY;
29132 }
29144 }
static int[] dungeonPlatformX
static int numDungeonPlatforms
static int[] dungeonPlatformY
static ushort crackedType
static double MakeDungeon_GroundFurniture(int wallType)
static bool remixWorldGen
static double MakeDungeon_Banners(int[] roomWall, double count)
static bool PlaceTile(int i, int j, int Type, bool mute=false, bool forced=false, int plr=-1, int style=0)
static UnifiedRandom genRand
static void MakeDungeon_Lights(ushort tileType, ref int failCount, int failMax, ref int numAdd, int[] roomWall)
static void DungeonEnt(int i, int j, ushort tileType, int wallType)
static void DungeonStairs(int i, int j, ushort tileType, int wallType)
static bool AddBuriedChest(Point point, int contain=0, bool notNearOtherChests=false, int Style=-1)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool DungeonPitTrap(int i, int j, ushort tileType, int wallType)
static void DungeonHalls(int i, int j, ushort tileType, int wallType, bool forceX=false)
static bool drunkWorldGen
static void MakeDungeon_Traps(ref int failCount, int failMax, ref int numAdd)
static bool getGoodWorldGen
static double MakeDungeon_Pictures(int[] roomWall, double count)
static void DungeonRoom(int i, int j, ushort tileType, int wallType)