home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume15 / dinkum2 / part06 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  45.8 KB

  1. Path: uunet!news.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v15i041:  dinkum2 - australian text adventure game, Part06/07
  5. Message-ID: <4197@master.CNA.TEK.COM>
  6. Date: 14 Jan 93 03:26:19 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1412
  9. Approved: billr@saab.CNA.TEK.COM
  10. Xref: uunet comp.sources.games:1540
  11.  
  12. Submitted-by: Gary Allen <gary@sun.mech.uq.oz.au>
  13. Posting-number: Volume 15, Issue 41
  14. Archive-name: dinkum2/Part06
  15. Supersedes: dinkum: Volume 15, Issue 21-26
  16. Environment: Unix, DOS
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 6 (of 7)."
  27. # Contents:  describe.c parse.c
  28. # Wrapped by billr@saab on Wed Jan 13 19:20:19 1993
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'describe.c' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'describe.c'\"
  32. else
  33. echo shar: Extracting \"'describe.c'\" \(26018 characters\)
  34. sed "s/^X//" >'describe.c' <<'END_OF_FILE'
  35. X#define DSCRB
  36. X#include "dink_sym.h"
  37. X#include "dink_glb.h"
  38. Xvoid describe(n)
  39. X/*********************************************************/
  40. X/*                                                       */
  41. X/*           --- Room Description and Path ---           */
  42. X/*                                                       */
  43. X/*      Program by Gary A. Allen, Jr.  6 June 1989       */
  44. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  45. X/*                                                       */
  46. X/*********************************************************/
  47. Xint n ;         
  48. X{
  49. X
  50. Xstatic int old_n, dark_count, sw_hint = FALSE ;
  51. Xchar chr ;
  52. X
  53. X/* room description */
  54. Xstatic char *descript[] = {
  55. X"are in a grassy meadow that stretches out in all directions",  /* 0 */
  56. X"are on a path next to the meadow.  To the east is a road.",    /* 1 */
  57. X"are approaching a thickly wooded forest full of gum trees.",   /* 2 */
  58. X"have hiked a short distance and then climbed up onto a river dike.",
  59. X"are next to a wide murky river that looks dangerous.",         /* 4 */
  60. X"--- marker for drowing in river",                              /* 5 */
  61. X"are next to a billabong with a stream feeding into it.",       /* 6 */
  62. X"feel something slimey under the water wraping itself around your leg.",
  63. X"--- marker for the bunyip",                                    /* 8 */
  64. X"are back on top of the dike next to a great meandering river.", 
  65. X"are waist deep in the stream, the water is cool and refreshing.",
  66. X"are in a thickly wooded forest. There is a rich eucalyptus smell",
  67. X"are deeper into the gum tree forest and getting disoriented.",
  68. X"are deep in a gum tree forest and appear to be ***lost***.",   /* 13 */
  69. X"are wading in the billabong.  The water is stagnant and smelly.",
  70. X"approach an area with high grass. You can only see in a few metres.",
  71. X"are deep in the grass, which is waist high.",                  /* 16 */
  72. X"see snakes slither by in the grass.  Some are quite big.",     /* 17 */
  73. X"--- marker for the Taipan",                                    /* 18 */
  74. X"leave the grassy area and head towards the meadow.",           /* 19 */
  75. X"are on a road.  Far to the east are some deserted buildings.", /* 20 */
  76. X"are on a narrow one lane road stretching out to the horizon.", /* 21 */
  77. X"are west from the head gear of the abandoned ACME Gold Mine.", /* 22 */
  78. X"are in an orange desert with bulldust swirling about you.",    /* 23 */
  79. X"are in a desert full of high sand dunes.",                     /* 24 */
  80. X"are in between two sand dunes and can see only sand.",         /* 25 */
  81. X"are in a sandy desert with large thorny spinifexes rolling by you.",
  82. X"are west of the mine shaft lift.  The mine tower looms over head.",
  83. X"are walking away from a forest of sweet smelling gum trees. ", /* 28 */
  84. X"find yourself on a narrow potholed bitumen road with soft shoulders.",
  85. X"are southwest of the mine lift.  To the south is desert.",     /* 30 */
  86. X"are southeast of the mine lift.  To the south is desert.",     /* 31 */
  87. X"are east of the mine tower between the lift and the office.",  /* 32 */
  88. X"are east of the mine office building.  There is no door here.",
  89. X"are at the north eastern corner of the office building.",      /* 34 */
  90. X"are at the north western corner of the office building.",      /* 35 */
  91. X"are west of the ACME Gold Mine office building entrance.",     /* 36 */
  92. X"are in the entry hall.  There are doors to the north, south and west.",
  93. X"are in the Site Manager's office.  The only exit is to the south.",
  94. X"are in the western section of the Geologist's Office.",        /* 39 */
  95. X"are in the store room. The only exit is to the south.",    /* 40 */
  96. X"are in the eastern section of the Geologist's Office.",        /* 41 */
  97. X"continue walking on the narrow road which has only one lane.", /* 42 */
  98. X"are inside the mine lift.  The doorway is to the west.",
  99. X"are in a dimly lit tunnel going west.  To the east is the lift.",
  100. X"are in a poorly lit tunnel going east, west and south.",       /* 45 */
  101. X"are in a dimly lit tunnel going north.  To the east is the lift.",
  102. X"are in a pasture.  To the east is a road and west is a billabong.",
  103. X"are in a T-section going north, south or east.",               /* 48 */
  104. X"are in a T-section going north, south or west.",               /* 49 */
  105. X"are in a T-section going north, west or east.",                /* 50 */
  106. X"are in a T-section going east, west or south.",                /* 51 */
  107. X"are in a T-section going northeast, northwest, or southwest.", /* 52 */
  108. X"are in a T-section going northeast, northwest, or southeast.", /* 53 */
  109. X"are in a T-section going northeast, southeast, or southwest.",
  110. X"are in a tunnel going north and south.",                       /* 55 */
  111. X"are in a tunnel going east and west.",                         /* 56 */
  112. X"are in a tunnel going northwest and southeast.",               /* 57 */
  113. X"are in a tunnel going northeast and southwest.",               /* 58 */
  114. X"are in a tunnel that has a hole in the ground and goes east/west.",
  115. X"are in an L-section going southeast or up through a hole in the roof.",
  116. X"are in an L-section that goes south or up through a hole in the roof.",
  117. X"are in an L-section that goes east or up through a hole in the roof.",
  118. X"are in an L-section that goes west or up through a hole in the roof.",
  119. X"are in a Y-section that goes north, southeast, or southwest.", /* 64 */
  120. X"are in a Y-section that goes south, northeast, or northwest.", /* 65 */
  121. X"are in a Y-section that goes west, northeast, or southeast.",  /* 66 */
  122. X"are in a Y-section that goes east, northwest, or southwest.",  /* 67 */
  123. X"are in a Y-section that goes north, south, or southwest.",     /* 68 */
  124. X"are in a Y-section that goes south, north, or northwest.",     /* 69 */
  125. X"are in a Y-section that goes west, east, or southeast.",       /* 70 */
  126. X"are in a Y-section that goes east, west, or southwest.",       /* 71 */
  127. X"are in a Y-section that goes north, south, or southeast.",     /* 72 */
  128. X"are in a Y-section that goes south, north, or northeast.",     /* 73 */
  129. X"are in a Y-section that goes west, east, or northeast.",       /* 74 */
  130. X"are in a Y-section that goes east, west, or northwest.",       /* 75 */
  131. X"are in a Y-section that goes down a manhole, northwest, or southwest.",
  132. X"are in a Y-section that goes down a manhole, northeast, or southeast.",
  133. X"are at a tunnel crossing.  You can go north, east, south, or west.",
  134. X"are at a tunnel crossing going nw, ne, sw, and se.",           /* 79 */
  135. X"are in a tunnel corner that goes south and west.",             /* 80 */
  136. X"are in a tunnel corner that goes south and east.",             /* 81 */
  137. X"are in a tunnel corner that goes north and west.",             /* 82 */
  138. X"are in a tunnel corner that goes north and east.",             /* 83 */
  139. X"are in a tunnel corner that goes southeast and southwest.",    /* 84 */
  140. X"are in a tunnel corner that goes southeast and northeast.",    /* 85 */
  141. X"are in a tunnel corner that goes northwest and southwest.",    /* 86 */
  142. X"are in a tunnel corner that goes northwest and northeast.",    /* 87 */
  143. X"are in a tunnel going southwest with a stairway going down.",  /* 88 */
  144. X"are in a tunnel going northeast with a stairway going up.",    /* 89 */
  145. X"are at a deadend.",                                            /* 90 */
  146. X"are in the ventilation equipment room. The exit is to the west.",
  147. X"are in the worker's lunch room. The exit is to the north.",
  148. X"are at the stope face with the hydraulic jacks still in place.",
  149. X"are in an ore storage area with exits to the south and west.",
  150. X"are in a T-section going northwest, southeast, or southwest.",
  151. X"are in a tunnel going northeast/southwest, with a hole in the roof.",
  152. X"are in a corner going north and east, with a manhole going down.",
  153. X"are in a tunnel going west with a stairway going up.",         /* 98 */
  154. X"are in a tunnel going east with a stairway going down.",       /* 99 */
  155. X"can go north or climb down a man hole.",                       /*100 */
  156. X"are at a caved in section of tunnel which is now a dead end.", /*101 */
  157. X"are in a bleak and forbidding desert of bare flat stone.",     /*102 */
  158. X"are on a narrow one lane road with gum trees on either side.", /*103 */
  159. X"are in a flat and boring desert.",                /*104 */
  160. X"are in front of Ned Kelly's desert hide out.",            /*105 */
  161. X"are in a vast desert of dry salt lakes shimmering with mirages.",
  162. X"are inside Ned Kelly's hide out.  The only way out is to the west.",
  163. X"are north of a grassy area and within the bend of a great river.", 
  164. X"are south of a grassy area and on the edge of a gum tree forest.",
  165. X"can go east or climb down a man hole.",            /*110 */
  166. X"can go east, west or climb up through a hole in the roof.",    /*111 */
  167. X"are at the Level #67 Shift Foreman's office. You can go west.",
  168. X"are at the spacecraft's end.  You can go north, south and west.",
  169. X"are near the spacecraft's fin. You can go south or north-east.",
  170. X"are next to the ship's wing.  You can go south-west or south-east.",
  171. X"are beside the ship's window.  You can go north-west or south.",
  172. X"are next to the spacecraft's Mach probe.  You can north or south.",
  173. X"are facing the access hatch.  You can go up, north, or south-west.",
  174. X"are beside the landing gear.  You can go north-east or north-west.",
  175. X"are beside the wing's edge.  You can go north or south-east.",
  176. X"are in the spacecraft's airlock.  You can go down or north.",
  177. X"are in the central access way.  You can east, west, or south.",
  178. X"are on the flight deck of an ancient spacecraft.  You can go west.",
  179. X"are at a mysterious control panel.  You can east or west.",    /* 124 */
  180. X"are in the chamber with glowing hexagons. The only exit is east.",
  181. X"are in a room with a tank full of dark blue liquid.  You can go west.",
  182. X"are in a cavernous room with a huge silver gong in the middle.",
  183. X"are in a room with a warning on the wall going north, south and west.",
  184. X"are in a closet stinking of moth balls. The only exit is north.",
  185. X"are in the guard room. The closet is south, the main doorway is east.",
  186. X"are in the prayer room of the Iranian Parliament. The guard room is west.",
  187. X"are in a tunnel going east and west with a message on the wall.",
  188. X"are on a narrow country road.  There is a dead kangaroo by the road.",
  189. X"are on a road with a low rise ahead of you.  You hear a distant rumbling.",
  190. X"--- marker for getting hit by a road train.",                  /* 135 */
  191. X"are on a narrow country road.  There is a dead red kangaroo by the road."
  192. X}  ;
  193. X
  194. X#if (PROTOTYPE)
  195. Xvoid ender(int) ;
  196. Xchar getch(void) ;
  197. X#endif
  198. X
  199. X/* give the short description */
  200. Xif (((object[O_torch][J_loc] == B_have)&&object[O_torch][J_property])|| 
  201. X    (n < 186)||(n > 202)) { 
  202. X/* Deal with the possibility of a hint for the safe */
  203. X    if (n == R_office_mang) {
  204. X        if ((!sw_active)&&(object[O_rifle][J_property] != 0)&&
  205. X(Ned->Location == B_destroyed)&&(!sw_hint)) {
  206. X            sw_hint = TRUE ;
  207. Xprintf("For half of the bullets in your M-16 rifle I will\n") ;
  208. Xprintf("give you a hint on how to get into the safe.\n") ;
  209. Xprintf("             Are you interested? \n") ;
  210. X
  211. X            for (;;) {
  212. X
  213. X#ifndef __TURBOC__
  214. X                do {
  215. Xprintf("(Answer:  Yes or No) ") ; 
  216. X                } while ('\n' == (chr = getchar())) ;
  217. X
  218. X                while ('\n' != getchar()) ;
  219. X#endif
  220. X
  221. X#ifdef __TURBOC__
  222. X                printf("\n") ;
  223. X                do {
  224. Xprintf("(Answer:  Yes or No) ") ; 
  225. X                } while ('\n' == (chr = getch())) ;
  226. X                printf("\n") ;
  227. X#endif
  228. X
  229. X                if (('n' == chr)||
  230. X('N' == chr)||('y' == chr)||('Y' == chr)) {
  231. X                    if (('y' == chr)||
  232. X                        ('Y' == chr)) { 
  233. X                object[O_rifle][J_property] /= 2 ;
  234. Xprintf("\nTake the missing word in the sentence:\n") ;
  235. Xprintf("                      \"The chook **** an egg.\"\n");
  236. Xprintf("and spell it backwards.  Then look very carefully at the\n") ;
  237. Xprintf("map which you found in the manager's office.  Also, you\n") ;
  238. Xprintf("now have %d bullets in your rifle.\n",
  239. X                object[O_rifle][J_property]) ;
  240. X                    }
  241. X                break ;
  242. X                }
  243. X            }
  244. X            printf("\n") ;
  245. X        }
  246. X    }
  247. Xprintf ("You %s \n",descript[room[n][M_descp]]);
  248. X    old_n = n;
  249. X    dark_count = 0 ;
  250. X
  251. X}
  252. X
  253. X/* deal with dark rooms */
  254. Xelse {
  255. X    if (n == 186) {
  256. Xprintf("You have entered a north/south passage which does not have\n") ;
  257. Xprintf("electric lighting.  There is some light coming in from the\n");
  258. Xprintf("north, but the tunnel to the south is completely dark.\n");
  259. X        return;
  260. X    }
  261. X    if (n == 187) {
  262. Xprintf("The tunnel you are in is pitch black.  There is a little\n");
  263. Xprintf("light coming in from the north.  If you keep going you will\n");
  264. Xprintf("probably fall down a hole.\n") ;
  265. X        return ;
  266. X    }
  267. X    if ((n >= 188)&&(n <= 202)) {
  268. X        if ((dark_count==0)||(old_n == n)) {
  269. Xprintf("You are in a mine tunnel in total darkness, which is \n") ;
  270. Xprintf("extremely dangerous.  I have no clue where we are going.\n") ;
  271. Xprintf("Let's go back to where there is some light!\n") ;
  272. X            ++dark_count ;
  273. X            old_n = n;
  274. X        }
  275. X        else {
  276. Xprintf("Twit!!  You have fallen down a hole and broken your neck!\n");
  277. X        ender(F_died) ;
  278. X        }
  279. X        return ;
  280. X    }
  281. X}
  282. X} /* end of the "describe" subroutine */
  283. Xvoid rdtxt(k)
  284. X/*********************************************************/
  285. X/*                                                       */
  286. X/*     --- Text for the "Read"/"Describe" Command ---    */
  287. X/*                                                       */
  288. X/*       Program by Gary A. Allen, Jr.  21 February 1989 */
  289. X/*         (c) Copyright 1992 by Gary A. Allen, Jr.      */
  290. X/*                                                       */
  291. X/*********************************************************/
  292. Xint k;
  293. X{
  294. Xswitch(k) {
  295. X
  296. X/* text for the map fragment in the manager's office */
  297. Xcase O_map_frag:
  298. Xprintf("______________________________________________________ \n");
  299. Xprintf("|..................................................... \n");
  300. Xprintf("|...._______________________.......................... \n");
  301. Xprintf("|...|  Current Operational  |........................ \n");
  302. Xprintf("|...|  Levels are:          |......D--W--W--W--W--W- \n");
  303. Xprintf("|...|     0, 49, 67, 82     |......|................ \n");
  304. Xprintf("|...| Level #67 is depicted |......S................ \n");
  305. Xprintf("|...._______________________.......|................ \n");
  306. Xprintf("|..................................S............... \n");
  307. Xprintf("|..................................|............... \n");
  308. Xprintf("|......................S--W--W--D--W.............. \n");
  309. Xprintf("|......................|........|................. \n");
  310. Xprintf("|......................S........E--E--E--E--E--E- \n");
  311. Xprintf("|......................|.......................... \n");
  312. Xprintf("|.......[dead end]--W--*--E--[dead end].......... \n");
  313. Xprintf("|......................|........................ \n");
  314. Xprintf("|......................S......................");
  315. Xprintf("       The rest of the map\n");
  316. Xprintf("|......................|.....................");
  317. Xprintf("        has turned into dust.\n");
  318. Xprintf("|.........[false dead end (partition)]......\n");
  319. Xprintf("|...........^..........|................. \n");
  320. Xprintf("|.{use an explosive}...S.............. \n");
  321. Xprintf("|......................|.... \n");
  322. Xprintf("|.............. \n");
  323. X    break;
  324. X
  325. X/* Can of Fourex Beer */
  326. Xcase O_can:
  327. Xprintf("You see an aluminum beer can with a hole in the bottom. The\n");
  328. Xprintf("can is coloured yellow-orange.  Written in red letters\n");
  329. Xprintf("across the can's front is the following:\n\n") ;
  330. Xprintf("                  \"CASTLEMAINE\"\n") ;
  331. Xprintf("                      XXXX\n") ;
  332. Xprintf("                   BITTER ALE\n\n") ;
  333. Xprintf("There's a picture of Fourex's Milton brewery in the middle.\n");
  334. X    break ;
  335. X
  336. X/* Atropine pills */
  337. Xcase O_pills:
  338. Xprintf("You're holding a packet which once contained ") ;
  339. Xprintf("30 pills but now\nholds only") ;
  340. Xprintf(" %d pills.  On the back of the packet is written:\n\n",
  341. X    pill_count) ;
  342. Xprintf("                       ATROPINE PILLS\n");
  343. Xprintf("The pills in this packet will protect the user against ") ;
  344. Xprintf("poisoning\nby organo-phosphorous ") ;
  345. Xprintf("compounds, i.e. VX nerve gas.\n") ;
  346. Xprintf("    Dosage:  Take ONE pill when poisoning symptons occur.\n");
  347. Xprintf("    Warning:  Atropine is itself a poison.  An overdose can\n");
  348. Xprintf("              be lethal!\n\n") ;
  349. X    break ;
  350. X
  351. X
  352. X/* description of Qaddafi's letter bomb */
  353. Xcase O_letter:
  354. Xprintf("___________________________________________________________\n");
  355. Xprintf("|                                               +-----+   |\n");
  356. Xprintf("| Col. M. Gaddafi                               |Libya|   |\n");
  357. Xprintf("| Azizya Barracks                Postage Due    |5 zl.|   |\n");
  358. Xprintf("| Tripoli, Libya                   $1.50        | -o- |   |\n");
  359. Xprintf("|                                               +-----+   |\n");
  360. Xprintf("|                 Sam Cohen                               |\n");
  361. Xprintf("|                 Level #67 Shift Boss                    |\n");
  362. Xprintf("|                 ACME Mine Ltd.                          |\n");
  363. Xprintf("|                 Birdsville, Queensland 4482             |\n");
  364. Xprintf("|  AIR MAIL                   Australia                   |\n");
  365. Xprintf("|                                                         |\n");
  366. Xprintf("___________________________________________________________\n");
  367. Xprintf("\n\nThe envelope must be opened before the ");
  368. Xprintf("letter can be read.\n\n") ;
  369. X    break;
  370. X
  371. X/* text for the paper found in the safe */
  372. Xcase O_paper:
  373. Xprintf("                             Congratulations!!! \n");
  374. Xprintf("You got the safe open!  Now you can start scoring points for ");
  375. Xprintf("treasure.\n") ;
  376. Xprintf("Credit is awarded **only** for treasure put into the safe. ");
  377. Xprintf("Beware of fell\nbush ") ;
  378. Xprintf("rangers who steal treasure (and sometimes kill adventurers).") ;
  379. Xprintf("\n\n                        ---  Concerning Gleeps ---\n");
  380. Xprintf("Gleeps are potent adjuncts which are credited separately from");
  381. Xprintf(" treasure.  Gleeps\n") ;
  382. Xprintf("will reproduce if left undisturbed in special locations ") ;
  383. Xprintf("underground. However\n") ;
  384. Xprintf("in most locations they will remain dormant. Credit ");
  385. Xprintf("for gleeps is awarded \n") ;
  386. Xprintf("only for those placed in a \"gleep tank\". While anyone ");
  387. Xprintf("can gather treasure, the\n") ;
  388. Xprintf("ability to cultivate and collect gleeps is the mark of a ");
  389. Xprintf("fair dinkum master.\n") ;
  390. Xprintf("                               Have Fun !!\n");
  391. X    break;
  392. X
  393. X/* description of the rifle */
  394. Xcase O_rifle:
  395. Xprintf("--- You are looking at a Colt M16 infantry rifle. --- \n");
  396. Xprintf("This fully automatic weapon is supplied bullets from a \n") ;
  397. Xprintf("detachable magazine which can hold up to 200 rounds. \n") ;
  398. Xprintf("The rifle has a selector knob that can place the weapon \n") ;
  399. Xprintf("into one of four possible firing modes: \n\n") ;
  400. Xprintf("     SAFE = Rifle can't fire, even if dropped \n") ;
  401. Xprintf("     I    = Single fire mode. Shoots one bullet at a time \n");
  402. Xprintf("     III  = Triple fire mode. Shoots three bullets rapidly \n");
  403. Xprintf("            every time the trigger is pulled. \n") ;
  404. Xprintf("     AUTO = Fully automatic, firing bullets at a rate of \n") ;
  405. Xprintf("            660 rounds/min. when trigger is pulled. \n\n") ;
  406. Xif (rifle_flag == F_safety)
  407. Xprintf("The rifle is currently set in the SAFE mode. \n") ;
  408. Xif (rifle_flag == F_single)
  409. Xprintf
  410. X  ("The rifle is currently set in the \"I\" or single fire mode.\n");
  411. Xif (rifle_flag == F_triple)
  412. Xprintf("The rifle is now set in the \"III\" or triple fire mode.\n");
  413. Xif (rifle_flag == F_auto)
  414. Xprintf("The rifle is currently set in the AUTO mode. \n") ;
  415. Xif (clip_flag == F_no_clip)
  416. Xprintf("The rifle does not have an ammunition clip attached to it.\n") ;
  417. Xif (clip_flag == F_normal_clip) {
  418. X    printf("The rifle has a standard ammunition clip attached ") ;
  419. X    printf("which contains %d rounds.\n",
  420. X                object[O_rifle][J_property]) ;
  421. X}
  422. Xif (clip_flag == F_org_clip) {
  423. X    printf("The rifle has an orange ammunition clip attached ") ;
  424. X    printf("which contains %d rounds.\n",
  425. X                object[O_rifle][J_property]) ;
  426. X}
  427. X    break ;
  428. X/* description of the safe */
  429. Xcase O_safe:
  430. Xprintf("You see a conventional combination dial type wall safe \n");
  431. Xprintf("fixed immovably into the wall.  The dial is black with \n");
  432. Xprintf("white numbers written onto it.  The numbers range from \n");
  433. Xprintf("one to one hundred. Attached to the upper right hand \n");
  434. Xprintf("corner of the safe is a manufacturer's label which reads:\n\n");
  435. Xprintf("                     _____________________________  \n") ;
  436. Xprintf("                    |     Kryptonite Safe Co.     | \n") ;
  437. Xprintf("                    |  Model Number:  C-3283      | \n") ; 
  438. Xprintf("                    |  Serial Number: 10149167182 | \n") ;
  439. Xprintf("                    |      Made in Australia      | \n") ;
  440. Xprintf("                     _____________________________  \n") ;
  441. X    break ;
  442. X/* Message from Indiana Jones */
  443. Xcase O_message:
  444. Xprintf("You've read this message before.  It says:\n\n") ;
  445. Xprintf("Dear Treasure Hunter:\n") ;
  446. Xprintf("There was lots of treasure on this level when I first\n") ;
  447. Xprintf("discovered this mine.  However I have since carted it all\n") ;
  448. Xprintf("away.  You might try looking on another level.") ;
  449. Xprintf("\n\n                            Good Luck!\n") ;
  450. Xprintf("                         Dr. I. Jones, Ph.D.\n\n") ;
  451. Xreturn ;
  452. X/* description of the save script recorder */
  453. Xcase O_recorder:
  454. Xprintf("  --- You are holding a Fair Dinkum data recorder. ---\n") ;
  455. Xprintf("This device is a metal box with three coloured buttons.  The\n") ;
  456. Xprintf("buttons have the following functions:\n\n") ;
  457. Xprintf("Green Button:\n") ;
  458. Xprintf("When the green button is pressed the recorder will query the user\n") ;
  459. Xprintf("for a data file name.  Once the name has been provided, every\n") ;
  460. Xprintf("move made after will be recorded in the named file.  The recording\n") ;
  461. Xprintf("session will end when the red button is pressed.\n\n") ;
  462. Xprintf("White Button:\n") ;
  463. Xprintf("When the white button is pressed the recorder will query the user\n") ;
  464. Xprintf("for a data file name.  Once the name for an existing data file has\n") ;
  465. Xprintf("been provided, then all the moves listed in that file will be\n") ;
  466. Xprintf("played back with the player acting accordingly.\n\n") ;
  467. Xprintf("Red Button:\n") ;
  468. Xprintf("When the red button is pressed a recording or play back session\n") ;
  469. Xprintf("is ended.  Otherwise nothing happens.\n\n") ;
  470. Xprintf("Warning:  Things Change!  A file which worked for one situation\n") ;
  471. Xprintf("could become lethal for another.\n") ;
  472. X    break ;
  473. X/* description of the Semtex detector*/
  474. Xcase O_detector:
  475. Xprintf("You see an olive green box with a yellow button in its\n");
  476. Xprintf("centre, a yellow light in its upper right hand corner and\n");
  477. Xprintf("Cryllic writing all over it.  Below the Cryllic letters\n") ;
  478. Xprintf("is a translation in English which reads:\n\n") ;
  479. Xprintf("              Mk 5.12 Semtex Explosive Detector\n") ;
  480. Xprintf("This device is used in detecting explosive weapons such as\n");
  481. Xprintf("antipersonal mines which utilize the high velocity plastic\n") ;
  482. Xprintf("explosive Semtex.  To operate this device merely press the\n") ;
  483. Xprintf("yellow button and an air sample will be taken. If trace\n");
  484. Xprintf("amounts of Semtex are detected then a warning beeper will\n");
  485. Xprintf("be activated.   If there is no detectable Semtex then a\n") ;
  486. Xprintf("yellow light will flash.\n\n") ;
  487. Xprintf("               Made in the Czeckoslovak Socialist Republic\n") ;
  488. X    break ;
  489. X/* description of the black cube with the blue button */
  490. Xcase O_cube:
  491. Xprintf("You're holding a cube made of dull black metal which is about\n") ;
  492. Xprintf("6 cm across each face.  There is a strange alien writing much\n") ;
  493. Xprintf("like Sanskrit stamped into the metal.  On one cube face is a\n") ;
  494. Xprintf("large iridescent blue push button projecting out from the surface.\n") ;
  495. Xbreak ;
  496. X/* description of the normal ammunition clip */
  497. Xcase O_clip:
  498. Xprintf("You see a conventional M16 ammunition clip.  It is olive "); 
  499. Xprintf(" green\n") ;
  500. Xprintf("in colour and about 30 centimetres long.\n"); 
  501. X
  502. Xif (object[O_clip][J_property] == 0)
  503. X    printf("\nThe clip is EMPTY with NO bullets.\n") ;
  504. Xelse {
  505. Xif (object[O_clip][J_property] == 1)
  506. X    printf("\nThe clip contains one bullet.\n") ;
  507. Xelse
  508. Xprintf("\nThe clip contains %d bullets.\n", object[O_clip][J_property]) ;
  509. X}
  510. Xbreak ;
  511. X/* description of the orange clip */
  512. Xcase O_org_clip:
  513. Xprintf("You see an M16 ammunition clip which has been painted bright");
  514. Xprintf(" orange.\n") ;
  515. Xprintf("A strange blue glow seems to be radiating from the clip. ");
  516. Xprintf("There is\n") ;
  517. Xprintf("a placard attached to the side of the clip which reads:\n\n") ;
  518. Xprintf("     ____________________________________________________ \n");
  519. Xprintf("    |    Hypertoxic 0.223 Caliber Ammunition Magazine    |\n");
  520. Xprintf("    |                                                    |\n");
  521. Xprintf("    | The ammunition contained in this magazine is       |\n");
  522. Xprintf("    | manufactured from spent nuclear fuel rods composed |\n");
  523. Xprintf("    | of uranium and plutonium metal.  The bullets have  |\n");
  524. Xprintf("    | been hollowed out and filled with mercury metal.   |\n");
  525. Xprintf("    | The exterior of each bullet has been striated and  |\n");
  526. Xprintf("    | impregnated with VX nerve gas and anthrax bacillus.|\n");
  527. Xprintf("    | The use of this ammunition violates the Geneva     |\n");
  528. Xprintf("    | Convention on the Rules of War, the International  |\n");
  529. Xprintf("    | Moratorium on Biological Weapons, and the United   |\n");
  530. Xprintf("    | Nations Charter.  Close proximity to this          |\n");
  531. Xprintf("    | ammunition can be harmful to your health.          |\n");
  532. Xprintf("    |                                                    |\n");
  533. Xprintf("    |    Developed under DOE Contract: LLNL 89-5632/Z    |\n");
  534. Xprintf("    |                  Patent Pending                    |\n");
  535. Xprintf("     ____________________________________________________ \n");
  536. X
  537. Xif (object[O_org_clip][J_property] == 0)
  538. X    printf("\nThe orange clip is EMPTY with NO bullets.\n") ;
  539. Xelse {
  540. Xif (object[O_org_clip][J_property] == 1)
  541. X    printf("\nThe orange clip contains one bullet.\n") ;
  542. Xelse printf("\nThe orange clip contains %d bullets.\n",
  543. X    object[O_org_clip][J_property]) ;
  544. X}
  545. X    break ;
  546. X}
  547. X} /* --- end of "rdtxt" subroutine --- */
  548. END_OF_FILE
  549. if test 26018 -ne `wc -c <'describe.c'`; then
  550.     echo shar: \"'describe.c'\" unpacked with wrong size!
  551. fi
  552. # end of 'describe.c'
  553. fi
  554. if test -f 'parse.c' -a "${1}" != "-c" ; then 
  555.   echo shar: Will not clobber existing file \"'parse.c'\"
  556. else
  557. echo shar: Extracting \"'parse.c'\" \(17330 characters\)
  558. sed "s/^X//" >'parse.c' <<'END_OF_FILE'
  559. X#define PARSE
  560. X#include "dink_sym.h"
  561. X#include "dink_glb.h"
  562. X#include <string.h>
  563. Xvoid parse()
  564. X/*********************************************************/
  565. X/*                                                       */
  566. X/*      --- English Language Parsing Subroutine ---      */
  567. X/*                                                       */
  568. X/*  This subroutine parses a sentence of up to nineteen  */
  569. X/*  words and decodes the words into integers and passes */
  570. X/*  a twenty element vector back to the calling          */
  571. X/*  program.  The digit 0, implies an unused word.  The  */
  572. X/*  digit -1 (V_LINE_END), indicates end of sentence.    */
  573. X/*                                                       */
  574. X/*      Program by Gary A. Allen, Jr.  17 December 1992  */
  575. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  576. X/*                                                       */
  577. X/*********************************************************/
  578. X{
  579. X#if (PROTOTYPE)
  580. Xchar getche(void) ;
  581. Xint synonym(int) ;
  582. Xvoid purge(int, int*) ;
  583. X#endif
  584. X
  585. Xregister int i, j ;
  586. X
  587. Xint m, n, jacc, i_ws, sw_purge, j_purge, sw_loop, sw_decode ;
  588. X
  589. X/* a sentence can have 19 words of 15 letters */ 
  590. Xchar words[20][15], word[15] ;
  591. Xchar letter, buffer[300], *pnt ;
  592. X
  593. X/* flush the "sent vector" */
  594. Xfor (i = 0; i <= 19; i++) sent[i] = 0 ;
  595. X
  596. X/* flush the tag vector */
  597. Xfor (i = 0; i <= tag_max; i++) tag[i] = FALSE ;
  598. X
  599. X/* Outer infinite "for" loop to parse and load in the words */
  600. Xfor(;;) {
  601. X
  602. X/* Keyboard input "for" loop */
  603. Xfor (i = 0; i <= 299; i++) {
  604. X    if (sw_playing) {
  605. X        if (feof(fp)) {
  606. X            sw_playing = FALSE ;
  607. X            continue ;
  608. X        }
  609. X        letter = fgetc(fp) ;
  610. X        putchar(letter) ;
  611. X    }
  612. X    else {
  613. X#ifndef __TURBOC__
  614. X        letter = getchar() ;    
  615. X#endif
  616. X#ifdef __TURBOC__
  617. X        letter = getche() ;    
  618. X#endif
  619. X        if (sw_recording) {
  620. X            if ((letter == '\n') || (letter == 13)) {
  621. X                fprintf(fp,"\n") ;
  622. X            }
  623. X            else fputc(letter, fp) ;
  624. X        }
  625. X    }
  626. X
  627. X    buffer[i] = letter ;
  628. X
  629. X    /* First pass "switch" block */
  630. X    switch(letter) {
  631. X
  632. X    /* Carriage return */
  633. X    case '\n':
  634. X    case 13:
  635. X        break ;
  636. X
  637. X    /* Backspace */
  638. X    case 8:
  639. X        i -= 2 ;
  640. X        if (i < 0) {
  641. X            i = -1 ;
  642. X#ifdef __TURBOC__
  643. X            putchar(0x07) ; /* ring bell */
  644. X/* "{" --- this is to balance the parenthesis below for Vi */
  645. X        }
  646. X        putchar(' ') ;
  647. X        putchar(0x08) ;
  648. X#endif
  649. X#ifndef __TURBOC__
  650. X        }
  651. X#endif
  652. X        continue ;
  653. X
  654. X    default:
  655. X        continue ;
  656. X    } /* end of the first pass "switch" block */
  657. X    break ;
  658. X} /* end of keyboard input "for" loop */
  659. X
  660. X/* Deal with goofy long strings */
  661. Xif (i > 299) {
  662. X    printf("\n\nHuh? That last sentence was a long one!\n") ;
  663. X    printf("Try making it a bit shorter.\n\n") ;
  664. X    continue ;
  665. X}
  666. X
  667. Xsw_loop = FALSE ;
  668. Xsw_decode = FALSE ;
  669. Xpnt = buffer ;
  670. X
  671. X/* Outer word counting "for" loop */
  672. Xfor (i = 0; i <= 18; i++) {
  673. X    /* Inner letter counting "for" loop */
  674. X    for (j = 0; j <= 14; j++) {
  675. X        /* Letter type "switch" block */
  676. X        switch (letter = *(pnt++)) {
  677. X            case '\n':
  678. X            case 13 :
  679. X                sw_loop = TRUE ;
  680. X                if ((i == 0) && (j == 0)) break ;
  681. X                words[i][j] = '\0' ;  
  682. X                sw_decode = TRUE ; 
  683. X                break ;
  684. X
  685. X            /* White spaces and punctuation for cutting out words */
  686. X            case '\"':
  687. X            case ' ':
  688. X            case ',':
  689. X            case '.':
  690. X            case ';':
  691. X            case ':':
  692. X            case '?':
  693. X            case '!':
  694. X            case '&':
  695. X            case '{':
  696. X            case '}':
  697. X            case '[':
  698. X            case ']':
  699. X            case ')':
  700. X            case '(':
  701. X            case '\'':
  702. X            case '`':
  703. X            case '\t':
  704. X                words[i][j] = '\0' ;  
  705. X                break;
  706. X
  707. X            default:
  708. X                words[i][j] = letter ;
  709. X                continue ;
  710. X        } /* end of letter type "switch" block */
  711. X        break ;
  712. X    } /* end of inner letter counting "for" loop */
  713. X    if (sw_loop) break ;
  714. X    if (j > 14) {
  715. Xprintf("\nYou're saying nonsense! Type the sentence again. \n");
  716. X        break ;
  717. X    }
  718. X    if (j == 0) i-- ;
  719. X} /* end of outer word counting "for" loop */
  720. X
  721. X/* Bad sentence handling block */
  722. Xif (!sw_decode) {
  723. X    if (sw_loop) continue ;
  724. X
  725. X    if (i > 18) 
  726. Xprintf ("\nYour sentence is too long. Type something shorter! \n") ;
  727. X
  728. X#ifndef __TURBOC__
  729. X    /* Purge the input buffer */
  730. X    for (;;) if ('\n' == getchar()) break ;
  731. X#endif
  732. X
  733. X    continue ; /* resume the infinite "for" loop */
  734. X} /* end of bad sentence handling block */
  735. X
  736. X#ifdef __TURBOC__
  737. Xprintf("\n") ;
  738. X#endif
  739. X
  740. X/* Decode the words from the known vocabulary */
  741. Xm = i ;
  742. Xjacc = 0;
  743. Xfor (i = 0; i <= m; i++) {
  744. X    for (j = 0; j <= 14; j++) {
  745. X        word[j] = words[i][j] ; 
  746. X    }
  747. X    for (j = 0; j <= letmax; j++) {
  748. X        n = strcmp (word,vocab[j]);
  749. X        if (n == 0) {
  750. X            if ((j > 9)&&(j < 20)) j -= 10;
  751. X            sent[jacc++] = j+1 ;
  752. X            break; 
  753. X        }
  754. X    }
  755. X} /* end of vobaulary decode block */
  756. X
  757. Xif (jacc == 0) {
  758. X    printf ("Nothing you said was understandable! Try again. \n");
  759. X    continue ;
  760. X}
  761. X/* mark last word */
  762. Xsent[jacc] = V_LINE_END ;
  763. X/* Check to see if this is a simple move command */
  764. Xif (sent[0] <= 10) {
  765. X    tag[V_MOVE] = TRUE ;
  766. X    tag[V_DIRECTION] = TRUE ;
  767. X    verb = sent[0] ;
  768. X    return ; 
  769. X} /* end of the simple move block */
  770. X/* adjective and "in/out" preposition "for" loop */
  771. Xsw_purge = FALSE ;
  772. Xfor (j = 0; j <= jacc-1; j++) {
  773. X
  774. X    /* check for adjectives */
  775. X    for (i = 0; i <= adj_max; i++) {
  776. X        if (sent[j] == adjective[i][Aj_adj]) {
  777. X
  778. X        /* Does a noun have to be ignored ? */
  779. X        if ((adjective[i][Aj_adj_cmd] == F_ignore) &&
  780. X            (adjective[i][Aj_trig_noun] != sent[j+1])) break ;
  781. X
  782. X        /* Does a noun have to be replaced? */
  783. X        if ((adjective[i][Aj_adj_cmd] == F_replace) &&
  784. X            (adjective[i][Aj_trig_noun] == sent[j+1])) {
  785. X                sent[j+1] = adjective[i][Aj_act_noun] ;
  786. X        }
  787. X        sw_purge = TRUE ;
  788. X        j_purge = j ;
  789. X        }
  790. X    } 
  791. X} /* end of adjective and "in/out" preposition "for" loop */
  792. X
  793. X/* purge processed adjective from sentence */
  794. Xif (sw_purge) purge(j_purge, &jacc) ;
  795. X/* Verb grammer check "for" loop */
  796. X/* see if the sentence is of a command sentax */
  797. Xsw_loop = FALSE ;
  798. Xfor (i = 0; i <= verb_max; i++) {
  799. X    if (sent[0] == verb_table[i]) {
  800. X        if (synonym(jacc)) {
  801. X            sw_loop = TRUE ;
  802. X            break ;
  803. X        }
  804. X        return ;
  805. X    }
  806. X} /* end of verb grammer check "for" loop */
  807. Xif (sw_loop) continue ;
  808. X
  809. X/* First word is not a verb so check to see if this is a "question" sentence */
  810. Xfor (i = 0; i <= quest_max; i++) {
  811. X    if (sent[0] == quest[i]) {
  812. X        /* shift the sentence over and load in "question" */ 
  813. X        for (j = jacc; j >= 0; j--) sent[j+1] = sent[j] ;
  814. X        sent[0] = V_QUESTION ;
  815. X        tag[V_QUESTION] = TRUE ; 
  816. X        if (++jacc == 2) {
  817. X        /* Sentence is a one word command */
  818. X            tag[V_VERB_ONLY] = TRUE ;
  819. X            tag[sent[1]] = TRUE ;
  820. X            verb = V_QUESTION ;
  821. X            return ;
  822. X        }
  823. X        if (synonym(jacc)) {
  824. X            sw_loop = TRUE ;
  825. X            break ;
  826. X        }
  827. X        return ;
  828. X    } 
  829. X} /* end of first word not a verb so check if "question" block */
  830. Xif (sw_loop) continue ;
  831. X/* This is not a question and the first word is --not-- a verb. */
  832. X/*     Therefore a verb is embedded and must be swapped in. */
  833. Xif (jacc != 1) for (j = 1; j <= jacc-1; j++) {
  834. X    /* Check to see if the word is a move command */
  835. X    if (sent[j] <= 10) {
  836. X        tag[V_MOVE] = TRUE ;
  837. X        i_ws = sent[0] ;
  838. X        sent[0] = sent[j] ;
  839. X        sent[j] = i_ws ;
  840. X        if (synonym(jacc)) {
  841. X            sw_loop = TRUE ;
  842. X            break ;
  843. X        }
  844. X        return ;
  845. X    } /* end of simple move command block */
  846. X
  847. X    /* if not a move command then check the verb table */
  848. X    for (i = 0; i <= verb_max; i++) {
  849. X        if (sent[j] == verb_table[i]) {
  850. X            i_ws = sent[0] ;
  851. X            sent[0] = sent[j] ;
  852. X            sent[j] = i_ws ;
  853. X            if (synonym(jacc)) {
  854. X                sw_loop = TRUE ;
  855. X                break ;
  856. X            }
  857. X            return ;
  858. X        }
  859. X    }
  860. X    if (sw_loop) break ;
  861. X} /* end of verb is embedded and must be swapped in block */
  862. Xif (sw_loop) continue ;
  863. X
  864. X/* Verb error routine */
  865. Xprintf ("If there was a verb in that sentence, I didn't understand ") ;
  866. Xprintf ("it.\n") ;
  867. X
  868. X} /* end of outer most infinite "for" loop to parse in the words */
  869. X
  870. X} /* --- end of "parse" subroutine --- */
  871. X
  872. X
  873. Xint synonym(jacc)
  874. X/**************************************/
  875. X/*                                    */
  876. X/*         Synonym Function           */
  877. X/*                                    */
  878. X/* Version: Mk 1.0    6 December 1992 */
  879. X/*                                    */
  880. X/**************************************/
  881. X
  882. Xint jacc ;
  883. X
  884. X{
  885. Xregister int i, j ;
  886. Xint j_point ;
  887. Xint sw_movement, sw_adverb, sw_adverb_fnd ;
  888. X
  889. X#if (PROTOTYPE)
  890. Xvoid purge(int, int*) ;
  891. X#endif
  892. X
  893. X/* prescan for verb connected movement commands */
  894. Xswitch(sent[0]) { 
  895. Xcase V_go:
  896. Xcase V_move:
  897. Xcase V_walk:
  898. Xcase V_run:
  899. Xcase V_jump:
  900. Xcase V_bop:
  901. Xcase V_hop:
  902. Xcase V_stroll:
  903. Xcase V_saunter:
  904. Xcase V_swagger:
  905. X    sw_movement = TRUE ;
  906. X    break ;
  907. Xdefault:
  908. X    sw_movement = FALSE ;
  909. X}
  910. X
  911. X/* adverb scan, sent[0] is the verb */
  912. Xsw_adverb = FALSE ;
  913. Xsw_adverb_fnd = FALSE ;
  914. Xfor (i = 0; i <= adv_max; i++) {
  915. X    for (j = 1; j <= jacc-1; j++) {
  916. X        /* see if this is an adverb */
  917. X        if (sent[j] == adverb[i][Av_adv]) {
  918. X            j_point = j ;
  919. X            sw_adverb = TRUE ;
  920. X
  921. X            /* does the sentence have the companion verb? */
  922. X            if (adverb[i][Av_verb_old] == sent[0]) {
  923. X                sent[0] = adverb[i][Av_verb_new] ;
  924. X                sw_adverb = FALSE ;
  925. X                sw_adverb_fnd = TRUE ;
  926. X
  927. X            /* purge processed adverb from sentence */
  928. X                purge(j, &jacc) ;
  929. X            }
  930. X        }
  931. X    }
  932. X}
  933. X
  934. X/* purge unprocessed adverb from sentence */
  935. Xif (sw_adverb && (!sw_movement)) purge(j_point, &jacc) ;
  936. X/* scan the sentence for the movement direction */
  937. Xif ((!sw_adverb_fnd) && sw_movement) {
  938. X    for (j = 0; j <= jacc-1; j++) {
  939. X        if (sent[j] <= 10) {
  940. X            tag[V_MOVE] = TRUE ;
  941. X            tag[V_DIRECTION] = TRUE ;
  942. X            verb = sent[j] ;
  943. X            return(FALSE) ;
  944. X        }
  945. X        if (sent[j] == V_LINE_END) break ;
  946. X    }
  947. X    printf("Where to?  In what direction?\n") ;
  948. X    return(TRUE) ;
  949. X} 
  950. X
  951. Xtag[sent[0]] = TRUE ;  /* activate the tag for the verb */
  952. Xif (jacc == 1) {
  953. X/* Sentence is a one word command */
  954. X    tag[V_VERB_ONLY] = TRUE ;
  955. X    verb = sent[0] ;
  956. X    if (sent[0] <= 4) return(FALSE) ; /* first 5 elements are reserved */
  957. X    return(FALSE) ;
  958. X}
  959. X
  960. X/* Load the "tag" matrix for detected words and synonyms */
  961. Xfor (j = 1; j <= 19; j++) {
  962. X    if (sent[j] == V_LINE_END) break ;
  963. X    if (sent[j] <= 10) tag[V_DIRECTION] = TRUE ;
  964. X    if (sent[j] <= 4) continue ; /* first 5 elements are reserved */
  965. X    tag[sent[j]] = TRUE ;  /* activate an element for each word */
  966. X
  967. X    /* Deal with synonym nouns */
  968. X    switch(sent[j]) {
  969. X
  970. X    case V_automatic:
  971. X    case V_AUTO:
  972. X        tag[V_auto] = TRUE ;
  973. X        continue ;
  974. X    case V_bar:
  975. X        tag[V_gold] = TRUE ;
  976. X        continue ;
  977. X
  978. X    case V_beer:
  979. X    case V_fourex:
  980. X    case V_Fourex:
  981. X        tag[V_can] = TRUE ;
  982. X        continue ;
  983. X
  984. X    case V_cockroaches:
  985. X        tag[V_PLURAL] = TRUE ;
  986. X        tag[V_cockroach] = TRUE ;
  987. X        continue ;
  988. X    case V_diamond:
  989. X        tag[V_ring] = TRUE ;
  990. X        continue ;
  991. X    case V_doormat:
  992. X        tag[V_mat] = TRUE ;
  993. X        continue ;
  994. X
  995. X    case V_drop:
  996. X        tag[V_bear] = TRUE ;
  997. X        continue ;
  998. X
  999. X    case V_everything:
  1000. X        tag[V_all] = TRUE ;
  1001. X        continue ;
  1002. X
  1003. X    case V_lager:
  1004. X        tag[V_bottle] = TRUE ;
  1005. X        continue ;
  1006. X
  1007. X    case V_fuze:
  1008. X    case V_fuse:
  1009. X        tag[V_cap] = TRUE ;
  1010. X        continue ;
  1011. X
  1012. X    case V_gleeps:
  1013. X        tag[V_PLURAL] = TRUE ;
  1014. X        tag[V_gleep] = TRUE ;
  1015. X        continue ;
  1016. X
  1017. X    case V_hoop:
  1018. X        tag[V_snake] = TRUE ;
  1019. X        continue ;
  1020. X
  1021. X    case V_M16:
  1022. X    case V_m16:
  1023. X    case V_gun:
  1024. X        tag[V_rifle] = TRUE ;
  1025. X        continue ;
  1026. X
  1027. X    case V_kangaroos:
  1028. X        tag[V_PLURAL] = TRUE ;
  1029. X        tag[V_kangaroo] = TRUE ;
  1030. X        continue ;
  1031. X
  1032. X    case V_magazine:
  1033. X    case V_ammo:
  1034. X        tag[V_clip] = TRUE ;
  1035. X        continue ;
  1036. X
  1037. X    case V_mail:
  1038. X    case V_envelope:
  1039. X        tag[V_letter] = TRUE ;
  1040. X        continue ;
  1041. X
  1042. X    case V_matchbox:
  1043. X        tag[V_matches] = TRUE ;
  1044. X    case V_matches:
  1045. X        tag[V_PLURAL] = TRUE ;
  1046. X        tag[V_match] = TRUE ;
  1047. X        continue ;
  1048. X
  1049. X    case V_Ned:
  1050. X    case V_kelly:
  1051. X    case V_Kelly:
  1052. X        tag[V_ned] = TRUE ;
  1053. X        continue ;
  1054. X
  1055. X    case V_off_q:
  1056. X        tag[V_off] = TRUE ;
  1057. X        continue ;
  1058. X
  1059. X    case V_on_q:
  1060. X        tag[V_on] = TRUE ;
  1061. X        continue ;
  1062. X    case V_plan:
  1063. X        tag[V_map] = TRUE ;
  1064. X        continue ;
  1065. X
  1066. X    case V_painting:
  1067. X        tag[V_picture] = TRUE ;
  1068. X        continue ;
  1069. X
  1070. X    case V_picture:
  1071. X        tag[V_photo] = TRUE ;
  1072. X        continue ;
  1073. X
  1074. X    case V_doors:
  1075. X        tag[V_PLURAL] = TRUE ;
  1076. X        tag[V_door] = TRUE ;
  1077. X        continue ;
  1078. X
  1079. X    case V_pills:
  1080. X    case V_packet:
  1081. X        tag[V_PLURAL] = TRUE ;
  1082. X    case V_atropine:
  1083. X        tag[V_pill] = TRUE ;
  1084. X        continue ;
  1085. X
  1086. X    case V_safety:
  1087. X    case V_SAFE:
  1088. X        tag[V_safe] = TRUE ;
  1089. X        continue ;
  1090. X    case V_silver:
  1091. X        tag[V_coin] = TRUE ;
  1092. X        continue ;
  1093. X
  1094. X    case V_spinifexes:
  1095. X        tag[V_PLURAL] = TRUE ;
  1096. X        tag[V_spinifex] = TRUE ;
  1097. X        continue ;
  1098. X
  1099. X    case V_stick:
  1100. X        tag[V_dynamite] = TRUE ;
  1101. X        continue ;
  1102. X
  1103. X    case V_switch:
  1104. X        tag[V_button] = TRUE ;
  1105. X        continue ;
  1106. X
  1107. X    case V_treasure:
  1108. X        tag[V_all] = TRUE ;
  1109. X        continue ;
  1110. X
  1111. X    case V_I:
  1112. X        tag[V_single] = TRUE ;
  1113. X        continue ;
  1114. X
  1115. X    case V_III:
  1116. X        tag[V_triple] = TRUE ;
  1117. X        continue ;
  1118. X
  1119. X    case V_zero:
  1120. X        tag[V_0] = TRUE ;
  1121. X        continue ;
  1122. X
  1123. X    case V_forty_nine:
  1124. X        tag[V_49] = TRUE ;
  1125. X        continue ;
  1126. X
  1127. X    case V_sixty_seven:
  1128. X        tag[V_67] = TRUE ;
  1129. X        continue ;
  1130. X
  1131. X    case V_eighty_two:
  1132. X        tag[V_82] = TRUE ;
  1133. X        continue ;
  1134. X
  1135. X    default:
  1136. X        continue ;
  1137. X    }
  1138. X} /* end of sentence tag word scan */
  1139. Xverb = sent[0] ;
  1140. Xreturn(FALSE) ;
  1141. X
  1142. X} /* --- end of "synonym" subroutine --- */
  1143. X
  1144. Xvoid purge(k_start, k_finish)
  1145. X/***********************************/
  1146. X/*                                 */
  1147. X/*   Sentence Purging Subroutine   */
  1148. X/*                                 */
  1149. X/* Version: Mk 1.0  3 March 1990   */
  1150. X/*                                 */
  1151. X/***********************************/
  1152. X
  1153. Xint k_start, *k_finish ;
  1154. X{
  1155. Xregister int k ;
  1156. Xint k_end ;
  1157. X
  1158. Xk_end = *k_finish ;
  1159. Xfor (k = k_start; k <= k_end-1; k++) sent[k] = sent[k+1] ;
  1160. X*k_finish = --k_end ;
  1161. X} /* --- end of "purge" subroutine --- */
  1162. X
  1163. Xvoid filler()
  1164. X/***********************************/
  1165. X/*                                 */
  1166. X/*        Looker Subroutine        */
  1167. X/*                                 */
  1168. X/* Version: Mk 1.0  18 August 1989 */
  1169. X/*                                 */
  1170. X/***********************************/
  1171. X{
  1172. X
  1173. Xif (tag[V_VERB_ONLY]) {
  1174. X    printf("Fill what?\n") ;
  1175. X    return ;
  1176. X}
  1177. Xif (tag[V_can]) {
  1178. X    if (object[O_can][J_loc] != B_have) 
  1179. Xprintf("You don't have the Fourex can in your possession!\n") ;
  1180. Xelse printf("I can't do it!  There's a hole in the can's bottom.\n") ;
  1181. X    return ;
  1182. X}
  1183. Xif (tag[V_bottle]) {
  1184. X    if (object[O_bottle][J_loc] != B_have) 
  1185. Xprintf("You don't have the bottle in your possession!\n") ;
  1186. Xelse printf("I can't do it!  The bottle has a crack in it's bottom.\n");
  1187. X    return ;
  1188. X}
  1189. Xprintf("I can't fill that!\n") ;
  1190. X} /* --- end of the "filler" subroutine --- */
  1191. X
  1192. Xvoid looker(n)
  1193. X/***********************************/
  1194. X/*                                 */
  1195. X/*        Looker Subroutine        */
  1196. X/*                                 */
  1197. X/* Version: Mk 1.0  18 August 1989 */
  1198. X/*                                 */
  1199. X/***********************************/
  1200. Xint n ;
  1201. X{
  1202. Xint m ;
  1203. X
  1204. X#if (PROTOTYPE)
  1205. Xvoid long_descp(int), describe(int), objlooker(int), gleeper(int) ;
  1206. Xvoid actor(int), rdtxt(int) ;
  1207. X#endif
  1208. X
  1209. X/* an isolated "look" means to just look at the room */
  1210. Xif (tag[V_VERB_ONLY]) { 
  1211. X    /* Check for long description */
  1212. X    if ((room[n][M_rm_type] == T_was_long)||(n == R_lift_inside))
  1213. X       long_descp(n);
  1214. X    else describe (n) ;
  1215. X    objlooker(n) ; /* Check if there are objects in the room */
  1216. X    gleeper(n) ;   /* check for gleeps and update the gleep count */
  1217. X    /* describe unmovable action objects and status */
  1218. X    if (room[n][M_rm_type] == T_action_obj) actor(n) ;
  1219. X    return ;
  1220. X}
  1221. X
  1222. X/* Gleep tank */
  1223. Xif (tag[V_tank]) {
  1224. X    if (n == R_gleep_tank) {
  1225. Xprintf("You look inside the gleep tank and see a blue fluid which\n") ;
  1226. Xprintf("smells of chlorine") ;
  1227. X        if (gleep_score == 0) {
  1228. Xprintf(".\n") ;
  1229. X            return ;
  1230. X        }
  1231. X        if (gleep_score == 1) {
  1232. Xprintf(" and a single gleep submerged in the fluid.\n") ;
  1233. X            return ;
  1234. X        }
  1235. Xprintf(" and %d gleeps submerged in the fluid.\n",
  1236. X        gleep_score) ;
  1237. X        return ;
  1238. X    }
  1239. X    else {
  1240. X        printf("There is no gleep tank here!\n") ;
  1241. X        return ;
  1242. X    }
  1243. X}
  1244. X
  1245. X/* wall safe */
  1246. Xif (tag[V_safe]) {
  1247. X    if ((n == R_office_mang)&&
  1248. X        (room[R_office_mang][M_rm_status] >= S_revealed)) {
  1249. X        m = O_safe ;
  1250. X        rdtxt(m);
  1251. X    }
  1252. X    else printf("I see no safe here for me to describe.\n");
  1253. X    return ;
  1254. X}
  1255. X
  1256. Xfor (;;) {
  1257. X    /* map from the manager's office */
  1258. X    if (tag[V_map]) {
  1259. X        m = O_map_frag ;
  1260. X        break ;
  1261. X    }
  1262. X
  1263. X    /* Fourex can */
  1264. X    if (tag[V_can]) {
  1265. X        m = O_can ;
  1266. X        break ;
  1267. X    }
  1268. X
  1269. X    /* recorder */
  1270. X    if (tag[V_recorder]) {
  1271. X        m = O_recorder ;
  1272. X        break ;
  1273. X    }
  1274. X
  1275. X    /* Atropine pills */
  1276. X    if (tag[V_pill]) {
  1277. X        m = O_pills ;
  1278. X        break ;
  1279. X    }
  1280. X
  1281. X    /* Qadaffi's letter bomb */
  1282. X    if (tag[V_letter]) {
  1283. X        m = O_letter ;
  1284. X        break ;
  1285. X    }
  1286. X
  1287. X    /* paper from the safe */
  1288. X    if (tag[V_paper]) {
  1289. X         m = O_paper ;
  1290. X        break ;
  1291. X    }
  1292. X
  1293. X    /* cube */            
  1294. X    if (tag[V_cube]) {
  1295. X        m = O_cube ;
  1296. X        break ;
  1297. X    }
  1298. X
  1299. X    /* ammo clip */            
  1300. X    if (tag[V_clip]) {
  1301. X        m = O_clip ;
  1302. X        break ;
  1303. X    }
  1304. X
  1305. X    /* orange clip */
  1306. X    if (tag[V_org_clip]) {
  1307. X        m = O_org_clip ;
  1308. X        break ;
  1309. X    }
  1310. X
  1311. X    /* rifle */
  1312. X    if (tag[V_rifle]) {
  1313. X        m = O_rifle ;
  1314. X        break ;
  1315. X    }
  1316. X
  1317. X    /* Semtex detector */
  1318. X    if (tag[V_detector]) {
  1319. X        m = O_detector ;
  1320. X        break ;
  1321. X    }
  1322. X    /* Deal with unreadable objects */
  1323. X    printf("There is nothing more that I can describe about it.\n");
  1324. X    return ;
  1325. X} /* end of infinite for block */
  1326. X
  1327. Xif (object[m][J_loc] == B_have) rdtxt(m);
  1328. Xelse 
  1329. Xprintf("I can examine an object only if it is in my possession.\n");
  1330. X
  1331. X} /* --- end of the "looker" subroutine --- */
  1332. X
  1333. Xvoid pass()
  1334. X/***********************************/
  1335. X/*                                 */
  1336. X/*        Password Subroutine      */
  1337. X/*                                 */
  1338. X/* Version: Mk 1.0  29 July 1989   */
  1339. X/*                                 */
  1340. X/***********************************/
  1341. X{
  1342. Xregister int i ;
  1343. Xchar chr ;
  1344. Xstatic char *passwd = "2Xngootx7Ysd4Du9" ;
  1345. X
  1346. X#if (PROTOTYPE)
  1347. Xvoid exit(int);
  1348. Xchar getch(void) ;
  1349. X#endif
  1350. X
  1351. X/* Request password */
  1352. Xprintf("Enter password:  ") ;
  1353. X
  1354. X#ifndef __TURBOC__
  1355. Xfor (i = 2; i <= 7; i++) {
  1356. X    chr = getchar() ;
  1357. X    if (chr+i-1 != passwd[i]) exit(0) ;
  1358. X}    
  1359. Xif (getchar() != '\n') exit(0) ;
  1360. Xprintf(".\n") ;  /* indicate that the password was accepted */
  1361. X#endif
  1362. X
  1363. X#ifdef __TURBOC__
  1364. Xfor (i = 2; i <= 7; i++) {
  1365. X    chr = getch() ;
  1366. X    if (chr+i-1 != passwd[i]) { 
  1367. X        for (;;) if (getch() == 3) break ;
  1368. X        printf("\r                    \n") ;
  1369. X        exit(0) ;
  1370. X    }
  1371. X}
  1372. Xprintf("\r.                     \n") ;
  1373. X#endif
  1374. X
  1375. Xsw_wizard = TRUE ; /* toggle wizard switch */
  1376. X
  1377. X} /* --- end of the "pass" subroutine */
  1378. END_OF_FILE
  1379. if test 17330 -ne `wc -c <'parse.c'`; then
  1380.     echo shar: \"'parse.c'\" unpacked with wrong size!
  1381. fi
  1382. # end of 'parse.c'
  1383. fi
  1384. echo shar: End of archive 6 \(of 7\).
  1385. cp /dev/null ark6isdone
  1386. MISSING=""
  1387. for I in 1 2 3 4 5 6 7 ; do
  1388.     if test ! -f ark${I}isdone ; then
  1389.     MISSING="${MISSING} ${I}"
  1390.     fi
  1391. done
  1392. if test "${MISSING}" = "" ; then
  1393.     echo You have unpacked all 7 archives.
  1394.     rm -f ark[1-9]isdone
  1395. else
  1396.     echo You still need to unpack the following archives:
  1397.     echo "        " ${MISSING}
  1398. fi
  1399. ##  End of shell archive.
  1400. exit 0
  1401.