]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - battlestar/com2.c
Don't try to wear anything that isn't OBJECT or NOUNS. Don't try to
[bsdgames-darwin.git] / battlestar / com2.c
index 19ec2ec61bfec1664bc6a9cd5805317177e5acc4..634d4e3dd0aa2c56bf597595c678065c9df33fa1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: com2.c,v 1.10 2000/09/17 23:04:17 jsm Exp $    */
+/*     $NetBSD: com2.c,v 1.12 2000/09/21 10:38:50 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.10 2000/09/17 23:04:17 jsm Exp $");
+__RCSID("$NetBSD: com2.c,v 1.12 2000/09/21 10:38:50 jsm Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -52,8 +52,11 @@ wearit()
 
        firstnumber = wordnumber;
        while (wordtype[++wordnumber] == ADJS);
-       while (wordnumber <= wordcount) {
+       while (wordnumber <= wordcount && (wordtype[wordnumber] == OBJECT ||
+           wordtype[wordnumber] == NOUNS) && wordvalue[wordnumber] != DOOR) {
                value = wordvalue[wordnumber];
+               if (objsht[value] == NULL)
+                       break;
                for (n = 0; objsht[value][n]; n++);
                switch (value) {
 
@@ -178,9 +181,35 @@ murder()
        int     n;
 
        for (n = 0; !((n == SWORD || n == KNIFE || n == TWO_HANDED || n == MACE || n == CLEAVER || n == BROAD || n == CHAIN || n == SHOVEL || n == HALBERD) && testbit(inven, n)) && n < NUMOFOBJECTS; n++);
-       if (n == NUMOFOBJECTS)
-               puts("You don't have suitable weapons to kill.");
-       else {
+       if (n == NUMOFOBJECTS) {
+               if (testbit(inven, LASER)) {
+                       printf("Your laser should do the trick.\n");
+                       n = wordnumber;
+                       while (wordtype[++n] == ADJS)
+                               ;
+                       switch(wordvalue[n]) {
+                       case NORMGOD:
+                       case TIMER:
+                       case NATIVE:
+                       case MAN:
+                               wordvalue[wordnumber] = SHOOT;
+                               cypher();
+                               break;
+                       case -1:
+                               puts("Kill what?");
+                               break;
+                       default:
+                               if (wordtype[n] != OBJECT ||
+                                   wordvalue[wordnumber] == EVERYTHING)
+                                       puts("You can't kill that!");
+                               else
+                                       printf("You can't kill the %s!\n",
+                                           objsht[wordvalue[n]]);
+                               break;
+                       }
+               } else
+                       puts("You don't have suitable weapons to kill.");
+       } else {
                printf("Your %s should do the trick.\n", objsht[n]);
                while (wordtype[++wordnumber] == ADJS);
                switch (wordvalue[wordnumber]) {