diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index f9b3fe283..13d11bcca 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1486,6 +1486,7 @@ digging in ice was handled inconsistently, particularly if done at the span angry god may remove an intrinsic blessed scroll of destroy armor asks which armor to destroy archeologists' fedora is lucky +gelatinous cubes eat organic objects inside them Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/monmove.c b/src/monmove.c index f27f8bdee..61afc0d35 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -409,6 +409,32 @@ bee_eat_jelly(struct monst *mon, struct obj *obj) return -1; /* a queen is already present; ordinary bee hasn't moved yet */ } +/* gelatinous cube eats something from its inventory */ +static int +gelcube_digests(struct monst *mtmp) +{ + struct obj *otmp = mtmp->minvent; + + if (mtmp->meating || !mtmp->minvent) + return -1; + + while (otmp) { + if (is_organic(otmp) && !otmp->oartifact + && !is_mines_prize(otmp) && !is_soko_prize(otmp)) + break; + otmp = otmp->nobj; + } + + if (!otmp) + return -1; + + mtmp->meating = eaten_stat(mtmp->meating, otmp); + extract_from_minvent(mtmp, otmp, TRUE, TRUE); + m_consume_obj(mtmp, otmp); + return 0; /* used a move */ +} + + /* FIXME: gremlins don't flee from monsters wielding Sunsword or wearing gold dragon scales/mail, nor from gold dragons, only from the hero */ #define flees_light(mon) \ @@ -846,6 +872,10 @@ dochug(struct monst *mtmp) && (res = bee_eat_jelly(mtmp, otmp)) >= 0) return res; + if (mdat == &mons[PM_GELATINOUS_CUBE] + && (res = gelcube_digests(mtmp)) >= 0) + return res; + /* A monster that passes the following checks has the opportunity to move. Movement itself is handled by the m_move() function. */ if (!nearby || mtmp->mflee || scared || mtmp->mconf || mtmp->mstun