MCPcopy Create free account
hub / github.com/NetHack/NetHack / mselftouch

Function mselftouch

src/trap.c:3912–3933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3910}
3911
3912void
3913mselftouch(
3914 struct monst *mon,
3915 const char *arg,
3916 boolean byplayer)
3917{
3918 struct obj *mwep = MON_WEP(mon);
3919
3920 if (mwep && mwep->otyp == CORPSE && touch_petrifies(&mons[mwep->corpsenm])
3921 && !resists_ston(mon)) {
3922 if (cansee(mon->mx, mon->my)) {
3923 pline_mon(mon, "%s%s touches %s.", arg ? arg : "",
3924 arg ? mon_nam(mon) : Monnam(mon),
3925 corpse_xname(mwep, (const char *) 0, CXN_PFX_THE));
3926 }
3927 minstapetrify(mon, byplayer);
3928 /* if life-saved, might not be able to continue wielding */
3929 if (!DEADMONSTER(mon)
3930 && !which_armor(mon, W_ARMG) && !resists_ston(mon))
3931 mwepgone(mon);
3932 }
3933}
3934
3935/* start levitating */
3936void

Callers 5

steal_itFunction · 0.85
mhitm_ad_seduFunction · 0.85
do_pitFunction · 0.85
newchamFunction · 0.85
trapeffect_pitFunction · 0.85

Calls 7

pline_monFunction · 0.85
mon_namFunction · 0.85
MonnamFunction · 0.85
corpse_xnameFunction · 0.85
minstapetrifyFunction · 0.85
which_armorFunction · 0.85
mwepgoneFunction · 0.85

Tested by

no test coverage detected