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

Function worm_nomove

src/worm.c:287–297  ·  view source on GitHub ↗

* worm_nomove() * * Check for mon->wormno before calling this function! * * The worm doesn't move, so it should shrink. */

Source from the content-addressed store, hash-verified

285 * The worm doesn't move, so it should shrink.
286 */
287void
288worm_nomove(struct monst *worm)
289{
290 shrink_worm((int) worm->wormno); /* shrink */
291
292 if (worm->mhp > count_wsegs(worm)) {
293 worm->mhp -= d(2, 2); /* 2..4, average 3; note: mhpmax not changed! */
294 if (worm->mhp < 1)
295 worm->mhp = 1;
296 }
297}
298
299/*
300 * wormgone()

Callers 1

m_moveFunction · 0.85

Calls 3

shrink_wormFunction · 0.85
count_wsegsFunction · 0.85
dFunction · 0.85

Tested by

no test coverage detected