E const char *FDECL(dfeature_at, (int,int,char *));
E int FDECL(look_here, (int,BOOLEAN_P));
E int NDECL(dolook);
+E boolean FDECL(will_feel_cockatrice, (struct obj *,BOOLEAN_P));
E void FDECL(feel_cockatrice, (struct obj *,BOOLEAN_P));
E void FDECL(stackobj, (struct obj *));
E int NDECL(doprgold);
const char *dfeature = (char *)0;
char fbuf[BUFSZ], fbuf2[BUFSZ];
winid tmpwin;
- boolean skip_objects = (obj_cnt >= 5);
+ boolean skip_objects = (obj_cnt >= 5), felt_cockatrice = FALSE;
if (u.uswallow && u.ustuck) {
struct monst *mtmp = u.ustuck;
putstr(tmpwin, 0, fbuf);
putstr(tmpwin, 0, "");
}
- putstr(tmpwin, 0, "Things that are here:");
+ putstr(tmpwin, 0, Blind ? "Things that you feel here:" :
+ "Things that are here:");
for ( ; otmp; otmp = otmp->nexthere) {
+ if (otmp->otyp == CORPSE && will_feel_cockatrice(otmp, FALSE)) {
+ char buf[BUFSZ];
+ felt_cockatrice = TRUE;
+ Strcpy(buf, doname(otmp));
+ Strcat(buf, "...");
+ putstr(tmpwin, 0, buf);
+ break;
+ }
putstr(tmpwin, 0, doname(otmp));
- if (otmp->otyp == CORPSE) feel_cockatrice(otmp, FALSE);
}
display_nhwindow(tmpwin, TRUE);
destroy_nhwindow(tmpwin);
+ if (felt_cockatrice) feel_cockatrice(otmp, FALSE);
read_engr_at(u.ux, u.uy); /* Eric Backus */
}
return(!!Blind);
return look_here(0, FALSE);
}
+boolean
+will_feel_cockatrice(otmp, force_touch)
+struct obj *otmp;
+boolean force_touch;
+{
+ if ((Blind || force_touch) && !uarmg && !Stone_resistance &&
+ (otmp->otyp == CORPSE && touch_petrifies(&mons[otmp->corpsenm])))
+ return TRUE;
+ return FALSE;
+}
+
void
feel_cockatrice(otmp, force_touch)
struct obj *otmp;
{
char kbuf[BUFSZ];
- if ((Blind || force_touch) && !uarmg && !Stone_resistance &&
- (otmp->otyp == CORPSE && touch_petrifies(&mons[otmp->corpsenm]))) {
+ if (will_feel_cockatrice(otmp, force_touch)) {
if(poly_when_stoned(youmonst.data))
You("touched the %s corpse with your bare %s.",
mons[otmp->corpsenm].mname, makeplural(body_part(HAND)));
pick_list[i].count = count;
} else {
n = query_objlist("Pick up what?", objchain,
- traverse_how|AUTOSELECT_SINGLE|INVORDER_SORT,
- &pick_list, PICK_ANY, all_but_uchain);
+ traverse_how|AUTOSELECT_SINGLE|INVORDER_SORT|FEEL_COCKATRICE,
+ &pick_list, PICK_ANY, all_but_uchain);
}
menu_pickup:
n_tried = n;
pack = flags.inv_order;
do {
printed_type_name = FALSE;
- for (curr = olist; curr; curr = FOLLOW(curr, qflags))
+ for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
+ if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE &&
+ will_feel_cockatrice(curr, FALSE)) {
+ destroy_nhwindow(win); /* stop the menu and revert */
+ look_here(0, FALSE);
+ return 0;
+ }
if ((!(qflags & INVORDER_SORT) || curr->oclass == *pack)
&& (*allow)(curr)) {
def_oc_syms[(int)objects[curr->otyp].oc_class],
ATR_NONE, doname(curr), MENU_UNSELECTED);
}
+ }
pack++;
} while (qflags & INVORDER_SORT && *pack);