]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - battlestar/com4.c
WARNSify
[bsdgames-darwin.git] / battlestar / com4.c
index d1ba925e6b52772f81d24763b00bcf0768f90b63..d93c0a750ec265add9bfc3ee5d66afe9ff5db5a7 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: com4.c,v 1.5 1997/10/10 11:39:25 lukem Exp $   */
+
 /*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-static char sccsid[] = "@(#)com4.c     5.4 (Berkeley) 6/1/90";
+#if 0
+static char sccsid[] = "@(#)com4.c     8.2 (Berkeley) 4/28/95";
+#else
+__RCSID("$NetBSD: com4.c,v 1.5 1997/10/10 11:39:25 lukem Exp $");
+#endif
 #endif /* not lint */
 
-#include "externs.h"
+#include "extern.h"
 
+int
 take(from)
-unsigned int from[];
+       unsigned int from[];
 {
        int firstnumber, heavy, bulky, value;
-       register int n;
+       int n;
 
        firstnumber = wordnumber;
        if (wordnumber < wordcount && wordvalue[wordnumber+1] == OFF){
@@ -61,7 +69,7 @@ unsigned int from[];
                                setbit(inven,value);
                                carrying += objwt[value];
                                encumber += objcumber[value];
-                               time++;
+                               ourtime++;
                                if (testbit(from,value))
                                        printf("Taken.\n");
                                else
@@ -165,7 +173,7 @@ unsigned int from[];
                                        puts("ties it at the waist.  Around her neck hangs a golden amulet.");
                                        puts("She bids you to follow her.");
                                        pleasure++;
-                                       followgod = time;
+                                       followgod = ourtime;
                                        clearbit(location[position].objects,BATHGOD);
                                } else if (!testbit(location[position].objects,BATHGOD))
                                        puts("You're in no position to take her.");
@@ -181,6 +189,7 @@ unsigned int from[];
        return(firstnumber);
 }
 
+int
 throw(name)
        char *name;
 {
@@ -261,8 +270,9 @@ throw(name)
        return(first);
 }
 
+int
 drop(name)
-char *name;
+       char *name;
 {
        
        int firstnumber, value;
@@ -285,7 +295,7 @@ char *name;
                                setbit(location[position].objects,value);
                        else
                                tempwiz = 0;
-                       time++;
+                       ourtime++;
                        if (*name == 'K')
                                puts("Drop kicked.");
                        else
@@ -312,18 +322,21 @@ char *name;
        return(-1);
 }
 
+int
 takeoff()
 {
        wordnumber = take(wear);
        return(drop("Dropped"));
 }
 
+int
 puton()
 {
        wordnumber = take(location[position].objects);
        return(wearit());
 }
 
+int
 eat()
 {
        int firstnumber, value;
@@ -354,16 +367,18 @@ eat()
                        case MANGO:
 
                                printf("%s:\n",objsht[value]);
-                               if (testbit(inven,value) && time > ate - CYCLE && testbit(inven,KNIFE)){
+                               if (testbit(inven,value) &&
+                                   ourtime > ate - CYCLE &&
+                                   testbit(inven,KNIFE)){
                                        clearbit(inven,value);
                                        carrying -= objwt[value];
                                        encumber -= objcumber[value];
-                                       ate = max(time,ate) + CYCLE/3;
+                                       ate = max(ourtime,ate) + CYCLE/3;
                                        snooze += CYCLE/10;
-                                       time++;
+                                       ourtime++;
                                        puts("Eaten.  You can explore a little longer now.");
                                }
-                               else if (time < ate - CYCLE)
+                               else if (ourtime < ate - CYCLE)
                                        puts("You're stuffed.");
                                else if (!testbit(inven,KNIFE))
                                        puts("You need a knife.");