26589    {
26590        GenVars.dEnteranceX = 0;
26591        GenVars.numDRooms = 0;
26592        GenVars.numDDoors = 0;
26593        GenVars.numDungeonPlatforms = 0;
26597        {
26599        }
26602        switch (num)
26603        {
26604        case 0:
26607            GenVars.crackedType = 481;
26608            break;
26609        case 1:
26612            GenVars.crackedType = 482;
26613            break;
26614        default:
26617            GenVars.crackedType = 483;
26618            break;
26619        }
26621        GenVars.dungeonLake = true;
26622        GenVars.numDDoors = 0;
26623        GenVars.numDungeonPlatforms = 0;
26624        GenVars.numDRooms = 0;
26625        GenVars.dungeonX = x;
26626        GenVars.dungeonY = y;
26627        GenVars.dMinX = x;
26628        GenVars.dMaxX = x;
26629        GenVars.dMinY = y;
26630        GenVars.dMaxY = y;
26631        GenVars.dxStrength1 = 
genRand.Next(25, 30);
 
26632        GenVars.dyStrength1 = 
genRand.Next(20, 25);
 
26633        GenVars.dxStrength2 = 
genRand.Next(35, 50);
 
26634        GenVars.dyStrength2 = 
genRand.Next(10, 15);
 
26635        double num4 = Main.maxTilesX / 60;
 
26641        {
26643            {
26645            }
26647            {
26649            }
26651            {
26653            }
26655            Main.statusText = Lang.gen[58].Value + 
" " + (int)((
num5 - 
num4) / 
num5 * 60.0) + 
"%";
 
26657            {
26659            }
26661            {
26664                {
26669                    {
26671                    }
26673                    GenVars.dungeonX = dungeonX;
26674                    GenVars.dungeonY = dungeonY;
26675                }
26676                else
26677                {
26679                }
26680            }
26681            else
26682            {
26684            }
26685        }
26690        {
26692            {
26695            }
26696        }
26697        GenVars.dungeonX = 
num7;
 
26698        GenVars.dungeonY = 
num8;
 
26699        GenVars.dEnteranceX = 
num7;
 
26700        GenVars.dSurface = false;
26703        {
26704            GenVars.dSurface = true;
26705        }
26707        {
26709            {
26711            }
26713            {
26721            }
26723        }
26725        Main.statusText = Lang.gen[58].Value + " 65%";
26726        int num9 = Main.maxTilesX * 2;
 
26729        {
26732            if ((
double)
num11 < Main.worldSurface)
 
26733            {
26734                num11 = (int)Main.worldSurface;
 
26735            }
26738        }
26740        {
26742            {
26744                {
26748                    break;
26749                }
26750            }
26752            {
26754                {
26758                    break;
26759                }
26760            }
26762            {
26764                {
26769                    break;
26770                }
26771            }
26773            {
26775                {
26780                    break;
26781                }
26782            }
26783        }
26784        Main.statusText = Lang.gen[58].Value + " 70%";
26788        int num16 = Main.maxTilesX / 100;
 
26790        {
26792        }
26794        {
26799            {
26801            }
26804            {
26807                {
26809                }
26811                {
26812                }
26814                {
26818                    {
26821                        {
26828                        }
26831                    }
26835                    {
26838                        {
26845                        }
26848                    }
26849                }
26850            }
26852            {
26855            }
26856        }
26860        Main.statusText = Lang.gen[58].Value + " 75%";
26862        {
26868            {
26871                {
26873                }
26875                {
26876                }
26878                {
26882                    {
26885                        {
26892                        }
26895                    }
26899                    {
26902                        {
26909                        }
26912                    }
26913                }
26914            }
26916            {
26919            }
26920        }
26921        Main.statusText = Lang.gen[58].Value + " 80%";
26923        {
26931            {
26932                bool flag = true;
26935                {
26937                }
26938                if (!Main.tileDungeon[Main.tile[
num34, 
num35].type])
 
26939                {
26940                    flag = false;
26941                }
26944                {
26945                }
26946                if (!Main.tileDungeon[Main.tile[
num34, 
num35].type])
 
26947                {
26948                    flag = false;
26949                }
26952                {
26953                    continue;
26954                }
26960                {
26962                    {
26964                        {
26965                            flag = false;
26966                            break;
26967                        }
26968                    }
26969                }
26970                if (flag)
26971                {
26973                    {
26975                        {
26977                            {
26978                                flag = false;
26979                                break;
26980                            }
26981                        }
26982                    }
26983                }
26985                {
26986                    bool flag2 = 
false;
 
26988                    {
26990                    }
26992                    {
26994                    }
26996                    {
26998                    }
27000                    {
27003                    }
27004                }
27005            }
27007            {
27008                continue;
27009            }
27014            {
27016            }
27018            {
27020            }
27024            {
27029                {
27031                    Main.tile[
num44 - 1, 
num47].ClearEverything();
 
27033                }
27035                {
27037                    Main.tile[
num44 - 2, 
num47].ClearEverything();
 
27039                }
27041                {
27043                    Main.tile[
num44 + 1, 
num47].ClearEverything();
 
27045                }
27047                {
27049                    Main.tile[
num44 + 2, 
num47].ClearEverything();
 
27051                }
27052            }
27053            int style = 13;
27055            {
27057                {
27058                case 7:
27059                    style = 16;
27060                    break;
27061                case 8:
27062                    style = 17;
27063                    break;
27064                case 9:
27065                    style = 18;
27066                    break;
27067                }
27068            }
27073            {
27075            }
27077            {
27079                {
27084                    {
27086                        Main.tile[
num44 - 1, 
num49].ClearEverything();
 
27088                    }
27090                    {
27092                        Main.tile[
num44 - 2, 
num49].ClearEverything();
 
27094                    }
27095                }
27096            }
27100            {
27102            }
27104            {
27106                {
27111                    {
27113                        Main.tile[
num44 + 1, 
num50].ClearEverything();
 
27115                    }
27117                    {
27119                        Main.tile[
num44 + 2, 
num50].ClearEverything();
 
27121                    }
27122                }
27123            }
27127            {
27129                {
27131                    Main.tile[
num44 + 2, 
num51].ClearEverything();
 
27133                }
27135                {
27137                    Main.tile[
num44 + 3, 
num51].ClearEverything();
 
27139                }
27141                {
27143                    Main.tile[
num44 - 2, 
num51].ClearEverything();
 
27145                }
27147                {
27149                    Main.tile[
num44 - 3, 
num51].ClearEverything();
 
27151                }
27152            }
27159        }
27160        int[] 
array = 
new int[3];
 
27162        {
27163        case 7:
27167            break;
27168        case 9:
27172            break;
27173        default:
27177            break;
27178        }
27180        {
27182            {
27187                {
27189                    {
27190                        if ((
double)
num58 > Main.worldSurface)
 
27191                        {
27195                            {
27197                            }
27198                        }
27199                    }
27200                }
27201            }
27202        }
27203        Main.statusText = Lang.gen[58].Value + " 85%";
27205        {
27208            int num64 = Main.maxTilesX;
 
27210            if ((
double)
num63 < Main.worldSurface + 50.0)
 
27211            {
27213            }
27215            {
27218                bool flag3 = 
false;
 
27220                {
27222                }
27223                else
27224                {
27226                    {
27229                        {
27231                            break;
27232                        }
27233                    }
27235                    {
27237                        if (!Main.tileDungeon[Main.tile[
num68, 
num66].type] || 
num68 == Main.maxTilesX - 1)
 
27238                        {
27240                            break;
27241                        }
27242                    }
27243                }
27245                {
27246                    continue;
27247                }
27254                {
27256                    {
27258                        {
27260                            break;
27261                        }
27262                    }
27263                }
27265                {
27267                    {
27269                        break;
27270                    }
27271                }
27273                {
27275                    break;
27276                }
27277            }
27279            {
27280                continue;
27281            }
27286            {
27291                {
27292                case 7:
27294                    break;
27295                case 8:
27297                    break;
27298                default:
27300                    break;
27301                }
27304            }
27306            {
27311                {
27312                case 7:
27314                    break;
27315                case 8:
27317                    break;
27318                default:
27320                    break;
27321                }
27323            }
27324        }
27327        {
27329        }
27331        {
27332            bool flag5 = 
false;
 
27334            {
27338                {
27339                    continue;
27340                }
27345                {
27346                case 0:
27349                    break;
27350                case 1:
27352                    {
27355                    }
27356                    else
27357                    {
27360                    }
27361                    break;
27362                case 5:
27364                    {
27367                    }
27368                    else
27369                    {
27372                    }
27373                    break;
27374                case 2:
27377                    break;
27378                case 3:
27381                    break;
27382                case 4:
27386                    break;
27387                }
27389            }
27390        }
27391        int[] 
array2 = 
new int[3]
 
27392        {
27395            0
27396        };
27398        {
27400        }
27403        {
27405        }
27406        Main.statusText = Lang.gen[58].Value + " 90%";
27410        while (
num15 < Main.maxTilesX / 20)
 
27411        {
27417            {
27420                {
27422                }
27424                {
27427                    {
27429                    }
27431                    {
27433                    }
27434                }
27436                {
27439                    {
27441                        {
27443                            {
27445                                break;
27446                            }
27447                        }
27448                    }
27450                    {
27454                        {
27455                        }
27457                        bool flag7 = 
false;
 
27459                        {
27461                        }
27463                        {
27465                            {
27470                                {
27472                                }
27474                                {
27476                                }
27477                                else
27478                                {
27480                                }
27483                                {
27485                                    if (
genRand.Next(50) == 0 && (
double)
num84 > (Main.worldSurface + Main.rockLayer) / 2.0 && Main.tile[
num83, 
num84 - 1].type == 50)
 
27486                                    {
27488                                    }
27489                                }
27491                            }
27495                            {
27500                                {
27502                                }
27504                                {
27505                                case 0:
27507                                    break;
27508                                case 1:
27510                                    break;
27511                                }
27514                                {
27516                                    {
27518                                    }
27519                                    else
27520                                    {
27522                                    }
27523                                }
27524                            }
27525                        }
27526                    }
27527                }
27528            }
27530            {
27533            }
27534        }
27535        Main.statusText = Lang.gen[58].Value + " 95%";
27538        {
27540            while (
num94 < 1000)
 
27541            {
27548                {
27550                }
27552                {
27553                case 2:
27555                    break;
27556                case 3:
27558                    break;
27559                case 4:
27561                    break;
27562                case 5:
27564                    break;
27565                case 6:
27567                    break;
27568                case 7:
27570                    break;
27571                case 8:
27574                    break;
27575                default:
27578                    break;
27579                }
27580                if ((
double)
num96 < Main.worldSurface + 50.0)
 
27581                {
27584                }
27586                {
27588                    continue;
27589                }
27591                {
27594                }
27596            }
27597        }
27598        GenVars.dMinX -= 25;
27599        GenVars.dMaxX += 25;
27600        GenVars.dMinY -= 25;
27601        GenVars.dMaxY += 25;
27603        {
27604            GenVars.dMinX = 0;
27605        }
27607        {
27608            GenVars.dMaxX = Main.maxTilesX;
27609        }
27611        {
27612            GenVars.dMinY = 0;
27613        }
27615        {
27616            GenVars.dMaxY = Main.maxTilesY;
27617        }
27629    }
static double Sqrt(double d)
 
static double Abs(double value)
 
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)