create a "living" statue at x,y */
| 387 | |
| 388 | /* create a "living" statue at x,y */ |
| 389 | staticfn void |
| 390 | mk_trap_statue(coordxy x, coordxy y) |
| 391 | { |
| 392 | struct monst *mtmp; |
| 393 | struct obj *otmp, *statue; |
| 394 | struct permonst *mptr; |
| 395 | int trycount = 10; |
| 396 | |
| 397 | do { /* avoid ultimately hostile co-aligned unicorn */ |
| 398 | mptr = &mons[rndmonnum_adj(3, 6)]; |
| 399 | } while (--trycount > 0 && is_unicorn(mptr) |
| 400 | && sgn(u.ualign.type) == sgn(mptr->maligntyp)); |
| 401 | statue = mkcorpstat(STATUE, (struct monst *) 0, mptr, x, y, |
| 402 | CORPSTAT_NONE); |
| 403 | mtmp = makemon(&mons[statue->corpsenm], 0, 0, MM_NOCOUNTBIRTH | MM_NOMSG); |
| 404 | if (!mtmp) |
| 405 | return; /* should never happen */ |
| 406 | while (mtmp->minvent) { |
| 407 | otmp = mtmp->minvent; |
| 408 | otmp->owornmask = 0; |
| 409 | obj_extract_self(otmp); |
| 410 | (void) add_to_container(statue, otmp); |
| 411 | } |
| 412 | statue->owt = weight(statue); |
| 413 | mongone(mtmp); |
| 414 | } |
| 415 | |
| 416 | /* find "bottom" level of specified dungeon, stopping at quest locate */ |
| 417 | staticfn int |
no test coverage detected