| 3880 | } |
| 3881 | |
| 3882 | void |
| 3883 | selftouch(const char *arg) |
| 3884 | { |
| 3885 | char kbuf[BUFSZ]; |
| 3886 | const char *corpse_pmname; |
| 3887 | |
| 3888 | if (uwep && uwep->otyp == CORPSE && touch_petrifies(&mons[uwep->corpsenm]) |
| 3889 | && !Stone_resistance) { |
| 3890 | corpse_pmname = obj_pmname(uwep); |
| 3891 | pline("%s touch the %s corpse.", arg, corpse_pmname); |
| 3892 | Sprintf(kbuf, "%s corpse", an(corpse_pmname)); |
| 3893 | instapetrify(kbuf); |
| 3894 | /* life-saved; unwield the corpse if we can't handle it */ |
| 3895 | if (!uarmg && !Stone_resistance) |
| 3896 | uwepgone(); |
| 3897 | } |
| 3898 | /* Or your secondary weapon, if wielded [hypothetical; we don't |
| 3899 | allow two-weapon combat when either weapon is a corpse] */ |
| 3900 | if (u.twoweap && uswapwep && uswapwep->otyp == CORPSE |
| 3901 | && touch_petrifies(&mons[uswapwep->corpsenm]) && !Stone_resistance) { |
| 3902 | corpse_pmname = obj_pmname(uswapwep); |
| 3903 | pline("%s touch the %s corpse.", arg, corpse_pmname); |
| 3904 | Sprintf(kbuf, "%s corpse", an(corpse_pmname)); |
| 3905 | instapetrify(kbuf); |
| 3906 | /* life-saved; unwield the corpse */ |
| 3907 | if (!uarmg && !Stone_resistance) |
| 3908 | uswapwepgone(); |
| 3909 | } |
| 3910 | } |
| 3911 | |
| 3912 | void |
| 3913 | mselftouch( |
no test coverage detected