MCPcopy Index your code
hub / github.com/NetHack/NetHack / rndmonnum_adj

Function rndmonnum_adj

src/mkobj.c:394–414  ·  view source on GitHub ↗

select a random, common monster type, with adjusted difficulty */

Source from the content-addressed store, hash-verified

392
393/* select a random, common monster type, with adjusted difficulty */
394int
395rndmonnum_adj(int minadj, int maxadj)
396{
397 struct permonst *ptr;
398 int i;
399 unsigned short excludeflags;
400
401 /* Plan A: get a level-appropriate common monster */
402 ptr = rndmonst_adj(minadj, maxadj);
403 if (ptr)
404 return monsndx(ptr);
405
406 /* Plan B: get any common monster */
407 excludeflags = G_UNIQ | G_NOGEN | (Inhell ? G_NOHELL : G_HELL);
408 do {
409 i = rn1(SPECIAL_PM - LOW_PM, LOW_PM);
410 ptr = &mons[i];
411 } while ((ptr->geno & excludeflags) != 0);
412
413 return i;
414}
415
416void
417copy_oextra(struct obj *obj2, struct obj *obj1)

Callers 3

rndmonnumFunction · 0.85
mksobj_initFunction · 0.85
mk_trap_statueFunction · 0.85

Calls 1

rndmonst_adjFunction · 0.85

Tested by

no test coverage detected