warning about bad food didn't recognize tin of Medusa meat
eating tainted Medusa corpse caused food poisioning instead of petrification
avoid potential stale pointer use after magic bag explosion
+nymphs and monkeys can't steal rings worn under gloves
monkeys can't steal rings worn under cursed weapon
+succubi will remove hero's gloves before taking worn ring; incubi will do
+ so before forcing ring to be put on
Platform- and/or Interface-Specific Fixes
-/* SCCS Id: @(#)mhitu.c 3.5 2004/12/21 */
+/* SCCS Id: @(#)mhitu.c 3.5 2005/02/09 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
{
register struct obj *ring, *nring;
boolean fem = (mon->data == &mons[PM_SUCCUBUS]); /* otherwise incubus */
+ int tried_gloves = 0;
char qbuf[QBUFSZ];
if (mon->mcan || mon->mspec_used) {
if (Blind) pline("It caresses you...");
else You_feel("very attracted to %s.", mon_nam(mon));
+ /* don't try to take off gloves if cursed weapon blocks them */
+ if (welded(uwep)) tried_gloves = 1;
for(ring = invent; ring; ring = nring) {
nring = ring->nobj;
if (ring->otyp != RIN_ADORNMENT) continue;
if (fem) {
+ if (ring->owornmask && uarmg) {
+ /* don't take off worn ring if gloves are in the way */
+ if (!tried_gloves++) mayberem(uarmg, "gloves");
+ if (uarmg) continue; /* next ring might not be worn */
+ }
if (rn2(20) < ACURR(A_CHA)) {
Sprintf(qbuf, "\"That %s looks pretty. May I have it?\"",
safe_qbuf("",sizeof("\"That looks pretty. May I have it?\""),
&& uright->otyp==RIN_ADORNMENT)
break;
if (ring==uleft || ring==uright) continue;
+ if (uarmg) {
+ /* don't put on ring if gloves are in the way */
+ if (!tried_gloves++) mayberem(uarmg, "gloves");
+ if (uarmg) break; /* no point trying further rings */
+ }
if (rn2(20) < ACURR(A_CHA)) {
Sprintf(qbuf,"\"That %s looks pretty. Would you wear it for me?\"",
safe_qbuf("",
if(!uarmc)
mayberem(uarm, "suit");
mayberem(uarmf, "boots");
- if(!uwep || !welded(uwep))
+ if (!tried_gloves)
mayberem(uarmg, "gloves");
mayberem(uarms, "shield");
mayberem(uarmh, helm_simple_name(uarmh));
}
monkey_business = is_animal(mtmp->data);
- if (monkey_business) {
+ if (monkey_business || uarmg) {
; /* skip ring special cases */
} else if (Adornment & LEFT_RING) {
otmp = uleft;
impossible("Steal fails!");
return(0);
}
+ /* can't steal ring(s) while wearing gloves */
+ if ((otmp == uleft || otmp == uright) && uarmg) otmp = uarmg;
/* can't steal gloves while wielding - so steal the wielded item. */
- if (otmp == uarmg && uwep)
- otmp = uwep;
+ if (otmp == uarmg && uwep) otmp = uwep;
/* can't steal armor while wearing cloak - so steal the cloak. */
else if(otmp == uarm && uarmc) otmp = uarmc;
#ifdef TOURIST
+ /* can't steal shirt while wearing cloak or suit */
else if(otmp == uarmu && uarmc) otmp = uarmc;
else if(otmp == uarmu && uarm) otmp = uarm;
#endif
+
gotobj:
if(otmp->o_id == stealoid) return(0);