singularization of irregularly pluralized monster types

Fix makesingular() to handle "vortices", "liches", and "fungi"
as suggested by <Someone> a while back; also "fungus".
This commit is contained in:
nethack.rankin
2002-05-31 03:39:00 +00:00
parent 761164a30f
commit a99a8fcba8
2 changed files with 24 additions and 9 deletions
+1
View File
@@ -111,6 +111,7 @@ usually stop mimicing if you polymorph while using #monster mimic capability
under !GOLDOBJ, gold shouldn't disappear if you try to throw it at yourself under !GOLDOBJ, gold shouldn't disappear if you try to throw it at yourself
under !GOLDOBJ, remove temp gold from inventory during restore under !GOLDOBJ, remove temp gold from inventory during restore
Staff of Aesculapius did not always cure sliming Staff of Aesculapius did not always cure sliming
correct singularization of fungi, liches, vortices
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+23 -9
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)objnam.c 3.4 2002/04/30 */ /* SCCS Id: @(#)objnam.c 3.4 2002/05/30 */
/* 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. */
@@ -1452,27 +1452,32 @@ const char *oldstr;
Strcpy(p-3, "fe"); Strcpy(p-3, "fe");
return bp; return bp;
} }
if(!BSTRCMP(bp, p-6, "staves")) { if(!BSTRCMP(bp, p-6, "staves")) {
Strcpy(p-3, "ff"); Strcpy(p-3, "ff");
return bp; return bp;
} }
if (!BSTRCMPI(bp, p-6, "leaves")) { if (!BSTRCMPI(bp, p-6, "leaves")) {
Strcpy(p-3, "f"); Strcpy(p-3, "f");
return bp; return bp;
} }
if (!BSTRCMP(bp, p-8, "vortices")) {
/* note: nurses, axes but boxes */ Strcpy(p-4, "ex");
if(!BSTRCMP(bp, p-5, "boxes")) {
p[-2] = 0;
return bp; return bp;
} }
/* note: nurses, axes but boxes */
if (!BSTRCMP(bp, p-5, "boxes") ||
!BSTRCMP(bp, p-4, "ches")) {
p[-2] = '\0';
return bp;
}
if (!BSTRCMP(bp, p-6, "gloves") || if (!BSTRCMP(bp, p-6, "gloves") ||
!BSTRCMP(bp, p-6, "lenses") || !BSTRCMP(bp, p-6, "lenses") ||
!BSTRCMP(bp, p-5, "shoes") || !BSTRCMP(bp, p-5, "shoes") ||
!BSTRCMP(bp, p-6, "scales")) !BSTRCMP(bp, p-6, "scales"))
return bp; return bp;
} else if (!BSTRCMP(bp, p-5, "boots") || } else if (!BSTRCMP(bp, p-5, "boots") ||
!BSTRCMP(bp, p-9, "gauntlets") || !BSTRCMP(bp, p-9, "gauntlets") ||
!BSTRCMP(bp, p-6, "tricks") || !BSTRCMP(bp, p-6, "tricks") ||
@@ -1486,15 +1491,24 @@ const char *oldstr;
#ifdef WIZARD #ifdef WIZARD
!BSTRCMP(bp, p-9, "iron bars") || !BSTRCMP(bp, p-9, "iron bars") ||
#endif #endif
!BSTRCMP(bp, p-5, "aklys")) !BSTRCMP(bp, p-5, "aklys") ||
!BSTRCMP(bp, p-6, "fungus"))
return bp; return bp;
mins: mins:
p[-1] = 0; p[-1] = '\0';
} else { } else {
if(!BSTRCMP(bp, p-5, "teeth")) { if(!BSTRCMP(bp, p-5, "teeth")) {
Strcpy(p-5, "tooth"); Strcpy(p-5, "tooth");
return bp; return bp;
} }
if (!BSTRCMP(bp, p-5, "fungi")) {
Strcpy(p-5, "fungus");
return bp;
}
/* here we cannot find the plural suffix */ /* here we cannot find the plural suffix */
} }
return bp; return bp;