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

Function mhitm_ad_dise

src/uhitm.c:4592–4619  ·  view source on GitHub ↗

disease */

Source from the content-addressed store, hash-verified

4590
4591/* disease */
4592void
4593mhitm_ad_dise(
4594 struct monst *magr, struct attack *mattk,
4595 struct monst *mdef, struct mhitm_data *mhm)
4596{
4597 struct permonst *pa = magr->data, *pd = mdef->data;
4598
4599 if (magr == &gy.youmonst) {
4600 /* uhitm; hero can't polymorph into anything with this attack so
4601 this won't happen; if it could, it would be the same as the
4602 mhitm case except for messaging */
4603 goto mhitm_dise;
4604 } else if (mdef == &gy.youmonst) {
4605 /* mhitu */
4606 hitmsg(magr, mattk);
4607 if (!diseasemu(pa))
4608 mhm->damage = 0;
4609 } else {
4610 mhitm_dise:
4611 /* mhitm; protected monsters use the same criteria as for poly'd
4612 hero gaining sick resistance combined with any hero wielding a
4613 weapon or wearing dragon scales/mail that guards against disease */
4614 if (pd->mlet == S_FUNGUS || pd == &mons[PM_GHOUL]
4615 || defended(mdef, AD_DISE))
4616 mhm->damage = 0;
4617 /* else does ordinary damage */
4618 }
4619}
4620
4621/* seduce and also steal item */
4622void

Callers 2

mhitm_ad_pestFunction · 0.85
mhitm_adtypingFunction · 0.85

Calls 3

hitmsgFunction · 0.85
diseasemuFunction · 0.85
defendedFunction · 0.85

Tested by

no test coverage detected