dispose of contents of an eaten container; used for pets and other mons */
| 1351 | |
| 1352 | /* dispose of contents of an eaten container; used for pets and other mons */ |
| 1353 | void |
| 1354 | meatbox(struct monst *mon, struct obj *otmp) |
| 1355 | { |
| 1356 | boolean engulf_contents = (mon->data == &mons[PM_GELATINOUS_CUBE]); |
| 1357 | int x = mon->mx, y = mon->my; |
| 1358 | struct obj *cobj; |
| 1359 | |
| 1360 | if (!Has_contents(otmp) || !isok(x, y)) |
| 1361 | return; |
| 1362 | |
| 1363 | /* contents of eaten containers become engulfed or dropped onto |
| 1364 | the floor; this is arbitrary, but otherwise g-cubes are too |
| 1365 | powerful */ |
| 1366 | if (!engulf_contents && cansee(x, y)) { |
| 1367 | pline("%s contents spill out onto the %s.", |
| 1368 | s_suffix(The(distant_name(otmp, xname))), |
| 1369 | surface(x, y)); |
| 1370 | } |
| 1371 | while ((cobj = otmp->cobj) != 0) { |
| 1372 | obj_extract_self(cobj); |
| 1373 | if (otmp->otyp == ICE_BOX) |
| 1374 | removed_from_icebox(cobj); |
| 1375 | if (engulf_contents) { |
| 1376 | (void) mpickobj(mon, cobj); |
| 1377 | } else { |
| 1378 | if (!flooreffects(cobj, x, y, "")) |
| 1379 | place_object(cobj, x, y); |
| 1380 | } |
| 1381 | } |
| 1382 | } |
| 1383 | |
| 1384 | #define mstoning(obj) \ |
| 1385 | (ofood(obj) && ismnum(obj->corpsenm) \ |
no test coverage detected