fix #285 - feeling cockatrice corpse while blind (trunk only)
From a bug report: moving while blind
and gloveless onto spot containing a cockatrice corpse is fatal if there
are fewer than 5 items there, but harmless when you get the "there are
several/many objects here" result for 5 or more. I thought that this was
something which had already been changed, but it wasn't. Run a touch
check on the whole pile of objects even when no object-by-object feedback
is being given.
Trunk only because it's using the trunk version of corpse_xname().
This commit is contained in:
@@ -221,6 +221,8 @@ salamanders can use green slime corpses to cure themselves of petrification
|
|||||||
feedback about summoned monsters may use singular when it should use plural
|
feedback about summoned monsters may use singular when it should use plural
|
||||||
rogue's backstab bonus doesn't apply for throwing attacks
|
rogue's backstab bonus doesn't apply for throwing attacks
|
||||||
hiding monsters who are unhidden when hero leaves a level can hide upon return
|
hiding monsters who are unhidden when hero leaves a level can hide upon return
|
||||||
|
touching a pile of objects while blind affects hero even when the pile is
|
||||||
|
big enough to give "there are many objects here" and not list them
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+28
-12
@@ -2383,14 +2383,16 @@ boolean picked_some;
|
|||||||
|
|
||||||
if (Blind) {
|
if (Blind) {
|
||||||
boolean drift = Is_airlevel(&u.uz) || Is_waterlevel(&u.uz);
|
boolean drift = Is_airlevel(&u.uz) || Is_waterlevel(&u.uz);
|
||||||
|
|
||||||
if (dfeature && !strncmp(dfeature, "altar ", 6)) {
|
if (dfeature && !strncmp(dfeature, "altar ", 6)) {
|
||||||
/* don't say "altar" twice, dfeature has more info */
|
/* don't say "altar" twice, dfeature has more info */
|
||||||
You("try to feel what is here.");
|
You("try to feel what is here.");
|
||||||
} else {
|
} else {
|
||||||
const char *where = (Blind && !can_reach_floor(TRUE)) ?
|
const char *where = (Blind && !can_reach_floor(TRUE)) ?
|
||||||
"lying beneath you" : "lying here on the ",
|
"lying beneath you" : "lying here on the ",
|
||||||
*onwhat = (Blind && !can_reach_floor(TRUE)) ?
|
*onwhat = (Blind && !can_reach_floor(TRUE)) ?
|
||||||
"" : surface(u.ux,u.uy);
|
"" : surface(u.ux,u.uy);
|
||||||
|
|
||||||
You("try to feel what is %s%s.",
|
You("try to feel what is %s%s.",
|
||||||
drift ? "floating here" : where,
|
drift ? "floating here" : where,
|
||||||
drift ? "" : onwhat);
|
drift ? "" : onwhat);
|
||||||
@@ -2421,6 +2423,15 @@ boolean picked_some;
|
|||||||
There("are %s%s objects here.",
|
There("are %s%s objects here.",
|
||||||
(obj_cnt <= 10) ? "several" : "many",
|
(obj_cnt <= 10) ? "several" : "many",
|
||||||
picked_some ? " more" : "");
|
picked_some ? " more" : "");
|
||||||
|
for ( ; otmp; otmp = otmp->nexthere)
|
||||||
|
if (otmp->otyp == CORPSE && will_feel_cockatrice(otmp, FALSE)) {
|
||||||
|
pline("Including %s%s.",
|
||||||
|
corpse_xname(otmp, (const char *)0, CXN_ARTICLE),
|
||||||
|
poly_when_stoned(youmonst.data) ? "" :
|
||||||
|
", unfortunately");
|
||||||
|
feel_cockatrice(otmp, FALSE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else if (!otmp->nexthere) {
|
} else if (!otmp->nexthere) {
|
||||||
/* only one object */
|
/* only one object */
|
||||||
if (dfeature) pline(fbuf);
|
if (dfeature) pline(fbuf);
|
||||||
@@ -2471,8 +2482,9 @@ struct obj *otmp;
|
|||||||
boolean force_touch;
|
boolean force_touch;
|
||||||
{
|
{
|
||||||
if ((Blind || force_touch) && !uarmg && !Stone_resistance &&
|
if ((Blind || force_touch) && !uarmg && !Stone_resistance &&
|
||||||
(otmp->otyp == CORPSE && touch_petrifies(&mons[otmp->corpsenm])))
|
(otmp->otyp == CORPSE &&
|
||||||
return TRUE;
|
touch_petrifies(&mons[otmp->corpsenm])))
|
||||||
|
return TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2484,14 +2496,18 @@ boolean force_touch;
|
|||||||
char kbuf[BUFSZ];
|
char kbuf[BUFSZ];
|
||||||
|
|
||||||
if (will_feel_cockatrice(otmp, force_touch)) {
|
if (will_feel_cockatrice(otmp, force_touch)) {
|
||||||
if(poly_when_stoned(youmonst.data))
|
/* "the <cockatrice> corpse" */
|
||||||
You("touched the %s corpse with your bare %s.",
|
Strcpy(kbuf, corpse_xname(otmp, (const char *)0, CXN_PFX_THE));
|
||||||
mons[otmp->corpsenm].mname, makeplural(body_part(HAND)));
|
|
||||||
|
if (poly_when_stoned(youmonst.data))
|
||||||
|
You("touched %s with your bare %s.",
|
||||||
|
kbuf, makeplural(body_part(HAND)));
|
||||||
else
|
else
|
||||||
pline("Touching the %s corpse is a fatal mistake...",
|
pline("Touching %s is a fatal mistake...", kbuf);
|
||||||
mons[otmp->corpsenm].mname);
|
/* normalize body shape here; hand, not body_part(HAND) */
|
||||||
Sprintf(kbuf, "%s corpse", an(mons[otmp->corpsenm].mname));
|
Sprintf(kbuf, "touching %s bare-handed", killer_xname(otmp));
|
||||||
instapetrify(kbuf);
|
/* will call polymon() for the poly_when_stoned() case */
|
||||||
|
instapetrify(kbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user