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

Function eating_dangerous_corpse

src/eat.c:474–493  ·  view source on GitHub ↗

if temporary acid or stoning resistance is timing out while eating something which that resistance is protecting against, caller will extend resistance's duration so that it times out after meal finishes */

Source from the content-addressed store, hash-verified

472 something which that resistance is protecting against, caller will
473 extend resistance's duration so that it times out after meal finishes */
474boolean
475eating_dangerous_corpse(int res)
476{
477 struct obj *food;
478 int mnum;
479
480 if (go.occupation == eatfood
481 && (food = svc.context.victual.piece) != 0
482 && food->otyp == CORPSE
483 && (mnum = food->corpsenm) >= LOW_PM
484 && (carried(food) || obj_here(food, u.ux, u.uy))) {
485
486 if (res == ACID_RES && acidic(&mons[mnum]))
487 return TRUE;
488 /* flesh_petrifies() includes Medusa as well as touch_petrifies() */
489 if (res == STONE_RES && flesh_petrifies(&mons[mnum]))
490 return TRUE;
491 }
492 return FALSE;
493}
494
495#if 0 /* no longer used */
496staticfn void maybe_extend_timed_resist(int);

Callers 1

nh_timeoutFunction · 0.85

Calls 1

obj_hereFunction · 0.85

Tested by

no test coverage detected