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

Function disintegrate_mon

src/zap.c:4722–4756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4720}
4721
4722staticfn void
4723disintegrate_mon(
4724 struct monst *mon,
4725 int type, /* hero vs other */
4726 const char *fltxt)
4727{
4728 struct obj *otmp, *otmp2, *m_amulet = mlifesaver(mon);
4729
4730 if (canseemon(mon)) {
4731 if (!m_amulet)
4732 pline("%s is disintegrated!", Monnam(mon));
4733 else
4734 hit(fltxt, mon, "!");
4735 }
4736
4737/* note: worn amulet of life saving must be preserved in order to operate */
4738#define oresist_disintegration(obj) \
4739 (objects[obj->otyp].oc_oprop == DISINT_RES || obj_resists(obj, 5, 50) \
4740 || is_quest_artifact(obj) || obj == m_amulet)
4741
4742 for (otmp = mon->minvent; otmp; otmp = otmp2) {
4743 otmp2 = otmp->nobj;
4744 if (!oresist_disintegration(otmp)) {
4745 extract_from_minvent(mon, otmp, TRUE, TRUE);
4746 obfree(otmp, (struct obj *) 0);
4747 }
4748 }
4749
4750#undef oresist_disintegration
4751
4752 if (type < 0)
4753 monkilled(mon, (char *) 0, -AD_RBRE);
4754 else
4755 xkilled(mon, XKILL_NOMSG | XKILL_NOCORPSE);
4756}
4757
4758void
4759ubuzz(int type, int nd)

Callers 1

dobuzzFunction · 0.85

Calls 9

mlifesaverFunction · 0.85
canseemonFunction · 0.85
MonnamFunction · 0.85
hitFunction · 0.85
extract_from_minventFunction · 0.85
obfreeFunction · 0.85
monkilledFunction · 0.85
xkilledFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected