player eating metal
1) player-as-rust monster should obey same rules for edible metal as monsters. 2) with GOLDOBJ, player-as-xorn couldn't eat gold in inventory
This commit is contained in:
11
src/eat.c
11
src/eat.c
@@ -104,7 +104,8 @@ register struct obj *obj;
|
||||
/* above also prevents the Amulet from being eaten, so we must never
|
||||
allow fake amulets to be eaten either [which is already the case] */
|
||||
|
||||
if (metallivorous(youmonst.data) && is_metallic(obj))
|
||||
if (metallivorous(youmonst.data) && is_metallic(obj) &&
|
||||
(youmonst.data != &mons[PM_RUST_MONSTER] || is_rustprone(obj)))
|
||||
return TRUE;
|
||||
if (u.umonnum == PM_GELATINOUS_CUBE && is_organic(obj) &&
|
||||
/* [g.cubes can eat containers and retain all contents
|
||||
@@ -1533,6 +1534,11 @@ eatspecial() /* called after eating non-food */
|
||||
victual.piece = (struct obj *)0;
|
||||
victual.eating = 0;
|
||||
if (otmp->oclass == GOLD_CLASS) {
|
||||
#ifdef GOLDOBJ
|
||||
if (carried(otmp))
|
||||
useupall(otmp);
|
||||
else
|
||||
#endif
|
||||
dealloc_obj(otmp);
|
||||
return;
|
||||
}
|
||||
@@ -2336,7 +2342,8 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */
|
||||
}
|
||||
}
|
||||
|
||||
if ((gold = g_at(u.ux, u.uy)) != 0) {
|
||||
if (youmonst.data != &mons[PM_RUST_MONSTER] &&
|
||||
(gold = g_at(u.ux, u.uy)) != 0) {
|
||||
if (gold->quan == 1L)
|
||||
Sprintf(qbuf, "There is 1 gold piece here; eat it?");
|
||||
else
|
||||
|
||||
18
src/invent.c
18
src/invent.c
@@ -763,8 +763,16 @@ register const char *let,*word;
|
||||
|
||||
ilet = 'a';
|
||||
for (otmp = invent; otmp; otmp = otmp->nobj) {
|
||||
if (!flags.invlet_constant) otmp->invlet = ilet; /* reassign() */
|
||||
if (!*let || index(let, otmp->oclass)) {
|
||||
if (!flags.invlet_constant)
|
||||
#ifndef GOLDOBJ
|
||||
if (otmp->invlet != GOLD_SYM) /* don't reassign this */
|
||||
#endif
|
||||
otmp->invlet = ilet; /* reassign() */
|
||||
if (!*let || index(let, otmp->oclass)
|
||||
#ifdef GOLDOBJ
|
||||
|| (usegold && otmp->invlet == GOLD_SYM)
|
||||
#endif
|
||||
) {
|
||||
register int otyp = otmp->otyp;
|
||||
bp[foo++] = otmp->invlet;
|
||||
|
||||
@@ -995,7 +1003,11 @@ register const char *let,*word;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(!allowall && let && !index(let,otmp->oclass)) {
|
||||
if(!allowall && let && !index(let,otmp->oclass)
|
||||
#ifdef GOLDOBJ
|
||||
&& !(usegold && otmp->oclass == GOLD_CLASS)
|
||||
#endif
|
||||
) {
|
||||
pline(silly_thing_to, word);
|
||||
return((struct obj *)0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user