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

Function make_niches

src/mklev.c:801–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799}
800
801staticfn void
802make_niches(void)
803{
804 int ct = rnd((svn.nroom >> 1) + 1), dep = depth(&u.uz);
805 boolean ltptr = (!svl.level.flags.noteleport && dep > 15),
806 vamp = (dep > 5 && dep < 25);
807
808 while (ct--) {
809 if (ltptr && !rn2(6)) {
810 ltptr = FALSE;
811 makeniche(LEVEL_TELEP);
812 } else if (vamp && !rn2(6)) {
813 vamp = FALSE;
814 makeniche(TRAPDOOR);
815 } else
816 makeniche(NO_TRAP);
817 }
818}
819
820staticfn void
821makevtele(void)

Callers 1

makelevelFunction · 0.85

Calls 4

rndFunction · 0.85
depthFunction · 0.85
rn2Function · 0.85
makenicheFunction · 0.85

Tested by

no test coverage detected