From b70cf02d334c9377130caff93e07b0afbc39189a Mon Sep 17 00:00:00 2001 From: jsm Date: Mon, 25 Sep 2000 14:08:08 +0000 Subject: Add OBJ_AN flag to objflags so as to use "a" or "an" appropriately in messages; avoids "a amulet", "a Elf". Define and use macros to use "a", "an", "the", "is", "are" appropriately. Partly based on OpenBSD. --- battlestar/com4.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'battlestar/com4.c') diff --git a/battlestar/com4.c b/battlestar/com4.c index b73e3d61..467e2906 100644 --- a/battlestar/com4.c +++ b/battlestar/com4.c @@ -1,4 +1,4 @@ -/* $NetBSD: com4.c,v 1.17 2000/09/24 09:46:57 jsm Exp $ */ +/* $NetBSD: com4.c,v 1.18 2000/09/25 14:08:08 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)com4.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: com4.c,v 1.17 2000/09/24 09:46:57 jsm Exp $"); +__RCSID("$NetBSD: com4.c,v 1.18 2000/09/25 14:08:08 jsm Exp $"); #endif #endif /* not lint */ @@ -75,18 +75,17 @@ take(from) if (value == MEDALION) win--; } else if (testbit(inven, value)) - printf("You're already holding%s%s.\n", - (is_plural_object(value) ? " " : " a "), + printf("You're already holding %s%s.\n", + A_OR_AN_OR_BLANK(value), objsht[value]); else if (!testbit(from, value)) printf("I don't see any %s around here.\n", objsht[value]); else if (!heavy) - printf("The %s %s too heavy.\n", objsht[value], - (is_plural_object(value) ? "are" : "is")); + printf("The %s %stoo heavy.\n", objsht[value], + IS_OR_ARE(value)); else - printf("The %s %s too cumbersome to hold.\n", - objsht[value], - (is_plural_object(value) ? "are" : "is")); + printf("The %s %stoo cumbersome to hold.\n", + objsht[value], IS_OR_ARE(value)); if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) wordnumber++; else @@ -384,9 +383,8 @@ eat() return (firstnumber); default: - printf("You can't eat%s%s!\n", - is_plural_object(value) ? " " : " a ", - objsht[value]); + printf("You can't eat %s%s!\n", + A_OR_AN_OR_BLANK(value), objsht[value]); return (firstnumber); case PAPAYAS: -- cgit v1.2.3