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

  1. Path: uunet!paladin.american.edu!howland.reston.ans.net!spool.mu.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: v17i008:  dinkum3 - australian text adventure game, V2.12, Part03/07
  5. Message-ID: <4519@master.CNA.TEK.COM>
  6. Date: 9 Feb 93 20:02:12 GMT
  7. Article-I.D.: master.4519
  8. Sender: news@master.CNA.TEK.COM
  9. Lines: 1372
  10. Approved: billr@saab.CNA.TEK.COM
  11. Xref: uunet comp.sources.games:1687
  12.  
  13. Submitted-by: Gary Allen <gary@sun.mech.uq.oz.au>
  14. Posting-number: Volume 17, Issue 8
  15. Archive-name: dinkum3/Part03
  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 3 (of 7)."
  28. # Contents:  taker.c
  29. # Wrapped by billr@saab on Mon Feb  8 13:40:51 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'taker.c' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'taker.c'\"
  33. else
  34. echo shar: Extracting \"'taker.c'\" \(35391 characters\)
  35. sed "s/^X//" >'taker.c' <<'END_OF_FILE'
  36. X#define TAKER
  37. X#include "dink_sym.h"
  38. X#include "dink_glb.h"
  39. X#if (PROTOTYPE)
  40. Xvoid taker(int n)
  41. X#else
  42. Xvoid taker(n)
  43. Xint n ;
  44. X#endif
  45. X/*********************************************************/
  46. X/*                                                       */
  47. X/*           --- Object Taking Subroutine ---            */
  48. X/*                                                       */
  49. X/*      Program by Gary A. Allen, Jr.   15 January 1993  */
  50. X/*        (c) Copyright 1993 by Gary A. Allen, Jr.       */
  51. X/*                                                       */
  52. X/*********************************************************/
  53. X{
  54. Xregister int i, j ;
  55. Xint  sw_done, gleep_local, ammo_flag ;
  56. XOBJECT_STRUCT *pnt ;
  57. X
  58. X#if (PROTOTYPE)
  59. Xvoid clip_in(int), clip_out(int), ender(int), eater(void) ;
  60. X#endif
  61. X
  62. X/* Alias in the object for the single word "take" command */
  63. Xif (tag[V_VERB_ONLY]) {
  64. X    j = 0 ;
  65. X    /* See if there is only one object on the floor */
  66. X    pnt = object ;
  67. X    for (i = 0; i < Objcnt; i++) {
  68. X        if (n == pnt->Location) {
  69. X            j++ ;
  70. X            tag[pnt->ID] = TRUE ;
  71. X        }
  72. X        pnt++ ;
  73. X    }
  74. X
  75. X    if (room[n][M_gleep] != 0) {
  76. X        j++ ;
  77. X        tag[V_gleep] = TRUE ;
  78. X        if (room[n][M_gleep] > 1) tag[V_PLURAL] = TRUE ;
  79. X    }
  80. X
  81. X    /* Complain if there isn't a single object on the ground */
  82. X    if (j > 1) {
  83. X        printf ("What exactly do you want me to take? \n");
  84. X        return ;
  85. X    }
  86. X}
  87. X
  88. Xammo_flag = F_no_clip ;
  89. Xif (tag[V_clip]) ammo_flag = F_normal_clip ;
  90. Xif (tag[V_org_clip]) ammo_flag = F_org_clip ;
  91. X
  92. X/* deal with special case of "orange clip" implied by its being alone */
  93. Xif (tag[V_clip]&&(Clip->Location != n)&&(Org_clip->Location == n)) {
  94. X    tag[V_org_clip] = TRUE ;
  95. X    tag[V_clip] = FALSE ;
  96. X    if (V_clip == sent[1]) sent[1] = V_org_clip ;
  97. X}
  98. X
  99. X/* deal with the verb "attach" */
  100. Xif (verb == V_attach) {
  101. X    if (tag[V_rifle]&&(ammo_flag != F_no_clip)) {
  102. X        clip_in(ammo_flag) ;
  103. X        return ;
  104. X    }
  105. X    if ((n != R_office_mang)&&(room[n][M_obj_cnt] <= 0)) {
  106. X        printf ("There is nothing here that I can attach!\n");
  107. X        return ;
  108. X    }
  109. X}
  110. X
  111. X/* Check to see if player already has the item */
  112. Xpnt = object ;
  113. Xfor (i = 0; i < Objcnt; i++) { 
  114. X    if (pnt->ID == sent[1]) {
  115. X        if (pnt->Location == B_have) {
  116. Xprintf ("You already have a %s in your possession.\n",vocab[sent[1]-1]);
  117. X            return ;
  118. X        }
  119. X        else break ;
  120. X    }
  121. X    pnt++ ;
  122. X}
  123. X
  124. Xsw_done = FALSE ;
  125. X
  126. X/* Special case of "take pill" */
  127. Xif ((tag[V_pill])&&(Pills->Location == B_have)) {
  128. X    eater() ;
  129. X    return ;
  130. X}
  131. X
  132. X/* Reject "take" command when there is nothing to take */
  133. Xif ((n != R_office_mang)&&(verb != V_attach)&&(verb != V_remove)&&
  134. X    (room[n][M_obj_cnt] <= 0)&&(room[n][M_gleep] == 0)&&
  135. X    (!((n == R_gleep_tank)&&(Tank->Status > 0)))
  136. X    &&(!room[n][M_unmov_obj])) {
  137. X    printf ("There is nothing here that you can take! \n");
  138. X    return ;
  139. X}
  140. X
  141. X/* player takes something from the gleep tank */
  142. Xif (tag[V_tank]) {
  143. X    if (n != R_gleep_tank) {
  144. Xprintf("I see no gleep tank to take anything from. \n") ;
  145. X        return ;
  146. X    }
  147. Xprintf("\nYou climb up onto the edge of the gleep tank and reach\n");
  148. Xprintf("into the dark blue fluid.  Suddenly the fluid begins a\n");
  149. Xprintf("furious boiling that instantly reduces your hand into\n") ;
  150. Xprintf("bleached white bones.  The shock and pain disturbs your\n");
  151. Xprintf("balance and you fall into the horrible stuff!!  There is\n");
  152. Xprintf("once again a furious boiling.  Eventually the fluid stills\n");
  153. Xprintf("and becomes clear again.  On the bottom of the tank can\n") ;
  154. Xprintf("be seen a white, clean, \"medical school quality\" human\n");
  155. Xprintf("skeleton.\n") ;
  156. X    ender(F_died) ;
  157. X}
  158. X/* Deal with "safe" taking errors */
  159. Xif ((tag[V_safe])&&(n != R_office_mang)) {
  160. X    printf("There is no safe here.\n") ;
  161. X    return ;
  162. X}
  163. X
  164. X/* gleep taking routine (must be after the gleep tank routine) */
  165. Xif (tag[V_gleep]) {
  166. Xif (!tag[V_safe]) {
  167. X
  168. X    /* Count up the gleeps available in this room */
  169. X    if ((n == R_office_mang)&&(Safe->Status == S_open)) 
  170. X        gleep_local = gleep_safe ;
  171. X    else gleep_local = 0 ;
  172. X    gleep_local += room[n][M_gleep] ;
  173. X    /* Gleeps in the tank aren't really accessible but the player */
  174. X    /*    may wish to suicide by taking them.                     */
  175. X    if (n == R_gleep_tank) gleep_local += Tank->Status ;
  176. X
  177. X    /* Leave if there are no gleeps */
  178. X    if (gleep_local == 0) {
  179. X        printf("There are no gleeps here to take!\n") ;
  180. X        return ;
  181. X    }
  182. X
  183. X    /* Gleeps in the tank but not on the floor */
  184. X    /*   This is to lure player into suicide.  */
  185. X    if ((n == R_gleep_tank)&&(room[n][M_gleep] == 0)) {
  186. X        printf("There are no gleeps on the floor but I see ") ;
  187. X        if (Tank->Status == 1) 
  188. X            printf("a gleep in the gleep tank.\n");
  189. X        else
  190. X            printf("%d gleeps in the gleep tank.\n",Tank->Status) ;
  191. X        return ;
  192. X    }
  193. X
  194. X    /* This block is for accessible gleeps in office with open safe */
  195. X    if ((n == R_office_mang)&&(Safe->Status == S_open)
  196. X            &&(Picture->Status == S_open)) {
  197. X        if ((!tag[V_PLURAL])||(gleep_local == 1)) {
  198. X            printf("Gleep taken. \n") ; 
  199. X            ++gleep_count ;
  200. X            if (gleep_safe == 0) --room[n][M_gleep] ;
  201. X            else --gleep_safe ;
  202. X        }
  203. X        else {
  204. X            if (tag[V_NUMBER]) {
  205. X                if (number_word == 0) {
  206. X                    printf("Don't be silly.\n") ;
  207. X                    return ;
  208. X                }
  209. X                if (number_word > gleep_local) {
  210. Xprintf("There aren't that many gleeps here!\n") ;
  211. X                    return ;
  212. X                }
  213. X                else {
  214. Xprintf("%d gleeps taken.\n", number_word) ; 
  215. X                    gleep_count += number_word ;
  216. X                    gleep_local -= number_word ;
  217. X                    gleep_safe = gleep_local ;
  218. X                    room[n][M_gleep] = 0 ;
  219. X                }
  220. X            }
  221. X            else {
  222. X                printf("Gleeps taken. \n") ; 
  223. X                gleep_count += gleep_local ;
  224. X                room[n][M_gleep] = 0 ;
  225. X                gleep_safe = 0 ;
  226. X            }
  227. X        }
  228. X        return ;
  229. X    }
  230. X
  231. X    /* This block is for accessible gleeps everywhere else */
  232. X    /*       or the office with the safe closed.           */
  233. X    if ((!tag[V_PLURAL])||(room[n][M_gleep] == 1)) {
  234. X        printf("Gleep taken. \n") ; 
  235. X        ++gleep_count ;
  236. X        --room[n][M_gleep] ;
  237. X    }
  238. X    else {
  239. X        if (tag[V_NUMBER]) {
  240. X            if (number_word == 0) {
  241. X                printf("Don't be silly.\n") ;
  242. X                return ;
  243. X            }
  244. X            if (number_word > room[n][M_gleep]) {
  245. Xprintf("There aren't that many gleeps here!\n") ;
  246. X                    return ;
  247. X            }
  248. X            else {
  249. X                printf("%d gleeps taken.\n", number_word) ; 
  250. X                gleep_count += number_word ;
  251. X                room[n][M_gleep] -= number_word ;
  252. X            }
  253. X        }
  254. X        else {
  255. X            printf("Gleeps taken. \n") ; 
  256. X            gleep_count += room[n][M_gleep] ;
  257. X            room[n][M_gleep] = 0 ;
  258. X        }
  259. X    }
  260. X    return ;
  261. X} /* sentence does NOT have the word "safe" block */
  262. Xelse {
  263. X    if ((Picture->Status == S_open)&&(Safe->Status == S_open)) {
  264. X        if (gleep_safe != 0) { 
  265. X        if (tag[V_PLURAL] && (gleep_safe > 1)) {
  266. X            if (tag[V_NUMBER]) {
  267. X                if (number_word == 0) {
  268. X                    printf("Don't be silly.\n") ;
  269. X                    return ;
  270. X                }
  271. X                if (number_word > gleep_safe) {
  272. Xprintf("There aren't that many gleeps in the safe!\n") ;
  273. X                    return ;
  274. X                }
  275. X                else {
  276. Xprintf("%d gleeps taken.\n", number_word) ; 
  277. X                    gleep_count += number_word ;
  278. X                    gleep_safe -= number_word ;
  279. X                }
  280. X            }
  281. X            else {
  282. X                printf("Gleeps taken from safe. \n") ; 
  283. X                gleep_count += gleep_safe ;
  284. X                gleep_safe = 0 ;
  285. X            }
  286. X        }
  287. X        else {
  288. X            printf("Gleep taken from safe. \n") ; 
  289. X            ++gleep_count ;
  290. X            --gleep_safe ;
  291. X        }
  292. X        }
  293. X        else printf("There are no gleeps in the safe!\n") ;
  294. X    }
  295. X    else {
  296. X        if (tag[V_PLURAL]) 
  297. Xprintf("There is no open safe to take gleeps from.\n") ;
  298. X        else
  299. Xprintf("There is no open safe to take the gleep from.\n") ;
  300. X    }
  301. X    return ;
  302. X} /* sentence does have the word "safe" block */
  303. X} /* end of the gleep taking block */
  304. X
  305. X
  306. X/* treat the verb "remove" in the context of "remove clip from rifle" */
  307. Xif (verb == V_remove) {
  308. X    if ((!tag[V_safe])&&(ammo_flag != F_no_clip)) {
  309. X        clip_out(n) ;
  310. X        return ;
  311. X    }
  312. X}
  313. X
  314. Xif (carry_count > 5) {
  315. Xprintf("I can't do it!\n") ;
  316. Xprintf("I'm holding so many things that I can't take anymore!\n") ;
  317. X    return ;
  318. X}
  319. X
  320. Xif (carry_weight >= 800) {
  321. Xprintf("I can't do it!\n") ;
  322. Xprintf("This junk I'm carrying is too heavy! I can't carry anymore!\n");
  323. X    return ;
  324. X}
  325. X
  326. X
  327. X/* find the object(s) in this room */
  328. Xpnt = object ;
  329. Xfor (i = 0; i < Objcnt; i++) {
  330. X
  331. X    if ((carry_count > 5)||(carry_weight >= 800)) break ;
  332. X
  333. X    /* See if the object is in the safe and was requested */
  334. X    if ((n == R_office_mang)&&(pnt->Location == B_in_safe)
  335. X        &&(tag[pnt->ID]||tag[V_all])
  336. X        &&((!tag[V_treasure])||(pnt->Value > 0))) {
  337. X
  338. X        if (Picture->Status != S_open) {
  339. X            if (tag[V_all] || tag[V_treasure])
  340. X                printf("I don't see a safe.\n") ;
  341. X            else printf("You need to open the picture first.\n") ;
  342. X            return ;
  343. X        }
  344. X        if (Safe->Status == S_open) {
  345. X            pnt->Location = B_have; 
  346. X            carry_count++ ;
  347. X            carry_weight += pnt->Weight ; 
  348. X            sw_done = TRUE ;
  349. X        }
  350. X        else {
  351. X            printf("I can't do it because the safe is closed. \n") ;
  352. X            return ;
  353. X        }
  354. X    } 
  355. X    
  356. X    /* See if the object is in the room and was requested */
  357. X    if ((pnt->Location == n)&&(tag[pnt->ID] || tag[V_all])
  358. X        &&((!tag[V_treasure])||(pnt->Value > 0))) {
  359. X
  360. X        /* Objects referred to in this block are not in the safe */
  361. X        if (!tag[V_safe]) {
  362. X        /* see if taking the object causes special action */
  363. X        if (pnt->Type == Z_transform) {
  364. X            switch(pnt->ID) {
  365. X            /* ACME doormat */
  366. X            case V_mat:
  367. Xprintf("As you lift up the dirty old doormat, you find half \n") ;
  368. Xprintf("hidden in the dust....  a large brass key. \n") ;
  369. X                Mat->Type = Z_normal ;
  370. X                carry_count++ ;
  371. X                carry_weight += Mat->Weight;
  372. X                Mat->Location = B_have;
  373. X                Key->Location = R_office_entr ;
  374. X                sw_done = TRUE ;
  375. X                return ;
  376. X
  377. X            /* Map of the ACME Mine */
  378. X            case V_map:
  379. Xprintf("As you picked up the old map from the floor, most of it");
  380. Xprintf(" crumbled into \ndust leaving only one small piece. \n") ;
  381. X                Map->Location = B_unmade ;
  382. X                Map_frag->Location = B_have ;
  383. X                carry_count++ ;
  384. X                carry_weight += Map_frag->Weight ;
  385. X                --room[n][M_obj_cnt] ;
  386. X                sw_done = TRUE ;
  387. X                return ;
  388. X            }
  389. X        } /* end of the special action block */ 
  390. X
  391. X        /* see if an object on the floor can be taken */
  392. X        if ((pnt->Type == Z_normal)||
  393. X                (pnt->Type == Z_alias)) {
  394. X            --room[n][M_obj_cnt] ;
  395. X            carry_count++ ;
  396. X            carry_weight += pnt->Weight ; 
  397. X            pnt->Location = B_have; 
  398. X            sw_done = TRUE ;
  399. X        } 
  400. X        }
  401. X
  402. X        /* see if this is an unmovable, nonacting object */
  403. X        if ((pnt->Type == Z_unmovable) &&
  404. X                (pnt->Location == n) && (!tag[V_all])) {
  405. X
  406. X            switch(pnt->ID) {
  407. X            case V_bulldust:
  408. Xprintf("The bulldust is so fine that it wafts away with a touch.\n") ;
  409. X                return ;
  410. X
  411. X            /* Silver gong */
  412. X            case V_gong:
  413. Xprintf("The siver gong is about three metres in diameter and weighs at\n") ;
  414. Xprintf("least a ton!  There is no way I could move it, let alone get\n") ;
  415. Xprintf("it through the tunnel!\n") ;
  416. X                return ;
  417. X
  418. X            /* Cockroach(es) */
  419. X            case V_cockroach:
  420. Xprintf("I will not touch the filthy things!\n") ;
  421. X                return ;
  422. X
  423. X            /* Kangaroo(s) */
  424. X            case V_kangaroo:
  425. Xprintf("I will not touch a dead maggoty kangaroo!  ") ;
  426. Xprintf("The smell is bad enough!\n") ;
  427. X                return ;
  428. X
  429. X            case V_desk:
  430. Xprintf("The desk is of very solid construction and can not be moved.\n") ;
  431. X                return ;
  432. X
  433. X            case V_chart:
  434. Xprintf("The charts and production schedules are so old and brittle that\n") ;
  435. Xprintf("they'd fall apart the moment you touched them.  Besides they're\n") ;
  436. Xprintf("useless and not worth taking.\n") ;
  437. X                return ;
  438. X
  439. X            case V_poster:
  440. Xprintf("I think this sort of poster is best left on the wall.\n") ;
  441. X                return ;
  442. X
  443. X            /* Spinifex(es) */
  444. X            case V_spinifex:
  445. Xprintf("The thorns on the spinifex are large and nasty.\n") ;
  446. Xprintf("I'll just leave them to roll about.\n") ;
  447. X                return ;
  448. X
  449. X            /* Platypus Picture */
  450. X            case V_picture:
  451. Xprintf("The picture can not be removed.  It appears to be hinged ");
  452. Xprintf("to the wall.\n");
  453. X                return ;
  454. X
  455. X            /* Safe */
  456. X            case V_safe:
  457. X                if (sw_done) break ;
  458. Xprintf("The safe is set in a concrete wall.  I can see no way\n") ;
  459. Xprintf("the safe can be removed without destroying the wall.\n") ;
  460. X                return ;
  461. X
  462. X            /* Building door */
  463. X            case V_door:
  464. X                if (Door->Status == S_kicked) 
  465. Xprintf("The door is too heavy and bulky to move.\n") ;
  466. X                else {
  467. Xprintf("The door is attached to the building with some heavy duty\n") ;
  468. Xprintf("hinges which I can't remove.\n") ;
  469. X                }
  470. X                return ;
  471. X
  472. X            /* "Other" non-movable objects */
  473. X            default:
  474. X                printf("I don't think I can move that.\n") ;
  475. X                return ;
  476. X            } /* end of switch block */
  477. X        } /* end of unmovable object block */ 
  478. X
  479. X    } 
  480. X    pnt++ ;
  481. X} /* end of the object scan loop */
  482. X
  483. X/* take all gleeps if any */
  484. Xif (tag[V_all]&&(!tag[V_treasure])) {
  485. X    if (room[n][M_gleep] > 0) { 
  486. X        gleep_count += room[n][M_gleep] ;
  487. X        room[n][M_gleep] = 0 ;
  488. X        sw_done = TRUE ;
  489. X    }
  490. X    if ((gleep_safe != 0)&&(n == R_office_mang)
  491. X            &&(Safe->Status == S_open)) {
  492. X        gleep_count +=  gleep_safe ;
  493. X        gleep_safe = 0 ;
  494. X        sw_done = TRUE ;
  495. X    }
  496. X}
  497. X
  498. X/* Announce the "take" was successful */
  499. Xif (sw_done) {
  500. X    if (((carry_count > 5)||(carry_weight >= 800))&&(tag[V_all])) 
  501. X        printf("You've taken as much as you can.\n") ;
  502. X    else printf ("Done \n");
  503. X}
  504. X/* --else-- announce the "take" was unsuccessful */
  505. Xelse  {
  506. X    if (tag[V_all]) printf("I see nothing which I can take.\n") ;
  507. X    else { 
  508. X        if (tag[V_VERB_ONLY]) 
  509. X            printf("What exactly should I take?\n") ;
  510. X        else {
  511. X            printf ("I don't see a") ;
  512. X            if (tag[V_PLURAL]) printf("ny") ;
  513. X            printf (" %s around here. \n",vocab[sent[1]-1]);
  514. X        }
  515. X    }
  516. X}
  517. Xreturn ;
  518. X
  519. X} /* --- end of the "taker" subroutine --- */
  520. X
  521. X#if (PROTOTYPE)
  522. Xvoid loader(void)
  523. X#else
  524. Xvoid loader()
  525. X#endif
  526. X/*********************************************************/
  527. X/*                                                       */
  528. X/*           --- Rifle Loading Subroutine ---            */
  529. X/*                                                       */
  530. X/*      Program by Gary A. Allen, Jr.  29 April 1990     */
  531. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  532. X/*                                                       */
  533. X/*********************************************************/
  534. X{
  535. X
  536. Xint ammo_flag ;
  537. X
  538. X#if (PROTOTYPE)
  539. Xvoid clip_in(int) ;
  540. X#endif
  541. X
  542. X/* Reject single verb load command */
  543. Xif (tag[V_VERB_ONLY]) {
  544. Xprintf("What exactly do you want me to load?\n") ;
  545. X    return ;
  546. X}
  547. Xif (!tag[V_rifle]) {
  548. Xprintf("I don't know how I could load that.\n") ;
  549. X    return ;
  550. X}
  551. X
  552. X/* Deal with implied clip type command */
  553. Xif (!tag[V_clip]) {
  554. X    if ((Clip->Location != B_have)&&
  555. X        (Org_clip->Location == B_have)) ammo_flag = F_org_clip ;
  556. X
  557. X    /* the case were there is no clip is found in clip_in */
  558. X    if ((Clip->Location == B_have)&&
  559. X         (Org_clip->Location != B_have)) ammo_flag = F_normal_clip ;
  560. X}
  561. X
  562. X/* Deal with specific "load [orange] clip" command */
  563. Xelse {
  564. X    if (tag[V_orange]) {
  565. X        if (Org_clip->Location == B_have) ammo_flag = F_org_clip ;
  566. X        else {
  567. Xprintf("You don't possess the orange ammunition clip.\n") ;
  568. X            return ;
  569. X        }
  570. X    }
  571. X    else {
  572. X        if (Clip->Location == B_have) ammo_flag = F_normal_clip ;
  573. X
  574. X        /* Assume "load clip" with no normal clip implies orange clip */
  575. X        else {
  576. X            if (Org_clip->Location == B_have) 
  577. X                ammo_flag = F_org_clip ;
  578. X            else{
  579. Xprintf("You don't possess an ammunition clip to load.\n") ;
  580. X                return ;
  581. X            }
  582. X        }
  583. X    }
  584. X}
  585. X
  586. Xclip_in(ammo_flag) ;
  587. X} /* --- end of the "loader" subroutine --- */
  588. X
  589. X#if (PROTOTYPE)
  590. Xvoid unloader(int n)
  591. X#else
  592. Xvoid unloader(n)
  593. Xint n ;
  594. X#endif
  595. X/*********************************************************/
  596. X/*                                                       */
  597. X/*          --- Rifle Unloading Subroutine ---           */
  598. X/*                                                       */
  599. X/*      Program by Gary A. Allen, Jr.  29 April 1990     */
  600. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  601. X/*                                                       */
  602. X/*********************************************************/
  603. X{
  604. X#if (PROTOTYPE)
  605. Xvoid clip_out(int) ;
  606. X#endif
  607. X
  608. X/* Reject single verb load command */
  609. Xif (tag[V_VERB_ONLY]) {
  610. Xprintf("What exactly do you want me to unload?\n") ;
  611. X    return ;
  612. X}
  613. Xif (!tag[V_rifle]) {
  614. Xprintf("I don't know how I could unload that.\n") ;
  615. X    return ;
  616. X}
  617. Xclip_out(n) ;
  618. X} /* --- end of the "unloader" subroutine --- */
  619. X
  620. X#if (PROTOTYPE)
  621. Xvoid dropper(int n)
  622. X#else
  623. Xvoid dropper(n)
  624. Xint n ;
  625. X#endif
  626. X/*********************************************************/
  627. X/*                                                       */
  628. X/*          --- Object Dropping Subroutine ---           */
  629. X/*                                                       */
  630. X/*      Program by Gary A. Allen, Jr.  21 May 1990       */
  631. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  632. X/*                                                       */
  633. X/*********************************************************/
  634. X{
  635. Xregister int i, k ;
  636. X
  637. Xint sw_possess, sw_done, ammo_flag, sw_object, i_10, i_fract ;
  638. Xint sw_found ;
  639. X
  640. XOBJECT_STRUCT *pnt ;
  641. X
  642. X#if (PROTOTYPE)
  643. Xvoid clip_in(int), clip_out(int), boom(void) ;
  644. Xvoid objlooker(int), gleeper(int), unlocker(int) ;
  645. Xvoid cap_drop(void), dynamite_drop(void), destroy_all(void) ;
  646. Xvoid dropped_gun(void) ;
  647. X#endif
  648. X
  649. X/* respond to "verb only" command */
  650. Xif (tag[V_VERB_ONLY]) {
  651. X    printf ("You'll have to be more specific. \n");
  652. X    return ;
  653. X}
  654. X
  655. X/* deal with special case of "orange clip" implied by its being alone */
  656. Xif (tag[V_clip]&&(Clip->Location != B_have)
  657. X        &&(clip_flag != F_normal_clip)
  658. X        &&((Org_clip->Location == B_have)||(clip_flag == F_org_clip))) {
  659. X    tag[V_org_clip] = TRUE ;
  660. X    tag[V_clip] = FALSE ;
  661. X    if (V_clip == sent[1]) sent[1] = V_org_clip ;
  662. X}
  663. X
  664. Xammo_flag = F_no_clip ;
  665. Xif (tag[V_clip])  ammo_flag = F_normal_clip ;
  666. Xif (tag[V_org_clip])  ammo_flag = F_org_clip ;
  667. X
  668. X/* deal with special cases of the verbs */
  669. Xswitch(verb) {
  670. Xcase V_put:
  671. X    /* special case of putting (destroying) an object in water */
  672. X    if (tag[V_tank]||tag[V_gleep]||tag[V_safe]||
  673. X        tag[V_river]||tag[V_billabong]||tag[V_stream]) break ;
  674. X
  675. X    /* special case of "put key in door(lock)" */
  676. X    if (tag[V_key] && tag[V_door]) {
  677. X        unlocker(n) ;
  678. X        return ;
  679. X    }
  680. X
  681. X    if (!tag[V_cap]) {
  682. X        if ((!tag[V_rifle])&&(ammo_flag != F_no_clip)) {
  683. X            printf("What am I to put the clip into? \n") ;
  684. X            return ;
  685. X        }
  686. X        if (tag[V_rifle]&&(ammo_flag != F_no_clip))  
  687. X                clip_in(ammo_flag) ;
  688. X        else 
  689. Xprintf("I don't understand what this is to be put into. \n") ;
  690. X        return ;
  691. X    }
  692. X
  693. Xcase V_insert:
  694. X    if (tag[V_safe]) break ;
  695. X    if (ammo_flag != F_no_clip) {
  696. X        if (!tag[V_rifle]) {
  697. Xprintf("What am I to insert the clip into? \n") ;
  698. X        }
  699. X        else {
  700. X            clip_in(ammo_flag) ;
  701. X        }
  702. X        return ;
  703. X    }
  704. X    if (tag[V_cap]) {
  705. X        if (!tag[V_dynamite]) {
  706. Xprintf("I see no reason why I should put a blasting cap into that.\n") ;
  707. X            return ;
  708. X        }
  709. X        /* Cap insertion routine */
  710. X        else {
  711. X            /* see if your are holding the dynamite or the cap */
  712. X            if ((Cap->Location != B_have)&&
  713. X                (Dynamite->Location != B_have)) {
  714. Xprintf("You bloody dill!  You have neither the dynamite or a ");
  715. Xprintf("blasting cap.\n") ;
  716. X                return ;
  717. X            }
  718. X            if (Cap->Location != B_have) {
  719. Xprintf("You've got the dynamite but you need a blasing cap.\n") ;
  720. X                return ;
  721. X            }
  722. X                if (Dynamite->Location != B_have) {
  723. Xprintf("You've got the blasting cap but you need some dynamite.\n") ;
  724. X                return ;
  725. X            }
  726. X/* transform the two objects into one */
  727. Xprintf("With some trepidation, you slide the blasting cap into\n");
  728. Xprintf("the dynamite.  What you are now holding is VERY dangerous.\n");
  729. X            Cap->Location = B_unmade ; 
  730. X            Dynamite->Type = Z_alias ;
  731. X            carry_weight -= Cap->Weight ;
  732. X            carry_count-- ;
  733. X            return ;
  734. X        } /* end of the cap insertion block */
  735. X    }
  736. Xprintf("I can think of some interesing places to insert this. \n") ;
  737. Xprintf("However I shall not reduce myself to such vulgarity.\n");
  738. X    return ;
  739. X    
  740. Xcase V_eject:
  741. X/* Command "eject clip" ejects clip from rifle no matter what type*/
  742. X    if ((ammo_flag == F_normal_clip)&&(clip_flag == F_org_clip)) 
  743. X        ammo_flag = F_org_clip ; 
  744. Xcase V_drop:
  745. X    if (((ammo_flag == F_org_clip)&&(clip_flag == F_org_clip))|| 
  746. X    ((ammo_flag == F_normal_clip)&&(clip_flag == F_normal_clip))) { 
  747. X        clip_out(n) ;
  748. X        return ;
  749. X    }
  750. X    break ;
  751. X
  752. X} /* end of switch */
  753. X
  754. X/* Deal with "drop" when player has no objects */
  755. Xif (tag[V_all]&&(carry_count == 0)&&(gleep_count == 0)) {
  756. X    printf("You dill!  You have nothing to drop!\n") ;
  757. X    return ;
  758. X}
  759. X
  760. X/* deal with "drop in safe ..." errors */
  761. Xif (tag[V_safe]) {
  762. X    /* see if this is the managers office */
  763. X    if (n != R_office_mang) {        
  764. X        printf("There is no safe here! \n");
  765. X        return ;
  766. X    }
  767. X
  768. X    /* See if the picture and safe are open */
  769. X    if ((Picture->Status != S_open) || (Safe->Status != S_open)) {
  770. X        printf ("I don't see an open safe to put anything into.\n") ;
  771. X        return ;
  772. X    }
  773. X}
  774. X/* gleep droping routine */
  775. Xif (tag[V_gleep]||tag[V_tank]) {
  776. X    /* drop gleeps in a normal way */
  777. X    if (!tag[V_tank]) {
  778. X        if (gleep_count == 0) { 
  779. X            printf("You have no gleeps to drop! \n") ;
  780. X            return ;
  781. X        }
  782. X        if ((!tag[V_PLURAL])||(gleep_count == 1)) {
  783. X            if (tag[V_safe]) {
  784. X                printf("Gleep put into safe.\n") ;
  785. X                ++gleep_safe ;
  786. X                --gleep_count ;
  787. X            }
  788. X            else {
  789. X                printf("Gleep dropped. \n") ; 
  790. X                --gleep_count ;
  791. X                ++room[n][M_gleep] ;
  792. X            }
  793. X        }
  794. X        else {
  795. X            if (tag[V_safe]) {
  796. X                if (tag[V_NUMBER]) {
  797. X                    if (number_word == 0) {
  798. X                        printf("Don't be silly.\n") ;
  799. X                        return ;
  800. X                    }
  801. X                    if (number_word > gleep_count) {
  802. Xprintf("I don't have that many gleeps!\n") ;
  803. X                        return ;
  804. X                    }
  805. X                    else {
  806. Xprintf("You put %d gleeps into the safe.\n", number_word) ; 
  807. X                        gleep_safe += number_word ;
  808. X                        gleep_count -= number_word ;
  809. X                    }
  810. X                }
  811. X                else {
  812. X                    printf("Gleeps put into safe.\n") ;
  813. X                    gleep_safe += gleep_count ;
  814. X                    gleep_count = 0 ;
  815. X                }
  816. X            }
  817. X            else {
  818. X                if (tag[V_NUMBER]) {
  819. X                    if (number_word == 0) {
  820. X                        printf("Don't be silly.\n") ;
  821. X                        return ;
  822. X                    }
  823. X                    if (number_word > gleep_count) {
  824. Xprintf("I don't have that many gleeps!\n") ;
  825. X                        return ;
  826. X                    }
  827. X                    else {
  828. Xprintf("You drop %d gleeps.\n", number_word) ; 
  829. X                    room[n][M_gleep] += number_word ;
  830. X                    gleep_count -= number_word ;
  831. X                    }
  832. X                }
  833. X                else {
  834. X                    printf("Gleeps dropped. \n") ; 
  835. X                    room[n][M_gleep] += gleep_count ;
  836. X                    gleep_count = 0 ;
  837. X                }
  838. X            }
  839. X        }
  840. X        gleep_drop = TRUE ;
  841. X        return ;
  842. X    }
  843. X
  844. X    /* drop objects(including gleeps) into a gleep tank */
  845. X    else {
  846. X        sw_found = FALSE ;
  847. X        if (n != R_gleep_tank) {
  848. X            printf("I don't see a gleep tank here. \n") ;
  849. X            return ;
  850. X        }
  851. X        if (tag[V_gleep]) {
  852. X            if (gleep_count <= 0) {
  853. Xprintf("You have no gleeps to put in the tank. \n") ; 
  854. X                return ;
  855. X            }
  856. X            sw_found = TRUE ;
  857. X            if ((!tag[V_PLURAL])||(gleep_count == 1)) {
  858. Xprintf("Your gleep falls into the tank with a \"plonk\".\n") ;
  859. X                ++Tank->Status ;
  860. X                --gleep_count ;
  861. X            }
  862. X            if (tag[V_PLURAL]) {
  863. X                if (tag[V_NUMBER]) {
  864. X                    if (number_word == 0) {
  865. X                        printf("Don't be silly.\n") ;
  866. X                        return ;
  867. X                    }
  868. X                    if (number_word > gleep_count) {
  869. Xprintf("I don't have that many gleeps!\n") ;
  870. X                        return ;
  871. X                    }
  872. X                    else {
  873. Xprintf("You drop %d gleeps into the gleep tank.\n", number_word) ;
  874. X                        Tank->Status += number_word ;
  875. X                        gleep_count -= number_word ;
  876. X                    }
  877. X                }
  878. X                else {
  879. Xprintf("Your gleeps fall into the tank causing a splash.\n") ;
  880. X                    Tank->Status += gleep_count ;
  881. X                    gleep_count = 0 ;
  882. X                }
  883. X            }
  884. X        } /* end of the tag[V_gleep] block */
  885. X
  886. X        /* Drop non-gleeps into the tank */
  887. X        /* the "drop all" routine */
  888. X        if (tag[V_all]) {
  889. X            sw_possess = FALSE ;
  890. X            pnt = object ;
  891. X            for (i = 0; i < Objcnt; i++) {
  892. X                if ((pnt->Location == B_have)&&
  893. X                    ((!tag[V_treasure])||
  894. X                    (pnt->Value > 0))) {
  895. X                    sw_possess = TRUE ;
  896. X                    pnt->Location = B_destroyed; 
  897. X                    carry_count-- ;
  898. X                carry_weight -= pnt->Weight ;
  899. X                }
  900. X                pnt++ ;
  901. X            }
  902. X            if (gleep_count == 0) {
  903. X                if (sw_possess) {
  904. Xprintf("You dump everything into the gleep tank. There is a furious\n");
  905. Xprintf("bubbling as the corrosive fluid of the tank turns the\n");
  906. Xprintf("objects into NOTHING.\n") ;
  907. X                }
  908. X                else 
  909. Xprintf("You've got nothing to throw into the tank.\n") ;
  910. X            }
  911. X            else {
  912. X                if (sw_possess) {
  913. Xprintf("You fling everything into the gleep tank.  The gleep");
  914. X                if (gleep_count > 1) {
  915. Xprintf("s\nsplash into the tank and settle to the bottom of the\n") ;
  916. X                }
  917. X                else {
  918. Xprintf("\nplonks into the tank and settles to the bottom of the\n") ;
  919. X                }
  920. Xprintf("tank.  However the other objects begin to dissolve the\n");
  921. Xprintf("moment the tank's fluid touches them.  Time passes and\n");
  922. Xprintf("the objects dissolve into NOTHING.\n") ;
  923. X                }
  924. X                /* you possess no non-gleeps */
  925. X                else {
  926. X                if (gleep_count == 1) 
  927. Xprintf("Your gleep falls into the tank with a \"plonk\".\n") ;
  928. X                else
  929. Xprintf("Your gleeps fall into the tank causing a splash.\n") ;
  930. X                }
  931. X            Tank->Status += gleep_count ;
  932. X            gleep_count = 0 ;
  933. X            }
  934. X            return ;
  935. X        } /* end of the "drop all" if block */
  936. X
  937. X        /* Individual non-gleeps are dropped into the tank */
  938. X
  939. X        /* see if your are holding the object(s) */
  940. X        pnt = object ;
  941. X        for (i = 0; i < Objcnt; i++) {
  942. X             if (tag[pnt->ID] && (pnt->ID != V_tank)) {
  943. X                if (pnt->Location == B_have) {
  944. Xprintf ("You fling the %s into the gleep tank.  As soon as it\n",
  945. X    vocab[pnt->ID - 1]);
  946. Xprintf ("touched the tank's fluid there was a furious effervescence\n");
  947. Xprintf ("as it began to dissolve.  With the passage of time, the\n") ;
  948. Xprintf ("fluid stills and there is NOTHING left.\n") ;
  949. X                    carry_count-- ;
  950. X                    carry_weight -= pnt->Weight ;
  951. X                    pnt->Location = B_destroyed; 
  952. X                }
  953. X                else {
  954. Xprintf("You don't have a %s to toss into the gleep tank.\n",
  955. X    vocab[pnt->ID - 1]);
  956. X                }
  957. X                return ;
  958. X            }
  959. X            pnt++ ;
  960. X        } /* object scan "for" loop */
  961. X
  962. X        /* deal with garbage object to drop */
  963. Xif (!sw_found) printf("I don't understand what you want me to drop.\n") ;
  964. X        return ;
  965. X    }
  966. X}
  967. X
  968. Xsw_done = FALSE ;
  969. X
  970. X/* the "drop all" routine */
  971. Xif (tag[V_all]) {
  972. X
  973. X    /* Deal with throwing stuff into water */
  974. X    if(tag[V_stream]) {
  975. X        if (n == R_stream) {
  976. Xprintf("You fling everything into the stream.\n");
  977. X            destroy_all() ;
  978. X            return ;
  979. X        }
  980. X        else
  981. Xprintf("I see no stream to toss stuff into.\n") ;
  982. X        return ;
  983. X    }
  984. X    if(tag[V_billabong]) {
  985. X        if ((n == R_stream)||(n == R_slime)||
  986. X            (n == R_billabong)) { 
  987. Xprintf("You fling everything into the billabong.\n");
  988. X            destroy_all() ;
  989. X            return ;
  990. X        }
  991. X        else
  992. Xprintf("I see no billabong to toss stuff into.\n") ;
  993. X        return ;
  994. X    }
  995. X    if(tag[V_river]) {
  996. X        if ((n == R_dike)||(n == R_river_edge)||
  997. X            (n == R_river_exit)) {
  998. Xprintf("You fling everything into the river.\n");
  999. X            destroy_all() ;
  1000. X            return ;
  1001. X        }
  1002. X        else
  1003. Xprintf("I see no river to toss stuff into.\n") ;
  1004. X        return ;
  1005. X    }
  1006. X
  1007. X    if (!tag[V_safe]) {
  1008. X/* normal drop */
  1009. Xif (room[n][M_rm_type] != T_looping) {
  1010. X    /* normal room */
  1011. X    pnt = object ;
  1012. X    for (i = 0; i < Objcnt; i++) {
  1013. X        if ((pnt->Location == B_have)&&
  1014. X            ((!tag[V_treasure]) || (pnt->Value > 0))) {
  1015. X
  1016. X        sw_done = TRUE ;
  1017. X
  1018. X        /* see if the blasting cap was hard dropped */
  1019. X        if ((pnt->ID == V_cap)&&(verb != V_slow_drop)) {
  1020. X            cap_drop() ;
  1021. X            return ;
  1022. X        }
  1023. X
  1024. X/* see if the dynamite with blasting cap was hard dropped */
  1025. X        if ((pnt->ID == V_dynamite)&&(Dynamite->Type == Z_alias)
  1026. X            &&(verb != V_slow_drop)) dynamite_drop() ;
  1027. X        ++room[n][M_obj_cnt] ;
  1028. X        carry_count-- ;
  1029. X        carry_weight -= pnt->Weight ;
  1030. X        pnt->Location = n; 
  1031. X/* set valuable switch if valuable object dropped in Ned's area */
  1032. X        if (pnt->Value > 0) {
  1033. X            for (k = 22; k <= 41; k++) 
  1034. X                if (k == n) sw_valuable = TRUE;
  1035. X            for (k = 144; k <= 146; k++) 
  1036. X                 if (k == n) sw_valuable = TRUE;
  1037. X        }
  1038. X    }
  1039. X    pnt++ ;
  1040. X}
  1041. X            /* drop all gleeps */
  1042. X            if ((gleep_count > 0) &&
  1043. X                    (!tag[V_treasure])) {
  1044. X                room[n][M_gleep] += gleep_count ;
  1045. X                gleep_count = 0 ;
  1046. X                sw_done = TRUE ;
  1047. X                gleep_drop = TRUE ;
  1048. X            }
  1049. X
  1050. X            if (sw_done) {
  1051. X                printf ("Done\n");
  1052. X                objlooker(n) ;
  1053. X                gleeper(n) ; 
  1054. X            } 
  1055. X            else printf("Don't have it to drop.\n") ;
  1056. X            return ;
  1057. X        }
  1058. X        /* object destroyer room */
  1059. X        else {
  1060. X        /* Code assumes that player has something to drop */
  1061. Xprintf ("You dropped everything you had in a heap, which \n");
  1062. Xprintf ("promptly vaporized into a bright blue flash followed \n");
  1063. Xprintf ("by a low \"BOOM\". \n") ; 
  1064. Xprintf ("       --- You've blown it Bozo!! ---\n") ;
  1065. X            destroy_all() ;
  1066. X            return ;
  1067. X        }
  1068. X    }
  1069. X    /* "drop all into the safe" routine */
  1070. X    else {
  1071. X        pnt = object ;
  1072. X        for (i = 0; i < Objcnt; i++) {
  1073. X            if ((pnt->Location == B_have) &&
  1074. X                ((!tag[V_treasure])||
  1075. X                (pnt->Value > 0))) {
  1076. X                pnt->Location = B_in_safe ;    
  1077. X                carry_count-- ;
  1078. X                carry_weight -= pnt->Weight ;
  1079. X                sw_done = TRUE ;
  1080. X            }
  1081. X            pnt++ ;
  1082. X        }
  1083. X        if (!tag[V_treasure]) {
  1084. X            gleep_safe += gleep_count ;
  1085. X            gleep_count = 0 ;
  1086. X            sw_done = TRUE ;
  1087. X        }
  1088. X        if (sw_done) printf ("Done \n");
  1089. X        else printf("You don't have it to put in the safe!\n") ;
  1090. X        return ;
  1091. X    }
  1092. X}
  1093. X
  1094. X/* see if your are holding the object(s) */
  1095. Xfor (i = 0; i < Objcnt; i++) {
  1096. X    if (i == 0) pnt = object ;
  1097. X    else pnt++ ;
  1098. X    sw_object = FALSE ;
  1099. X    if (tag[pnt->ID]) {
  1100. X        sw_object = TRUE ;
  1101. X         if (pnt->Location == B_have) {
  1102. X            /* Safe storage routine */
  1103. X            if (tag[V_safe]) {
  1104. X                pnt->Location = B_in_safe ;    
  1105. Xprintf ("The %s is now inside the safe. \n", 
  1106. X    vocab[pnt->ID - 1]);
  1107. X                sw_done = TRUE ;
  1108. X                carry_count-- ;
  1109. X                carry_weight -= pnt->Weight ;
  1110. X                continue ;
  1111. X            }
  1112. X            /* Single 'drop' routine */
  1113. X            if (tag[V_river]||tag[V_billabong]||
  1114. X                tag[V_stream]) {
  1115. X        /* The object is to be dropped in water */
  1116. X                if(tag[V_stream]) {
  1117. X                    if (n == R_stream) {
  1118. Xprintf("You fling the %s into the stream.\n", 
  1119. X    vocab[pnt->ID - 1]);
  1120. X                    carry_count-- ;
  1121. X                carry_weight -= pnt->Weight ;
  1122. X                    pnt->Location = B_destroyed; 
  1123. X                    return ;
  1124. X                    }
  1125. X                    else
  1126. Xprintf("I see no stream to toss it into.\n") ;
  1127. X                    return ;
  1128. X                }
  1129. X            if(tag[V_billabong]) {
  1130. X                if ((n == R_stream)||
  1131. X                (n == R_slime)||(n == R_billabong)) { 
  1132. Xprintf("You fling the %s into the billabong.\n",
  1133. X    vocab[pnt->ID - 1]);
  1134. X                    carry_count-- ;
  1135. X                carry_weight -= pnt->Weight ;
  1136. X                    pnt->Location = B_destroyed; 
  1137. X                    return ;
  1138. X                }
  1139. X                else
  1140. Xprintf("I see no billabong to toss it into.\n") ;
  1141. X                return ;
  1142. X            }
  1143. X            if(tag[V_river]) {
  1144. X                if ((n == R_dike)||(n == R_river_edge)||
  1145. X                    (n == R_river_exit)) {
  1146. Xprintf("You fling the %s into the river.\n", 
  1147. X    vocab[pnt->ID - 1]);
  1148. X                    carry_count-- ;
  1149. X                carry_weight -= pnt->Weight ;
  1150. X                    pnt->Location = B_destroyed; 
  1151. X                    return ;
  1152. X                }
  1153. X                else
  1154. Xprintf("I see no river to toss it into.\n") ;
  1155. X                return ;
  1156. X            }
  1157. X        }
  1158. X        /* Normal Drop */
  1159. X        else if (room[n][M_rm_type] != T_looping) {
  1160. X            if ((pnt->ID == V_cap)&&(verb != V_slow_drop)) {
  1161. X                cap_drop() ;
  1162. X                return ;
  1163. X            }
  1164. X            if ((pnt->ID == V_dynamite)&&(verb != V_slow_drop)&&
  1165. X        (Dynamite->Type == Z_alias)) dynamite_drop();
  1166. X
  1167. X/* If the he rifle is dropped.  See if it kills the player */
  1168. Xif (pnt->ID == V_rifle) {
  1169. X    if ((clip_flag != F_no_clip) && 
  1170. X(Rifle->Status > 0)) switch(rifle_flag) {
  1171. X    case F_safety:
  1172. X        break ;
  1173. X            
  1174. X    case F_single:
  1175. X        printf("\nBam!\n") ;
  1176. X        dropped_gun() ;
  1177. X
  1178. X    case F_triple:
  1179. X        printf("\n") ;
  1180. X        if (Rifle->Status >= 3) {
  1181. X            printf("Bam! Bam! Bam! \n\n") ;
  1182. X        }
  1183. X        else {
  1184. X        for (k = 1; k <= Rifle->Status; k++) 
  1185. X            printf("Bam! ") ;
  1186. X        }
  1187. X        dropped_gun() ;
  1188. X
  1189. X    case F_auto:
  1190. X        printf("\n") ;
  1191. X        if (Rifle->Status >= 30) {
  1192. X            for (k = 1; k <= 3; k++) 
  1193. Xprintf("Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! \n") ;
  1194. X        }
  1195. X        else {
  1196. X            i_10 = Rifle->Status / 10 ;
  1197. X        i_fract = Rifle->Status - (i_10 * 10) ;
  1198. X            for (k = 1; k <= i_10; k++) 
  1199. Xprintf("Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! \n") ;
  1200. X            for (k = 1; k <= i_fract; k++) 
  1201. X                printf("Bam! ") ;
  1202. X        }
  1203. X        dropped_gun() ;
  1204. X    } /* end of the switch block */
  1205. X} /* end of "drop rifle" block */
  1206. X
  1207. X            carry_count-- ;
  1208. X            carry_weight -= pnt->Weight ;
  1209. X            ++room[n][M_obj_cnt] ;
  1210. X            pnt->Location = n; 
  1211. X            sw_done = TRUE ;
  1212. X/* set valuable switch if valuable object dropped in Ned's area */
  1213. X            if (pnt->Value > 0) {
  1214. X                for (k = 22; k <= 41; k++) 
  1215. X                    if (k == n) sw_valuable = TRUE ;
  1216. X                for (k = 144; k <= 146; k++) 
  1217. X                    if (k == n) sw_valuable = TRUE ;
  1218. X            }
  1219. X            continue ;
  1220. X        }
  1221. X        else {
  1222. Xprintf ("As the %s left your possession there was a bright \n",
  1223. X    vocab[pnt->ID - 1]);
  1224. Xprintf ("blue flash, followed by a low \"BOOM\" as it vaporized \n");
  1225. Xprintf ("into nonexistence. \n");
  1226. X            carry_count-- ;
  1227. X            carry_weight -= pnt->Weight ;
  1228. X            pnt->Location = B_destroyed; 
  1229. X            return ;
  1230. X        }
  1231. X        }
  1232. X         if (pnt->Location == B_unmade) continue ;
  1233. X    } /* end of the object requested block */
  1234. X    if ((!sw_done)&&sw_object) {
  1235. Xprintf("You do not possess a %s.\n", vocab[pnt->ID - 1]);
  1236. X        return ;
  1237. X    }
  1238. X} /* end of the object scan loop */
  1239. Xif (sw_done) {
  1240. X    printf ("Done \n");
  1241. X    objlooker(n) ;
  1242. X    gleeper(n) ; 
  1243. X} 
  1244. Xelse 
  1245. Xprintf("I don't understand what it is I'm supposed to drop.\n") ;
  1246. X
  1247. Xreturn ;
  1248. X
  1249. X
  1250. X} /* --- end of the "dropper" subroutine --- */
  1251. X
  1252. X#if (PROTOTYPE)
  1253. Xvoid cap_drop(void)
  1254. X#else
  1255. Xvoid cap_drop()
  1256. X#endif
  1257. X/*********************************************************/
  1258. X/*                                                       */
  1259. X/*         --- Blasing Cap Dropping Subroutine ---       */
  1260. X/*                                                       */
  1261. X/*      Program by Gary A. Allen, Jr.  6 December 1992   */
  1262. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  1263. X/*                                                       */
  1264. X/*********************************************************/
  1265. X{
  1266. Xprintf("Bang!! The blasting cap you were carrying detonated when\n") ;
  1267. Xprintf("it hit the ground.  Fortunately no damage was caused.\n") ;  
  1268. XCap->Location = B_destroyed; 
  1269. Xcarry_count-- ;
  1270. Xcarry_weight -= Cap->Weight ;
  1271. X
  1272. X} /* --- end of the "cap_drop" subroutine --- */
  1273. X
  1274. X#if (PROTOTYPE)
  1275. Xvoid dynamite_drop(void)
  1276. X#else
  1277. Xvoid dynamite_drop()
  1278. X#endif
  1279. X/*********************************************************/
  1280. X/*                                                       */
  1281. X/*           --- Dynamite Dropping Subroutine ---        */
  1282. X/*                                                       */
  1283. X/*      Program by Gary A. Allen, Jr.  6 December 1992   */
  1284. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  1285. X/*                                                       */
  1286. X/*********************************************************/
  1287. X{
  1288. X#if (PROTOTYPE)
  1289. Xvoid ender(int), boom(void) ;
  1290. X#endif
  1291. X
  1292. Xboom() ;
  1293. Xprintf("Dropping a stick of dynamite with a blasting cap in it\n");
  1294. Xprintf("ranks high as one of the dumbest things a person can do.\n") ;
  1295. Xprintf("Needless to say you were blown to bits. Next time drop\n") ;
  1296. Xprintf("the dynamite slowly or gently.\n") ;
  1297. Xender(F_died) ;
  1298. X
  1299. X} /* --- end of the "dynamite_drop" subroutine --- */
  1300. X
  1301. X#if (PROTOTYPE)
  1302. Xvoid destroy_all(void)
  1303. X#else
  1304. Xvoid destroy_all()
  1305. X#endif
  1306. X/*********************************************************/
  1307. X/*                                                       */
  1308. X/*        --- Destroy Everything Held Subroutine ---     */
  1309. X/*                                                       */
  1310. X/*      Program by Gary A. Allen, Jr.  6 December 1992   */
  1311. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  1312. X/*                                                       */
  1313. X/*********************************************************/
  1314. X{
  1315. Xregister int i ;
  1316. XOBJECT_STRUCT *pnt ;
  1317. X
  1318. Xgleep_count = 0 ;
  1319. Xcarry_count = 0 ;
  1320. Xcarry_weight = 0 ;
  1321. Xpnt = object ;
  1322. Xfor (i = 0; i < Objcnt; i++) {
  1323. X    if (pnt->Location == B_have)  pnt->Location = B_destroyed; 
  1324. X    pnt++ ;
  1325. X}
  1326. X} /* --- end of the "destroy_all" subroutine --- */
  1327. X
  1328. X#if (PROTOTYPE)
  1329. Xvoid dropped_gun(void)
  1330. X#else
  1331. Xvoid dropped_gun()
  1332. X#endif
  1333. X/*********************************************************/
  1334. X/*                                                       */
  1335. X/*     --- Player Suicides by Dropping Armed Rifle ---   */
  1336. X/*                                                       */
  1337. X/*      Program by Gary A. Allen, Jr.  31 December 1992  */
  1338. X/*        (c) Copyright 1992 by Gary A. Allen, Jr.       */
  1339. X/*                                                       */
  1340. X/*********************************************************/
  1341. X{
  1342. X#if (PROTOTYPE)
  1343. Xvoid ender(int) ;
  1344. X#endif
  1345. X
  1346. Xprintf("\n") ;
  1347. Xprintf("Dropping a loaded and armed automatic rifle is a stupid way\n");
  1348. Xif ((Rifle->Status == 1) || (rifle_flag == F_single)) {
  1349. Xprintf("to commit suicide.  Needless to say you were hit by the\n") ;
  1350. Xprintf("bullet after the rifle went off.\n") ;
  1351. X}
  1352. Xelse {
  1353. Xprintf("to commit suicide.  The bullets shot from the rifle fly\n") ;
  1354. Xprintf("around.  One of them bounces back and hits you!\n") ;
  1355. X}
  1356. Xender(F_died) ;
  1357. X} /* --- end of the "dropped_gun" subroutine --- */
  1358. END_OF_FILE
  1359. if test 35391 -ne `wc -c <'taker.c'`; then
  1360.     echo shar: \"'taker.c'\" unpacked with wrong size!
  1361. fi
  1362. # end of 'taker.c'
  1363. fi
  1364. echo shar: End of archive 3 \(of 7\).
  1365. cp /dev/null ark3isdone
  1366. MISSING=""
  1367. for I in 1 2 3 4 5 6 7 ; do
  1368.     if test ! -f ark${I}isdone ; then
  1369.     MISSING="${MISSING} ${I}"
  1370.     fi
  1371. done
  1372. if test "${MISSING}" = "" ; then
  1373.     echo You have unpacked all 7 archives.
  1374.     rm -f ark[1-9]isdone
  1375. else
  1376.     echo You still need to unpack the following archives:
  1377.     echo "        " ${MISSING}
  1378. fi
  1379. ##  End of shell archive.
  1380. exit 0
  1381.