home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume17 / dinkum3 / part06 < prev    next >
Encoding:
Internet Message Format  |  1993-03-20  |  49.1 KB

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