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

Function dprince

src/minion.c:390–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390int
391dprince(aligntyp atyp)
392{
393 int tryct, pm;
394
395 for (tryct = !In_endgame(&u.uz) ? 20 : 0; tryct > 0; --tryct) {
396 pm = rn1(PM_DEMOGORGON + 1 - PM_ORCUS, PM_ORCUS);
397 if (!(svm.mvitals[pm].mvflags & G_GONE)
398 && (atyp == A_NONE || sgn(mons[pm].maligntyp) == sgn(atyp)))
399 return pm;
400 }
401 return dlord(atyp); /* approximate */
402}
403
404int
405dlord(aligntyp atyp)

Callers 1

msummonFunction · 0.85

Calls 2

sgnFunction · 0.85
dlordFunction · 0.85

Tested by

no test coverage detected