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

Function mhitm_ad_famn

src/uhitm.c:3776–3805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3774}
3775
3776void
3777mhitm_ad_famn(
3778 struct monst *magr,
3779 struct attack *mattk UNUSED,
3780 struct monst *mdef, struct mhitm_data *mhm)
3781{
3782 struct permonst *pd = mdef->data;
3783
3784 if (magr == &gy.youmonst) {
3785 /* uhitm; hero can't polymorph into anything with this attack
3786 so this won't happen; if it could, it would be the same as
3787 the mhitm case except for messaging */
3788 goto mhitm_famn;
3789 } else if (mdef == &gy.youmonst) {
3790 /* mhitu */
3791 pline_mon(magr, "%s reaches out, and your body shrivels.",
3792 Monnam(magr));
3793 exercise(A_CON, FALSE);
3794 if (!is_fainted())
3795 morehungry(rn1(40, 40));
3796 /* plus the normal damage */
3797 } else {
3798 mhitm_famn:
3799 /* mhitm; it's possible for Famine to hit another monster;
3800 if target is something that doesn't eat, it won't be harmed;
3801 otherwise, just inflict the normal damage */
3802 if (!(carnivorous(pd) || herbivorous(pd) || metallivorous(pd)))
3803 mhm->damage = 0;
3804 }
3805}
3806
3807void
3808mhitm_ad_pest(

Callers 1

mhitm_adtypingFunction · 0.85

Calls 5

pline_monFunction · 0.85
MonnamFunction · 0.85
exerciseFunction · 0.85
is_faintedFunction · 0.85
morehungryFunction · 0.85

Tested by

no test coverage detected