make an object of the appropriate type for a shop square */
| 451 | |
| 452 | /* make an object of the appropriate type for a shop square */ |
| 453 | staticfn void |
| 454 | mkshobj_at(const struct shclass *shp, int sx, int sy, boolean mkspecl) |
| 455 | { |
| 456 | struct monst *mtmp; |
| 457 | struct permonst *ptr; |
| 458 | int atype; |
| 459 | |
| 460 | /* 3.6 tribute */ |
| 461 | if (mkspecl && (!strcmp(shp->name, "rare books") |
| 462 | || !strcmp(shp->name, "second-hand bookstore"))) { |
| 463 | struct obj *novel = mksobj_at(SPE_NOVEL, sx, sy, FALSE, FALSE); |
| 464 | |
| 465 | if (novel) |
| 466 | svc.context.tribute.bookstock = TRUE; |
| 467 | return; |
| 468 | } |
| 469 | |
| 470 | if (rn2(100) < depth(&u.uz) && !MON_AT(sx, sy) |
| 471 | && (ptr = mkclass(S_MIMIC, 0)) != 0 |
| 472 | && (mtmp = makemon(ptr, sx, sy, NO_MM_FLAGS)) != 0) { |
| 473 | /* nothing */ |
| 474 | } else { |
| 475 | atype = get_shop_item((int) (shp - shtypes)); |
| 476 | if (atype == VEGETARIAN_CLASS) |
| 477 | mkveggy_at(sx, sy); |
| 478 | else if (atype < 0) |
| 479 | (void) mksobj_at(-atype, sx, sy, TRUE, TRUE); |
| 480 | else |
| 481 | (void) mkobj_at(atype, sx, sy, TRUE); |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | /* extract a shopkeeper name for the given shop type */ |
| 486 | staticfn void |
no test coverage detected