diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2000-09-26 04:42:57 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2000-09-26 04:42:57 +0000 |
commit | 081be079b82a2b9dcf1d7c705032e009184290b4 (patch) | |
tree | 7ec64cfd94c4f374f423a2d1639f6ed60b6ea28a /games/battlestar/com7.c | |
parent | 1b52f89e205c620c377b41287725ba817dcd34bb (diff) |
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.
Diffstat (limited to 'games/battlestar/com7.c')
-rw-r--r-- | games/battlestar/com7.c | 12 |
1 files changed, 7 insertions, 5 deletions
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, "<fight!>-: ", 0); - for (i = 0; next && i < 10; i++) + next = getcom(auxbuf, LINELENGTH, "<fight!>-: ", 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; |