| 388 | } |
| 389 | |
| 390 | int |
| 391 | dprince(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 | |
| 404 | int |
| 405 | dlord(aligntyp atyp) |