home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume15 / dinkum2 / part04 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  48.4 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: v15i039:  dinkum2 - australian text adventure game, Part04/07
  5. Message-ID: <4195@master.CNA.TEK.COM>
  6. Date: 14 Jan 93 03:25:58 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1353
  9. Approved: billr@saab.CNA.TEK.COM
  10. Xref: uunet comp.sources.games:1538
  11.  
  12. Submitted-by: Gary Allen <gary@sun.mech.uq.oz.au>
  13. Posting-number: Volume 15, Issue 39
  14. Archive-name: dinkum2/Part04
  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 4 (of 7)."
  27. # Contents:  monster.c objlook.c
  28. # Wrapped by billr@saab on Wed Jan 13 19:20:18 1993
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'monster.c' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'monster.c'\"
  32. else
  33. echo shar: Extracting \"'monster.c'\" \(28639 characters\)
  34. sed "s/^X//" >'monster.c' <<'END_OF_FILE'
  35. X#define MNSTR
  36. X#include "dink_sym.h"
  37. X#include "dink_glb.h"
  38. X
  39. Xint sw_snaked = FALSE, sw_wombat = FALSE ;
  40. Xvoid monster(loc_pnt)
  41. X/********************************************************************/
  42. X/*                                                                  */
  43. X/*                  --- The Monster Subroutine ---                  */
  44. X/*                                                                  */
  45. X/*  monster_flag is a global variable input parameters              */
  46. X/*                                                                  */
  47. X/* Software by Gary A. Allen, Jr. 22 December 1992, Version: Mk 1.5 */
  48. X/*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  49. X/*                                                                  */
  50. X/********************************************************************/
  51. X
  52. Xint loc_pnt[3] ;
  53. X{
  54. Xregister int j ;
  55. Xint sw_chasing, sw_local ;
  56. Xstatic int sw_hoop = FALSE, bear_flag = 0 ;
  57. Xstatic int sw_replaced = FALSE ;
  58. Xstatic int sw_nogo = FALSE, sw_guarded = TRUE ;
  59. Xstatic int sw_letter = FALSE ;
  60. Xstatic int count_down = 0 ;
  61. X
  62. Xstruct monster_struct *mnstr, *mnstr_local, *mnstr_chase ;
  63. X
  64. X#if (PROTOTYPE)
  65. Xvoid ender(int), long_descp(int), hold_it(void), boom(void) ;
  66. Xvoid ned_kills(void), mullah_kills(void) ;
  67. Xvoid see_letter(int*, int*) ;
  68. Xvoid chief_mullah(int*) ;
  69. Xint bribe_mullah(int*) ;
  70. Xvoid chaser(struct monster_struct*, int[3]) ;
  71. X#endif
  72. X/* set up some of the input variables */
  73. Xsw_chasing = FALSE ; /* turn off the chasing monster switch */
  74. Xsw_local = FALSE ;   /* turn off the local monster switch */
  75. X
  76. X/* There can be no active monsters while in the closet */
  77. Xif (loc_pnt[0] == R_closet) {
  78. X    monster_flag = F_no_monster ;
  79. X    if (sw_letter == TRUE) {
  80. X        sw_letter = FALSE ;
  81. X        sw_nogo = TRUE ;
  82. Xprintf("\nYou hear a loud \"BOOM!\" from the Prayer Room followed\n");
  83. Xprintf("by the sounds of people shouting and cursing in Farsi. I\n");
  84. Xprintf("think it is definitely time that we leave.\n") ;
  85. X    }
  86. X    return ;
  87. X}
  88. X
  89. X/* scan the enemy table for the local and/or chasing monsters */
  90. Xfor (j = 0; j <= enemy_max; j++) {
  91. X    mnstr = (monster_start + j) ;  /* point to the monster */
  92. X    if (mnstr->Location == loc_pnt[0]) {
  93. X        sw_local = TRUE;
  94. X        mnstr_local = mnstr ;
  95. X    }
  96. X    else if (mnstr->Status != F_asleep){
  97. X        if ((N_mullah == j)||(N_guards == j)||((N_ned == j)&&
  98. X        (mnstr->Status == F_stealing))) continue ;
  99. X        sw_chasing = TRUE;
  100. X        mnstr_chase = mnstr ;
  101. X    }
  102. X} 
  103. X
  104. X/* see if the monster is local */
  105. Xif (sw_local) {
  106. X/* deal with case of being chased by monster to another monster */
  107. Xif (sw_chasing) {
  108. X    switch(mnstr_chase->Type) {
  109. X/* Mutant wombat scares off the local monser */
  110. X    case N_wombat:
  111. X/* put the local monster to sleep and swap location with wombat  */
  112. X    mnstr_local->Status = F_asleep ;
  113. X    mnstr_local->Location = Wombat->Location ;
  114. X    chaser(mnstr_chase, loc_pnt) ;
  115. X    return ;
  116. X/* Hoop Snake breaks off the chase */
  117. X    case N_hoop_snake:
  118. Xprintf("                     ---- What a relief!! ---- \n") ;
  119. Xprintf("           The dreaded hoop snake has broken off pursuit.\n");
  120. Xprintf("                         But what is this!!\n\n") ;
  121. Xprintf("You see yet another terrible creature!\n");
  122. X    sw_replaced = TRUE  ;
  123. X    break ;
  124. X    }
  125. X    /* put the chasing monster to sleep */
  126. X    monster_flag = F_no_monster ;
  127. X    mnstr_chase->Status = F_asleep ;
  128. X    sw_chasing = FALSE;
  129. X}
  130. X
  131. X/* local monster routines */
  132. Xswitch(mnstr_local->Type) {
  133. X
  134. X/* Revolutionary Guard local (only) behavior */
  135. Xcase N_guards:
  136. Xmonster_flag = F_monster_active ;
  137. X
  138. X/* guards always kill after the letter bomb has exploded */
  139. Xif (sw_nogo) {
  140. Xprintf("\nWith you are three men dressed in ripped and shredded ");
  141. Xprintf("clothes which have\nbeen blackened by an explosion.  They ") ;
  142. Xprintf("are armed to the teeth and insane\nwith rage.  They take ");
  143. Xprintf("one look at you and proceed to cut you to pieces with\n");
  144. Xprintf("their automatic weapons!\n\n");
  145. X    ender(F_died) ;
  146. X}
  147. X
  148. X/* guards always kill if they see a rifle */
  149. Xif (object[O_rifle][J_loc] == B_have) {
  150. Xprintf("With you are four men dressed in rather shabby clothes. ");
  151. Xprintf("Three of them\nare clutching AK-47 assault rifles while ");
  152. Xprintf("the fourth one is holding an Uzi\nmachine gun. They ") ;
  153. Xprintf("take one look at the M-16 rifle which you are clutching,\n");
  154. Xprintf("point their own weapons at you and proceed to hose you ");
  155. Xprintf("with a hail of\nlead!  Ten seconds later you look like ");
  156. Xprintf("a piece of Swiss cheese.\n\n") ;
  157. X    ender(F_died) ;
  158. X}
  159. X
  160. Xswitch (Guards->Status) {
  161. X    case F_asleep:
  162. X        Guards->Status = F_passive ;
  163. Xprintf("With you are four men dressed in rather shabby clothes. ");
  164. Xprintf("Three of them\nare clutching AK-47 assault rifles while ");
  165. Xprintf("the fourth one is holding an Uzi\nmachine gun. They ") ;
  166. Xprintf("search you but find nothing that is obviously a\n") ;
  167. Xprintf("weapon.  They are in a quandary on what to do with ") ;
  168. Xprintf("you, since you\nliterally appeared out of thin air.\n");
  169. X        return ;
  170. X    
  171. X    case F_passive:
  172. X        if (Mullah->Status == F_asleep) {
  173. Xprintf("\nThe four men have concluded that the best thing to do\n");
  174. Xprintf("with you is to take you to their superiors.  Two of the men\n");
  175. Xprintf("roughly grab hold of you and fling you bodily through the\n");
  176. Xprintf("doorway to the east.\n\n") ;
  177. X        loc_pnt[0] = R_prayer;
  178. X        long_descp(R_prayer) ;
  179. X        chief_mullah(&count_down) ;
  180. X        return ;
  181. X        }
  182. X        if (sw_guarded) {
  183. Xprintf("\nAll of the guards are currently in the prayer room.\n") ;
  184. X            sw_guarded = FALSE ;
  185. X        }
  186. X        return ;
  187. X
  188. X    case F_aggressive:
  189. X        Guards->Status = F_killing ;
  190. Xprintf("\nThe four guards grab you by the arms and legs, and frog\n");
  191. Xprintf("march you back into the prayer room.\n");
  192. X        loc_pnt[0] = R_prayer;
  193. X        return ;
  194. X
  195. X    case F_killing:
  196. Xprintf("\nThe guards are tired of fooling with you.  One of them\n") ;
  197. Xprintf("hits you on the head with the butt of his rifle.  Then the\n");
  198. Xprintf("other two guards drag you outside where you are executed\n");
  199. Xprintf("before a jeering mob of 30,000 people!\n\n") ;
  200. X        ender(F_died) ;
  201. X
  202. X} /* end of the Guards local routine and switch block */
  203. X
  204. X
  205. X/* Chief Mullah local (only) behaivor */
  206. Xcase N_mullah:
  207. Xswitch (Mullah->Status) {
  208. X    case F_asleep:
  209. X        chief_mullah(&count_down) ;
  210. X        return ;
  211. X
  212. X    case F_aggressive:
  213. X        /* The Mullah takes any valuables dropped */
  214. X        if (bribe_mullah(&count_down)) return ;
  215. X
  216. X        /* The Mullah sees and takes the letter */
  217. X        if (object[O_letter][J_loc] == R_prayer) {
  218. X            see_letter(&count_down, &sw_letter);
  219. X            return ;
  220. X        }
  221. X        count_down++ ;
  222. X        switch(count_down) {
  223. X        case 1:
  224. Xprintf("\nThe Mullah is waiting for you to give him something.\n") ;
  225. X            return ;
  226. X        case 2:
  227. Xprintf("\nThe Mullah is becoming quite impaitent.  You had better\n") ;
  228. Xprintf("do something soon!\n") ;
  229. X        Mullah->Status = F_killing ;
  230. X        }
  231. X        return ;
  232. X
  233. X    case F_passive:
  234. X        count_down++ ;
  235. X        switch(count_down) {
  236. X
  237. X        case 1:
  238. Xprintf("\nThe Mullah is examining the envelope of Muammar's letter.\n");
  239. X            return ;
  240. X
  241. X        case 2:
  242. Xprintf("\nThe Mullah has turned the envelope over and is just\n") ;
  243. Xprintf("about to open it.\n") ;
  244. X            return ;
  245. X
  246. X        case 3:
  247. X            boom() ;
  248. Xprintf("The Mullah opened the letter.  Needless to say, the letter\n") ;
  249. Xprintf("was a bomb.  The good news is the nasty old Mullah died.\n");
  250. Xprintf("The bad news is you died in the explosion as well!\n\n") ;
  251. X            ender(F_died) ;
  252. X        }
  253. X
  254. X    case F_killing:
  255. X        if (bribe_mullah(&count_down)) {
  256. X            Mullah->Status = F_aggressive ;
  257. X            return ;
  258. X        }
  259. X        if (object[O_letter][J_loc]==R_prayer) {
  260. X            see_letter(&count_down, &sw_letter);
  261. X            return ;
  262. X        }
  263. Xprintf("\"You are a brainless idiot!\" screams the Mullah!\n") ;
  264. X        mullah_kills() ;
  265. X} /* end of mullah status switch block */
  266. X
  267. X/* The mullah sees Gaddafi's lette (this might be dead code) */
  268. X/* temporary */
  269. Xsee_letter(&count_down, &sw_letter);
  270. Xreturn ;
  271. X/* end of the mullah local behavior routine */
  272. X
  273. X/* Ned Kelly local behavior */
  274. Xcase N_ned:
  275. Xif (monster_flag == F_no_monster) {
  276. Xprintf("\nAs you approached the entrance of Ned Kelly's hide out, a ") ;
  277. Xprintf("man walked out\n") ;
  278. Xprintf("the front door and prevented you from entering.  He is ");
  279. Xprintf("wearing an iron\n") ;
  280. Xprintf("helmet with thin eye slits which completely covers ");
  281. Xprintf("his head.  He has\n") ;
  282. Xprintf("body armour made of thin sheets of iron that covers ");
  283. Xprintf("his chest and abdomen.\n") ;
  284. Xprintf("He is holding a 12 guage double barrel shotgun ");
  285. Xprintf("and has a pistol on\nhis hip.  ") ;
  286. Xprintf("I could be wrong but I think this is Ned Kelly!\n\n");
  287. X    loc_pnt[0] = R_hideout_entr ;
  288. X    monster_flag = F_monster_active ;
  289. X    Ned->Status = F_passive ;
  290. X    return ;
  291. X}
  292. Xelse {
  293. X    if (Ned->Status == F_killing) ned_kills() ;
  294. Xprintf("\nNed is not about to allow you to enter his hide out.  He ");
  295. Xprintf("is now expressing\n") ;
  296. Xprintf("his displeasure with your continued presence by cocking both ");
  297. Xprintf("of the hammers on\n") ;
  298. Xprintf("his shotgun and pointing it at your head.  I believe it is ");
  299. Xprintf("time to go!!\n\n") ;
  300. X    loc_pnt[0] = R_hideout_entr ;
  301. X    Ned->Status = F_killing ;
  302. X    return ;
  303. X}
  304. X
  305. X/* Mutant Wombat monster behavior */
  306. Xcase N_wombat:
  307. Xsw_replaced = FALSE ; 
  308. Xif (monster_flag == F_no_monster) {
  309. Xprintf("\n                        ----- OH NO!! -----\n") ;
  310. Xprintf("                  You are in ***SERIOUS TROUBLE*** !!!\n") ;
  311. Xprintf("Forget about hoop snakes, and forget about drop bears.  This ");
  312. Xprintf("is the WORST\n") ;
  313. Xprintf("thing that can be found in the ACME Mine.  You see before ");
  314. Xprintf("you the awful\n") ;
  315. Xprintf("spawn of the Pommy nuclear weapon's tests. Its ancestors ");
  316. Xprintf("were inoffensive\n") ;
  317. Xprintf("creatures, but gamma radiation has transformed this into...\n");
  318. Xprintf("                      The Dreadful Mutant Wombat!! \n") ;
  319. Xprintf("Normally I would advise you to run for your life.  However ");
  320. Xprintf("there's really\n");
  321. Xprintf("no point.  You can not out run this thing, and it's almost ");
  322. Xprintf("impossible to\n");
  323. Xprintf("kill.  You might as well just stand here and let it finish ");
  324. Xprintf("you off as\n") ;
  325. Xprintf("quickly and painlessly as possible.\n\n") ;
  326. X    monster_flag = F_monster_active ;
  327. X    Wombat->Status = F_aggressive ;
  328. X    loc_pnt[1] = loc_pnt[0] ; 
  329. X    loc_pnt[2] = 0 ; /* zero out the previous location */
  330. X}
  331. Xelse {
  332. X    if (Wombat->Status == F_aggressive) {
  333. Xprintf("\nThe wombat is approaching you.  Its mouth is wide open ") ;
  334. Xprintf("showing its\n") ;
  335. Xprintf("enormous canines.  Its claws are fully extended.  The ") ;
  336. Xprintf("wombat sees\n") ;
  337. Xprintf("you as an easy meal and is preparing to feast.\n") ;
  338. X        Wombat->Status = F_killing ;
  339. X        return ;
  340. X    }
  341. X    if (Wombat->Status == F_killing) {
  342. X        /* The Mutant Wombat kills the player */
  343. Xprintf("\nThe obscene creature has grasped you with its terrible ");
  344. Xprintf("claws!  First the\n");
  345. Xprintf("wombat rips off your right arm with a single jerk and ");
  346. Xprintf("tosses it down its\n");
  347. Xprintf("throat like it was an appetizer (which it was!).  Next ");
  348. Xprintf("the monster studies\n");
  349. Xprintf("you for a moment and then twists off your left leg and ") ; 
  350. Xprintf("chews on it like\n") ;
  351. Xprintf("a turkey drumstick.  After savoring your left leg, it ");
  352. Xprintf("opens its mouth wide\n");
  353. Xprintf("and stuffs you in head first!  Your last memory was ") ;
  354. Xprintf("hearing the crunching\n");
  355. Xprintf("of your own bones as the wombat's jaws clamped down!\n") ;
  356. X        ender(F_died) ;
  357. X    }
  358. X}
  359. Xreturn ;
  360. X
  361. X/* Drop Bear monster behavior */
  362. Xcase N_drop_bear:
  363. Xsw_replaced = FALSE ; 
  364. Xif (monster_flag == F_no_monster) {
  365. X    switch(bear_flag) {
  366. Xcase 0:
  367. Xprintf("\nAs you walk in, you see something that looks vaguely like") ;
  368. Xprintf(" a koala bear\n") ;
  369. Xprintf("sitting in the middle of the floor.  However this \"koala\"") ;
  370. Xprintf(" has vampire\n") ;
  371. Xprintf("teeth and blood drooling down the sides of its mouth. The") ;
  372. Xprintf(" bear takes\n") ;
  373. Xprintf("one look at you and climbs up the wall onto the ceiling.") ;
  374. Xprintf(" It \n") ;
  375. Xprintf("clings to the ceiling much like a fly and seems to be") ;
  376. Xprintf(" positioning\n") ;
  377. Xprintf("itself to be directly over you.  I could be wrong but I") ;
  378. Xprintf(" think this is\n") ;
  379. Xprintf("the deadly DROP BEAR! \n\n") ;
  380. X    bear_flag = 1 ;
  381. X    break ;
  382. X
  383. Xcase 1:
  384. Xprintf("\nJust as you walk in, a drop bear flashes by and hits") ;
  385. Xprintf(" the ground with\n");
  386. Xprintf("a THUNK.  That was close!  Had it hit you, and caught ") ;
  387. Xprintf("hold with its\n");
  388. Xprintf("claws, you would have been finished.  The dreaded ");
  389. Xprintf("beast is now\n") ;
  390. Xprintf("running up the wall towards the ceiling to give it ") ;
  391. Xprintf("another go. I\n");
  392. Xprintf("think we had better leave and soon!\n\n") ;;
  393. X    bear_flag = 2 ;
  394. X    break ;
  395. X
  396. Xcase 2:
  397. Xprintf("\nAs you walk in, you see a drop bear lounging lazily in") ;
  398. Xprintf(" the middle of\n");
  399. Xprintf("the floor. It rolls over and takes one look at you, ") ;
  400. Xprintf("runs towards\n");
  401. Xprintf("the wall and scampers up to the ceiling.  It is now ");
  402. Xprintf("positioning\n") ;
  403. Xprintf("itself to be directly over you.\n\n") ;
  404. X    bear_flag = 1 ;
  405. X    }
  406. X
  407. Xmonster_flag = F_monster_active ;
  408. Xmnstr_local->Status = F_aggressive ;
  409. X}
  410. Xelse {
  411. X    if (mnstr_local->Status == F_aggressive) {
  412. Xprintf("\nThe drop bear is now positioned directly above you.  It is") ;
  413. Xprintf(" hanging batlike\n") ;
  414. Xprintf("by its rear paws, with its front arms reaching out with");
  415. Xprintf(" claws fully \n") ;
  416. Xprintf("extended.  Its mouth is wide open with its vampire teeth ");
  417. Xprintf("clearly visible.\n") ;
  418. Xprintf("I think this thing means business!  Let's make a hasty ");
  419. Xprintf("departure!!\n") ;
  420. X        mnstr_local->Status = F_killing ;
  421. X        return ;
  422. X    }
  423. X    if (mnstr_local->Status == F_killing) {
  424. X        /* The drop bear kills the player */
  425. Xprintf("\nThe drop bear drops on top of you!  First it grabs hold ") ;
  426. Xprintf("of you with its \n") ;
  427. Xprintf("sharp claws that sink deep into your flesh.  Then it bites ");
  428. Xprintf("into your neck \n") ; 
  429. Xprintf("at the jugular vein and begins sucking your blood.  You ");
  430. Xprintf("try desperately \n") ;
  431. Xprintf("to pull the horrible monster off, but it only clamps on ");
  432. Xprintf("harder and sucks \n") ; 
  433. Xprintf("more vigorously.  Soon you grow weak from lack of blood, ");
  434. Xprintf("and lapse into death. \n") ;
  435. X        ender(F_died) ;
  436. X    }
  437. X}
  438. Xreturn ;
  439. X/* Hoop Snake monster behavior */
  440. Xcase N_hoop_snake:
  441. Xif (monster_flag == F_no_monster) {
  442. X    if (sw_replaced) { 
  443. X        sw_replaced = FALSE  ;
  444. Xprintf("\nA new and rested hoop snake rolls into view.  The ");
  445. Xprintf("snake sees you, lets go of\n") ;
  446. Xprintf("its tail and starts slithering towards you with fangs ");
  447. Xprintf("at the ready. \n\n");
  448. X    }
  449. X    else {
  450. X        if (!sw_hoop) {
  451. Xprintf("\nSomething that looks vaguely like a barrel hoop rolls into ");
  452. Xprintf("the passage. You \n") ;
  453. Xprintf("suddenly realize to your horror that this is no hoop but a ");
  454. Xprintf("snake biting its \n") ;
  455. Xprintf("own tail.  The snake lets go of its tail and starts to ");
  456. Xprintf("slither towards you \n") ;
  457. Xprintf("like a regular, highly aggressive snake. \n\n");
  458. X            sw_hoop = TRUE ;
  459. X        }
  460. X        else {
  461. Xprintf("\nA hoop snake rolls towards you.  It lets go of its ");
  462. Xprintf("tail and starts slithering\n") ;
  463. Xprintf("in your direction. \n\n");
  464. X        }
  465. X    }
  466. X    monster_flag = F_monster_active ;
  467. X    mnstr_local->Status = F_aggressive ;
  468. X    loc_pnt[1] = loc_pnt[0] ; 
  469. X    loc_pnt[2] = 0 ; /* zero out the previous location */
  470. X    return ;
  471. X}
  472. Xelse {
  473. X    if (mnstr_local->Status == F_aggressive) {
  474. Xprintf("\nThe hoop snake is coiling up in front of you and ") ;
  475. Xprintf("hissing very aggressively. \n") ;
  476. Xprintf("Venom is dripping from its sharp fangs and seems ") ;
  477. Xprintf("to be burning holes into\n") ;
  478. Xprintf("the stone floor.\n\n") ;
  479. Xprintf("I think it would be wise for us to leave....  Quickly!!\n") ;
  480. X        mnstr_local->Status = F_killing ;
  481. X        return ;
  482. X    }
  483. X    if (mnstr_local->Status == F_killing) {
  484. X        /* The Hoop Snake kills the player */
  485. Xprintf("\nThe hoop snake strikes and bites you right on the nose!") ;
  486. Xprintf("\n\nYou begin to thrash around ") ;
  487. Xprintf("like a Baygon sprayed cocky.  The nerve poison \n") ;
  488. Xprintf("makes you jerk around onto your back with your arms and ") ;
  489. Xprintf("legs flailing about\n") ;
  490. Xprintf("in the air.  With time your spasmodic twitching reduces") ;
  491. Xprintf(" in frequency.  You\n") ;
  492. Xprintf("slowly grind down to a halt with the coming of death. \n") ;
  493. X        ender(F_died) ;
  494. X    }
  495. X
  496. X}
  497. X} /* end of the local monster switch group */
  498. X}
  499. X
  500. Xchaser(mnstr_chase, loc_pnt) ;
  501. Xreturn ;
  502. X
  503. X} /* --- end of the "monster" subroutine --- */
  504. X
  505. Xvoid chaser(mnstr, loc_pnt)
  506. X/********************************************************************/
  507. X/*                                                                  */
  508. X/*               --- Monster Chasing Subroutine ---                 */
  509. X/*                                                                  */
  510. X/* Software by Gary A. Allen, Jr. 8 December 1992, Version: Mk 2.0 */
  511. X/*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  512. X/*                                                                  */
  513. X/********************************************************************/
  514. Xstruct monster_struct *mnstr ;
  515. Xint loc_pnt[3] ;
  516. X{ 
  517. X
  518. X#if (PROTOTYPE)
  519. Xvoid ned_kills(void) ;
  520. X#endif
  521. X
  522. Xswitch(mnstr->Type) {
  523. X/* Ned Kelly */
  524. Xcase N_ned:
  525. X    if (loc_pnt[0] == R_hideout_entr) {
  526. X    if (Ned->Status == F_passive) {
  527. Xprintf("\nNed Kelly is standing in front of you and is holding a ");
  528. Xprintf("12 guage shotgun\n") ;
  529. Xprintf("in a rather menacing manner.  This guy is really game!\n\n") ;
  530. Xprintf("I suggest we leave.....   and quickly!!\n\n") ;
  531. X        Ned->Status = F_aggressive ;
  532. X        return ;
  533. X    }
  534. X    if (Ned->Status == F_aggressive) {
  535. Xprintf("\nNed seems to be getting impaitent with you.  He is now ");
  536. Xprintf("expressing his\n") ;
  537. Xprintf("displeasure with your continued presence by cocking both ");
  538. Xprintf("of the hammers on\n") ;
  539. Xprintf("his shotgun and pointing it at your head.  I really think ");
  540. Xprintf("we should be\n") ;
  541. Xprintf("making a hasty departure!!\n\n") ;
  542. X        Ned->Status = F_killing ;
  543. X        return ;
  544. X    }
  545. X    if (Ned->Status != F_killing) break ;
  546. X        else ned_kills() ;
  547. X    }
  548. X    else break ;
  549. X/* Mutant wombat chases */
  550. Xcase N_wombat:
  551. X    if (loc_pnt[0] == R_lift_inside) {
  552. Xprintf("\nYou run as fast as you can into the lift.  You've made it! ") ;
  553. Xprintf(" You're in the\n") ;
  554. Xprintf("lift! However as you turn around, you realize to your horror") ;
  555. Xprintf(" that the\n") ;
  556. Xprintf("wombat has also made it inside the lift, and the door ");
  557. Xprintf("is closing!!\n\n") ;
  558. Xprintf("                     Ah, Stuff of Nightmares!!!\n") ;
  559. Xprintf("          ---Trapped in a Lift with a Mutant Wombat!!!---\n\n");
  560. Xprintf("This is just too horrible.  Let it suffice... You died. \n");
  561. X    ender(F_died) ;
  562. X    }
  563. X    if (loc_pnt[0] == loc_pnt[2]) {
  564. Xprintf("The wombat is in that direction.  You can't go that way!\n");
  565. X        loc_pnt[0] = loc_pnt[1] ;
  566. X        return ;
  567. X    }
  568. X    if (!sw_wombat) {
  569. Xprintf("\nAs you flee down the passage, you hear the ");
  570. Xprintf("\"THUD, THUD, THUD\" of the wombat\n") ;
  571. Xprintf("trudging down the passage.  The horrible thing is after") ;
  572. Xprintf(" you!  Give up\n") ;
  573. Xprintf("all hope!  The wombat is driven by nuclear energy and") ;
  574. Xprintf(" will never stop.\n\n") ;
  575. X    sw_wombat = TRUE ;
  576. X    }
  577. X    else { 
  578. Xprintf("\nThe wombat is still chasing you and not tiring. \n") ;
  579. X    }
  580. X    monster_flag = F_monster_active ;
  581. X    mnstr->Status = F_aggressive ;
  582. X    --room[mnstr->Location][M_monster] ;
  583. X    ++room[loc_pnt[0]][M_monster] ;
  584. X    mnstr->Location = loc_pnt[0] ;
  585. X    loc_pnt[2] = loc_pnt[1] ;
  586. X    loc_pnt[1] = loc_pnt[0] ;
  587. X    return ;
  588. X/* Hoop Snake chases */
  589. Xcase N_hoop_snake:
  590. X    if (loc_pnt[0] == R_lift_inside) {
  591. Xprintf("\nYou seek refuge from the hoop snake by fleeing into the ") ;
  592. Xprintf("lift.  Just as you\n") ;
  593. Xprintf("enter the lift, its door begins to close.  Unfortunately the") ;
  594. Xprintf(" hoop snake\n") ;
  595. Xprintf("rolls in the instant before the door is fully closed.\n\n") ;
  596. Xprintf("We will not describe the unpleasant events that occur behind");
  597. Xprintf(" the closed door\n");
  598. Xprintf("of the lift. However one can hear screams, curses, futile ");
  599. Xprintf("banging on the\n");
  600. Xprintf("lift door and loud snake hissing.  After a few minutes ");
  601. Xprintf("there is again silence.\n");
  602. Xprintf("The lift door opens and the hoop snake rolls out and away. ");
  603. Xprintf("A peek inside the\n");
  604. Xprintf("lift reveals your corpse which is in the early phases of ");
  605. Xprintf("rigor mortis.\n") ;
  606. X    ender(F_died) ;
  607. X    }
  608. X    if (loc_pnt[0] == loc_pnt[2]) {
  609. X        if (mnstr->Status == F_killing) {
  610. Xprintf("The hoop snake is in that direction.  ") ;
  611. Xprintf("You can't go that way!\n");
  612. X        loc_pnt[0] = loc_pnt[1] ;
  613. X        return ;
  614. X        }
  615. X        else {
  616. Xprintf("You have run back the way you came and passed the hoop ");
  617. Xprintf("snake, which\n") ;
  618. Xprintf("is still biting its tail and rolling like a hoop. The ") ;
  619. Xprintf("vile creature\n") ;
  620. Xprintf("hisses in frustration and does a U-turn to continue ") ;
  621. Xprintf("the chase.\n\n") ;
  622. X        }
  623. X    }
  624. X    else {
  625. X        if (!sw_snaked) {
  626. Xprintf("\nAs you flee down the passage, you hear the characteristic ") ;
  627. Xprintf("sound of reptilian\n") ;
  628. Xprintf("scales rubbing the stone floor.  You look over your shoulder") ;
  629. Xprintf(" and see the\n") ;
  630. Xprintf("hoop snake is rolling along right behind you! The dreaded") ;
  631. Xprintf(" thing is chasing you!!\n\n") ;
  632. X            sw_snaked = TRUE ;
  633. X        }
  634. X        else {
  635. Xprintf("\nThe hoop snake is rolling along behind you, and still") ;
  636. Xprintf(" in hot pursuit!\n\n") ;
  637. X        }
  638. X    }
  639. X    monster_flag = F_monster_active ;
  640. X    mnstr->Status = F_aggressive ;
  641. X    --room[mnstr->Location][M_monster] ;
  642. X    ++room[loc_pnt[0]][M_monster] ;
  643. X    mnstr->Location = loc_pnt[0] ;
  644. X    loc_pnt[2] = loc_pnt[1] ;
  645. X    loc_pnt[1] = loc_pnt[0] ;
  646. X    return ;
  647. X} /* end of the chasing monster switch group */
  648. X
  649. X/* player has fled the monster, so turn it off */
  650. Xmonster_flag = F_no_monster ;
  651. Xmnstr->Status = F_asleep ;
  652. Xreturn ;
  653. X
  654. X} /* --- end of the "chaser" subroutine --- */
  655. X
  656. Xvoid ned_kills()
  657. X/********************************************************************/
  658. X/*                                                                  */
  659. X/*           --- Ned Killy Kills the Player Subroutine ---           */
  660. X/*                                                                  */
  661. X/*  Software by Gary A. Allen, Jr. 7 December 1992, Version: Mk 1.0 */
  662. X/*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  663. X/*                                                                  */
  664. X/********************************************************************/
  665. X{
  666. X
  667. X#if (PROTOTYPE)
  668. Xvoid ender(int) ;
  669. X#endif
  670. X
  671. Xprintf("\nWith an air of professional detachment, Ned Kelly pulls ");
  672. Xprintf("both triggers\n") ;
  673. Xprintf("on his shotgun and blows your head clean off your ") ;
  674. Xprintf("shoulders. \n\n") ;
  675. X    ender(F_died) ;
  676. X} /* --- end of the ned_kills" subroutine --- */
  677. X
  678. Xvoid mullah_kills()
  679. X/********************************************************************/
  680. X/*                                                                  */
  681. X/*             --- Mullah Kills the Player Subroutine ---           */
  682. X/*                                                                  */
  683. X/*  Software by Gary A. Allen, Jr. 7 December 1992, Version: Mk 1.0 */
  684. X/*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  685. X/*                                                                  */
  686. X/********************************************************************/
  687. X{
  688. X
  689. X#if (PROTOTYPE)
  690. Xvoid ender(int) ;
  691. X#endif
  692. X
  693. Xprintf("\nWith that pronouncement, the chief Mullah claps his hands\n");
  694. Xprintf("twice.  Two Revolutionary Guards drag you outside where you\n");
  695. Xprintf("are executed before a jeering mob of 30,000 people!\n") ;
  696. X    ender(F_died) ;
  697. X} /* --- end of the "mullah_kills" subroutine --- */
  698. X
  699. Xvoid see_letter(count_on, sw_letter)
  700. X/********************************************************************/
  701. X/*                                                                  */
  702. X/*         --- Mullah see Gaddafi's Letter Subroutine ---           */
  703. X/*                                                                  */
  704. X/*  Software by Gary A. Allen, Jr. 7 December 1992, Version: Mk 1.0 */
  705. X/*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  706. X/*                                                                  */
  707. X/********************************************************************/
  708. X
  709. Xint *count_on, *sw_letter ;
  710. X
  711. X{
  712. Xprintf("\nThe Mullah gives the letter a casual glance, then\n");
  713. Xprintf("suddenly his face lights up and he claps his hands with\n") ;
  714. Xprintf("glee.\n\n") ;
  715. Xprintf("\"It's a letter from my old friend Muammar!\", he exclaims!\n");
  716. Xprintf("\"This is an occasion for much jubulation.  As a token of\n");
  717. Xprintf("my esteem take this ancient gong clapper made of gold and\n");
  718. Xprintf("ivory.  It was recovered from the personal collection of\n") ;
  719. Xprintf("the deposed Shah. It once belonged to the ancient Persian\n") ;
  720. Xprintf("King Cyrus and is priceless!\"\n\n") ;
  721. Xprintf("With this glad tiding the Mullah hands you the ancient\n") ;
  722. Xprintf("clapper and then reaches down to pick up the letter from\n") ;
  723. Xprintf("his old friend.\n") ;
  724. X
  725. XMullah->Status = F_passive ;
  726. XGuards->Status = F_passive ;
  727. Xobject[O_letter][J_loc] = B_destroyed ;
  728. X--room[R_prayer][M_obj_cnt] ;
  729. Xobject[O_clapper][J_loc] = B_have ;
  730. Xobject[O_detector][J_loc] = R_guard ;
  731. X++room[R_guard][M_obj_cnt] ;
  732. Xcarry_count++ ;
  733. Xcarry_weight += object[O_clapper][J_weight] ;
  734. X*sw_letter = TRUE ;
  735. X*count_on = 0 ;
  736. X
  737. X} /* --- end of the "see_letter" subroutine --- */
  738. X
  739. Xvoid chief_mullah(count_on)
  740. X/********************************************************************/
  741. X/*                                                                  */
  742. X/*               --- Chief Mullah Subroutine ---                    */
  743. X/*                                                                  */
  744. X/*  Software by Gary A. Allen, Jr. 8 December 1992, Version: Mk 1.0 */
  745. X/*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  746. X/*                                                                  */
  747. X/********************************************************************/
  748. X
  749. Xint *count_on ;
  750. X{
  751. Xregister int i ;
  752. X
  753. X#if (PROTOTYPE)
  754. Xvoid hold_it(void) ;
  755. Xvoid mullah_kills(void) ;
  756. X#endif
  757. X
  758. Xprintf("\n") ;
  759. Xhold_it() ;
  760. XMullah->Status = F_aggressive ;
  761. XGuards->Status = F_aggressive ;
  762. X
  763. Xprintf("The chief Mullah (or whatever he is) who is sitting on the\n");
  764. Xprintf("dias glares in your direction and begins expounding in a\n");
  765. Xprintf("long monologue in Farsi. One of his Revolutionary Guards\n") ;
  766. Xprintf("starts translating the Mullah's words into fairly good\n");
  767. Xprintf("English (with an American accent!). Here is what he said:\n") ;
  768. Xprintf("\n\"I can see by your slouch hat, singlet and short pants\n");
  769. Xprintf("that you are a good-for-nothing satanic Australian. I am\n");
  770. Xprintf("compelled to point out that your sort is most unwelcomed in\n");
  771. X
  772. X/* see if the player has any valuables or the letter */
  773. Xfor (i = 0; i <= objcnt; i++) { 
  774. X    if ((object[i][J_loc] == B_have)&& 
  775. X         ((O_letter == i)||(object[i][J_value] > 0))) {
  776. X
  777. X/* Player has something the Mullah wants, so he lives */
  778. Xprintf("this holy precinct.  Unless you can provide some good\n");
  779. Xprintf("reasons (preferably financial ones) to the contrary, I\n");
  780. Xprintf("shall order you to be executed immediately for the\n");
  781. Xprintf("amusement and edification of the local populace!\"\n") ;
  782. X            *count_on = 0 ;
  783. X            return ;    
  784. X    }
  785. X}
  786. X
  787. X/* Player has no valuables and doesn't have the letter so he dies */
  788. Xprintf("this holy precinct.  Since you have nothing of value, our\n");
  789. Xprintf("usual practice would be to take you hostage and extract a\n");
  790. Xprintf("ransom from your government.  However the Ozzie Dollar\n") ;
  791. Xprintf("doesn't buy all that much anymore, so we'll just execute\n");
  792. Xprintf("you and leave it at that.\"\n") ;
  793. Xmullah_kills() ;
  794. X
  795. X} /* --- end of the "chief_mullah" subroutine --- */
  796. X
  797. Xint bribe_mullah(count_on)
  798. X/********************************************************************/
  799. X/*                                                                  */
  800. X/*               --- Chief Mullah Subroutine ---                    */
  801. X/*                                                                  */
  802. X/*  Software by Gary A. Allen, Jr. 3 January 1993 , Version: Mk 1.0 */
  803. X/*           (c) Copyright 1993 by Gary A. Allen, Jr.               */
  804. X/*                                                                  */
  805. X/********************************************************************/
  806. X
  807. Xint *count_on ;
  808. X{
  809. Xregister int j ;
  810. Xint sw_bribe ;
  811. X
  812. X/* The Mullah takes any valuables dropped */
  813. Xsw_bribe = FALSE ;
  814. Xfor (j = 0; j <= objcnt; j++) { 
  815. X    if ((object[j][J_loc] == R_prayer) && (object[j][J_value] > 0)) {
  816. X        object[j][J_loc] = B_destroyed ;
  817. X        --room[R_prayer][M_obj_cnt] ;
  818. X        sw_bribe = TRUE ;
  819. X    }
  820. X}
  821. Xif (sw_bribe) {
  822. Xprintf("\nOne of the guards picks up the treasure and hands it over to\n") ;
  823. Xprintf("the chief Mullah who discretely pockets it within his robe.  The\n") ;
  824. Xprintf("Mullah then looks expectantly towards you...  I think he wants\n") ;
  825. Xprintf("more treasure.\n") ;
  826. X    *count_on = 0 ;
  827. X    return(TRUE) ;    
  828. X}
  829. Xreturn(FALSE) ;
  830. X
  831. X} /* --- end of the "bribe_mullah" function --- */
  832. END_OF_FILE
  833. if test 28639 -ne `wc -c <'monster.c'`; then
  834.     echo shar: \"'monster.c'\" unpacked with wrong size!
  835. fi
  836. # end of 'monster.c'
  837. fi
  838. if test -f 'objlook.c' -a "${1}" != "-c" ; then 
  839.   echo shar: Will not clobber existing file \"'objlook.c'\"
  840. else
  841. echo shar: Extracting \"'objlook.c'\" \(17427 characters\)
  842. sed "s/^X//" >'objlook.c' <<'END_OF_FILE'
  843. X#define OBJLKR
  844. X#include "dink_sym.h"
  845. X#include "dink_glb.h"
  846. X
  847. Xvoid objlooker(n)
  848. X/*********************************************************/
  849. X/*                                                       */
  850. X/*    --- Object in Room Examination Subroutine ---      */
  851. X/*                                                       */
  852. X/*      Program by Gary A. Allen, Jr.  18 May 1990       */
  853. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  854. X/*                                                       */
  855. X/*********************************************************/
  856. Xint n ;
  857. X{
  858. X#if (PROTOTYPE)
  859. Xvoid objector(int) ;
  860. X#endif
  861. X
  862. Xregister int i ;
  863. X
  864. Xif (((object[O_torch][J_loc] == B_have) && object[O_torch][J_property]) || 
  865. X   (n < 186) || (n > 202)) { 
  866. X    if (room[n][M_obj_cnt] == 1) {
  867. X        for (i=0; i <= objcnt; i++) {
  868. X            if ((object[i][J_loc] == n) && 
  869. X                (object[i][J_type] != Z_unmovable)) {
  870. X                if (n == R_office_mang) {
  871. Xprintf ("On the floor you see ") ;
  872. X                    objector(i) ;
  873. X                    printf (".\n") ;
  874. X                }
  875. X                else {
  876. X                     printf ("You see ") ;
  877. X                    objector(i) ;
  878. X                    printf (".\n") ;
  879. X                }
  880. X            }
  881. X        }
  882. X    }
  883. X    if (room[n][M_obj_cnt] > 1) {
  884. X        if (n == R_office_mang) 
  885. Xprintf ("You see the following on the floor: \n");
  886. X        else printf ("You see the following: \n");
  887. X        for (i=0; i <= objcnt; i++) {
  888. X            if ((object[i][J_loc] == n) && 
  889. X                (object[i][J_type] != Z_unmovable)) {
  890. X                printf ("        ") ;
  891. X                objector(i) ;
  892. X                printf ("\n") ;
  893. X            }
  894. X        }
  895. X    }
  896. X}
  897. X} /* end of "objlooker" subroutine */
  898. Xvoid kelly(n) 
  899. X/********************************************************************/
  900. X/*                                                                  */
  901. X/*                  --- Ned Kelly Subroutine --                     */
  902. X/*                                                                  */
  903. X/* Software by Gary A. Allen, Jr. 5 November 1989  Version: Mk 1.2  */
  904. X/*           (c) Copyright 1989 by Gary A. Allen, Jr.               */
  905. X/*                                                                  */
  906. X/********************************************************************/
  907. Xint n ;
  908. X{
  909. Xregister int i, k ;
  910. Xstatic int ned_look = 0, sw_fiddle = TRUE ;
  911. Xint  sw_ned_look, sw_ned_set ;
  912. X
  913. X/* check if Ned  Kelly is dead */
  914. Xif (Ned->Location == B_destroyed) return ;
  915. X
  916. X/* this switch is for Ned looking for treasure once per cycle */
  917. Xsw_ned_look = FALSE ;
  918. Xsw_ned_set = FALSE ;
  919. X
  920. X/* check if player is in Ned's trigger rooms */
  921. Xswitch (n) {
  922. X/* Cause Ned Kelly to steal */
  923. Xcase R_lift_inside:
  924. X    /* are there valuables in the safe and the safe open? */
  925. X    if ((score > 0)&&
  926. X        (room[R_office_mang][M_rm_status] >= S_dialed)) {
  927. X    /* is the office building open? */
  928. X        if ((ned_look > 3)||
  929. X            (room[R_office_entr][M_rm_status] == S_open)||
  930. X            (room[R_office_entr][M_rm_status] == S_kicked)||
  931. X        (room[R_office_entr][M_rm_status] == S_unlocked)) {
  932. X
  933. X            if (ned_look > 3) {
  934. X            room[R_office_entr][M_rm_status] = S_kicked ;
  935. X            room[R_office_entr][2] = R_office_hall ;
  936. X            }
  937. X/* scan the object list for treasure in safe and transfer to hideout */
  938. X            for (i=0; i <= objcnt; i++) {
  939. X    if ((object[i][J_loc] == B_in_safe)&&(object[i][J_value] > 0)) {
  940. X                    ++room[R_hideout][M_obj_cnt] ;
  941. X                    object[i][J_loc] = R_hideout; 
  942. X                    sw_ned_set = TRUE ;
  943. X                }
  944. X            }    
  945. X        }
  946. X/* the safe is open with treasure but the door is locked */
  947. X        else {
  948. X            ++ned_look ;
  949. X            sw_ned_look = TRUE ;
  950. X        }
  951. X    } /* end of the block concerning Ned and the safe */
  952. X
  953. X    if (sw_valuable) {
  954. X        for (i=0; i <= objcnt; i++) {
  955. X/* scan for treasure laying around outside the building on surface */
  956. X            for (k = 22; k <= 36; k++) { 
  957. X                if ((object[i][J_loc] == k)&&
  958. X                    (object[i][J_value] > 0)) {
  959. X                    ++room[R_hideout][M_obj_cnt] ;
  960. X                    --room[k][M_obj_cnt] ;
  961. X                    object[i][J_loc] = R_hideout; 
  962. X                    sw_ned_set = TRUE ;
  963. X                    sw_valuable = FALSE ;
  964. X                    break ;
  965. X                }
  966. X            }    
  967. X            for (k = 144; k <= 145; k++) {
  968. X                if ((object[i][J_loc] == k)&&
  969. X                    (object[i][J_value] > 0)) {
  970. X                    ++room[R_hideout][M_obj_cnt] ;
  971. X                    --room[k][M_obj_cnt] ;
  972. X                    object[i][J_loc] = R_hideout; 
  973. X                    sw_valuable = FALSE ;
  974. X                    sw_ned_set = TRUE ;
  975. X                    break ;
  976. X                }
  977. X            }    
  978. X        /* scan the office building for treasure on the floor */
  979. X            for (k = 37; k <= 41; k++) { 
  980. X                if ((object[i][J_loc] == k)&&
  981. X                    (object[i][J_value] > 0)) {
  982. X/* if the office bldg. door is open then Ned Kelly steals treasure */
  983. X        if ((room[R_office_entr][M_rm_status] == S_open)||
  984. X            (room[R_office_entr][M_rm_status] == S_unlocked)||
  985. X          (room[R_office_entr][M_rm_status] == S_kicked)) {
  986. X            ++room[R_hideout][M_obj_cnt] ;
  987. X            --room[k][M_obj_cnt] ;
  988. X            object[i][J_loc] = R_hideout; 
  989. X            sw_valuable = FALSE ;
  990. X            sw_ned_set = TRUE ;
  991. X            break ;
  992. X        }
  993. X/* if Ned Kelly sees locked treasure four times, he kicks in the door */
  994. X        if (ned_look > 3) {
  995. X            room[R_office_entr][M_rm_status] = S_kicked ;
  996. X            room[R_office_entr][2] = R_office_hall ;
  997. X            ++room[R_hideout][M_obj_cnt] ;
  998. X            --room[k][M_obj_cnt] ;
  999. X            object[i][J_loc] = R_hideout; 
  1000. X            sw_valuable = FALSE ;
  1001. X            sw_ned_set = TRUE ;
  1002. X        }
  1003. X        else {
  1004. X            if (!sw_ned_look) ++ned_look ;
  1005. X            sw_ned_look = TRUE ;
  1006. X            break ; /* conclude the office bldg. loop */
  1007. X        }
  1008. X        break ;
  1009. X                }
  1010. X            }    
  1011. X        }    
  1012. X    } /* end of block concerning Ned and loose treasure */
  1013. X
  1014. X    if (sw_ned_set) {
  1015. X        Ned->Status = F_stealing ; 
  1016. X        Ned->Location = R_hideout ;
  1017. X        room[R_hideout][M_monster] = 1 ;
  1018. X        sw_ned_set = FALSE ;
  1019. X    }
  1020. X    return ;
  1021. X
  1022. Xcase R_office_entr:
  1023. X/* Cause Ned Kelly to run away with treasure */
  1024. X    if (Ned->Status == F_stealing) {
  1025. X        Ned->Status = F_asleep ;
  1026. Xprintf("There is an odd looking character with an iron bucket on his ");
  1027. Xprintf("head and a swag\n");
  1028. Xprintf("bag over his shoulder running away from the ");
  1029. Xprintf("office building towards\nthe desert. \n\n") ;
  1030. X        return ;
  1031. X    }
  1032. X    if ((ned_look == 2) && sw_fiddle && 
  1033. X        (room[R_office_entr][M_rm_status] != S_open) &&
  1034. X        (room[R_office_entr][M_rm_status] != S_kicked) &&
  1035. X        (room[R_office_entr][M_rm_status] != S_unlocked)) {
  1036. X        sw_fiddle = FALSE ;
  1037. Xprintf("As you approach the office building's door, you see a\n");
  1038. Xprintf("strange looking character with a bucket on his head and\n") ;
  1039. Xprintf("wearing an iron breast plate.  He is on his knees before\n") ;
  1040. Xprintf("the door trying to pick the lock with a bit of coat hanger\n") ;
  1041. Xprintf("wire. Suddenly, he turns and sees you coming. With amazing\n"); 
  1042. Xprintf("speed, he throws away his wire and runs off towards the\n") ;
  1043. Xprintf("open desert.\n\n") ;
  1044. X        return ;
  1045. X    }
  1046. X} /* end of the ned kelly room switch block */
  1047. X} /* --- end of the "kelly" subroutine  --- */ 
  1048. X
  1049. Xvoid sounder(n) 
  1050. X/********************************************************************/
  1051. X/*                                                                  */
  1052. X/*                  --- Gong Sounding Subroutine --                 */
  1053. X/*                                                                  */
  1054. X/* Software by Gary A. Allen, Jr. 21 June 1989     Version: Mk 1.0  */
  1055. X/*           (c) Copyright 1989 by Gary A. Allen, Jr.               */
  1056. X/*                                                                  */
  1057. X/********************************************************************/
  1058. Xint n ;
  1059. X{
  1060. X#if (PROTOTYPE)
  1061. Xvoid exit(int), hold_it(void) ;
  1062. Xvoid los_angeles(void) ;
  1063. Xchar getche(void) ;
  1064. X#endif
  1065. X
  1066. Xchar letter ;
  1067. Xstatic int sw_told = FALSE ;
  1068. X
  1069. X/* see if player is in the gong room */
  1070. Xif (n != R_gong) {
  1071. X    if (tag[V_gong]) printf("I don't see a gong here.\n") ;
  1072. X    else printf("I don't see how you can do that.\n") ;
  1073. X    return ;
  1074. X}
  1075. X
  1076. X/* The player is in the gong room. Does he have the clapper? */
  1077. Xif (tag[V_clapper]) {
  1078. X    if (object[O_clapper][J_loc] == B_have) {
  1079. X        if (!tag[V_gong]) {
  1080. Xprintf("With what are you going to do that with the clapper?\n") ;
  1081. X            return ;
  1082. X        }
  1083. Xprintf
  1084. X("\n  GGGGGGGG       OOOOOOOO     NN       NN     GGGGGGGG     !!!\n") ;
  1085. Xprintf
  1086. X("GG        GG   OO        OO   NNN      NN   GG        GG   !!!\n") ;
  1087. Xprintf
  1088. X("GG             OO        OO   NN N     NN   GG             !!!\n") ;
  1089. Xprintf
  1090. X("GG             OO        OO   NN  N    NN   GG             !!!\n") ;
  1091. Xprintf
  1092. X("GG   GGGGGGG   OO        OO   NN   N   NN   GG    GGGGGG   !!!\n") ;
  1093. Xprintf
  1094. X("GG        GG   OO        OO   NN    N  NN   GG        GG   !!!\n") ;
  1095. Xprintf
  1096. X("GG        GG   OO        OO   NN     N NN   GG        GG\n") ;
  1097. Xprintf
  1098. X("GG        GG   OO        OO   NN      NNN   GG        GG   000\n") ;
  1099. Xprintf
  1100. X("  GGGGGGGG       OOOOOOOO     NN       NN     GGGGGGGG     000\n\n") ;
  1101. X
  1102. X/* see if the "end game" can begine */
  1103. X        /* Check to see if the recorder was used */
  1104. X        if (sw_script) {
  1105. X            if (sw_told) printf("Nothing happened.\n") ;
  1106. X            else {
  1107. Xprintf("You hear an ethereal voice which says:\n\n") ;
  1108. Xprintf("Sorry Mate!  You used the bloody data recorder which gave you\n") ;
  1109. Xprintf("an unfair advantage.  If you want to be admitted into the final\n") ;
  1110. Xprintf("part of Dinkum and have a chance at winning then you must find\n") ;
  1111. Xprintf("all the treasure, come back here and sound the gong WITHOUT having\n") ;
  1112. Xprintf("started Dinkum with the command switch \"-S\" (NO data recorder).\n\n");
  1113. Xprintf("You did however put in a good effort.  Better luck next time!\n") ;
  1114. X                sw_told = TRUE ;
  1115. X            }
  1116. X            return ;
  1117. X        }
  1118. X
  1119. X        /* No recorder so admit player to endgame */
  1120. X        if ((score < max_score)||(gleep_score == 0)) {
  1121. Xprintf("You hear an ethereal voice which says:\n\n") ;
  1122. X            if (score < max_score) {
  1123. Xprintf("Sorry Mate!  You haven't put all of the treasure in the\n") ;
  1124. Xprintf("safe yet.  Find the rest, and then the secret of the gong\n") ;
  1125. Xprintf("will be revealed.\n") ;
  1126. X                return ;
  1127. X            }
  1128. X            if (gleep_score == 0) {
  1129. Xprintf("Good on you Mate!  You've found all of the treasure.\n") ;
  1130. Xprintf("However you haven't put a single gleep in the gleep tank!\n");
  1131. Xprintf("You're not a Fair Dinkum Adventurer until you've put at\n") ;
  1132. Xprintf("least one gleep in the tank.\n") ;
  1133. X                return ;
  1134. X            }
  1135. X        }
  1136. X        /* Begin the End Game */
  1137. Xprintf("There is a loud \"Fromp!\" as a portcullis crashes down and\n");
  1138. Xprintf("seals the northern (and only) exit.  The lights go dim and\n");
  1139. Xprintf("a hazy fog appears in the room.  Slowly this fog coalesces\n") ;
  1140. Xif (sw_warned) {
  1141. Xprintf("into the now familiar form of Banjo Patterson.  For some\n") ;
  1142. Xprintf("odd reason Banjo is holding in his right hand a sword of\n") ;
  1143. Xprintf("fire such as one reads about in Genesis. The deathly quiet\n");
  1144. Xprintf("is broken when Banjo begins to speak:\n") ;
  1145. X}
  1146. Xelse {
  1147. Xprintf("into a ghostly human form.  This ethereal being is wearing\n") ;
  1148. Xprintf("a grey flannel suit, a bowler hat, and has a gold pocket\n") ;
  1149. Xprintf("watch chain looped across the front of his waist coat.  He\n");
  1150. Xprintf("is holding in his right hand a sword of fire such as one\n") ;
  1151. Xprintf("reads about in Genesis.  You can hear \"Waltzing Matilda\"\n");
  1152. Xprintf("being played softly in the background.  You know what?\n");
  1153. Xprintf("I think this ethereal being is none other than the ghost\n") ;
  1154. Xprintf("of Banjo Patterson!  With this realization Banjo begins to\n") ;
  1155. Xprintf("speak:\n") ;
  1156. X}
  1157. X        hold_it() ;
  1158. Xprintf("\"Good on you, Fair Dinkum Adventurer!  You have braved\n") ; 
  1159. Xprintf("the perils of hoop snakes, drop bears, and mutant wombats.\n") ;
  1160. Xprintf("You have solved many riddles, collected much treasure and\n") ;
  1161. Xprintf("encountered true evil and dealt with it appropriately.\n");
  1162. Xprintf("However it has occured to us that you might not be one of\n") ;
  1163. Xprintf("the chosen few who can be admitted into the Land of the\n") ;
  1164. Xprintf("Blessed.  The possibility remains that you could be a\n") ;
  1165. Xprintf("whinging Pom or a bleeding Yank.  Therefore you will be\n") ;
  1166. Xprintf("tested with three questions.  If you answer correctly, you\n") ;
  1167. Xprintf("will be admitted into paradise. However should you answer\n");
  1168. Xprintf("falsely, you will be sent to another place, an abode of\n");
  1169. Xprintf("darkness and dread.  So answer wisely, for you will not be\n") ;
  1170. Xprintf("given a second chance!\"\n\n") ;
  1171. X
  1172. Xprintf("What is the capital of Australia?\n\n") ;
  1173. Xprintf("     A) Sydney\n") ;
  1174. Xprintf("     B) Canberra\n") ;
  1175. Xprintf("     C) Melbourne\n\n") ;
  1176. Xprintf("Answer A, B, or C:  ") ;
  1177. X#ifndef __TURBOC__
  1178. X        for(;;) {
  1179. X            letter = getchar() ;
  1180. X            if ((letter != '\n')&&(letter != ' ')) break ;
  1181. X        }
  1182. X        if (('b' == letter)||('B' == letter)) 
  1183. X            printf("\nCorrect!\n\n") ;
  1184. X#endif
  1185. X
  1186. X#ifdef __TURBOC__
  1187. X        for(;;) {
  1188. X            letter = getche() ;
  1189. X            if ((letter != '\n')&&(letter != ' ')) break ;
  1190. X        }
  1191. X        if (('b' == letter)||('B' == letter)) 
  1192. X            printf("\n\nCorrect!\n\n") ;
  1193. X#endif
  1194. X        else {
  1195. X            los_angeles() ;
  1196. X            return ;
  1197. X        }
  1198. X
  1199. Xprintf("In the Australian emblem there appears two animals on\n") ;
  1200. Xprintf("either side of a shield.  One of the two animals is a\n") ;
  1201. Xprintf("kangaroo.  What species is the other animal?\n\n") ;
  1202. Xprintf("     A) Koala Bear\n") ;
  1203. Xprintf("     B) Platypus\n") ;
  1204. Xprintf("     C) Emu\n\n") ;
  1205. Xprintf("Answer A, B, or C:  ") ;
  1206. X#ifndef __TURBOC__
  1207. X        for(;;) {
  1208. X            letter = getchar() ;
  1209. X            if ((letter != '\n')&&(letter != ' ')) break ;
  1210. X        }
  1211. X        if (('c' == letter)||('C' == letter)) 
  1212. X            printf("\nCorrect!\n\n") ;
  1213. X#endif
  1214. X
  1215. X#ifdef __TURBOC__
  1216. X        for(;;) {
  1217. X            letter = getche() ;
  1218. X            if ((letter != '\n')&&(letter != ' ')) break ;
  1219. X        }
  1220. X        if (('c' == letter)||('C' == letter)) 
  1221. X            printf("\n\nCorrect!\n\n") ;
  1222. X#endif
  1223. X        else {
  1224. X            los_angeles() ;
  1225. X            return ;
  1226. X        }
  1227. X
  1228. Xprintf("Which place is a state in Australia?\n\n") ;
  1229. Xprintf("     A) Arcadia\n") ;
  1230. Xprintf("     B) Patagonia\n") ;
  1231. Xprintf("     C) Tasmania\n\n") ;
  1232. Xprintf("Answer A, B, or C:  ") ;
  1233. X#ifndef __TURBOC__
  1234. X        for(;;) {
  1235. X            letter = getchar() ;
  1236. X            if ((letter != '\n')&&(letter != ' ')) break ;
  1237. X        }
  1238. X        if (('c' == letter)||('C' == letter)) 
  1239. X            printf("\nCorrect!\n\n") ;
  1240. X#endif
  1241. X
  1242. X#ifdef __TURBOC__
  1243. X        for(;;) {
  1244. X            letter = getche() ;
  1245. X            if ((letter != '\n')&&(letter != ' ')) break ;
  1246. X        }
  1247. X        if (('c' == letter)||('C' == letter)) 
  1248. X            printf("\n\nCorrect!\n\n") ;
  1249. X#endif
  1250. X        else {
  1251. X            los_angeles() ;
  1252. X            return ;
  1253. X        }
  1254. X
  1255. X/* Player has won the game */
  1256. Xprintf("You see Banjo Patterson with a beatific smile.  He waves\n") ;
  1257. Xprintf("his firey sword with a florish and the scene around you\n") ;
  1258. Xprintf("dissolves into a million tiny motes of light.  You now\n") ;
  1259. Xprintf("find yourself wearing swimming togs.  You are being carried\n");
  1260. Xprintf("by a guard of honour made up of four sumptuous shielas\n") ;
  1261. Xprintf("dressed in string bikinis and four handsome lifeguards.\n") ;
  1262. Xprintf("They carry you to a perfect beach on South Stradbroke\n") ;
  1263. Xprintf("Island.  Off in the distance on the Queensland mainland\n") ;
  1264. Xprintf("you see the Gold Coast which vaguely resembles the Emerald\n") ;
  1265. Xprintf("City of the classic movie.  Your guard of honour sets you\n") ;
  1266. Xprintf("down and hands you a can of Power's Bitter.  Three\n") ;
  1267. Xprintf("beautiful white pelicans float over head in a clear blue\n") ;
  1268. Xprintf("sky completing a scene of exquisite beauty.\n\n") ;
  1269. Xprintf("You're in paradise Mate and you've also won the game!\n\n") ;
  1270. X
  1271. X/* deal with final gleep announcement */
  1272. Xif (gleep_score == 1) {
  1273. Xprintf("---- A hint for those who want to go on playing Dinkum ----\n");
  1274. Xprintf("In this game you only put the minimum single gleep in the\n");
  1275. Xprintf("gleep tank.  In future games try seeding fertile tunnels\n");
  1276. Xprintf("with gleeps and reproducing them.  Build up as many gleeps\n");
  1277. Xprintf("as you can and then hit the gong before Dinkum times out.\n");
  1278. X}
  1279. Xelse {
  1280. Xprintf("You won this game with %d gleeps in the gleep tank.\n\n",
  1281. X    gleep_score) ;
  1282. X}
  1283. X        if (sw_wizard) return ;
  1284. X        else exit(0) ;
  1285. X    }
  1286. X    else {
  1287. X        printf("I don't have a clapper to hit it with! \n") ;
  1288. X        return ;
  1289. X    }
  1290. X}
  1291. Xelse {
  1292. X    printf("\nThud!\n\n") ;
  1293. X    printf("Nothing happened.\n") ;
  1294. Xprintf("I think you'd have more success if you used a gong clapper.\n");
  1295. X    return ;
  1296. X}
  1297. X} /* --- end of the "sounder" subroutine  --- */ 
  1298. X
  1299. Xvoid los_angeles()
  1300. X/********************************************************************/
  1301. X/*                                                                  */
  1302. X/*                 --- Los Angeles Subroutine --                    */
  1303. X/*                                                                  */
  1304. X/*       Player enters false answer and goes to Los Angeles.        */
  1305. X/*                                                                  */
  1306. X/* Software by Gary A. Allen, Jr. 7 December 1992  Version: Mk 1.0  */
  1307. X/*           (c) Copyright 1992 by Gary A. Allen, Jr.               */
  1308. X/*                                                                  */
  1309. X/********************************************************************/
  1310. X{
  1311. Xprintf("\n        -!-!-!-!-!-     Wrong!    -!-!-!-!-!-\n\n") ;
  1312. Xprintf("Banjo Patterson brings down the sword of fire onto your\n");
  1313. Xprintf("head. The scene around you disappears in a flash and you\n");
  1314. Xprintf("find yourself transported to.....\n\n") ;
  1315. Xprintf("             Pico Blvd., West Los Angeles\n\n") ;
  1316. Xprintf("L.A. is having a stage three smog alert.  The air is so\n");
  1317. Xprintf("foul you can taste it.  A Los Angeles municipal bus roars\n");
  1318. Xprintf("by covering you in soot.  Across the street you see a\n");
  1319. Xprintf("modern day Neanderthal selling vials of Crack to children.\n"); 
  1320. Xprintf("The person next to you has taken a definite physical\n");
  1321. Xprintf("interest in you.  She/he is wearing a short skirt and has a\n");
  1322. Xprintf("beehive hairdo.  He/she also has a five o'clock shadow, and\n");
  1323. Xprintf("bicepts so thick that he could collapse your skull with a\n");
  1324. Xprintf("single thump.\n\n") ; 
  1325. Xprintf("We now leave this unhappy scene.  Since you were sent to\n") ;
  1326. Xprintf("Los Angeles your score has been zeroed.\n\n") ; 
  1327. Xprintf("So ends yet another unsuccessful session at Dinkum!\n") ;
  1328. X
  1329. Xif (sw_wizard) return ;
  1330. Xelse exit(0) ;
  1331. X
  1332. X} /* --- end of the "los_angeles" subroutine  --- */ 
  1333. END_OF_FILE
  1334. if test 17427 -ne `wc -c <'objlook.c'`; then
  1335.     echo shar: \"'objlook.c'\" unpacked with wrong size!
  1336. fi
  1337. # end of 'objlook.c'
  1338. fi
  1339. echo shar: End of archive 4 \(of 7\).
  1340. cp /dev/null ark4isdone
  1341. MISSING=""
  1342. for I in 1 2 3 4 5 6 7 ; do
  1343.     if test ! -f ark${I}isdone ; then
  1344.     MISSING="${MISSING} ${I}"
  1345.     fi
  1346. done
  1347. if test "${MISSING}" = "" ; then
  1348.     echo You have unpacked all 7 archives.
  1349.     rm -f ark[1-9]isdone
  1350. else
  1351.     echo You still need to unpack the following archives:
  1352.     echo "        " ${MISSING}
  1353. fi
  1354. ##  End of shell archive.
  1355. exit 0
  1356.