]> granicus.if.org Git - nethack/commitdiff
fix B11001 - fruit name quibbling
authornethack.rankin <nethack.rankin>
Tue, 10 Sep 2002 09:10:23 +0000 (09:10 +0000)
committernethack.rankin <nethack.rankin>
Tue, 10 Sep 2002 09:10:23 +0000 (09:10 +0000)
> OK, it's "grape juice" now, but it's still "bunch of grapes farm".

include/extern.h
src/do.c
src/fountain.c
src/objnam.c
src/potion.c

index f016746d9f531f8cec47489f2a9ca5ceefc37135..53b4ffbc335d9b88bec7d77b5dca85597b9b7dff 100644 (file)
@@ -1326,7 +1326,7 @@ E char *FDECL(obj_typename, (int));
 E char *FDECL(simple_typename, (int));
 E boolean FDECL(obj_is_pname, (struct obj *));
 E char *FDECL(distant_name, (struct obj *,char *(*)(OBJ_P)));
-E char *NDECL(fruitjuice);
+E char *FDECL(fruitname, (BOOLEAN_P));
 E char *FDECL(xname, (struct obj *));
 E char *FDECL(mshot_xname, (struct obj *));
 E boolean FDECL(the_unique_obj, (struct obj *obj));
index c0d44f91ecdf13ce453dedfe54fd611fdcde48c6..a255ca20ef1d3cfaed3db467a1bcc72c306b8451 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)do.c       3.4     2002/08/11      */
+/*     SCCS Id: @(#)do.c       3.4     2002/09/08      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -260,7 +260,7 @@ giveback:
                pline_The("sink quivers upward for a moment.");
                break;
            case RIN_POISON_RESISTANCE:
-               You("smell rotten %s.", makeplural(pl_fruit));
+               You("smell rotten %s.", makeplural(fruitname(FALSE)));
                break;
            case RIN_AGGRAVATE_MONSTER:
                pline("Several flies buzz angrily around the sink.");
index 5bec5c4f0a4e8f5b64d33ae5c1dc6fb417148db1..40e878b83abeab6657c75ba2c01bbe8f75c791a5 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)fountain.c 3.4     2002/07/10      */
+/*     SCCS Id: @(#)fountain.c 3.4     2002/09/08      */
 /*     Copyright Scott R. Turner, srt@ucla, 10/27/86 */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -255,7 +255,9 @@ drinkfountain()
 
                        pline_The("water is contaminated!");
                        if (Poison_resistance) {
-          pline("Perhaps it is runoff from the nearby %s farm.", pl_fruit);
+                          pline(
+                             "Perhaps it is runoff from the nearby %s farm.",
+                                fruitname(FALSE));
                           losehp(rnd(4),"unrefrigerated sip of juice",
                                KILLED_BY_AN);
                           break;
index 90243c1257881d5be8edfd21682e336a06ab6632..52269611b382993cb75d7a713311f6016de4cbc1 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)objnam.c   3.4     2002/08/18      */
+/*     SCCS Id: @(#)objnam.c   3.4     2002/09/08      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -212,17 +212,18 @@ char *FDECL((*func), (OBJ_P));
 /* convert player specified fruit name into corresponding fruit juice name
    ("slice of pizza" -> "pizza juice" rather than "slice of pizza juice") */
 char *
-fruitjuice()
+fruitname(juice)
+boolean juice; /* whether or not to append " juice" to the name */
 {
     char *buf = nextobuf();
-    const char *juice = strstri(pl_fruit, " of ");
+    const char *fruit_nam = strstri(pl_fruit, " of ");
 
-    if (juice)
-       juice += 4;             /* skip past " of " */
+    if (fruit_nam)
+       fruit_nam += 4;         /* skip past " of " */
     else
-       juice = pl_fruit;       /* use it as is */
+       fruit_nam = pl_fruit;   /* use it as is */
 
-    Sprintf(buf, "%s juice", makesingular(juice));
+    Sprintf(buf, "%s%s", makesingular(fruit_nam), juice ? " juice" : "");
     return buf;
 }
 
index 466aa3e0caeeaff6878054454e7c3630afc69354..a657cb776a378c724beee8e983a30d647f58d75d 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)potion.c   3.4     2002/08/18      */
+/*     SCCS Id: @(#)potion.c   3.4     2002/09/08      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -563,7 +563,8 @@ peffects(otmp)
                    pline(Hallucination ?
                      "This tastes like 10%% real %s%s all-natural beverage." :
                                "This tastes like %s%s.",
-                        otmp->odiluted ? "reconstituted " : "", fruitjuice());
+                         otmp->odiluted ? "reconstituted " : "",
+                         fruitname(TRUE));
                if (otmp->otyp == POT_FRUIT_JUICE) {
                    u.uhunger += (otmp->odiluted ? 5 : 10) * (2 + bcsign(otmp));
                    newuhs(FALSE);
@@ -654,7 +655,7 @@ peffects(otmp)
                pline("Yecch!  This stuff tastes like poison.");
                if (otmp->blessed) {
                    pline("(But in fact it was mildly stale %s.)",
-                         fruitjuice());
+                         fruitname(TRUE));
                    if (!Role_if(PM_HEALER)) {
                        if (otmp->corpsenm)
                            losehp(1,
@@ -667,7 +668,7 @@ peffects(otmp)
                    if(Poison_resistance)
                        pline(
                          "(But in fact it was biologically contaminated %s.)",
-                             fruitjuice());
+                             fruitname(TRUE));
                    if (Role_if(PM_HEALER))
                        pline("Fortunately, you have been immunized.");
                    else {