| 441 | } |
| 442 | |
| 443 | int |
| 444 | ndemon(aligntyp atyp) /* A_NONE is used for 'any alignment' */ |
| 445 | { |
| 446 | struct permonst *ptr; |
| 447 | |
| 448 | /* |
| 449 | * 3.6.2: [fixed #H2204, 22-Dec-2010, eight years later...] |
| 450 | * pick a correctly aligned demon in one try. This used to |
| 451 | * use mkclass() to choose a random demon type and keep trying |
| 452 | * (up to 20 times) until it got one with the desired alignment. |
| 453 | * mkclass_aligned() skips wrongly aligned potential candidates. |
| 454 | * [The only neutral demons are djinni and mail daemon and |
| 455 | * mkclass() won't pick them, but call it anyway in case either |
| 456 | * aspect of that changes someday.] |
| 457 | */ |
| 458 | #if 0 |
| 459 | if (atyp == A_NEUTRAL) |
| 460 | return NON_PM; |
| 461 | #endif |
| 462 | ptr = mkclass_aligned(S_DEMON, 0, atyp); |
| 463 | return (ptr && is_ndemon(ptr)) ? monsndx(ptr) : NON_PM; |
| 464 | } |
| 465 | |
| 466 | /* guardian angel has been affected by conflict so is abandoning hero */ |
| 467 | void |
no test coverage detected