| 4720 | } |
| 4721 | |
| 4722 | staticfn void |
| 4723 | disintegrate_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 | |
| 4758 | void |
| 4759 | ubuzz(int type, int nd) |
no test coverage detected