]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - battlestar/extern.h
Rename com#.c to command#.c to avoid conflicts with those file basenames
[bsdgames-darwin.git] / battlestar / extern.h
index 3257bfd779f4c0790197fcfcdd1122cbae91947e..ef8e3910f8e0961dba087cbcfc724c1d57aed373 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.22 2000/09/23 19:23:58 jsm Exp $ */
+/*     $NetBSD: extern.h,v 1.28 2000/09/25 19:37:59 jsm Exp $ */
 
 /*
  * Copyright (c) 1983, 1993
 #define OPEN   1053
 #define VERBOSE        1054
 #define BRIEF  1055
+#define AUXVERB        1056
 
  /* injuries */
 #define ARM    6               /* broken arm */
 #define MAXWEIGHT      60
 #define MAXCUMBER      10
 
-/* Flags for objects.  */
+/*
+ * These are flags for objects in the objflags array.  OBJ_PLURAL means
+ * that the object short name is plural; OBJ_AN that it begins with a
+ * vowel sound so should be preceded by "an" instead of "a"; OBJ_PERSON
+ * that it is a living person; OBJ_NONOBJ that it is not an object (to
+ * which any game action can be applied) at all (e.g. footsteps, asteroids).
+ * Any individual object has at most one of OBJ_PERSON and OBJ_NONOBJ.
+ */
 #define OBJ_PLURAL     1
+#define OBJ_AN         2
+#define OBJ_PERSON     4
+#define OBJ_NONOBJ     8
 
 struct room {
        const char   *name;
@@ -256,6 +267,14 @@ extern const int     objwt[NUMOFOBJECTS];
 extern const int     objcumber[NUMOFOBJECTS];
 extern const int     objflags[NUMOFOBJECTS];
 #define is_plural_object(n)    (objflags[(n)] & OBJ_PLURAL)
+/*
+ * These macros yield words to use with objects (followed but not preceded
+ * by spaces, or with no spaces if the expansion is the empty string).
+ */
+#define A_OR_AN(n)             (objflags[(n)] & OBJ_AN ? "an " : "a ")
+#define A_OR_AN_OR_THE(n)      (is_plural_object((n)) ? "the " : A_OR_AN((n)))
+#define A_OR_AN_OR_BLANK(n)    (is_plural_object((n)) ? "" : A_OR_AN((n)))
+#define IS_OR_ARE(n)           (is_plural_object((n)) ? "are " : "is ")
 
  /* current input line */
 #define WORDLEN        15
@@ -302,10 +321,6 @@ struct wlist {
        int     value, article;
        struct wlist *next;
 };
-#define HASHSIZE       256
-#define HASHMUL                81
-#define HASHMASK       (HASHSIZE - 1)
-extern struct wlist *hashtab[HASHSIZE];
 extern struct wlist wlist[];
 
 struct objs {
@@ -317,7 +332,6 @@ extern const struct objs nightobjs[];
 
 #define DEFAULT_SAVE_FILE      ".Bstar"
 
-void blast __P((void));
 void bury __P((void));
 int card __P((const char *, int));
 void chime __P((void));
@@ -333,29 +347,23 @@ void drink __P((void));
 int drive __P((void));
 int drop __P((const char *));
 int eat __P((void));
-void endfly __P((void));
 int fight __P((int, int));
 int follow __P((void));
 char *getcom __P((char *, int, const char *, const char *));
 char *getword __P((char *, char *, int));
 int give __P((void));
-int hash __P((const char *));
 void initialize __P((const char *));
-void install __P((struct wlist *));
 int jump __P((void));
 void kiss __P((void));
 int land __P((void));
 int launch __P((void));
 void light __P((void));
 void live __P((void)) __attribute__((__noreturn__));
-struct wlist *lookup __P((const char *));
 void love __P((void));
-void moveenemy __P((int));
 int moveplayer __P((int, int));
 void murder __P((void));
 void news __P((void));
 void newway __P((int));
-void notarget __P((void));
 void open_score_file __P((void));
 void parse __P((void));
 void post __P((char));
@@ -368,12 +376,9 @@ void restore __P((const char *));
 int ride __P((void));
 void save __P((const char *));
 char *save_file_name __P((const char *, size_t));
-void screen __P((void));
 int shoot __P((void));
-void succumb __P((int));
 int take __P((unsigned int[]));
 int takeoff __P((void));
-void target __P((void));
 int throw __P((const char *));
 const char *truedirec __P((int, char));
 int ucard __P((const unsigned int *));