E long FDECL(money2mon, (struct monst *, long));
E void FDECL(money2u, (struct monst *, long));
#endif
-E char *FDECL(shkname, (struct monst *));
E void FDECL(shkgone, (struct monst *));
E void FDECL(set_residency, (struct monst *,BOOLEAN_P));
E void FDECL(replshk, (struct monst *,struct monst *));
E void FDECL(stock_room, (int,struct mkroom *));
E boolean FDECL(saleable, (struct monst *,struct obj *));
E int FDECL(get_shop_item, (int));
+E const char *FDECL(shkname, (struct monst *));
+E boolean FDECL(shkname_is_pname, (struct monst *));
/* ### sit.c ### */
-/* SCCS Id: @(#)end.c 3.5 2004/12/21 */
+/* SCCS Id: @(#)end.c 3.5 2005/03/11 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
Strcat(buf, "ghost");
if (mtmp->mnamelth) Sprintf(eos(buf), " of %s", NAME(mtmp));
} else if(mtmp->isshk) {
- Sprintf(eos(buf), "%s %s, the shopkeeper",
- (mtmp->female ? "Ms." : "Mr."), shkname(mtmp));
+ const char *shknm = shkname(mtmp),
+ *honorific = shkname_is_pname(mtmp) ? "" :
+ mtmp->female ? "Ms. " : "Mr. ";
+
+ Sprintf(eos(buf), "%s%s, the shopkeeper", honorific, shknm);
killer.format = KILLED_BY;
} else if (mtmp->ispriest || mtmp->isminion) {
/* m_monnam() suppresses "the" prefix plus "invisible", and
#define VEGETARIAN_CLASS (MAXOCLASSES+1)
+/*
+ * Name prefix codes:
+ * dash _ female, personal name
+ * underscore _ female, general name
+ * plus + male, personal name
+ * vertical bar | male, general name (implied for most of shktools)
+ * equals = gender not specified, personal name
+ *
+ * Personal names do not receive the honorific prefix "Mr." or "Ms.".
+ */
+
static const char * const shkliquors[] = {
/* Ukraine */
"Njezjin", "Tsjernigof", "Ossipewsk", "Gorlowka",
"Ganden", "Tsurphu", "Lhasa", "Tsedong",
"Drepung",
/* Hippie names */
- "Azura", "Blaze", "Breanna", "Breezy",
- "Dharma", "Feather", "Jasmine", "Luna",
- "Melody", "Moonjava", "Petal", "Rhiannon",
- "Starla", "Tranquilla", "Windsong", "Zennia",
- "Zoe", "Zora",
+ "=Azura", "=Blaze", "=Breanna", "=Breezy",
+ "=Dharma", "=Feather", "=Jasmine", "=Luna",
+ "=Melody", "=Moonjava", "=Petal", "=Rhiannon",
+ "=Starla", "=Tranquilla", "=Windsong", "=Zennia",
+ "=Zoe", "=Zora",
0
};
{"hardware store", TOOL_CLASS, 3, D_SHOP,
{{100, TOOL_CLASS}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
shktools},
- /* Actually shktools is ignored; the code specifically chooses a
- * random implementor name (along with candle shops having
- * random shopkeepers)
- */
{"rare books", SPBOOK_CLASS, 3, D_SHOP,
{{90, SPBOOK_CLASS}, {10, SCROLL_CLASS}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
shkbooks},
if (nlp == shklight && In_mines(&u.uz)
&& (sptr = Is_special(&u.uz)) != 0 && sptr->flags.town) {
/* special-case minetown lighting shk */
- shname = "Izchak";
+ shname = "+Izchak";
shk->female = FALSE;
} else {
/* We want variation from game to game, without needing the save
for (trycnt = 0; trycnt < 50; trycnt++) {
if (nlp == shktools) {
shname = shktools[rn2(names_avail)];
- shk->female = (*shname == '_');
- if (shk->female) shname++;
+ shk->female = 0; /* reversed below for '_' prefix */
} else if (name_wanted < names_avail) {
shname = nlp[name_wanted];
} else if ((i = rn2(names_avail)) != 0) {
continue;
continue; /* next `trycnt' iteration */
} else {
- shname = shk->female ? "Lucrezia" : "Dirk";
+ shname = shk->female ? "-Lucrezia" : "+Dirk";
}
+ if (*shname == '_' || *shname == '-') shk->female = 1;
+ else if (*shname == '|' || *shname == '+') shk->female = 0;
/* is name already in use on this level? */
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
return shp->iprobs[i].itype;
}
+const char *
+shkname(mtmp)
+struct monst *mtmp;
+{
+ const char *shknm = ESHK(mtmp)->shknam;
+
+ /* strip prefix if present */
+ if (!letter(*shknm)) ++shknm;
+ return shknm;
+}
+
+boolean
+shkname_is_pname(mtmp)
+struct monst *mtmp;
+{
+ const char *shknm = ESHK(mtmp)->shknam;
+
+ return (*shknm == '-' || *shknm == '+' || *shknm == '=');
+}
+
/*shknam.c*/