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

Function gelcube_digests

src/monmove.c:423–445  ·  view source on GitHub ↗

gelatinous cube eats something from its inventory */

Source from the content-addressed store, hash-verified

421
422/* gelatinous cube eats something from its inventory */
423static int
424gelcube_digests(struct monst *mtmp)
425{
426 struct obj *otmp = mtmp->minvent;
427
428 if (mtmp->meating || !mtmp->minvent)
429 return -1;
430
431 while (otmp) {
432 if (is_organic(otmp) && !otmp->oartifact
433 && !is_mines_prize(otmp) && !is_soko_prize(otmp))
434 break;
435 otmp = otmp->nobj;
436 }
437
438 if (!otmp)
439 return -1;
440
441 mtmp->meating = eaten_stat(mtmp->meating, otmp);
442 extract_from_minvent(mtmp, otmp, TRUE, TRUE);
443 m_consume_obj(mtmp, otmp);
444 return 0; /* used a move */
445}
446
447
448/* FIXME: gremlins don't flee from monsters wielding Sunsword or wearing

Callers 1

dochugFunction · 0.85

Calls 3

eaten_statFunction · 0.85
extract_from_minventFunction · 0.85
m_consume_objFunction · 0.85

Tested by

no test coverage detected