trying to #untrap a monster from a pit; is the weight too heavy? */
| 5674 | |
| 5675 | /* trying to #untrap a monster from a pit; is the weight too heavy? */ |
| 5676 | staticfn int |
| 5677 | try_lift( |
| 5678 | struct monst *mtmp, /* trapped monster */ |
| 5679 | struct trap *ttmp, /* pit, possibly made by hero, or spiked pit */ |
| 5680 | int xtra_wt, /* monster (corpse weight) + (stuff ? minvent weight : 0) */ |
| 5681 | boolean stuff) /* False: monster w/o minvent; True: w/ minvent */ |
| 5682 | { |
| 5683 | if (calc_capacity(xtra_wt) >= HVY_ENCUMBER) { |
| 5684 | pline("%s is %s for you to lift.", Monnam(mtmp), |
| 5685 | stuff ? "carrying too much" : "too heavy"); |
| 5686 | if (!ttmp->madeby_u && !mtmp->mpeaceful && mtmp->mcanmove |
| 5687 | && !mindless(mtmp->data) && mtmp->data->mlet != S_HUMAN |
| 5688 | && rnl(10) < 3) { |
| 5689 | mtmp->mpeaceful = 1; |
| 5690 | set_malign(mtmp); /* reset alignment */ |
| 5691 | pline("%s thinks it was nice of you to try.", Monnam(mtmp)); |
| 5692 | } |
| 5693 | return 0; |
| 5694 | } |
| 5695 | return 1; |
| 5696 | } |
| 5697 | |
| 5698 | /* Help trapped monster (out of a (spiked) pit) */ |
| 5699 | staticfn int |
no test coverage detected