+/* $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){
setbit(inven,value);
carrying += objwt[value];
encumber += objcumber[value];
- time++;
+ ourtime++;
if (testbit(from,value))
printf("Taken.\n");
else
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.");
return(firstnumber);
}
+int
throw(name)
char *name;
{
return(first);
}
+int
drop(name)
-char *name;
+ char *name;
{
int firstnumber, value;
setbit(location[position].objects,value);
else
tempwiz = 0;
- time++;
+ ourtime++;
if (*name == 'K')
puts("Drop kicked.");
else
return(-1);
}
+int
takeoff()
{
wordnumber = take(wear);
return(drop("Dropped"));
}
+int
puton()
{
wordnumber = take(location[position].objects);
return(wearit());
}
+int
eat()
{
int firstnumber, value;
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.");