MCPcopy Create free account
hub / github.com/diasurgical/devilution / DRLG_L3

Function DRLG_L3

Source/drlg_l3.cpp:1494–1625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1492}
1493
1494static void DRLG_L3(int entry)
1495{
1496 int x1, y1, x2, y2, i, j;
1497 BOOL found, genok;
1498
1499 lavapool = FALSE;
1500
1501 do {
1502 do {
1503 do {
1504 InitL3Dungeon();
1505 x1 = random_(0, 20) + 10;
1506 y1 = random_(0, 20) + 10;
1507 x2 = x1 + 2;
1508 y2 = y1 + 2;
1509 DRLG_L3FillRoom(x1, y1, x2, y2);
1510 DRLG_L3CreateBlock(x1, y1, 2, 0);
1511 DRLG_L3CreateBlock(x2, y1, 2, 1);
1512 DRLG_L3CreateBlock(x1, y2, 2, 2);
1513 DRLG_L3CreateBlock(x1, y1, 2, 3);
1514 if (QuestStatus(QTYPE_ANVIL)) {
1515 x1 = random_(0, 10) + 10;
1516 y1 = random_(0, 10) + 10;
1517 x2 = x1 + 12;
1518 y2 = y1 + 12;
1519 DRLG_L3FloorArea(x1, y1, x2, y2);
1520 }
1521 DRLG_L3FillDiags();
1522 DRLG_L3FillSingles();
1523 DRLG_L3FillStraights();
1524 DRLG_L3FillDiags();
1525 DRLG_L3Edges();
1526 if (DRLG_L3GetFloorArea() >= 600) {
1527 found = DRLG_L3Lockout();
1528 } else {
1529 found = FALSE;
1530 }
1531 } while (!found);
1532 DRLG_L3MakeMegas();
1533 if (entry == 0) {
1534 genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, 1, 0);
1535 if (!genok) {
1536 genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, 0, 1);
1537 if (!genok && currlevel == 9) {
1538 genok = DRLG_L3PlaceMiniSet(L3HOLDWARP, 1, 1, -1, -1, 0, 6);
1539 }
1540 }
1541 } else if (entry == 1) {
1542 genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, 0, 0);
1543 if (!genok) {
1544 genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, 1, 1);
1545 ViewX += 2;
1546 ViewY -= 2;
1547 if (!genok && currlevel == 9) {
1548 genok = DRLG_L3PlaceMiniSet(L3HOLDWARP, 1, 1, -1, -1, 0, 6);
1549 }
1550 }
1551 } else {

Callers 1

CreateL3DungeonFunction · 0.85

Calls 15

InitL3DungeonFunction · 0.85
random_Function · 0.85
DRLG_L3FillRoomFunction · 0.85
DRLG_L3CreateBlockFunction · 0.85
QuestStatusFunction · 0.85
DRLG_L3FloorAreaFunction · 0.85
DRLG_L3FillDiagsFunction · 0.85
DRLG_L3FillSinglesFunction · 0.85
DRLG_L3FillStraightsFunction · 0.85
DRLG_L3EdgesFunction · 0.85
DRLG_L3GetFloorAreaFunction · 0.85
DRLG_L3LockoutFunction · 0.85

Tested by

no test coverage detected