select a random, common monster type, with adjusted difficulty */
| 392 | |
| 393 | /* select a random, common monster type, with adjusted difficulty */ |
| 394 | int |
| 395 | rndmonnum_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 | |
| 416 | void |
| 417 | copy_oextra(struct obj *obj2, struct obj *obj1) |
no test coverage detected