diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2000-09-23 03:02:39 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2000-09-23 03:02:39 +0000 |
commit | f6309a870e25a5f3bdffac70b081140ced9881c8 (patch) | |
tree | f32005b4b51cc4f5cda9705ab238dd5feb29cff4 /games/battlestar/extern.h | |
parent | 72ac17839d819818408469ecafad2cae36fbb3e8 (diff) |
drop adjectives in parse(), since they're never used.
tidy a little. fix love() a bit.
From conversations with jsm@netbsd.org:
Add objflags[] to deal with plurals and a/an usage.
Commas don't mean AND if followed by a verb.
Check for object presence before trying to lift or eat it.
Diffstat (limited to 'games/battlestar/extern.h')
-rw-r--r-- | games/battlestar/extern.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/games/battlestar/extern.h b/games/battlestar/extern.h index fb8fbcbdc03..1e911bfa111 100644 --- a/games/battlestar/extern.h +++ b/games/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.8 2000/09/17 21:28:32 pjanzen Exp $ */ +/* $OpenBSD: extern.h,v 1.9 2000/09/23 03:02:36 pjanzen Exp $ */ /* $NetBSD: extern.h,v 1.5 1995/04/24 12:22:18 cgd Exp $ */ /* @@ -60,7 +60,8 @@ #define SetBit(array, index) (array[index/BITS] |= (1 << (index % BITS))) #define ClearBit(array, index) (array[index/BITS] &= ~(1 << (index % BITS))) /* "a " vs "an " before an object */ -#define AorAn(value) (strchr("aeiou", objsht[value][0]) ? "an " : "a ") +#define AorAn(value) (objflags[(value)] & OBJ_AN ? "an " : "a ") +#define IsPluralObject(value) (objflags[(value)] & OBJ_PLURAL) /* well known rooms */ #define FINAL 275 @@ -110,8 +111,8 @@ #define MACE 29 #define SHOVEL 30 #define HALBERD 31 -#define COMPASS 32 -#define CRASH 33 +#define COMPASS 32 +#define CRASH 33 #define ELF 34 #define FOOT 35 #define COINS 36 @@ -209,7 +210,7 @@ #define NUMOFINJURIES 13 /* notes */ -#define CANTLAUNCH 0 +#define CANTLAUNCH 0 #define LAUNCHED 1 #define CANTSEE 2 #define CANTMOVE 3 @@ -235,6 +236,10 @@ #define MAXWEIGHT 60 #define MAXCUMBER 10 +/* Flags for objects */ +#define OBJ_PLURAL 1 +#define OBJ_AN 2 + struct room { const char *name; int link[8]; @@ -259,6 +264,7 @@ extern const char *const objsht[NUMOFOBJECTS]; extern const char *const ouch[NUMOFINJURIES]; extern const int objwt[NUMOFOBJECTS]; extern const int objcumber[NUMOFOBJECTS]; +extern const int objflags[NUMOFOBJECTS]; /* current input line */ #define WORDLEN 15 |