cmdassist bits
If the player gives the 'T' command while not wearing any armor,
don't suggest "use 'R' to remove accessories" unless the character is
actually wearing accessories. Likewise for 'R' while not wearing any
accessories, don't suggest "use 'T' to take off armor" unless wearing
some.
Add missing amulet case to the silly_thing() handling for 'W' and
'T'. Also handle boots, gloves, and lenses as plural in the message
there. silly_thing() has been simplified a little bit in the process.
This commit is contained in:
@@ -81,6 +81,7 @@ any golem statue hit with stone-to-flesh spell animates as flesh golem
|
|||||||
correct invalid startup gender selection
|
correct invalid startup gender selection
|
||||||
can no longer untrap floor containers during unskilled riding
|
can no longer untrap floor containers during unskilled riding
|
||||||
can no longer easily set land mines and bear traps during unskilled riding
|
can no longer easily set land mines and bear traps during unskilled riding
|
||||||
|
refine cmdassist handling for armor vs accessories
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)do_wear.c 3.4 2003/03/10 */
|
/* SCCS Id: @(#)do_wear.c 3.4 2003/05/25 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -996,8 +996,9 @@ dotakeoff()
|
|||||||
uskin->otyp >= GRAY_DRAGON_SCALES ?
|
uskin->otyp >= GRAY_DRAGON_SCALES ?
|
||||||
"dragon scales are" : "dragon scale mail is");
|
"dragon scales are" : "dragon scale mail is");
|
||||||
else
|
else
|
||||||
pline("Not wearing any armor.%s", iflags.cmdassist ?
|
pline("Not wearing any armor.%s", (iflags.cmdassist &&
|
||||||
" Use 'R' command to remove accessories." : "");
|
(uleft || uright || uamul || ublindf)) ?
|
||||||
|
" Use 'R' command to remove accessories." : "");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (armorpieces > 1)
|
if (armorpieces > 1)
|
||||||
@@ -1041,8 +1042,13 @@ doremring()
|
|||||||
MOREACC(ublindf);
|
MOREACC(ublindf);
|
||||||
|
|
||||||
if(!Accessories) {
|
if(!Accessories) {
|
||||||
pline("Not wearing any accessories.%s", iflags.cmdassist ?
|
pline("Not wearing any accessories.%s", (iflags.cmdassist &&
|
||||||
" Use 'T' command to take off non-accessories." : "");
|
(uarm || uarmc ||
|
||||||
|
#ifdef TOURIST
|
||||||
|
uarmu ||
|
||||||
|
#endif
|
||||||
|
uarms || uarmh || uarmg || uarmf)) ?
|
||||||
|
" Use 'T' command to take off armor." : "");
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
if (Accessories != 1) otmp = getobj(accessories, "remove");
|
if (Accessories != 1) otmp = getobj(accessories, "remove");
|
||||||
|
|||||||
53
src/invent.c
53
src/invent.c
@@ -1094,32 +1094,35 @@ silly_thing(word, otmp)
|
|||||||
const char *word;
|
const char *word;
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
{
|
{
|
||||||
int otyp = otmp->otyp;
|
const char *s1, *s2, *s3, *what;
|
||||||
boolean domsg = FALSE;
|
int ocls = otmp->oclass, otyp = otmp->otyp;
|
||||||
const char *s1, *s2, *s3;
|
|
||||||
const char *what = (otmp->quan > 1L) ? "one of those" : "that";
|
s1 = s2 = s3 = 0;
|
||||||
if ((!strcmp(word, "wear") || !strcmp(word, "take off")) &&
|
/* check for attempted use of accessory commands ('P','R') on armor
|
||||||
(otmp->oclass == RING_CLASS ||
|
and for corresponding armor commands ('W','T') on accessories */
|
||||||
(otmp->oclass == FOOD_CLASS && otmp->otyp == MEAT_RING) ||
|
if (ocls == ARMOR_CLASS) {
|
||||||
(otmp->oclass == TOOL_CLASS &&
|
if (!strcmp(word, "put on"))
|
||||||
(otyp == BLINDFOLD || otyp == TOWEL || otyp == LENSES)))) {
|
s1 = "W", s2 = "wear", s3 = "";
|
||||||
if (!strcmp(word, "wear")) {
|
else if (!strcmp(word, "remove"))
|
||||||
s1 = "P"; s2 = "put"; s3 = " on"; domsg = TRUE;
|
s1 = "T", s2 = "take", s3 = " off";
|
||||||
} else {
|
} else if ((ocls == RING_CLASS || otyp == MEAT_RING) ||
|
||||||
s1 = "R"; s2 = "remove"; s3 = ""; domsg = TRUE;
|
ocls == AMULET_CLASS ||
|
||||||
}
|
(otyp == BLINDFOLD || otyp == TOWEL || otyp == LENSES)) {
|
||||||
} else if ((!strcmp(word, "put on") || !strcmp(word, "remove")) &&
|
if (!strcmp(word, "wear"))
|
||||||
(otmp->oclass == ARMOR_CLASS)) {
|
s1 = "P", s2 = "put", s3 = " on";
|
||||||
if (!strcmp(word, "remove")) {
|
else if (!strcmp(word, "take off"))
|
||||||
s1 = "T"; s2 = "take"; s3 = " off"; domsg = TRUE;
|
s1 = "R", s2 = "remove", s3 = "";
|
||||||
} else {
|
}
|
||||||
s1 = "W"; s2 = "wear"; s3 = ""; domsg = TRUE;
|
if (s1) {
|
||||||
}
|
what = "that";
|
||||||
|
/* quantity for armor and accessory objects is always 1,
|
||||||
|
but some things should be referred to as plural */
|
||||||
|
if (otyp == LENSES || is_gloves(otmp) || is_boots(otmp))
|
||||||
|
what = "those";
|
||||||
|
pline("Use the '%s' command to %s %s%s.", s1, s2, what, s3);
|
||||||
|
} else {
|
||||||
|
pline(silly_thing_to, word);
|
||||||
}
|
}
|
||||||
if (domsg)
|
|
||||||
pline("Use the '%s' command to %s %s%s.", s1, s2, what, s3);
|
|
||||||
else
|
|
||||||
pline(silly_thing_to, word);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* OVL1 */
|
#endif /* OVL1 */
|
||||||
|
|||||||
Reference in New Issue
Block a user