1 /* 2 * Copyright (c) 1983 Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 static char sccsid[] = "@(#)com2.c 5.3 (Berkeley) 06/01/90"; 10 #endif /* not lint */ 11 12 #include "externs.h" 13 14 wearit() /* synonyms = {sheathe, sheath} */ 15 { 16 register int n; 17 int firstnumber, value; 18 19 firstnumber = wordnumber; 20 while(wordtype[++wordnumber] == ADJS); 21 while(wordnumber <= wordcount){ 22 value = wordvalue[wordnumber]; 23 for (n=0; objsht[value][n]; n++); 24 switch(value){ 25 26 case -1: 27 puts("Wear what?"); 28 return(firstnumber); 29 30 default: 31 printf("You can't wear%s%s!\n",(objsht[value][n-1] == 's' ? " " : " a "),objsht[value]); 32 return(firstnumber); 33 34 case KNIFE: 35 /* case SHIRT: */ 36 case ROBE: 37 case LEVIS: /* wearable things */ 38 case SWORD: 39 case MAIL: 40 case HELM: 41 case SHOES: 42 case PAJAMAS: 43 case COMPASS: 44 case LASER: 45 case AMULET: 46 case TALISMAN: 47 case MEDALION: 48 case ROPE: 49 case RING: 50 case BRACELET: 51 case GRENADE: 52 53 if (testbit(inven,value)){ 54 clearbit(inven,value); 55 setbit(wear,value); 56 carrying -= objwt[value]; 57 encumber -= objcumber[value]; 58 time++; 59 printf("You are now wearing %s %s.\n",(objsht[value][n-1] == 's' ? "the" : "a"), objsht[value]); 60 } 61 else if (testbit(wear,value)) 62 printf("You are already wearing the %s.\n", objsht[value]); 63 else 64 printf("You aren't holding the %s.\n", objsht[value]); 65 if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) 66 wordnumber++; 67 else 68 return(firstnumber); 69 } /* end switch */ 70 } /* end while */ 71 puts("Don't be ridiculous."); 72 return(firstnumber); 73 } 74 75 put() /* synonyms = {buckle, strap, tie} */ 76 { 77 if (wordvalue[wordnumber + 1] == ON){ 78 wordvalue[++wordnumber] = PUTON; 79 return(cypher()); 80 } 81 if (wordvalue[wordnumber + 1] == DOWN){ 82 wordvalue[++wordnumber] = DROP; 83 return(cypher()); 84 } 85 puts("I don't understand what you want to put."); 86 return(-1); 87 88 } 89 90 draw() /* synonyms = {pull, carry} */ 91 { 92 return(take(wear)); 93 } 94 95 use() 96 { 97 while (wordtype[++wordnumber] == ADJS && wordnumber < wordcount); 98 if (wordvalue[wordnumber] == AMULET && testbit(inven,AMULET) && position != FINAL){ 99 puts("The amulet begins to glow."); 100 if (testbit(inven,MEDALION)){ 101 puts("The medallion comes to life too."); 102 if (position == 114){ 103 location[position].down = 160; 104 whichway(location[position]); 105 puts("The waves subside and it is possible to descend to the sea cave now."); 106 time++; 107 return(-1); 108 } 109 } 110 puts("A light mist falls over your eyes and the sound of purling water trickles in"); 111 puts("your ears. When the mist lifts you are standing beside a cool stream."); 112 if (position == 229) 113 position = 224; 114 else 115 position = 229; 116 time++; 117 return(0); 118 } 119 else if (position == FINAL) 120 puts("The amulet won't work in here."); 121 else if (wordvalue[wordnumber] == COMPASS && testbit(inven,COMPASS)) 122 printf("Your compass points %s.\n",truedirec(NORTH,'-')); 123 else if (wordvalue[wordnumber] == COMPASS) 124 puts("You aren't holding the compass."); 125 else if (wordvalue[wordnumber] == AMULET) 126 puts("You aren't holding the amulet."); 127 else 128 puts("There is no apparent use."); 129 return(-1); 130 } 131 132 murder() 133 { 134 register int n; 135 136 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++); 137 if (n == NUMOFOBJECTS) 138 puts("You don't have suitable weapons to kill."); 139 else { 140 printf("Your %s should do the trick.\n",objsht[n]); 141 while (wordtype[++wordnumber] == ADJS); 142 switch(wordvalue[wordnumber]){ 143 144 case NORMGOD: 145 if (testbit(location[position].objects,BATHGOD)){ 146 puts("The goddess's head slices off. Her corpse floats in the water."); 147 clearbit(location[position].objects,BATHGOD); 148 setbit(location[position].objects,DEADGOD); 149 power += 5; 150 notes[JINXED]++; 151 } else if (testbit(location[position].objects,NORMGOD)){ 152 puts("The goddess pleads but you strike her mercilessly. Her broken body lies in a\npool of blood."); 153 clearbit(location[position].objects,NORMGOD); 154 setbit(location[position].objects,DEADGOD); 155 power += 5; 156 notes[JINXED]++; 157 if (wintime) 158 live(); 159 } else puts("I dont see her anywhere."); 160 break; 161 case TIMER: 162 if (testbit(location[position].objects,TIMER)){ 163 puts("The old man offers no resistance."); 164 clearbit(location[position].objects,TIMER); 165 setbit(location[position].objects,DEADTIME); 166 power++; 167 notes[JINXED]++; 168 } else puts("Who?"); 169 break; 170 case NATIVE: 171 if (testbit(location[position].objects,NATIVE)){ 172 puts("The girl screams as you cut her body to shreds. She is dead."); 173 clearbit(location[position].objects,NATIVE); 174 setbit(location[position].objects,DEADNATIVE); 175 power += 5; 176 notes[JINXED]++; 177 } else puts("What girl?"); 178 break; 179 case MAN: 180 if (testbit(location[position].objects,MAN)){ 181 puts("You strike him to the ground, and he coughs up blood."); 182 puts("Your fantasy is over."); 183 die(); 184 } 185 case -1: 186 puts("Kill what?"); 187 break; 188 189 default: 190 if (wordtype[wordnumber] != NOUNS) 191 puts("Kill what?"); 192 else 193 printf("You can't kill the %s!\n",objsht[wordvalue[wordnumber]]); 194 } 195 } 196 } 197 198 ravage() 199 { 200 while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); 201 if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects,wordvalue[wordnumber])){ 202 time++; 203 switch(wordvalue[wordnumber]){ 204 case NORMGOD: 205 puts("You attack the goddess, and she screams as you beat her. She falls down"); 206 puts("crying and tries to hold her torn and bloodied dress around her."); 207 power += 5; 208 pleasure += 8; 209 ego -= 10; 210 wordnumber--; 211 godready = -30000; 212 murder(); 213 win = -30000; 214 break; 215 case NATIVE: 216 puts("The girl tries to run, but you catch her and throw her down. Her face is"); 217 puts("bleeding, and she screams as you tear off her clothes."); 218 power += 3; 219 pleasure += 5; 220 ego -= 10; 221 wordnumber--; 222 murder(); 223 if (rnd(100) < 50){ 224 puts("Her screams have attracted attention. I think we are surrounded."); 225 setbit(location[ahead].objects,WOODSMAN); 226 setbit(location[ahead].objects,DEADWOOD); 227 setbit(location[ahead].objects,MALLET); 228 setbit(location[back].objects,WOODSMAN); 229 setbit(location[back].objects,DEADWOOD); 230 setbit(location[back].objects,MALLET); 231 setbit(location[left].objects,WOODSMAN); 232 setbit(location[left].objects,DEADWOOD); 233 setbit(location[left].objects,MALLET); 234 setbit(location[right].objects,WOODSMAN); 235 setbit(location[right].objects,DEADWOOD); 236 setbit(location[right].objects,MALLET); 237 } 238 break; 239 default: 240 puts("You are perverted."); 241 } 242 } 243 else 244 puts("Who?"); 245 } 246 247 follow() 248 { 249 if (followfight == time){ 250 puts("The Dark Lord leaps away and runs down secret tunnels and corridoors."); 251 puts("You chase him through the darkness and splash in pools of water."); 252 puts("You have cornered him. His laser sword extends as he steps forward."); 253 position = FINAL; 254 fight(DARK,75); 255 setbit(location[position].objects,TALISMAN); 256 setbit(location[position].objects,AMULET); 257 return(0); 258 } 259 else if (followgod == time){ 260 puts("The goddess leads you down a steamy tunnel and into a high, wide chamber."); 261 puts("She sits down on a throne."); 262 position = 268; 263 setbit(location[position].objects,NORMGOD); 264 notes[CANTSEE] = 1; 265 return(0); 266 } 267 else 268 puts("There is no one to follow."); 269 return(-1); 270 } 271