construct stairs up and down within the same branch, up and down in different rooms if possible */
| 2247 | /* construct stairs up and down within the same branch, |
| 2248 | up and down in different rooms if possible */ |
| 2249 | staticfn void |
| 2250 | generate_stairs(void) |
| 2251 | { |
| 2252 | /* generate_stairs_find_room() returns Null if nroom == 0, but that |
| 2253 | should never happen for a rooms+corridors style level */ |
| 2254 | static const char |
| 2255 | gen_stairs_panic[] = "generate_stairs: failed to find a room! (%d)"; |
| 2256 | struct mkroom *croom; |
| 2257 | coord pos; |
| 2258 | |
| 2259 | if (!Is_botlevel(&u.uz)) { |
| 2260 | if ((croom = generate_stairs_find_room()) == NULL) |
| 2261 | panic(gen_stairs_panic, svn.nroom); |
| 2262 | |
| 2263 | if (!somexyspace(croom, &pos)) { |
| 2264 | pos.x = somex(croom); |
| 2265 | pos.y = somey(croom); |
| 2266 | } |
| 2267 | mkstairs(pos.x, pos.y, 0, croom, FALSE); /* down */ |
| 2268 | } |
| 2269 | |
| 2270 | if (u.uz.dlevel != 1) { |
| 2271 | /* if there is only 1 room and we found it above, this will find |
| 2272 | it again */ |
| 2273 | if ((croom = generate_stairs_find_room()) == NULL) |
| 2274 | panic(gen_stairs_panic, svn.nroom); |
| 2275 | |
| 2276 | if (!somexyspace(croom, &pos)) { |
| 2277 | pos.x = somex(croom); |
| 2278 | pos.y = somey(croom); |
| 2279 | } |
| 2280 | mkstairs(pos.x, pos.y, 1, croom, FALSE); /* up */ |
| 2281 | } |
| 2282 | } |
| 2283 | |
| 2284 | staticfn void |
| 2285 | mkfount(struct mkroom *croom) |
no test coverage detected