fix #H4457 - grammar nitpick

"Your pair of speed boots glow silver for a moment." should be
"Your pair of speed boots glows silver for a moment.".  The fix
reverses a post-3.6.0 change to is_plural().  Also, add new
pair_of() to test for object formatted as "pair of Bars".  For verb
usage, that's definitely singular, but for pronoun usage, sometimes
plural seems better (although it might actually be incorrect).

I fixed up the formatting of a block comment in obj.h, but it is
still a candidate for tab cleanup.
This commit is contained in:
PatR
2016-07-30 01:19:44 -07:00
parent d466dc3742
commit 6632c380f3
7 changed files with 40 additions and 32 deletions
+1
View File
@@ -338,6 +338,7 @@ fix for long lines in config file (28-Jan-2016) made 'O' command's 'list' and
'remove' menu choices in interactive handling for menu colorings, 'remove' menu choices in interactive handling for menu colorings,
message types, and autopickup exceptions subject to buffer overflow message types, and autopickup exceptions subject to buffer overflow
when picking a destination for #jump, '$' to show valid dest. is more accurate when picking a destination for #jump, '$' to show valid dest. is more accurate
enchant armor gave "your pair of boots/gloves glow", should have been "glows"
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+10 -10
View File
@@ -330,14 +330,17 @@ struct obj {
((obj)->otyp == LUCKSTONE || (obj)->otyp == LOADSTONE \ ((obj)->otyp == LUCKSTONE || (obj)->otyp == LOADSTONE \
|| (obj)->otyp == FLINT || (obj)->otyp == TOUCHSTONE) || (obj)->otyp == FLINT || (obj)->otyp == TOUCHSTONE)
/* misc */ /* misc helpers, simple enough to be macros */
#define is_flimsy(otmp) \ #define is_flimsy(otmp) \
(objects[(otmp)->otyp].oc_material <= LEATHER \ (objects[(otmp)->otyp].oc_material <= LEATHER \
|| (otmp)->otyp == RUBBER_HOSE) || (otmp)->otyp == RUBBER_HOSE)
/* helpers, simple enough to be macros */
#define is_plural(o) \ #define is_plural(o) \
((o)->quan != 1L || (o)->otyp == LENSES || is_gloves(o) || is_boots(o)) ((o)->quan != 1L \
/* "the Eyes of the Overworld" are plural, but \
"a pair of lenses named the Eyes of the Overworld" is not */ \
|| ((o)->oartifact == ART_EYES_OF_THE_OVERWORLD \
&& !undiscovered_artifact(ART_EYES_OF_THE_OVERWORLD)))
#define pair_of(o) ((o)->otyp == LENSES || is_gloves(o) || is_boots(o))
/* Flags for get_obj_location(). */ /* Flags for get_obj_location(). */
#define CONTAINED_TOO 0x1 #define CONTAINED_TOO 0x1
@@ -366,17 +369,14 @@ struct obj {
* Notes for adding new oextra structures: * Notes for adding new oextra structures:
* *
* 1. Add the structure definition and any required macros in an * 1. Add the structure definition and any required macros in an
*appropriate * appropriate header file that precedes this one.
* header file that precedes this one. * 2. Add a pointer to your new struct to oextra struct in this file.
* 2. Add a pointer to your new struct to the oextra struct in this
*file.
* 3. Add a referencing macro to this file after the newobj macro above * 3. Add a referencing macro to this file after the newobj macro above
* (see ONAME, OMONST, OMIN, OLONG, or OMAILCMD for examples). * (see ONAME, OMONST, OMIN, OLONG, or OMAILCMD for examples).
* 4. Add a testing macro after the set of referencing macros * 4. Add a testing macro after the set of referencing macros
* (see has_oname(), has_omonst(), has_omin(), has_olong(), * (see has_oname(), has_omonst(), has_omin(), has_olong(),
* has_omailcmd() for examples). * has_omailcmd() for examples).
* 5. Create a newXX(otmp) function and possibly a free_XX(otmp) * 5. Create newXX(otmp) function and possibly free_XX(otmp) function
*function
* in an appropriate new or existing source file and add a prototype * in an appropriate new or existing source file and add a prototype
* for it to include/extern.h. The majority of these are currently * for it to include/extern.h. The majority of these are currently
* located in mkobj.c for convenience. * located in mkobj.c for convenience.
+4
View File
@@ -1091,6 +1091,7 @@ dokick()
goto ouch; goto ouch;
if (IS_TREE(maploc->typ)) { if (IS_TREE(maploc->typ)) {
struct obj *treefruit; struct obj *treefruit;
/* nothing, fruit or trouble? 75:23.5:1.5% */ /* nothing, fruit or trouble? 75:23.5:1.5% */
if (rn2(3)) { if (rn2(3)) {
if (!rn2(6) && !(mvitals[PM_KILLER_BEE].mvflags & G_GONE)) if (!rn2(6) && !(mvitals[PM_KILLER_BEE].mvflags & G_GONE))
@@ -1101,7 +1102,9 @@ dokick()
&& (treefruit = rnd_treefruit_at(x, y))) { && (treefruit = rnd_treefruit_at(x, y))) {
long nfruit = 8L - rnl(7), nfall; long nfruit = 8L - rnl(7), nfall;
short frtype = treefruit->otyp; short frtype = treefruit->otyp;
treefruit->quan = nfruit; treefruit->quan = nfruit;
treefruit->owt = weight(treefruit);
if (is_plural(treefruit)) if (is_plural(treefruit))
pline("Some %s fall from the tree!", xname(treefruit)); pline("Some %s fall from the tree!", xname(treefruit));
else else
@@ -1125,6 +1128,7 @@ dokick()
int cnt = rnl(4) + 2; int cnt = rnl(4) + 2;
int made = 0; int made = 0;
coord mm; coord mm;
mm.x = x; mm.x = x;
mm.y = y; mm.y = y;
while (cnt--) { while (cnt--) {
+1 -1
View File
@@ -1489,7 +1489,7 @@ struct obj *otmp;
} }
if (s1) if (s1)
pline("Use the '%s' command to %s %s%s.", s1, s2, pline("Use the '%s' command to %s %s%s.", s1, s2,
!is_plural(otmp) ? "that" : "those", s3); !(is_plural(otmp) || pair_of(otmp)) ? "that" : "those", s3);
else else
#endif #endif
pline(silly_thing_to, word); pline(silly_thing_to, word);
+15 -14
View File
@@ -2763,24 +2763,25 @@ struct obj *no_wish;
} }
/* /*
Skip over "pair of ", "pairs of", "set of" and "sets of". * Skip over "pair of ", "pairs of", "set of" and "sets of".
*
Accept "3 pair of boots" as well as "3 pairs of boots". It is valid * Accept "3 pair of boots" as well as "3 pairs of boots". It is
English either way. See makeplural() for more on pair/pairs. * valid English either way. See makeplural() for more on pair/pairs.
*
We should only double count if the object in question is not * We should only double count if the object in question is not
referred to as a "pair of". E.g. We should double if the player * referred to as a "pair of". E.g. We should double if the player
types "pair of spears", but not if the player types "pair of * types "pair of spears", but not if the player types "pair of
lenses". Luckily (?) all objects that are referred to as pairs * lenses". Luckily (?) all objects that are referred to as pairs
-- boots, gloves, and lenses -- are also not mergable, so cnt is * -- boots, gloves, and lenses -- are also not mergable, so cnt is
ignored anyway. * ignored anyway.
*/ */
if (!strncmpi(bp, "pair of ", 8)) { if (!strncmpi(bp, "pair of ", 8)) {
bp += 8; bp += 8;
cnt *= 2; cnt *= 2;
} else if (cnt > 1 && !strncmpi(bp, "pairs of ", 9)) { } else if (!strncmpi(bp, "pairs of ", 9)) {
bp += 9; bp += 9;
cnt *= 2; if (cnt > 1)
cnt *= 2;
} else if (!strncmpi(bp, "set of ", 7)) { } else if (!strncmpi(bp, "set of ", 7)) {
bp += 7; bp += 7;
} else if (!strncmpi(bp, "sets of ", 8)) { } else if (!strncmpi(bp, "sets of ", 8)) {
+1 -1
View File
@@ -1798,7 +1798,7 @@ dodip()
if (inaccessible_equipment(obj, "dip", FALSE)) if (inaccessible_equipment(obj, "dip", FALSE))
return 0; return 0;
shortestname = is_plural(obj) ? "them" : "it"; shortestname = (is_plural(obj) || pair_of(obj)) ? "them" : "it";
/* /*
* Bypass safe_qbuf() since it doesn't handle varying suffix without * Bypass safe_qbuf() since it doesn't handle varying suffix without
* an awful lot of support work. Format the object once, even though * an awful lot of support work. Format the object once, even though
+8 -6
View File
@@ -421,10 +421,11 @@ dowieldquiver()
} }
Strcpy(qbuf, "Ready all of them instead?"); Strcpy(qbuf, "Ready all of them instead?");
} else { } else {
boolean use_plural = (is_plural(uwep) || pair_of(uwep));
Sprintf(qbuf, "You are wielding %s. Ready %s instead?", Sprintf(qbuf, "You are wielding %s. Ready %s instead?",
/* uwep->quan is 1, but name might be plural ('boots') */ !use_plural ? "that" : "those",
!is_plural(uwep) ? "that" : "those", !use_plural ? "it" : "them");
!is_plural(uwep) ? "it" : "them");
} }
/* require confirmation to ready the main weapon */ /* require confirmation to ready the main weapon */
if (ynq(qbuf) != 'y') { if (ynq(qbuf) != 'y') {
@@ -458,11 +459,12 @@ dowieldquiver()
} }
Strcpy(qbuf, "Ready all of them instead?"); Strcpy(qbuf, "Ready all of them instead?");
} else { } else {
boolean use_plural = (is_plural(uswapwep) || pair_of(uswapwep));
Sprintf(qbuf, "%s your %s weapon. Ready %s instead?", Sprintf(qbuf, "%s your %s weapon. Ready %s instead?",
!is_plural(uswapwep) ? "That is" : "Those are", !use_plural ? "That is" : "Those are",
u.twoweap ? "second" : "alternate", u.twoweap ? "second" : "alternate",
/* uswapwep->quan is 1, but name might be plural */ !use_plural ? "it" : "them");
!is_plural(uswapwep) ? "it" : "them");
} }
/* require confirmation to ready the alternate weapon */ /* require confirmation to ready the alternate weapon */
if (ynq(qbuf) != 'y') { if (ynq(qbuf) != 'y') {