ATJWJORMWUTKUPVLEQKVB2KL2D4HHJOBP4JD4GT3EB3GMHMLOTAAC MPMVK6J5UQUFJ75SNRSPIBBSRTH67ZPDZKPZUF3RZRFKSERS62AAC 2C6B6QRTOK2ZMK2ZOF3EPSFUZTKG5B3IZXWBWIUYC4ZOVGQ2OV2QC B7MSPF6X2RLGWN4M6ZZF3WSOPKGYPTTD7LIJVST7DXN27DG6JHNAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC 6ZCKL3LCJ2QYYRI6CVK7CU4VXZMIZ6RIOTFUDEM2QTM4EHKVUKMAC NVSFIV2ZKP44XHCSCXG6OZVGL67OIFINC34J2EMKTA4KULCERUEAC FDJFPTPB5IT7IFTUXKLIKOODLUC32YH7SPPBIVF4GV5GGTEFTLEAC W45PMU4HNPSAMMEBJ4XH4MTHLPVIASZT4FXTBPID5LFXKIMNUBKAC 3UKFCWWS5BLFQWZRB5FUA46CE2XGX5VRCEWC3K3XH5RCGQK64N2AC MOT3YZFRY3JG2MH3GN2VD6IY3IJSAXJUXMXS222TXWKRFCENOCDQC PRG7UT7G56GT4W3FQ3KG5JRPGMKKJBFDLVHDLYFQK6IZW25JQLBQC 45EMD3KLQPMERNMIKU5G76H6556XOMIW352TSBP7VLWJX2YYGS7AC O4XZM4P4VW53I4TZMQWCQ7K4SOEL2YHKDWXWXCDPLZ6LJNKZDD4AC FIYBXLWALQINNQTHG2KNDUUTAQAZRDDLXW2XOVSKDKBADJ3XCJ4AC C22455VGUQOSUX2OORA32LROFQ7NNYDMD2ZDTTUZSAQLXK4AD6QAC MSQI3TH6T62JAXQGLL52QZCWAMC372TGB6ZNNRDGUGMJKBNNV2VAC QTAXF435XPFZWNFZHMUKPQ7UVNLUK6TG5ER4MKDY25BZF5PZ4JLAC // Draws a room, then another and links them together, then another and etc.// Of course, this can easily end up looking just like a make_trail level.int i;int roomsss = 30 + random2(90);bool exclusive = (one_chance_in(10) ? false : true);bool exclusive2 = coinflip();char romx1[30], romy1[30], romx2[30], romy2[30];int which_room = 0;for (i = 0; i < roomsss; i++){romx1[which_room] = 10 + random2(50);romy1[which_room] = 10 + random2(40);romx2[which_room] = romx1[which_room] + 2 + random2(8);romy2[which_room] = romy1[which_room] + 2 + random2(8);
if (exclusive && count_antifeature_in_box(romx1[which_room] - 1,romy1[which_room] - 1,romx2[which_room] + 1,romy2[which_room] + 1,DNGN_ROCK_WALL)){continue;}
const map_def *vault = find_map_by_name("layout_rooms");ASSERT(vault);
if (which_room > 0 && !exclusive2){const int rx1 = romx1[which_room];const int rx2 = romx2[which_room];const int prev_rx1 = romx1[which_room - 1];const int prev_rx2 = romx2[which_room - 1];const int ry1 = romy1[which_room];const int ry2 = romy2[which_room];const int prev_ry1 = romy1[which_room - 1];const int prev_ry2 = romy2[which_room - 1];join_the_dots( coord_def(rx1 + random2( rx2 - rx1 ),ry1 + random2( ry2 - ry1 )),coord_def(prev_rx1 + random2(prev_rx2 - prev_rx1),prev_ry1 + random2(prev_ry2 - prev_ry1)),MMT_VAULT );}which_room++;if (which_room >= 29)break;}if (exclusive2){for (i = 0; i < which_room; i++){if (i > 0){const int rx1 = romx1[i];const int rx2 = romx2[i];const int prev_rx1 = romx1[i - 1];const int prev_rx2 = romx2[i - 1];const int ry1 = romy1[i];const int ry2 = romy2[i];const int prev_ry1 = romy1[i - 1];const int prev_ry2 = romy2[i - 1];join_the_dots( coord_def( rx1 + random2( rx2 - rx1 ),ry1 + random2( ry2 - ry1 ) ),coord_def(prev_rx1 + random2( prev_rx2 - prev_rx1 ),prev_ry1 + random2( prev_ry2 - prev_ry1 ) ),MMT_VAULT );}}}
############################################################### layout_rooms## This replaces dungeon.cc:_plan_3().#NAME: layout_roomsORIENT: encompassTAGS: layout allow_dup{{local wall = dgn.feature_number("rock_wall")local floor = dgn.feature_number("floor")local num_rooms = 30 + crawl.random2(90)local exclusive = not crawl.one_chance_in(10)local exclusive2 = crawl.coinflip()local rooms = {}for i = 0, num_rooms dolocal new_room = {x1 = 10 + crawl.random2(50),y1 = 10 + crawl.random2(40)}new_room.x2 = new_room.x1 + 2 + crawl.random2(8)new_room.y2 = new_room.y1 + 2 + crawl.random2(8)local not_walls = dgn.count_antifeature_in_box(new_room.x1 - 1,new_room.y1 - 1, new_room.x2 + 1, new_room.y2 + 1, wall)if (not exclusive or not_walls == 0) thendgn.replace_area(new_room.x1, new_room.y1, new_room.x2,new_room.y2, wall, floor);if #rooms > 0 and not exclusive2 thendgn.join_the_dots_p(dgn.random_room_point(new_room),dgn.random_room_point(rooms[#rooms]))endtable.insert(rooms, new_room)if #rooms >= 30 thenbreakendendendif exclusive2 thenfor i = 2, #rooms dodgn.join_the_dots_p(dgn.random_room_point(rooms[i]),dgn.random_room_point(rooms[i - 1]))endend}}MAPENDMAP