MCPcopy Create free account
hub / github.com/NetHack/NetHack / mkfount

Function mkfount

src/mklev.c:2284–2300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2282}
2283
2284staticfn void
2285mkfount(struct mkroom *croom)
2286{
2287 coord m;
2288
2289 if (!find_okay_roompos(croom, &m))
2290 return;
2291
2292 /* Put a fountain at m.x, m.y */
2293 if (!set_levltyp(m.x, m.y, FOUNTAIN))
2294 return;
2295 /* Is it a "blessed" fountain? (affects drinking from fountain) */
2296 if (!rn2(7))
2297 levl[m.x][m.y].blessedftn = 1;
2298
2299 svl.level.flags.nfountains++;
2300}
2301
2302staticfn boolean
2303find_okay_roompos(struct mkroom *croom, coord *crd)

Callers 1

fill_ordinary_roomFunction · 0.85

Calls 3

find_okay_roomposFunction · 0.85
set_levltypFunction · 0.85
rn2Function · 0.85

Tested by

no test coverage detected