* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)com2.c 5.2 (Berkeley) %G%";
wearit() /* synonyms = {sheathe, sheath} */
firstnumber
= wordnumber
;
while(wordtype
[++wordnumber
] == ADJS
);
while(wordnumber
<= wordcount
){
value
= wordvalue
[wordnumber
];
for (n
=0; objsht
[value
][n
]; n
++);
printf("You can't wear%s%s!\n",(objsht
[value
][n
-1] == 's' ? " " : " a "),objsht
[value
]);
case LEVIS
: /* wearable things */
if (testbit(inven
,value
)){
carrying
-= objwt
[value
];
encumber
-= objcumber
[value
];
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 aren't holding the %s.\n", objsht
[value
]);
if (wordnumber
< wordcount
- 1 && wordvalue
[++wordnumber
] == AND
)
puts("Don't be ridiculous.");
put() /* synonyms = {buckle, strap, tie} */
if (wordvalue
[wordnumber
+ 1] == ON
){
wordvalue
[++wordnumber
] = PUTON
;
if (wordvalue
[wordnumber
+ 1] == DOWN
){
wordvalue
[++wordnumber
] = DROP
;
puts("I don't understand what you want to put.");
draw() /* synonyms = {pull, carry} */
while (wordtype
[++wordnumber
] == ADJS
&& wordnumber
< wordcount
);
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.");
location
[position
].down
= 160;
whichway(location
[position
]);
puts("The waves subside and it is possible to descend to the sea cave now.");
puts("A light mist falls over your eyes and the sound of purling water trickles in");
puts("your ears. When the mist lifts you are standing beside a cool stream.");
else if (position
== FINAL
)
puts("The amulet won't work in here.");
else if (wordvalue
[wordnumber
] == COMPASS
&& testbit(inven
,COMPASS
))
printf("Your compass points %s.\n",truedirec(NORTH
,'-'));
else if (wordvalue
[wordnumber
] == COMPASS
)
puts("You aren't holding the compass.");
else if (wordvalue
[wordnumber
] == AMULET
)
puts("You aren't holding the amulet.");
puts("There is no apparent use.");
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
++);
puts("You don't have suitable weapons to kill.");
printf("Your %s should do the trick.\n",objsht
[n
]);
while (wordtype
[++wordnumber
] == ADJS
);
switch(wordvalue
[wordnumber
]){
if (testbit(location
[position
].objects
,BATHGOD
)){
puts("The goddess's head slices off. Her corpse floats in the water.");
clearbit(location
[position
].objects
,BATHGOD
);
setbit(location
[position
].objects
,DEADGOD
);
} else if (testbit(location
[position
].objects
,NORMGOD
)){
puts("The goddess pleads but you strike her mercilessly. Her broken body lies in a\npool of blood.");
clearbit(location
[position
].objects
,NORMGOD
);
setbit(location
[position
].objects
,DEADGOD
);
} else puts("I dont see her anywhere.");
if (testbit(location
[position
].objects
,TIMER
)){
puts("The old man offers no resistance.");
clearbit(location
[position
].objects
,TIMER
);
setbit(location
[position
].objects
,DEADTIME
);
if (testbit(location
[position
].objects
,NATIVE
)){
puts("The girl screams as you cut her body to shreds. She is dead.");
clearbit(location
[position
].objects
,NATIVE
);
setbit(location
[position
].objects
,DEADNATIVE
);
} else puts("What girl?");
if (testbit(location
[position
].objects
,MAN
)){
puts("You strike him to the ground, and he coughs up blood.");
puts("Your fantasy is over.");
if (wordtype
[wordnumber
] != NOUNS
)
printf("You can't kill the %s!\n",objsht
[wordvalue
[wordnumber
]]);
while (wordtype
[++wordnumber
] != NOUNS
&& wordnumber
<= wordcount
);
if (wordtype
[wordnumber
] == NOUNS
&& testbit(location
[position
].objects
,wordvalue
[wordnumber
])){
switch(wordvalue
[wordnumber
]){
puts("You attack the goddess, and she screams as you beat her. She falls down");
puts("crying and tries to hold her torn and bloodied dress around her.");
puts("The girl tries to run, but you catch her and throw her down. Her face is");
puts("bleeding, and she screams as you tear off her clothes.");
puts("Her screams have attracted attention. I think we are surrounded.");
setbit(location
[ahead
].objects
,WOODSMAN
);
setbit(location
[ahead
].objects
,DEADWOOD
);
setbit(location
[ahead
].objects
,MALLET
);
setbit(location
[back
].objects
,WOODSMAN
);
setbit(location
[back
].objects
,DEADWOOD
);
setbit(location
[back
].objects
,MALLET
);
setbit(location
[left
].objects
,WOODSMAN
);
setbit(location
[left
].objects
,DEADWOOD
);
setbit(location
[left
].objects
,MALLET
);
setbit(location
[right
].objects
,WOODSMAN
);
setbit(location
[right
].objects
,DEADWOOD
);
setbit(location
[right
].objects
,MALLET
);
puts("You are perverted.");
if (followfight
== time
){
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.");
setbit(location
[position
].objects
,TALISMAN
);
setbit(location
[position
].objects
,AMULET
);
else if (followgod
== time
){
puts("The goddess leads you down a steamy tunnel and into a high, wide chamber.");
puts("She sits down on a throne.");
setbit(location
[position
].objects
,NORMGOD
);
puts("There is no one to follow.");