MCPcopy Index your code
hub / github.com/NetHack/NetHack / selftouch

Function selftouch

src/trap.c:3882–3910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3880}
3881
3882void
3883selftouch(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
3912void
3913mselftouch(

Callers 11

disintegrate_armFunction · 0.85
goto_levelFunction · 0.85
retouch_equipmentFunction · 0.85
dosinkfallFunction · 0.85
do_pitFunction · 0.85
newmanFunction · 0.85
polymonFunction · 0.85
rehumanizeFunction · 0.85
newuhsFunction · 0.85
trapeffect_pitFunction · 0.85
float_downFunction · 0.85

Calls 6

obj_pmnameFunction · 0.85
anFunction · 0.85
instapetrifyFunction · 0.85
uwepgoneFunction · 0.85
uswapwepgoneFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected