home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume15 / dinkum / part03 / taker.c < prev   
C/C++ Source or Header  |  1993-01-27  |  28KB  |  1,030 lines

  1. #define TAKER
  2. #include "dink_sym.h"
  3. #include "dink_glb.h"
  4.  
  5. void taker(n)
  6. /*********************************************************/
  7. /*                                                       */
  8. /*           --- Object Taking Subroutine ---            */
  9. /*                                                       */
  10. /*      Program by Gary A. Allen, Jr.   20 May 1990      */
  11. /*        (c) Copywrite 1990 by Gary A. Allen, Jr.       */
  12. /*                                                       */
  13. /*********************************************************/
  14. int n ;
  15. {
  16. #ifdef __TURBOC__
  17. void clip_in(int), clip_out(int), ender(int), eater(int) ;
  18. #endif
  19.  
  20. register int i, j ;
  21. int  sw_done, gleep_holder, ammo_flag ;
  22.  
  23. /* Alias in the object for the single word "take" command */
  24. if (tag[V_VERB_ONLY]) {
  25.     j = 0 ;
  26.     /* See if there is only one object on the floor */
  27.     for (i = 0; i <= objcnt; i++) if (n == object[i][J_loc]) {
  28.         j++ ;
  29.         tag[object[i][J_parse_id]] = TRUE ;
  30.     }
  31.  
  32.     if (room[n][M_gleep] != 0) {
  33.         j++ ;
  34.         tag[V_gleep] = TRUE ;
  35.         if (room[n][M_gleep] > 1) tag[V_PLURAL] = TRUE ;
  36.     }
  37.  
  38.     /* Complain if there isn't a single object on the ground */
  39.     if (j > 1) {
  40.         printf ("What exactly do you want me to take? \n");
  41.         return ;
  42.     }
  43. }
  44.  
  45. ammo_flag = F_no_clip ;
  46. if (tag[V_clip]) ammo_flag = F_normal_clip ;
  47. if (tag[V_org_clip]) ammo_flag = F_org_clip ;
  48.  
  49. /* deal with special case of "orange clip" implied by its being alone */
  50. if (tag[V_clip]&&(object[O_clip][J_loc] != n)&&
  51.    (object[O_org_clip][J_loc] == n)) {
  52.     tag[V_org_clip] = TRUE ;
  53.     tag[V_clip] = FALSE ;
  54.     if (V_clip == sent[1]) sent[1] = V_org_clip ;
  55. }
  56.  
  57. /* deal with the verb "attach" */
  58. if (verb == V_attach) {
  59.     if (tag[V_rifle]&&(ammo_flag != F_no_clip)) {
  60.         clip_in(ammo_flag) ;
  61.         return ;
  62.     }
  63.     if ((n != R_office_mang)&&(room[n][M_obj_cnt] <= 0)) {
  64.         printf ("There is nothing here that I can attach!\n");
  65.         return ;
  66.     }
  67. }
  68.  
  69. /* Check to see if player already has the item */
  70. for (i = 0; i <= objcnt; i++) { 
  71.     if (object[i][J_parse_id] == sent[1]) {
  72.         if (object[i][J_loc] == B_have) {
  73. printf ("You already have a %s in your possession.\n",vocab[sent[1]-1]);
  74.             return ;
  75.         }
  76.         else break ;
  77.     }
  78. }
  79.  
  80. sw_done = FALSE ;
  81.  
  82. if (tag[V_safe]) {
  83.     if (n != R_office_mang) {
  84.         printf("There is no safe here. \n") ;
  85.         return ;
  86.     }
  87.     if (room[R_office_mang][M_rm_status] != S_open) {
  88.         printf("I can't do it because the safe is closed. \n") ;
  89.         return ;
  90.     }
  91. }
  92.  
  93. /* Special case of "take pill" */
  94. if ((tag[V_pill])&&(object[O_pills][J_loc] == B_have)) {
  95.     eater(n) ;
  96.     return ;
  97. }
  98.  
  99. /* Reject "take" command when there is nothing to take */
  100. if ((n != R_office_mang)&&(verb != V_attach)&&(verb != V_remove)&&
  101.     (room[n][M_obj_cnt] <= 0)&&(room[n][M_gleep] == 0)&&
  102.     (!((n == R_gleep_tank)&&(gleep_score > 0)))&&
  103.     (room[n][M_rm_type] != T_unmovable_obj)) {
  104.     printf ("There is nothing here that you can take! \n");
  105.     return ;
  106. }
  107.  
  108. /* player takes something from the gleep tank */
  109. if (tag[V_tank]) {
  110.     if (n != R_gleep_tank) {
  111. printf("I see no gleep tank to take anything from. \n") ;
  112.         return ;
  113.     }
  114. printf("\nYou climb up onto the edge of the gleep tank and reach\n");
  115. printf("into the dark blue fluid.  Suddenly the fluid begins a\n");
  116. printf("furious boiling that instantly reduces your hand into\n") ;
  117. printf("bleached white bones.  The shock and pain disturbs your\n");
  118. printf("balance and you fall into the horrible stuff!!  There is\n");
  119. printf("once again a furious boiling.  Eventually the fluid stills\n");
  120. printf("and becomes clear again.  On the bottom of the tank can\n") ;
  121. printf("be seen a white, clean, \"medical school quality\" human\n");
  122. printf("skeleton.\n") ;
  123.     ender(F_died) ;
  124. }
  125.  
  126. /* gleep taking routine */
  127. if (tag[V_gleep]) {
  128. if (!tag[V_safe]) {
  129.  
  130.     /* This block is for inaccessible or nonexistant gleeps */
  131.     if ((room[n][M_gleep] == 0)&&(!((n == R_office_mang)&&
  132. (room[R_office_mang][M_rm_status] == S_open)&&(gleep_safe != 0)))) {
  133.  
  134.         if ((n != R_gleep_tank)||(gleep_score==0)) {
  135. printf("There are no gleeps here to take!\n") ;
  136.             return ;
  137.         }
  138.         else {
  139. printf("There are no gleeps on the floor but I see ") ;
  140.             if (gleep_score == 1) 
  141.                 printf("a gleep in the gleep tank.\n");
  142.             else
  143. printf("%d gleeps in the gleep tank.\n",gleep_score) ;
  144.             return ;
  145.         }
  146.     }
  147.  
  148.     /* This block is for accessible gleeps */
  149.     if ((n == R_office_mang)&&
  150. (room[R_office_mang][M_rm_status] == S_open)&&(gleep_safe != 0)) {
  151.         gleep_holder = gleep_safe ;
  152.     }
  153.     else gleep_holder = 0 ;
  154.  
  155.     if ((!tag[V_PLURAL])||
  156.         (room[n][M_gleep]+gleep_holder == 1)) {
  157.         printf("Gleep taken. \n") ; 
  158.         ++gleep_count ;
  159.         if (gleep_holder == 0) --room[n][M_gleep] ;
  160.         else --gleep_holder ;
  161.     }
  162.     else {
  163.         printf("Gleeps taken. \n") ; 
  164.         gleep_count += room[n][M_gleep]+gleep_holder ;
  165.         room[n][M_gleep] = 0 ;
  166.         gleep_holder = 0 ;
  167.     }
  168.     gleep_safe = gleep_holder ;
  169.     return ;
  170. }
  171. else {
  172.     if ((n == R_office_mang)&&
  173. (room[R_office_mang][M_rm_status] == S_open)&&(gleep_safe != 0)) { 
  174.         if (tag[V_PLURAL]) {
  175.             printf("Gleeps taken from safe. \n") ; 
  176.             gleep_count += gleep_safe ;
  177.             gleep_safe = 0 ;
  178.         }
  179.         else {
  180.             printf("Gleep taken from safe. \n") ; 
  181.             ++gleep_count ;
  182.             --gleep_safe ;
  183.         }
  184.     }
  185.     else printf("There are no gleeps in the safe!\n") ;
  186.     return ;
  187. }
  188. } /* end of the gleep taking block */
  189.  
  190. /* deal with the special case of the platypus picture */
  191. if ((n == R_office_mang) && tag[V_picture]) {
  192. printf("The picture can not be removed.  It appears to be hinged ");
  193. printf("to the wall. \n");
  194.     return ;
  195. }
  196.  
  197. /* treat the verb "remove" in the context of "remove clip from rifle" */
  198. if (verb == V_remove) {
  199.     if ((!tag[V_safe])&&(ammo_flag != F_no_clip)) {
  200.         clip_out(n) ;
  201.         return ;
  202.     }
  203. }
  204.  
  205. if (carry_count > 5) {
  206. printf("I can't do it!\n") ;
  207. printf("I'm holding so many things that I can't take anymore!\n") ;
  208.     return ;
  209. }
  210.  
  211. if (carry_weight >= 800) {
  212. printf("I can't do it!\n") ;
  213. printf("This junk I'm carrying is too heavy! I can't carry anymore!\n");
  214.     return ;
  215. }
  216.  
  217.  
  218. /* find the object(s) in this room */
  219. for (i = 0; i <= objcnt; i++) {
  220.  
  221.     if ((carry_count > 5)||(carry_weight >= 800)) break ;
  222.  
  223.     /* See if the object is in the safe and was requested */
  224.     if ((n == R_office_mang)&&(object[i][J_loc] == B_in_safe)&&
  225.         (tag[object[i][J_parse_id]]||tag[V_all])&&
  226.     (room[R_office_mang][M_rm_status] == S_open)&&
  227.     ((!tag[V_treasure])||(object[i][J_value] > 0))) {
  228.         object[i][J_loc]= B_have; 
  229.         carry_count++ ;
  230.         carry_weight += object[i][J_weight] ; 
  231.         sw_done = TRUE ;
  232.     } 
  233.     
  234.     /* See if the object is in the room and was requested */
  235.     if ((object[i][J_loc]==n)&&(tag[object[i][J_parse_id]]||
  236.         tag[V_all])&&
  237.         ((!tag[V_treasure])||(object[i][J_value] > 0))) {
  238.         /* see if the object can be taken */
  239.         if ((object[i][J_type] == Z_normal)||
  240.             (object[i][J_type] == Z_alias)) {
  241.             --room[n][M_obj_cnt] ;
  242.             carry_count++ ;
  243.             carry_weight += object[i][J_weight] ; 
  244.             object[i][J_loc] = B_have; 
  245.             sw_done = TRUE ;
  246.         } 
  247.  
  248.         /* see if this is a nonmovable, nonacting object */
  249.         if ((object[i][J_type] == Z_unmovable) &&
  250.             (object[i][J_loc]==n) && (!tag[V_all])) {
  251.  
  252.             switch(object[i][J_parse_id]) {
  253.             case V_bulldust:
  254. printf("The bulldust is so fine that it wafts away with a touch.\n") ;
  255.                 return ;
  256.  
  257.             /* Cockroach(es) */
  258.             case V_cockroach:
  259. printf("I will not touch the filthy things!\n") ;
  260.                 return ;
  261.  
  262.             /* Kangaroo(s) */
  263.             case V_kangaroo:
  264. printf("You make a grab for the kangaroo but it leaps away!\n") ;
  265.                 return ;
  266.  
  267.             case V_poster:
  268. printf("I think this sort of poster is best left on the wall.\n") ;
  269.                 return ;
  270.  
  271.             /* Spinifex(es) */
  272.             case V_spinifex:
  273. printf("The thorns on the spinifex are large and nasty.\n") ;
  274. printf("I'll just leave them to roll about.\n") ;
  275.                 return ;
  276.             } /* end of switch block */
  277.         } /* end of nonmovable object block */ 
  278.  
  279.         /* see if taking the object causes special action */
  280.         if (object[i][J_type] == Z_transform) {
  281.             switch(object[i][J_parse_id]) {
  282.             /* ACME doormat */
  283.             case V_mat:
  284. printf("As you lift up the dirty old doormat, you find half \n") ;
  285. printf("hidden in the dust....  a large brass key. \n") ;
  286.                 object[O_mat][J_type] = Z_normal ;
  287.                 carry_count++ ;
  288.                 carry_weight += object[O_mat][J_weight];
  289.                 object[O_mat][J_loc]= B_have;
  290.                 object[O_key][J_loc]=R_office_entr ;
  291.                 sw_done = TRUE ;
  292.                 return ;
  293.  
  294.             /* Map of the ACME Mine */
  295.             case V_map:
  296. printf("As you picked up the old map from the floor, most of it");
  297. printf(" crumbled into \ndust leaving only one small piece. \n") ;
  298.                 object[O_map][J_loc] = B_unmade ;
  299.                 object[O_map_frag][J_loc] = B_have ;
  300.                 carry_count++ ;
  301.             carry_weight += object[O_map_frag][J_weight] ;
  302.                 --room[n][M_obj_cnt] ;
  303.                 sw_done = TRUE ;
  304.                 return ;
  305.             }
  306.         } /* end of the special action block */ 
  307.     } 
  308. } /* end of the object scan loop */
  309.  
  310. /* take all gleeps if any */
  311. if (tag[V_all]&&(!tag[V_treasure])) {
  312.     if (room[n][M_gleep] > 0) { 
  313.         gleep_count += room[n][M_gleep] ;
  314.         room[n][M_gleep] = 0 ;
  315.         sw_done = TRUE ;
  316.     }
  317.     if ((gleep_safe != 0)&&(n == R_office_mang)&&
  318.         (room[R_office_mang][M_rm_status] == S_open)) {
  319.         gleep_count +=  gleep_safe ;
  320.         gleep_safe = 0 ;
  321.         sw_done = TRUE ;
  322.     }
  323. }
  324.  
  325. /* Announce the "take" was successful */
  326. if (sw_done) {
  327.     if (((carry_count > 5)||(carry_weight >= 800))&&(tag[V_all])) 
  328.         printf("You've taken as much as you can.\n") ;
  329.     else printf ("Done \n");
  330. }
  331. /* --or-- announce the "take" was unsuccessful */
  332. else  {
  333.     if (tag[V_all]) printf("I see nothing which I can take.\n") ;
  334.     else { 
  335.         if (tag[V_VERB_ONLY]) 
  336.             printf("What exactly should I take?\n") ;
  337.         else {
  338.             printf ("I don't see a") ;
  339.             if (tag[V_PLURAL]) printf("ny") ;
  340.             printf (" %s around here. \n",vocab[sent[1]-1]);
  341.         }
  342.     }
  343. }
  344. return ;
  345.  
  346. } /* --- end of the "taker" subroutine --- */
  347.  
  348. void loader()
  349. /*********************************************************/
  350. /*                                                       */
  351. /*           --- Rifle Loading Subroutine ---            */
  352. /*                                                       */
  353. /*      Program by Gary A. Allen, Jr.  29 April 1990     */
  354. /*        (c) Copywrite 1990 by Gary A. Allen, Jr.       */
  355. /*                                                       */
  356. /*********************************************************/
  357. {
  358.  
  359. #ifdef __TURBOC__
  360. void clip_in(int) ;
  361. #endif
  362.  
  363. int ammo_flag ;
  364.  
  365. /* Reject single verb load command */
  366. if (tag[V_VERB_ONLY]) {
  367. printf("What exactly do you want me to load?\n") ;
  368.     return ;
  369. }
  370. if (!tag[V_rifle]) {
  371. printf("I don't know how I could load that.\n") ;
  372.     return ;
  373. }
  374.  
  375. /* Deal with implied clip type command */
  376. if (!tag[V_clip]) {
  377. if ((object[O_clip][J_loc] != B_have)&&
  378.     (object[O_org_clip][J_loc] == B_have)) ammo_flag = F_org_clip ;
  379. if ((object[O_clip][J_loc] == B_have)&&
  380.      (object[O_org_clip][J_loc] != B_have)) ammo_flag = F_normal_clip ;
  381.     /* the case were there is no clip is found in clip_in */
  382. }
  383.  
  384. /* Deal with specific "load [orange] clip" command */
  385. else {
  386.     if (tag[V_orange]) {
  387.         if (object[O_org_clip][J_loc] == B_have) 
  388.             ammo_flag = F_org_clip ;
  389.         else {
  390. printf("You don't possess the orange ammunition clip.\n") ;
  391.             return ;
  392.         }
  393.     }
  394.     else {
  395.         if (object[O_clip][J_loc] == B_have)
  396.             ammo_flag = F_normal_clip ;
  397.  
  398. /* assume "load clip" with no normal clip implies orange clip */
  399.         else {
  400.             if (object[O_org_clip][J_loc] == B_have) 
  401.                 ammo_flag = F_org_clip ;
  402.             else{
  403. printf("You don't possess an ammunition clip to load.\n") ;
  404.                 return ;
  405.             }
  406.         }
  407.     }
  408. }
  409.  
  410. clip_in(ammo_flag) ;
  411. } /* --- end of the "loader" subroutine --- */
  412.  
  413. void unloader(n)
  414. /*********************************************************/
  415. /*                                                       */
  416. /*          --- Rifle Unloading Subroutine ---           */
  417. /*                                                       */
  418. /*      Program by Gary A. Allen, Jr.  29 April 1990     */
  419. /*        (c) Copywrite 1990 by Gary A. Allen, Jr.       */
  420. /*                                                       */
  421. /*********************************************************/
  422. int n ;
  423. {
  424. #ifdef __TURBOC__
  425. void clip_out(int) ;
  426. #endif
  427.  
  428. /* Reject single verb load command */
  429. if (tag[V_VERB_ONLY]) {
  430. printf("What exactly do you want me to unload?\n") ;
  431.     return ;
  432. }
  433. if (!tag[V_rifle]) {
  434. printf("I don't know how I could unload that.\n") ;
  435.     return ;
  436. }
  437. clip_out(n) ;
  438. } /* --- end of the "unloader" subroutine --- */
  439.  
  440. void dropper(n)
  441. /*********************************************************/
  442. /*                                                       */
  443. /*          --- Object Dropping Subroutine ---           */
  444. /*                                                       */
  445. /*      Program by Gary A. Allen, Jr.  21 May 1990       */
  446. /*        (c) Copywrite 1990 by Gary A. Allen, Jr.       */
  447. /*                                                       */
  448. /*********************************************************/
  449. int n ;
  450. {
  451. #ifdef __TURBOC__
  452. void clip_in(int), clip_out(int), boom(void) ;
  453. void objlooker(int), gleeper(int), unlocker(int) ;
  454. #endif
  455.  
  456. register int i, k ;
  457. int sw_possess, sw_done, ammo_flag, sw_object, i_10, i_fract, sw_shot ;
  458.  
  459. /* respond to "verb only" command */
  460. if (tag[V_VERB_ONLY]) {
  461.     printf ("You'll have to be more specific. \n");
  462.     return ;
  463. }
  464.  
  465. /* deal with special case of "orange clip" implied by its being alone */
  466. if (tag[V_clip]&&(object[O_clip][J_loc] != B_have)&&
  467.     (clip_flag != F_normal_clip)&&
  468.    ((object[O_org_clip][J_loc] == B_have)||(clip_flag == F_org_clip))) {
  469.     tag[V_org_clip] = TRUE ;
  470.     tag[V_clip] = FALSE ;
  471.     if (V_clip == sent[1]) sent[1] = V_org_clip ;
  472. }
  473.  
  474. ammo_flag = F_no_clip ;
  475. if (tag[V_clip])  ammo_flag = F_normal_clip ;
  476. if (tag[V_org_clip])  ammo_flag = F_org_clip ;
  477.  
  478. /* deal with special cases of the verbs */
  479. switch(verb) {
  480. case V_put:
  481.     /* special case of putting (destroying) an object in water */
  482.     if (tag[V_tank]||tag[V_gleep]||tag[V_safe]||
  483.         tag[V_river]||tag[V_billabong]||tag[V_stream]) break ;
  484.  
  485.     /* special case of "put key in door(lock)" */
  486.     if (tag[V_key] && tag[V_door]) {
  487.         unlocker(n) ;
  488.         return ;
  489.     }
  490.  
  491.     if (!tag[V_cap]) {
  492.         if ((!tag[V_rifle])&&(ammo_flag != F_no_clip)) {
  493.             printf("What am I to put the clip into? \n") ;
  494.             return ;
  495.         }
  496.         if (tag[V_rifle]&&(ammo_flag != F_no_clip))  
  497.                 clip_in(ammo_flag) ;
  498.         else 
  499. printf("I don't understand what this is to be put into. \n") ;
  500.         return ;
  501.     }
  502.  
  503. case V_insert:
  504.     if (tag[V_safe]) break ;
  505.     if (ammo_flag != F_no_clip) {
  506.         if (!tag[V_rifle]) {
  507. printf("What am I to insert the clip into? \n") ;
  508.         }
  509.         else {
  510.             clip_in(ammo_flag) ;
  511.         }
  512.         return ;
  513.     }
  514.     if (tag[V_cap]) {
  515.         if (!tag[V_dynamite]) {
  516. printf("I see no reason why I should put a blasting cap into that.\n") ;
  517.             return ;
  518.         }
  519.         else goto cap_in ;
  520.     }
  521. printf("I can think of some interesing places to insert this. \n") ;
  522. printf("However I shall not reduce myself to such vulgarity.\n");
  523.     return ;
  524.     
  525. case V_eject:
  526. /* Command "eject clip" ejects clip from rifle no matter what type*/
  527.     if ((ammo_flag == F_normal_clip)&&(clip_flag == F_org_clip)) 
  528.         ammo_flag = F_org_clip ; 
  529. case V_drop:
  530.     if (((ammo_flag == F_org_clip)&&(clip_flag == F_org_clip))|| 
  531.     ((ammo_flag == F_normal_clip)&&(clip_flag == F_normal_clip))) { 
  532.         clip_out(n) ;
  533.         return ;
  534.     }
  535.     break ;
  536.  
  537. } /* end of switch */
  538.  
  539. /* Deal with "drop" when user has no objects */
  540. if (tag[V_all]&&(carry_count == 0)&&(gleep_count == 0)) {
  541.     printf("You dill!  You have nothing to drop!\n") ;
  542.     return ;
  543. }
  544.  
  545. /* deal with "drop in safe ..." errors */
  546. if (tag[V_safe]) {
  547. /* see if this is the managers office */
  548.     if (n != R_office_mang) {        
  549.         printf("There is no safe here! \n");
  550.         return ;
  551.     }
  552. /* See if the safe is open */
  553.     if (room[R_office_mang][M_rm_status] != S_open) {
  554.         printf ("I can't do it!  The safe is closed. \n");
  555.         return ;
  556.     }
  557. }
  558.  
  559. /* gleep droping routine */
  560. if (tag[V_gleep]||tag[V_tank]) {
  561.     /* drop gleeps in a normal way */
  562.     if (!tag[V_tank]) {
  563.         if (gleep_count == 0) { 
  564.             printf("You have no gleeps to drop! \n") ;
  565.             return ;
  566.         }
  567.         if ((!tag[V_PLURAL])||(gleep_count == 1)) {
  568.             if (tag[V_safe]) {
  569.                 printf("Gleep put into safe.\n") ;
  570.                 ++gleep_safe ;
  571.                 --gleep_count ;
  572.             }
  573.             else {
  574.                 printf("Gleep dropped. \n") ; 
  575.                 --gleep_count ;
  576.                 ++room[n][M_gleep] ;
  577.             }
  578.         }
  579.         else {
  580.             if (tag[V_safe]) {
  581.                 printf("Gleeps put into safe.\n") ;
  582.                 gleep_safe += gleep_count ;
  583.                 gleep_count = 0 ;
  584.             }
  585.             else {
  586.                 printf("Gleeps dropped. \n") ; 
  587.                 room[n][M_gleep] += gleep_count ;
  588.                 gleep_count = 0 ;
  589.             }
  590.         }
  591.         gleep_drop = TRUE ;
  592.         return ;
  593.     }
  594.     /* drop objects(including gleeps) into a gleep tank */
  595.     else {
  596.         if (n != R_gleep_tank) {
  597.             printf("I don't see a gleep tank here. \n") ;
  598.             return ;
  599.         }
  600.         if (tag[V_gleep]) {
  601.             if (gleep_count <= 0) {
  602. printf("You have no gleeps to put in the tank. \n") ; 
  603.                 return ;
  604.             }
  605.             if ((!tag[V_PLURAL])||(gleep_count == 1)) {
  606. printf("Your gleep falls into the tank with a \"plonk\".\n") ;
  607.                 ++gleep_score ;
  608.                 --gleep_count ;
  609.             }
  610.             if (tag[V_PLURAL]&&(gleep_count > 1)) {
  611. printf("Your gleeps fall into the tank causing a splash.\n") ;
  612.                 gleep_score += gleep_count ;
  613.                 gleep_count = 0 ;
  614.             }
  615.         }
  616.         /* drop non-gleeps into the tank */
  617.  
  618.         /* the "drop all" routine */
  619.         if (tag[V_all]) {
  620.             sw_possess = FALSE ;
  621.             for (i = 0; i <= objcnt; i++) {
  622.                 if ((object[i][J_loc] == B_have)&&
  623.                     ((!tag[V_treasure])||
  624.                     (object[i][J_value] > 0))) {
  625.                     sw_possess = TRUE ;
  626.                     object[i][J_loc] = B_destroyed; 
  627.                     carry_count-- ;
  628.                 carry_weight -= object[i][J_weight] ;
  629.                 }
  630.             }
  631.             if (gleep_count == 0) {
  632.                 if (sw_possess) {
  633. printf("You dump everything into the gleep tank. There is a furious\n");
  634. printf("bubbling as the corrosive fluid of the tank turns the\n");
  635. printf("objects into NOTHING.\n") ;
  636.                 }
  637.                 else 
  638. printf("You've got nothing to throw into the tank.\n") ;
  639.             }
  640.             else {
  641.                 if (sw_possess) {
  642. printf("You fling everything into the gleep tank.  The gleep");
  643.                 if (gleep_count > 1) {
  644. printf("s\nsplash into the tank and settle to the bottom of the\n") ;
  645.                 }
  646.                 else {
  647. printf("\nplonks into the tank and settles to the bottom of the\n") ;
  648.                 }
  649. printf("tank.  However the other objects begin to dissolve the\n");
  650. printf("moment the tank's fluid touches them.  Time passes and\n");
  651. printf("the objects dissolve into NOTHING.\n") ;
  652.                 }
  653.                 /* you possess no non-gleeps */
  654.                 else {
  655.                 if (gleep_count == 1) 
  656. printf("Your gleep falls into the tank with a \"plonk\".\n") ;
  657.                 else
  658. printf("Your gleeps fall into the tank causing a splash.\n") ;
  659.                 }
  660.             gleep_score += gleep_count ;
  661.             gleep_count = 0 ;
  662.             return ;
  663.             }
  664.         } /* end of the "drop all" if block */
  665.         /* Individual non-gleeps are dropped into the tank */
  666.  
  667.         /* see if your are holding the object(s) */
  668.         for (i=0; i <= objcnt; i++) {
  669.              if (tag[object[i][J_parse_id]]) {
  670.                 if (object[i][J_loc]== B_have) {
  671. printf ("You fling the %s into the gleep tank.  As soon as it\n",
  672.     vocab[object[i][J_parse_id]-1]);
  673. printf ("touched the tank's fluid there was a furious effervescence\n");
  674. printf ("as it began to dissolve.  With the passage of time, the\n") ;
  675. printf ("fluid stills and there is NOTHING left.\n") ;
  676.                     carry_count-- ;
  677.                 carry_weight -= object[i][J_weight] ;
  678.                     object[i][J_loc] = B_destroyed; 
  679.                     return ;
  680.                 }
  681.                 else {
  682. printf("You don't have a %s to toss into the gleep tank.\n",
  683.     vocab[object[i][J_parse_id]-1]);
  684.                     return ;
  685.                 }
  686.             }
  687.         } /* object scan "for" loop */
  688.         return ;
  689.     }
  690. }
  691.  
  692. sw_done = FALSE ;
  693.  
  694. /* the "drop all" routine */
  695. if (tag[V_all]) {
  696.  
  697.     /* Deal with throwing stuff into water */
  698.     if(tag[V_stream]) {
  699.         if (n == R_stream) {
  700. printf("You fling everything into the stream.\n");
  701.             goto destroy_all ;
  702.         }
  703.         else
  704. printf("I see no stream to toss stuff into.\n") ;
  705.         return ;
  706.     }
  707.     if(tag[V_billabong]) {
  708.         if ((n == R_stream)||(n == R_slime)||
  709.             (n == R_billabong)) { 
  710. printf("You fling everything into the billabong.\n");
  711.             goto destroy_all ;
  712.         }
  713.         else
  714. printf("I see no billabong to toss stuff into.\n") ;
  715.         return ;
  716.     }
  717.     if(tag[V_river]) {
  718.         if ((n == R_dike)||(n == R_river_edge)||
  719.             (n == R_river_exit)) {
  720. printf("You fling everything into the river.\n");
  721.             goto destroy_all ;
  722.         }
  723.         else
  724. printf("I see no river to toss stuff into.\n") ;
  725.         return ;
  726.     }
  727.  
  728.     if (!tag[V_safe]) {
  729.         /* normal drop */
  730.         if (room[n][M_rm_type] != T_looping) {
  731.             /* normal room */
  732.             for (i = 0; i <= objcnt; i++) {
  733.                 if ((object[i][J_loc] == B_have)&&
  734.                     ((!tag[V_treasure])||
  735.                     (object[i][J_value] > 0))) {
  736.  
  737.                     sw_done = TRUE ;
  738.  
  739. /* see if the blasting cap was hard dropped */
  740. if ((i == O_cap)&&(verb != V_slow_drop)) {
  741. cap_drop:
  742. printf("Bang!! The blasting cap you were carrying detonated when\n") ;
  743. printf("it hit the ground.  Fortunately no damage was caused.\n") ;  
  744.     object[O_cap][J_loc] = B_destroyed; 
  745.     carry_count-- ;
  746.     carry_weight -= object[O_cap][J_weight] ;
  747.     return ;
  748. }
  749.  
  750. /* see if the dynamite with blasting cap was hard dropped */
  751. if ((i == O_dynamite)&&(object[O_dynamite][J_type] == Z_alias)&&
  752.     (verb != V_slow_drop)) {
  753. dynamite_drop:
  754.     boom () ;
  755. printf("Dropping a stick of dynamite with a blasting cap in it\n");
  756. printf("ranks high as one of the dumbest things a person can do.\n") ;
  757. printf("Needless to say you were blown to bits.\n") ;
  758.     ender(F_died) ;
  759. }
  760.                     ++room[n][M_obj_cnt] ;
  761.                     carry_count-- ;
  762.                 carry_weight -= object[i][J_weight] ;
  763.                     object[i][J_loc] = n; 
  764. /* set valuable switch if valuable object dropped in Ned's area */
  765.                     if (object[i][J_value] > 0) {
  766.                     for (k = 22; k <= 41; k++) 
  767.                     if (k == n) sw_valuable = TRUE;
  768.                     for (k = 144; k <= 146; k++) 
  769.                      if (k == n) sw_valuable = TRUE;
  770.                     }
  771.                 }
  772.             }
  773.             /* drop all gleeps */
  774.             if ((gleep_count > 0)&&
  775.                     (!tag[V_treasure])) {
  776.                 room[n][M_gleep] += gleep_count ;
  777.                 gleep_count = 0 ;
  778.                 sw_done = TRUE ;
  779.                 gleep_drop = TRUE ;
  780.             }
  781.  
  782.             if (sw_done) {
  783.                 printf ("Done\n");
  784.                 objlooker(n) ;
  785.                 gleeper(n) ; 
  786.             } 
  787.             else printf("Don't have it to drop.\n") ;
  788.             return ;
  789.         }
  790.         /* object destroyer room */
  791.         else {
  792.         /* Code assumes that user has something to drop */
  793. printf ("You dropped everything you had in a heap, which \n");
  794. printf ("promptly vaporized into a bright blue flash followed \n");
  795. printf ("by a low \"BOOM\". \n") ; 
  796. printf ("       --- You've blown it Bozo!! ---\n") ;
  797. destroy_all:
  798.             gleep_count = 0 ;
  799.             carry_count = 0 ;
  800.             carry_weight = 0 ;
  801.             for (i = 0; i <= objcnt; i++) {
  802.                 if (object[i][J_loc] == B_have) 
  803.                     object[i][J_loc] = B_destroyed; 
  804.             }
  805.             return ;
  806.         }
  807.     }
  808.     /* "drop all into the safe" routine */
  809.     else {
  810.         for (i = 0; i <= objcnt; i++) {
  811.             if ((object[i][J_loc] == B_have) &&
  812.                 ((!tag[V_treasure])||
  813.                 (object[i][J_value] > 0))) {
  814.                 object[i][J_loc] = B_in_safe ;    
  815.                 carry_count-- ;
  816.                 carry_weight -= object[i][J_weight] ;
  817.                 sw_done = TRUE ;
  818.             }
  819.         }
  820.         if (!tag[V_treasure]) {
  821.             gleep_safe += gleep_count ;
  822.             gleep_count = 0 ;
  823.             sw_done = TRUE ;
  824.         }
  825.         if (sw_done) printf ("Done \n");
  826.         else printf("You don't have it to put in the safe!\n") ;
  827.         return ;
  828.     }
  829. }
  830.  
  831. /* see if your are holding the object(s) */
  832. for (i=0; i <= objcnt; i++) {
  833.     sw_object = FALSE ;
  834.     if (tag[object[i][J_parse_id]]) {
  835.         sw_object = TRUE ;
  836.          if (object[i][J_loc] == B_have) {
  837.             /* Safe storage routine */
  838.             if (tag[V_safe]) {
  839.                 object[i][J_loc] = B_in_safe ;    
  840. printf ("The %s is now inside the safe. \n", 
  841.     vocab[object[i][J_parse_id]-1]);
  842.                 sw_done = TRUE ;
  843.                 carry_count-- ;
  844.                 carry_weight -= object[i][J_weight] ;
  845.                 continue ;
  846.             }
  847.  
  848.             /* Single 'drop' routine */
  849.             if (tag[V_river]||tag[V_billabong]||
  850.                 tag[V_stream]) {
  851.         /* The object is to be dropped in water */
  852.                 if(tag[V_stream]) {
  853.                     if (n == R_stream) {
  854. printf("You fling the %s into the stream.\n", 
  855.     vocab[object[i][J_parse_id]-1]);
  856.                     carry_count-- ;
  857.                 carry_weight -= object[i][J_weight] ;
  858.                     object[i][J_loc] = B_destroyed; 
  859.                     return ;
  860.                     }
  861.                     else
  862. printf("I see no stream to toss it into.\n") ;
  863.                     return ;
  864.                 }
  865.             if(tag[V_billabong]) {
  866.                 if ((n == R_stream)||
  867.                 (n == R_slime)||(n == R_billabong)) { 
  868. printf("You fling the %s into the billabong.\n",
  869.     vocab[object[i][J_parse_id]-1]);
  870.                     carry_count-- ;
  871.                 carry_weight -= object[i][J_weight] ;
  872.                     object[i][J_loc] = B_destroyed; 
  873.                     return ;
  874.                 }
  875.                 else
  876. printf("I see no billabong to toss it into.\n") ;
  877.                 return ;
  878.             }
  879.             if(tag[V_river]) {
  880.                 if ((n == R_dike)||(n == R_river_edge)||
  881.                     (n == R_river_exit)) {
  882. printf("You fling the %s into the river.\n", 
  883.     vocab[object[i][J_parse_id]-1]);
  884.                     carry_count-- ;
  885.                 carry_weight -= object[i][J_weight] ;
  886.                     object[i][J_loc] = B_destroyed; 
  887.                     return ;
  888.                 }
  889.                 else
  890. printf("I see no river to toss it into.\n") ;
  891.                 return ;
  892.             }
  893.         }
  894.         /* Normal Drop */
  895.         else if (room[n][M_rm_type] != T_looping) {
  896.             if ((i == O_cap)&&(verb != V_slow_drop)) 
  897.                 goto cap_drop ;
  898.             if ((i==O_dynamite)&&(verb != V_slow_drop)&&
  899.             (object[O_dynamite][J_type] == Z_alias)) 
  900.                 goto dynamite_drop ;
  901.  
  902. /* If the he rifle is dropped.  See if it kills the player */
  903. if (i==O_rifle) {
  904.     sw_shot = FALSE ;
  905.     if ((clip_flag != F_no_clip) && 
  906. (object[O_rifle][J_property] > 0)) switch(rifle_flag) {
  907.     case F_safety:
  908.         break ;
  909.             
  910.     case F_single:
  911.         printf("\nBam!\n\n") ;
  912.         sw_shot = TRUE ;
  913.         break ;
  914.  
  915.     case F_triple:
  916.         printf("\n") ;
  917.         if (object[O_rifle][J_property] >= 3) {
  918.             printf("Bam! Bam! Bam! \n\n") ;
  919.         }
  920.         else {
  921.         for (i = 1; i <= object[O_rifle][J_property]; i++) 
  922.             printf("Bam! ") ;
  923.         }
  924.         printf("\n") ;
  925.         sw_shot = TRUE ;
  926.         break ;
  927.  
  928.     case F_auto:
  929.         printf("\n") ;
  930.         if (object[O_rifle][J_property] >= 30) {
  931.             for (i = 1; i <= 3; i++) 
  932. printf("Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! \n") ;
  933.         }
  934.         else {
  935.             i_10 = object[O_rifle][J_property]/10 ;
  936.         i_fract = object[O_rifle][J_property]-(i_10*10) ;
  937.             for (i = 1; i <= i_10; i++) 
  938. printf("Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! \n") ;
  939.             for (i = 1; i <= i_fract; i++) 
  940.                 printf("Bam! ") ;
  941.         }
  942.         printf("\n") ;
  943.         sw_shot = TRUE ;
  944.         break ;
  945.     } /* end of the switch block */
  946.  
  947.     if (sw_shot) {
  948. printf("Dropping a loaded and armed automatic rifle is a stupid way\n");
  949.         if ((object[O_rifle][J_property] == 1) || 
  950.             (rifle_flag == F_single)) {
  951. printf("to commit suicide.  Needless to say you were hit by the\n") ;
  952. printf("bullet after the rifle went off.\n") ;
  953.         }
  954.         else {
  955. printf("to commit suicide.  The bullets shot from the rifle fly\n") ;
  956. printf("around.  One of them bounces back and hits you!\n") ;
  957.         }
  958.         ender(F_died) ;
  959.     }
  960. } /* end of "drop rifle" block */
  961.  
  962.             carry_count-- ;
  963.             carry_weight -= object[i][J_weight] ;
  964.             ++room[n][M_obj_cnt] ;
  965.             object[i][J_loc] = n; 
  966.             sw_done = TRUE ;
  967. /* set valuable switch if valuable object dropped in Ned's area */
  968.             if (object[i][J_value] > 0) {
  969.                 for (k = 22; k <= 41; k++) 
  970.                     if (k == n) sw_valuable = TRUE ;
  971.                 for (k = 144; k <= 146; k++) 
  972.                     if (k == n) sw_valuable = TRUE ;
  973.             }
  974.             continue ;
  975.         }
  976.         else {
  977. printf ("As the %s left your possession there was a bright \n",
  978.     vocab[object[i][J_parse_id]-1]);
  979. printf ("blue flash, followed by a low \"BOOM\" as it vaporized \n");
  980. printf ("into nonexistence. \n");
  981.             carry_count-- ;
  982.             carry_weight -= object[i][J_weight] ;
  983.             object[i][J_loc] = B_destroyed; 
  984.             return ;
  985.         }
  986.         }
  987.          if (object[i][J_loc] == B_unmade) continue ;
  988.     } /* end of the object requested block */
  989.     if ((!sw_done)&&sw_object) {
  990. printf("You do not possess a %s.\n", vocab[object[i][J_parse_id]-1]);
  991.         return ;
  992.     }
  993. } /* end of the object scan loop */
  994. if (sw_done) {
  995.     printf ("Done \n");
  996.     objlooker(n) ;
  997.     gleeper(n) ; 
  998. else 
  999. printf("I don't understand what it is I'm supposed to drop.\n") ;
  1000.  
  1001. return ;
  1002.  
  1003. /* cap insertion routine */
  1004. cap_in:
  1005. /* see if your are holding the dynamite or the cap */
  1006.     if ((object[O_cap][J_loc] != B_have)&&
  1007.         (object[O_dynamite][J_loc] != B_have)) {
  1008. printf("You bloody dill!  You have neither the dynamite or a ");
  1009. printf("blasting cap.\n") ;
  1010.         return ;
  1011.     }
  1012.     if (object[O_cap][J_loc] != B_have) {
  1013. printf("You've got the dynamite but you need a blasing cap.\n") ;
  1014.         return ;
  1015.     }
  1016.     if (object[O_dynamite][J_loc] != B_have) {
  1017. printf("You've got the blasting cap but you need some dynamite.\n") ;
  1018.         return ;
  1019.     }
  1020. /* transform the two objects into one */
  1021. printf("With some trepidation, you slide the blasting cap into\n");
  1022. printf("the dynamite.  What you are now holding is VERY dangerous.\n");
  1023.     object[O_cap][J_loc] = B_unmade ; 
  1024.     object[O_dynamite][J_type] = Z_alias ;
  1025.     carry_weight -= object[O_cap][J_weight] ;
  1026.     carry_count-- ;
  1027.  
  1028. } /* --- end of the "dropper" subroutine --- */
  1029.