From a6e37911705bca287dedfed4ed61981477055052 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 10 Sep 2002 09:10:23 +0000 Subject: [PATCH] fix B11001 - fruit name quibbling > OK, it's "grape juice" now, but it's still "bunch of grapes farm". --- include/extern.h | 2 +- src/do.c | 4 ++-- src/fountain.c | 6 ++++-- src/objnam.c | 15 ++++++++------- src/potion.c | 9 +++++---- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/include/extern.h b/include/extern.h index f016746d9..53b4ffbc3 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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)); diff --git a/src/do.c b/src/do.c index c0d44f91e..a255ca20e 100644 --- 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."); diff --git a/src/fountain.c b/src/fountain.c index 5bec5c4f0..40e878b83 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -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; diff --git a/src/objnam.c b/src/objnam.c index 90243c125..52269611b 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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; } diff --git a/src/potion.c b/src/potion.c index 466aa3e0c..a657cb776 100644 --- a/src/potion.c +++ b/src/potion.c @@ -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 { -- 2.49.0