-/* $NetBSD: com6.c,v 1.14 1999/09/13 17:18:56 jsm Exp $ */
+/* $NetBSD: com6.c,v 1.19 2000/09/22 08:19:21 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)com6.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: com6.c,v 1.14 1999/09/13 17:18:56 jsm Exp $");
+__RCSID("$NetBSD: com6.c,v 1.19 2000/09/22 08:19:21 jsm Exp $");
#endif
#endif /* not lint */
post(ch)
char ch;
{
- struct timeval tv;
- time_t tvsec;
+ time_t tv;
char *date;
sigset_t sigset, osigset;
sigemptyset(&sigset);
sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, &osigset);
- gettimeofday(&tv, (struct timezone *) 0); /* can't call time */
- tvsec = (time_t) tv.tv_sec;
- date = ctime(&tvsec);
+ tv = time(NULL);
+ date = ctime(&tv);
date[24] = '\0';
if (score_fp != NULL) {
fprintf(score_fp, "%s %8s %c%20s", date, username, ch, rate());
if (score == pleasure) {
if (score < 5)
return ("novice");
+ else if (score < 20)
+ return ("junior voyeur");
+ else if (score < 35)
+ return ("Don Juan");
else
- if (score < 20)
- return ("junior voyeur");
- else
- if (score < 35)
- return ("Don Juan");
- else
- return ("Marquis De Sade");
- } else
- if (score == power) {
- if (score < 5)
- return ("serf");
- else
- if (score < 8)
- return ("Samurai");
- else
- if (score < 13)
- return ("Klingon");
- else
- if (score < 22)
- return ("Darth Vader");
- else
- return ("Sauron the Great");
- } else {
- if (score < 5)
- return ("Polyanna");
- else
- if (score < 10)
- return ("philanthropist");
- else
- if (score < 20)
- return ("Tattoo");
- else
- return ("Mr. Roarke");
- }
+ return ("Marquis De Sade");
+ } else if (score == power) {
+ if (score < 5)
+ return ("serf");
+ else if (score < 8)
+ return ("Samurai");
+ else if (score < 13)
+ return ("Klingon");
+ else if (score < 22)
+ return ("Darth Vader");
+ else
+ return ("Sauron the Great");
+ } else {
+ if (score < 5)
+ return ("Polyanna");
+ else if (score < 10)
+ return ("philanthropist");
+ else if (score < 20)
+ return ("Tattoo");
+ else
+ return ("Mr. Roarke");
+ }
}
int
{
if (testbit(location[position].objects, HORSE)) {
puts("You climb onto the stallion and kick it in the guts. The stupid steed launches");
- puts("forward through bush and fern. You are thrown and the horse gallups off.");
+ puts("forward through bush and fern. You are thrown and the horse gallops off.");
clearbit(location[position].objects, HORSE);
while (!(position = rnd(NUMOFROOMS + 1)) || !OUTSIDE || !beenthere[position] || location[position].flyhere);
setbit(location[position].objects, HORSE);
if (location[position].north)
position = location[position].north;
+ else if (location[position].south)
+ position = location[position].south;
+ else if (location[position].east)
+ position = location[position].east;
else
- if (location[position].south)
- position = location[position].south;
- else
- if (location[position].east)
- position = location[position].east;
- else
- position = location[position].west;
+ position = location[position].west;
return (0);
} else
puts("There is no horse here.");
} else
puts("You're out of matches.");
}
+
+void
+dooropen()
+{ /* synonyms = {open, unlock} */
+ wordnumber++;
+ if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS
+ && wordvalue[wordnumber] == DOOR) {
+ switch(position) {
+ case 189:
+ case 231:
+ if (location[189].north == 231)
+ puts("The door is already open.");
+ else
+ puts("The door does not budge.");
+ break;
+ case 30:
+ if (location[30].west == 25)
+ puts("The door is gone.");
+ else
+ puts("The door is locked tight.");
+ break;
+ case 31:
+ puts("That's one immovable door.");
+ break;
+ case 20:
+ puts("The door is already ajar.");
+ break;
+ default:
+ puts("What door?");
+ }
+ } else
+ puts("That doesn't open.");
+}