| 745 | } |
| 746 | |
| 747 | staticfn void |
| 748 | shiny_orc_stuff(struct monst *mtmp) |
| 749 | { |
| 750 | int gemprob, goldprob, otyp; |
| 751 | struct obj *otmp; |
| 752 | boolean is_captain = (mtmp->data == &mons[PM_ORC_CAPTAIN]); |
| 753 | |
| 754 | /* probabilities */ |
| 755 | goldprob = is_captain ? 600 : 300; |
| 756 | gemprob = goldprob / 4; |
| 757 | if (rn2(1000) < goldprob) { |
| 758 | if ((otmp = mksobj(GOLD_PIECE, TRUE, FALSE)) != 0) { |
| 759 | otmp->quan = 1L + rnd(goldprob); |
| 760 | otmp->owt = weight(otmp); |
| 761 | add_to_minv(mtmp, otmp); |
| 762 | } |
| 763 | } |
| 764 | if (rn2(1000) < gemprob) { |
| 765 | if ((otmp = mkobj(GEM_CLASS, FALSE)) != 0) { |
| 766 | if (otmp->otyp == ROCK) |
| 767 | dealloc_obj(otmp); |
| 768 | else |
| 769 | add_to_minv(mtmp, otmp); |
| 770 | } |
| 771 | } |
| 772 | if (is_captain || !rn2(8)) { |
| 773 | otyp = shiny_obj(RING_CLASS); |
| 774 | if (otyp != STRANGE_OBJECT && (otmp = mksobj(otyp, TRUE, FALSE)) != 0) |
| 775 | add_to_minv(mtmp, otmp); |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | staticfn void |
| 780 | migr_booty_item(int otyp, const char *gang) |
no test coverage detected