summaryrefslogtreecommitdiffstats
path: root/battlestar/com2.c
diff options
context:
space:
mode:
Diffstat (limited to 'battlestar/com2.c')
-rw-r--r--battlestar/com2.c47
1 files changed, 31 insertions, 16 deletions
diff --git a/battlestar/com2.c b/battlestar/com2.c
index a38afe4c..77c4f46c 100644
--- a/battlestar/com2.c
+++ b/battlestar/com2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com2.c,v 1.4 1997/01/07 11:56:35 tls Exp $ */
+/* $NetBSD: com2.c,v 1.5 1997/10/10 11:39:19 lukem Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -33,19 +33,21 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$NetBSD: com2.c,v 1.4 1997/01/07 11:56:35 tls Exp $";
+__RCSID("$NetBSD: com2.c,v 1.5 1997/10/10 11:39:19 lukem Exp $");
#endif
#endif /* not lint */
#include "extern.h"
+int
wearit() /* synonyms = {sheathe, sheath} */
{
- register int n;
+ int n;
int firstnumber, value;
firstnumber = wordnumber;
@@ -87,14 +89,19 @@ wearit() /* synonyms = {sheathe, sheath} */
setbit(wear,value);
carrying -= objwt[value];
encumber -= objcumber[value];
- time++;
- printf("You are now wearing %s %s.\n",(objsht[value][n-1] == 's' ? "the" : "a"), objsht[value]);
+ ourtime++;
+ printf("You are now wearing %s %s.\n",
+ (objsht[value][n-1] == 's' ? "the"
+ : "a"), objsht[value]);
}
else if (testbit(wear,value))
- printf("You are already wearing the %s.\n", objsht[value]);
+ printf("You are already wearing the %s.\n",
+ objsht[value]);
else
- printf("You aren't holding the %s.\n", objsht[value]);
- if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND)
+ printf("You aren't holding the %s.\n",
+ objsht[value]);
+ if (wordnumber < wordcount - 1 &&
+ wordvalue[++wordnumber] == AND)
wordnumber++;
else
return(firstnumber);
@@ -104,6 +111,7 @@ wearit() /* synonyms = {sheathe, sheath} */
return(firstnumber);
}
+int
put() /* synonyms = {buckle, strap, tie} */
{
if (wordvalue[wordnumber + 1] == ON){
@@ -119,15 +127,18 @@ put() /* synonyms = {buckle, strap, tie} */
}
+int
draw() /* synonyms = {pull, carry} */
{
return(take(wear));
}
+int
use()
{
while (wordtype[++wordnumber] == ADJS && wordnumber < wordcount);
- if (wordvalue[wordnumber] == AMULET && testbit(inven,AMULET) && position != FINAL){
+ if (wordvalue[wordnumber] == AMULET && testbit(inven,AMULET) &&
+ position != FINAL){
puts("The amulet begins to glow.");
if (testbit(inven,MEDALION)){
puts("The medallion comes to life too.");
@@ -135,7 +146,7 @@ use()
location[position].down = 160;
whichway(location[position]);
puts("The waves subside and it is possible to descend to the sea cave now.");
- time++;
+ ourtime++;
return(-1);
}
}
@@ -145,7 +156,7 @@ use()
position = 224;
else
position = 229;
- time++;
+ ourtime++;
return(0);
}
else if (position == FINAL)
@@ -161,9 +172,10 @@ use()
return(-1);
}
+void
murder()
{
- register int n;
+ 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)
@@ -222,16 +234,18 @@ murder()
if (wordtype[wordnumber] != NOUNS)
puts("Kill what?");
else
- printf("You can't kill the %s!\n",objsht[wordvalue[wordnumber]]);
+ printf("You can't kill the %s!\n",
+ objsht[wordvalue[wordnumber]]);
}
}
}
+void
ravage()
{
while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount);
if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects,wordvalue[wordnumber])){
- time++;
+ ourtime++;
switch(wordvalue[wordnumber]){
case NORMGOD:
puts("You attack the goddess, and she screams as you beat her. She falls down");
@@ -276,9 +290,10 @@ ravage()
puts("Who?");
}
+int
follow()
{
- if (followfight == time){
+ if (followfight == ourtime){
puts("The Dark Lord leaps away and runs down secret tunnels and corridoors.");
puts("You chase him through the darkness and splash in pools of water.");
puts("You have cornered him. His laser sword extends as he steps forward.");
@@ -288,7 +303,7 @@ follow()
setbit(location[position].objects,AMULET);
return(0);
}
- else if (followgod == time){
+ else if (followgod == ourtime){
puts("The goddess leads you down a steamy tunnel and into a high, wide chamber.");
puts("She sits down on a throne.");
position = 268;