diff options
-rw-r--r-- | battlestar/com2.c | 6 | ||||
-rw-r--r-- | battlestar/com4.c | 5 | ||||
-rw-r--r-- | battlestar/cypher.c | 19 | ||||
-rw-r--r-- | battlestar/extern.h | 3 | ||||
-rw-r--r-- | battlestar/words.c | 10 |
5 files changed, 31 insertions, 12 deletions
diff --git a/battlestar/com2.c b/battlestar/com2.c index ce8b21a7..69334568 100644 --- a/battlestar/com2.c +++ b/battlestar/com2.c @@ -1,4 +1,4 @@ -/* $NetBSD: com2.c,v 1.20 2000/09/25 14:08:08 jsm Exp $ */ +/* $NetBSD: com2.c,v 1.21 2000/09/25 19:37:58 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: com2.c,v 1.20 2000/09/25 14:08:08 jsm Exp $"); +__RCSID("$NetBSD: com2.c,v 1.21 2000/09/25 19:37:58 jsm Exp $"); #endif #endif /* not lint */ @@ -117,10 +117,12 @@ put() { /* synonyms = {buckle, strap, tie} */ if (wordvalue[wordnumber + 1] == ON) { wordvalue[++wordnumber] = PUTON; + wordtype[wordnumber] = VERB; return (cypher()); } if (wordvalue[wordnumber + 1] == DOWN) { wordvalue[++wordnumber] = DROP; + wordtype[wordnumber] = VERB; return (cypher()); } puts("I don't understand what you want to put."); diff --git a/battlestar/com4.c b/battlestar/com4.c index 467e2906..537fa065 100644 --- a/battlestar/com4.c +++ b/battlestar/com4.c @@ -1,4 +1,4 @@ -/* $NetBSD: com4.c,v 1.18 2000/09/25 14:08:08 jsm Exp $ */ +/* $NetBSD: com4.c,v 1.19 2000/09/25 19:37:58 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.18 2000/09/25 14:08:08 jsm Exp $"); +__RCSID("$NetBSD: com4.c,v 1.19 2000/09/25 19:37:58 jsm Exp $"); #endif #endif /* not lint */ @@ -54,6 +54,7 @@ take(from) if (wordnumber < wordcount && wordvalue[wordnumber + 1] == OFF) { wordnumber++; wordvalue[wordnumber] = TAKEOFF; + wordtype[wordnumber] = VERB; return (cypher()); } else { wordnumber++; diff --git a/battlestar/cypher.c b/battlestar/cypher.c index a0642aec..caf4139d 100644 --- a/battlestar/cypher.c +++ b/battlestar/cypher.c @@ -1,4 +1,4 @@ -/* $NetBSD: cypher.c,v 1.20 2000/09/25 14:06:20 jsm Exp $ */ +/* $NetBSD: cypher.c,v 1.21 2000/09/25 19:37:58 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cypher.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: cypher.c,v 1.20 2000/09/25 14:06:20 jsm Exp $"); +__RCSID("$NetBSD: cypher.c,v 1.21 2000/09/25 19:37:58 jsm Exp $"); #endif #endif /* not lint */ @@ -55,8 +55,23 @@ cypher() size_t filename_len; while (wordnumber <= wordcount) { + if (wordtype[wordnumber] != VERB && + !(wordtype[wordnumber] == OBJECT && wordvalue[wordnumber] == KNIFE)) { + printf("%s: How's that?\n", + (wordnumber == wordcount) ? words[0] : words[wordnumber]); + return (-1); + } + switch (wordvalue[wordnumber]) { + case AUXVERB: + /* + * Take the following word as the verb (e.g. + * "make love", "climb up"). + */ + wordnumber++; + continue; + case UP: if (location[position].access || wiz || tempwiz) { if (!location[position].access) diff --git a/battlestar/extern.h b/battlestar/extern.h index edc3c2cf..ef8e3910 100644 --- a/battlestar/extern.h +++ b/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.27 2000/09/25 14:44:59 jsm Exp $ */ +/* $NetBSD: extern.h,v 1.28 2000/09/25 19:37:59 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -190,6 +190,7 @@ #define OPEN 1053 #define VERBOSE 1054 #define BRIEF 1055 +#define AUXVERB 1056 /* injuries */ #define ARM 6 /* broken arm */ diff --git a/battlestar/words.c b/battlestar/words.c index 86365a87..6bcc5414 100644 --- a/battlestar/words.c +++ b/battlestar/words.c @@ -1,4 +1,4 @@ -/* $NetBSD: words.c,v 1.9 2000/09/21 17:44:34 jsm Exp $ */ +/* $NetBSD: words.c,v 1.10 2000/09/25 19:37:59 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)words.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: words.c,v 1.9 2000/09/21 17:44:34 jsm Exp $"); +__RCSID("$NetBSD: words.c,v 1.10 2000/09/25 19:37:59 jsm Exp $"); #endif #endif /* not lint */ @@ -212,9 +212,9 @@ struct wlist wlist[] = { { "purple", 0, ADJS, NULL }, { "kingly", 0, ADJS, NULL }, { "the", 0, ADJS, NULL }, - { "climb", 0, ADJS, NULL }, - { "move", 0, ADJS, NULL }, - { "make", 0, ADJS, NULL }, + { "climb", AUXVERB, VERB, NULL }, + { "move", AUXVERB, VERB, NULL }, + { "make", AUXVERB, VERB, NULL }, { "to", 0, ADJS, NULL }, { NULL, 0, 0, NULL } }; |