From 081be079b82a2b9dcf1d7c705032e009184290b4 Mon Sep 17 00:00:00 2001 From: Paul Janzen Date: Tue, 26 Sep 2000 04:42:57 +0000 Subject: Improve handling of multiple commands on one line. Tidy fight parser. Handle "all" in one place (almost). Add AUXVERB category and OBJ_PERSON/ OBJ_NONOBJ flags. Most was discussed with jsm@netbsd.org, and some is from him. --- games/battlestar/com7.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'games/battlestar/com7.c') diff --git a/games/battlestar/com7.c b/games/battlestar/com7.c index 179107fc9cc..94a0b618231 100644 --- a/games/battlestar/com7.c +++ b/games/battlestar/com7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com7.c,v 1.8 2000/07/24 01:02:43 pjanzen Exp $ */ +/* $OpenBSD: com7.c,v 1.9 2000/09/26 04:42:56 pjanzen Exp $ */ /* $NetBSD: com7.c,v 1.3 1995/03/21 15:07:12 cgd Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)com7.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: com7.c,v 1.8 2000/07/24 01:02:43 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: com7.c,v 1.9 2000/09/26 04:42:56 pjanzen Exp $"; #endif #endif /* not lint */ @@ -55,6 +55,7 @@ fight(enemy, strength) int i; int exhaustion; + stop_cypher = 1; /* Don't parse the existing input line further */ fighton: ourtime++; snooze -= 5; @@ -66,8 +67,8 @@ fighton: } if (snooze - ourtime < 20) puts("You look tired! I hope you're able to fight."); - next = getcom(auxbuf, LINELENGTH, "-: ", 0); - for (i = 0; next && i < 10; i++) + next = getcom(auxbuf, LINELENGTH, "-: ", NULL); + for (i = 0; next && i < NWORD - 1; i++) next = getword(next, words[i], -1); parse(); switch (wordvalue[wordnumber]) { @@ -149,7 +150,7 @@ fighton: puts("His arm swings lifeless at his side."); break; case 2: - puts("Clutching his blood drenched shirt, he collapses stunned."); + puts("Clutching his blood-drenched shirt, he collapses, stunned."); break; } lifeline += 20; @@ -233,6 +234,7 @@ fighton: case DROP: case DRAW: + /* One call to cypher() does only the first command on the line */ cypher(); ourtime--; break; -- cgit v1.2.3