home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!uwm.edu!ogicse!news.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v17i008: dinkum3 - australian text adventure game, V2.12, Part03/07
- Message-ID: <4519@master.CNA.TEK.COM>
- Date: 9 Feb 93 20:02:12 GMT
- Article-I.D.: master.4519
- Sender: news@master.CNA.TEK.COM
- Lines: 1372
- Approved: billr@saab.CNA.TEK.COM
- Xref: uunet comp.sources.games:1687
-
- Submitted-by: Gary Allen <gary@sun.mech.uq.oz.au>
- Posting-number: Volume 17, Issue 8
- Archive-name: dinkum3/Part03
- Supersedes: dinkum2: Volume 15, Issue 36-43
- Environment: Unix, DOS
-
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 3 (of 7)."
- # Contents: taker.c
- # Wrapped by billr@saab on Mon Feb 8 13:40:51 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'taker.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'taker.c'\"
- else
- echo shar: Extracting \"'taker.c'\" \(35391 characters\)
- sed "s/^X//" >'taker.c' <<'END_OF_FILE'
- X#define TAKER
- X#include "dink_sym.h"
- X#include "dink_glb.h"
- X
- X#if (PROTOTYPE)
- Xvoid taker(int n)
- X#else
- Xvoid taker(n)
- Xint n ;
- X#endif
- X/*********************************************************/
- X/* */
- X/* --- Object Taking Subroutine --- */
- X/* */
- X/* Program by Gary A. Allen, Jr. 15 January 1993 */
- X/* (c) Copyright 1993 by Gary A. Allen, Jr. */
- X/* */
- X/*********************************************************/
- X{
- Xregister int i, j ;
- Xint sw_done, gleep_local, ammo_flag ;
- XOBJECT_STRUCT *pnt ;
- X
- X#if (PROTOTYPE)
- Xvoid clip_in(int), clip_out(int), ender(int), eater(void) ;
- X#endif
- X
- X/* Alias in the object for the single word "take" command */
- Xif (tag[V_VERB_ONLY]) {
- X j = 0 ;
- X /* See if there is only one object on the floor */
- X pnt = object ;
- X for (i = 0; i < Objcnt; i++) {
- X if (n == pnt->Location) {
- X j++ ;
- X tag[pnt->ID] = TRUE ;
- X }
- X pnt++ ;
- X }
- X
- X if (room[n][M_gleep] != 0) {
- X j++ ;
- X tag[V_gleep] = TRUE ;
- X if (room[n][M_gleep] > 1) tag[V_PLURAL] = TRUE ;
- X }
- X
- X /* Complain if there isn't a single object on the ground */
- X if (j > 1) {
- X printf ("What exactly do you want me to take? \n");
- X return ;
- X }
- X}
- X
- Xammo_flag = F_no_clip ;
- Xif (tag[V_clip]) ammo_flag = F_normal_clip ;
- Xif (tag[V_org_clip]) ammo_flag = F_org_clip ;
- X
- X/* deal with special case of "orange clip" implied by its being alone */
- Xif (tag[V_clip]&&(Clip->Location != n)&&(Org_clip->Location == n)) {
- X tag[V_org_clip] = TRUE ;
- X tag[V_clip] = FALSE ;
- X if (V_clip == sent[1]) sent[1] = V_org_clip ;
- X}
- X
- X/* deal with the verb "attach" */
- Xif (verb == V_attach) {
- X if (tag[V_rifle]&&(ammo_flag != F_no_clip)) {
- X clip_in(ammo_flag) ;
- X return ;
- X }
- X if ((n != R_office_mang)&&(room[n][M_obj_cnt] <= 0)) {
- X printf ("There is nothing here that I can attach!\n");
- X return ;
- X }
- X}
- X
- X/* Check to see if player already has the item */
- Xpnt = object ;
- Xfor (i = 0; i < Objcnt; i++) {
- X if (pnt->ID == sent[1]) {
- X if (pnt->Location == B_have) {
- Xprintf ("You already have a %s in your possession.\n",vocab[sent[1]-1]);
- X return ;
- X }
- X else break ;
- X }
- X pnt++ ;
- X}
- X
- Xsw_done = FALSE ;
- X
- X/* Special case of "take pill" */
- Xif ((tag[V_pill])&&(Pills->Location == B_have)) {
- X eater() ;
- X return ;
- X}
- X
- X/* Reject "take" command when there is nothing to take */
- Xif ((n != R_office_mang)&&(verb != V_attach)&&(verb != V_remove)&&
- X (room[n][M_obj_cnt] <= 0)&&(room[n][M_gleep] == 0)&&
- X (!((n == R_gleep_tank)&&(Tank->Status > 0)))
- X &&(!room[n][M_unmov_obj])) {
- X printf ("There is nothing here that you can take! \n");
- X return ;
- X}
- X
- X/* player takes something from the gleep tank */
- Xif (tag[V_tank]) {
- X if (n != R_gleep_tank) {
- Xprintf("I see no gleep tank to take anything from. \n") ;
- X return ;
- X }
- Xprintf("\nYou climb up onto the edge of the gleep tank and reach\n");
- Xprintf("into the dark blue fluid. Suddenly the fluid begins a\n");
- Xprintf("furious boiling that instantly reduces your hand into\n") ;
- Xprintf("bleached white bones. The shock and pain disturbs your\n");
- Xprintf("balance and you fall into the horrible stuff!! There is\n");
- Xprintf("once again a furious boiling. Eventually the fluid stills\n");
- Xprintf("and becomes clear again. On the bottom of the tank can\n") ;
- Xprintf("be seen a white, clean, \"medical school quality\" human\n");
- Xprintf("skeleton.\n") ;
- X ender(F_died) ;
- X}
- X
- X/* Deal with "safe" taking errors */
- Xif ((tag[V_safe])&&(n != R_office_mang)) {
- X printf("There is no safe here.\n") ;
- X return ;
- X}
- X
- X/* gleep taking routine (must be after the gleep tank routine) */
- Xif (tag[V_gleep]) {
- Xif (!tag[V_safe]) {
- X
- X /* Count up the gleeps available in this room */
- X if ((n == R_office_mang)&&(Safe->Status == S_open))
- X gleep_local = gleep_safe ;
- X else gleep_local = 0 ;
- X gleep_local += room[n][M_gleep] ;
- X /* Gleeps in the tank aren't really accessible but the player */
- X /* may wish to suicide by taking them. */
- X if (n == R_gleep_tank) gleep_local += Tank->Status ;
- X
- X /* Leave if there are no gleeps */
- X if (gleep_local == 0) {
- X printf("There are no gleeps here to take!\n") ;
- X return ;
- X }
- X
- X /* Gleeps in the tank but not on the floor */
- X /* This is to lure player into suicide. */
- X if ((n == R_gleep_tank)&&(room[n][M_gleep] == 0)) {
- X printf("There are no gleeps on the floor but I see ") ;
- X if (Tank->Status == 1)
- X printf("a gleep in the gleep tank.\n");
- X else
- X printf("%d gleeps in the gleep tank.\n",Tank->Status) ;
- X return ;
- X }
- X
- X /* This block is for accessible gleeps in office with open safe */
- X if ((n == R_office_mang)&&(Safe->Status == S_open)
- X &&(Picture->Status == S_open)) {
- X if ((!tag[V_PLURAL])||(gleep_local == 1)) {
- X printf("Gleep taken. \n") ;
- X ++gleep_count ;
- X if (gleep_safe == 0) --room[n][M_gleep] ;
- X else --gleep_safe ;
- X }
- X else {
- X if (tag[V_NUMBER]) {
- X if (number_word == 0) {
- X printf("Don't be silly.\n") ;
- X return ;
- X }
- X if (number_word > gleep_local) {
- Xprintf("There aren't that many gleeps here!\n") ;
- X return ;
- X }
- X else {
- Xprintf("%d gleeps taken.\n", number_word) ;
- X gleep_count += number_word ;
- X gleep_local -= number_word ;
- X gleep_safe = gleep_local ;
- X room[n][M_gleep] = 0 ;
- X }
- X }
- X else {
- X printf("Gleeps taken. \n") ;
- X gleep_count += gleep_local ;
- X room[n][M_gleep] = 0 ;
- X gleep_safe = 0 ;
- X }
- X }
- X return ;
- X }
- X
- X /* This block is for accessible gleeps everywhere else */
- X /* or the office with the safe closed. */
- X if ((!tag[V_PLURAL])||(room[n][M_gleep] == 1)) {
- X printf("Gleep taken. \n") ;
- X ++gleep_count ;
- X --room[n][M_gleep] ;
- X }
- X else {
- X if (tag[V_NUMBER]) {
- X if (number_word == 0) {
- X printf("Don't be silly.\n") ;
- X return ;
- X }
- X if (number_word > room[n][M_gleep]) {
- Xprintf("There aren't that many gleeps here!\n") ;
- X return ;
- X }
- X else {
- X printf("%d gleeps taken.\n", number_word) ;
- X gleep_count += number_word ;
- X room[n][M_gleep] -= number_word ;
- X }
- X }
- X else {
- X printf("Gleeps taken. \n") ;
- X gleep_count += room[n][M_gleep] ;
- X room[n][M_gleep] = 0 ;
- X }
- X }
- X return ;
- X} /* sentence does NOT have the word "safe" block */
- Xelse {
- X if ((Picture->Status == S_open)&&(Safe->Status == S_open)) {
- X if (gleep_safe != 0) {
- X if (tag[V_PLURAL] && (gleep_safe > 1)) {
- X if (tag[V_NUMBER]) {
- X if (number_word == 0) {
- X printf("Don't be silly.\n") ;
- X return ;
- X }
- X if (number_word > gleep_safe) {
- Xprintf("There aren't that many gleeps in the safe!\n") ;
- X return ;
- X }
- X else {
- Xprintf("%d gleeps taken.\n", number_word) ;
- X gleep_count += number_word ;
- X gleep_safe -= number_word ;
- X }
- X }
- X else {
- X printf("Gleeps taken from safe. \n") ;
- X gleep_count += gleep_safe ;
- X gleep_safe = 0 ;
- X }
- X }
- X else {
- X printf("Gleep taken from safe. \n") ;
- X ++gleep_count ;
- X --gleep_safe ;
- X }
- X }
- X else printf("There are no gleeps in the safe!\n") ;
- X }
- X else {
- X if (tag[V_PLURAL])
- Xprintf("There is no open safe to take gleeps from.\n") ;
- X else
- Xprintf("There is no open safe to take the gleep from.\n") ;
- X }
- X return ;
- X} /* sentence does have the word "safe" block */
- X} /* end of the gleep taking block */
- X
- X
- X/* treat the verb "remove" in the context of "remove clip from rifle" */
- Xif (verb == V_remove) {
- X if ((!tag[V_safe])&&(ammo_flag != F_no_clip)) {
- X clip_out(n) ;
- X return ;
- X }
- X}
- X
- Xif (carry_count > 5) {
- Xprintf("I can't do it!\n") ;
- Xprintf("I'm holding so many things that I can't take anymore!\n") ;
- X return ;
- X}
- X
- Xif (carry_weight >= 800) {
- Xprintf("I can't do it!\n") ;
- Xprintf("This junk I'm carrying is too heavy! I can't carry anymore!\n");
- X return ;
- X}
- X
- X
- X/* find the object(s) in this room */
- Xpnt = object ;
- Xfor (i = 0; i < Objcnt; i++) {
- X
- X if ((carry_count > 5)||(carry_weight >= 800)) break ;
- X
- X /* See if the object is in the safe and was requested */
- X if ((n == R_office_mang)&&(pnt->Location == B_in_safe)
- X &&(tag[pnt->ID]||tag[V_all])
- X &&((!tag[V_treasure])||(pnt->Value > 0))) {
- X
- X if (Picture->Status != S_open) {
- X if (tag[V_all] || tag[V_treasure])
- X printf("I don't see a safe.\n") ;
- X else printf("You need to open the picture first.\n") ;
- X return ;
- X }
- X if (Safe->Status == S_open) {
- X pnt->Location = B_have;
- X carry_count++ ;
- X carry_weight += pnt->Weight ;
- X sw_done = TRUE ;
- X }
- X else {
- X printf("I can't do it because the safe is closed. \n") ;
- X return ;
- X }
- X }
- X
- X /* See if the object is in the room and was requested */
- X if ((pnt->Location == n)&&(tag[pnt->ID] || tag[V_all])
- X &&((!tag[V_treasure])||(pnt->Value > 0))) {
- X
- X /* Objects referred to in this block are not in the safe */
- X if (!tag[V_safe]) {
- X /* see if taking the object causes special action */
- X if (pnt->Type == Z_transform) {
- X switch(pnt->ID) {
- X /* ACME doormat */
- X case V_mat:
- Xprintf("As you lift up the dirty old doormat, you find half \n") ;
- Xprintf("hidden in the dust.... a large brass key. \n") ;
- X Mat->Type = Z_normal ;
- X carry_count++ ;
- X carry_weight += Mat->Weight;
- X Mat->Location = B_have;
- X Key->Location = R_office_entr ;
- X sw_done = TRUE ;
- X return ;
- X
- X /* Map of the ACME Mine */
- X case V_map:
- Xprintf("As you picked up the old map from the floor, most of it");
- Xprintf(" crumbled into \ndust leaving only one small piece. \n") ;
- X Map->Location = B_unmade ;
- X Map_frag->Location = B_have ;
- X carry_count++ ;
- X carry_weight += Map_frag->Weight ;
- X --room[n][M_obj_cnt] ;
- X sw_done = TRUE ;
- X return ;
- X }
- X } /* end of the special action block */
- X
- X /* see if an object on the floor can be taken */
- X if ((pnt->Type == Z_normal)||
- X (pnt->Type == Z_alias)) {
- X --room[n][M_obj_cnt] ;
- X carry_count++ ;
- X carry_weight += pnt->Weight ;
- X pnt->Location = B_have;
- X sw_done = TRUE ;
- X }
- X }
- X
- X /* see if this is an unmovable, nonacting object */
- X if ((pnt->Type == Z_unmovable) &&
- X (pnt->Location == n) && (!tag[V_all])) {
- X
- X switch(pnt->ID) {
- X case V_bulldust:
- Xprintf("The bulldust is so fine that it wafts away with a touch.\n") ;
- X return ;
- X
- X /* Silver gong */
- X case V_gong:
- Xprintf("The siver gong is about three metres in diameter and weighs at\n") ;
- Xprintf("least a ton! There is no way I could move it, let alone get\n") ;
- Xprintf("it through the tunnel!\n") ;
- X return ;
- X
- X /* Cockroach(es) */
- X case V_cockroach:
- Xprintf("I will not touch the filthy things!\n") ;
- X return ;
- X
- X /* Kangaroo(s) */
- X case V_kangaroo:
- Xprintf("I will not touch a dead maggoty kangaroo! ") ;
- Xprintf("The smell is bad enough!\n") ;
- X return ;
- X
- X case V_desk:
- Xprintf("The desk is of very solid construction and can not be moved.\n") ;
- X return ;
- X
- X case V_chart:
- Xprintf("The charts and production schedules are so old and brittle that\n") ;
- Xprintf("they'd fall apart the moment you touched them. Besides they're\n") ;
- Xprintf("useless and not worth taking.\n") ;
- X return ;
- X
- X case V_poster:
- Xprintf("I think this sort of poster is best left on the wall.\n") ;
- X return ;
- X
- X /* Spinifex(es) */
- X case V_spinifex:
- Xprintf("The thorns on the spinifex are large and nasty.\n") ;
- Xprintf("I'll just leave them to roll about.\n") ;
- X return ;
- X
- X /* Platypus Picture */
- X case V_picture:
- Xprintf("The picture can not be removed. It appears to be hinged ");
- Xprintf("to the wall.\n");
- X return ;
- X
- X /* Safe */
- X case V_safe:
- X if (sw_done) break ;
- Xprintf("The safe is set in a concrete wall. I can see no way\n") ;
- Xprintf("the safe can be removed without destroying the wall.\n") ;
- X return ;
- X
- X /* Building door */
- X case V_door:
- X if (Door->Status == S_kicked)
- Xprintf("The door is too heavy and bulky to move.\n") ;
- X else {
- Xprintf("The door is attached to the building with some heavy duty\n") ;
- Xprintf("hinges which I can't remove.\n") ;
- X }
- X return ;
- X
- X /* "Other" non-movable objects */
- X default:
- X printf("I don't think I can move that.\n") ;
- X return ;
- X } /* end of switch block */
- X } /* end of unmovable object block */
- X
- X }
- X pnt++ ;
- X} /* end of the object scan loop */
- X
- X/* take all gleeps if any */
- Xif (tag[V_all]&&(!tag[V_treasure])) {
- X if (room[n][M_gleep] > 0) {
- X gleep_count += room[n][M_gleep] ;
- X room[n][M_gleep] = 0 ;
- X sw_done = TRUE ;
- X }
- X if ((gleep_safe != 0)&&(n == R_office_mang)
- X &&(Safe->Status == S_open)) {
- X gleep_count += gleep_safe ;
- X gleep_safe = 0 ;
- X sw_done = TRUE ;
- X }
- X}
- X
- X/* Announce the "take" was successful */
- Xif (sw_done) {
- X if (((carry_count > 5)||(carry_weight >= 800))&&(tag[V_all]))
- X printf("You've taken as much as you can.\n") ;
- X else printf ("Done \n");
- X}
- X/* --else-- announce the "take" was unsuccessful */
- Xelse {
- X if (tag[V_all]) printf("I see nothing which I can take.\n") ;
- X else {
- X if (tag[V_VERB_ONLY])
- X printf("What exactly should I take?\n") ;
- X else {
- X printf ("I don't see a") ;
- X if (tag[V_PLURAL]) printf("ny") ;
- X printf (" %s around here. \n",vocab[sent[1]-1]);
- X }
- X }
- X}
- Xreturn ;
- X
- X} /* --- end of the "taker" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid loader(void)
- X#else
- Xvoid loader()
- X#endif
- X/*********************************************************/
- X/* */
- X/* --- Rifle Loading Subroutine --- */
- X/* */
- X/* Program by Gary A. Allen, Jr. 29 April 1990 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/*********************************************************/
- X{
- X
- Xint ammo_flag ;
- X
- X#if (PROTOTYPE)
- Xvoid clip_in(int) ;
- X#endif
- X
- X/* Reject single verb load command */
- Xif (tag[V_VERB_ONLY]) {
- Xprintf("What exactly do you want me to load?\n") ;
- X return ;
- X}
- Xif (!tag[V_rifle]) {
- Xprintf("I don't know how I could load that.\n") ;
- X return ;
- X}
- X
- X/* Deal with implied clip type command */
- Xif (!tag[V_clip]) {
- X if ((Clip->Location != B_have)&&
- X (Org_clip->Location == B_have)) ammo_flag = F_org_clip ;
- X
- X /* the case were there is no clip is found in clip_in */
- X if ((Clip->Location == B_have)&&
- X (Org_clip->Location != B_have)) ammo_flag = F_normal_clip ;
- X}
- X
- X/* Deal with specific "load [orange] clip" command */
- Xelse {
- X if (tag[V_orange]) {
- X if (Org_clip->Location == B_have) ammo_flag = F_org_clip ;
- X else {
- Xprintf("You don't possess the orange ammunition clip.\n") ;
- X return ;
- X }
- X }
- X else {
- X if (Clip->Location == B_have) ammo_flag = F_normal_clip ;
- X
- X /* Assume "load clip" with no normal clip implies orange clip */
- X else {
- X if (Org_clip->Location == B_have)
- X ammo_flag = F_org_clip ;
- X else{
- Xprintf("You don't possess an ammunition clip to load.\n") ;
- X return ;
- X }
- X }
- X }
- X}
- X
- Xclip_in(ammo_flag) ;
- X} /* --- end of the "loader" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid unloader(int n)
- X#else
- Xvoid unloader(n)
- Xint n ;
- X#endif
- X/*********************************************************/
- X/* */
- X/* --- Rifle Unloading Subroutine --- */
- X/* */
- X/* Program by Gary A. Allen, Jr. 29 April 1990 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/*********************************************************/
- X{
- X#if (PROTOTYPE)
- Xvoid clip_out(int) ;
- X#endif
- X
- X/* Reject single verb load command */
- Xif (tag[V_VERB_ONLY]) {
- Xprintf("What exactly do you want me to unload?\n") ;
- X return ;
- X}
- Xif (!tag[V_rifle]) {
- Xprintf("I don't know how I could unload that.\n") ;
- X return ;
- X}
- Xclip_out(n) ;
- X} /* --- end of the "unloader" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid dropper(int n)
- X#else
- Xvoid dropper(n)
- Xint n ;
- X#endif
- X/*********************************************************/
- X/* */
- X/* --- Object Dropping Subroutine --- */
- X/* */
- X/* Program by Gary A. Allen, Jr. 21 May 1990 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/*********************************************************/
- X{
- Xregister int i, k ;
- X
- Xint sw_possess, sw_done, ammo_flag, sw_object, i_10, i_fract ;
- Xint sw_found ;
- X
- XOBJECT_STRUCT *pnt ;
- X
- X#if (PROTOTYPE)
- Xvoid clip_in(int), clip_out(int), boom(void) ;
- Xvoid objlooker(int), gleeper(int), unlocker(int) ;
- Xvoid cap_drop(void), dynamite_drop(void), destroy_all(void) ;
- Xvoid dropped_gun(void) ;
- X#endif
- X
- X/* respond to "verb only" command */
- Xif (tag[V_VERB_ONLY]) {
- X printf ("You'll have to be more specific. \n");
- X return ;
- X}
- X
- X/* deal with special case of "orange clip" implied by its being alone */
- Xif (tag[V_clip]&&(Clip->Location != B_have)
- X &&(clip_flag != F_normal_clip)
- X &&((Org_clip->Location == B_have)||(clip_flag == F_org_clip))) {
- X tag[V_org_clip] = TRUE ;
- X tag[V_clip] = FALSE ;
- X if (V_clip == sent[1]) sent[1] = V_org_clip ;
- X}
- X
- Xammo_flag = F_no_clip ;
- Xif (tag[V_clip]) ammo_flag = F_normal_clip ;
- Xif (tag[V_org_clip]) ammo_flag = F_org_clip ;
- X
- X/* deal with special cases of the verbs */
- Xswitch(verb) {
- Xcase V_put:
- X /* special case of putting (destroying) an object in water */
- X if (tag[V_tank]||tag[V_gleep]||tag[V_safe]||
- X tag[V_river]||tag[V_billabong]||tag[V_stream]) break ;
- X
- X /* special case of "put key in door(lock)" */
- X if (tag[V_key] && tag[V_door]) {
- X unlocker(n) ;
- X return ;
- X }
- X
- X if (!tag[V_cap]) {
- X if ((!tag[V_rifle])&&(ammo_flag != F_no_clip)) {
- X printf("What am I to put the clip into? \n") ;
- X return ;
- X }
- X if (tag[V_rifle]&&(ammo_flag != F_no_clip))
- X clip_in(ammo_flag) ;
- X else
- Xprintf("I don't understand what this is to be put into. \n") ;
- X return ;
- X }
- X
- Xcase V_insert:
- X if (tag[V_safe]) break ;
- X if (ammo_flag != F_no_clip) {
- X if (!tag[V_rifle]) {
- Xprintf("What am I to insert the clip into? \n") ;
- X }
- X else {
- X clip_in(ammo_flag) ;
- X }
- X return ;
- X }
- X if (tag[V_cap]) {
- X if (!tag[V_dynamite]) {
- Xprintf("I see no reason why I should put a blasting cap into that.\n") ;
- X return ;
- X }
- X /* Cap insertion routine */
- X else {
- X /* see if your are holding the dynamite or the cap */
- X if ((Cap->Location != B_have)&&
- X (Dynamite->Location != B_have)) {
- Xprintf("You bloody dill! You have neither the dynamite or a ");
- Xprintf("blasting cap.\n") ;
- X return ;
- X }
- X if (Cap->Location != B_have) {
- Xprintf("You've got the dynamite but you need a blasing cap.\n") ;
- X return ;
- X }
- X if (Dynamite->Location != B_have) {
- Xprintf("You've got the blasting cap but you need some dynamite.\n") ;
- X return ;
- X }
- X/* transform the two objects into one */
- Xprintf("With some trepidation, you slide the blasting cap into\n");
- Xprintf("the dynamite. What you are now holding is VERY dangerous.\n");
- X Cap->Location = B_unmade ;
- X Dynamite->Type = Z_alias ;
- X carry_weight -= Cap->Weight ;
- X carry_count-- ;
- X return ;
- X } /* end of the cap insertion block */
- X }
- Xprintf("I can think of some interesing places to insert this. \n") ;
- Xprintf("However I shall not reduce myself to such vulgarity.\n");
- X return ;
- X
- Xcase V_eject:
- X/* Command "eject clip" ejects clip from rifle no matter what type*/
- X if ((ammo_flag == F_normal_clip)&&(clip_flag == F_org_clip))
- X ammo_flag = F_org_clip ;
- Xcase V_drop:
- X if (((ammo_flag == F_org_clip)&&(clip_flag == F_org_clip))||
- X ((ammo_flag == F_normal_clip)&&(clip_flag == F_normal_clip))) {
- X clip_out(n) ;
- X return ;
- X }
- X break ;
- X
- X} /* end of switch */
- X
- X/* Deal with "drop" when player has no objects */
- Xif (tag[V_all]&&(carry_count == 0)&&(gleep_count == 0)) {
- X printf("You dill! You have nothing to drop!\n") ;
- X return ;
- X}
- X
- X/* deal with "drop in safe ..." errors */
- Xif (tag[V_safe]) {
- X /* see if this is the managers office */
- X if (n != R_office_mang) {
- X printf("There is no safe here! \n");
- X return ;
- X }
- X
- X /* See if the picture and safe are open */
- X if ((Picture->Status != S_open) || (Safe->Status != S_open)) {
- X printf ("I don't see an open safe to put anything into.\n") ;
- X return ;
- X }
- X}
- X
- X/* gleep droping routine */
- Xif (tag[V_gleep]||tag[V_tank]) {
- X /* drop gleeps in a normal way */
- X if (!tag[V_tank]) {
- X if (gleep_count == 0) {
- X printf("You have no gleeps to drop! \n") ;
- X return ;
- X }
- X if ((!tag[V_PLURAL])||(gleep_count == 1)) {
- X if (tag[V_safe]) {
- X printf("Gleep put into safe.\n") ;
- X ++gleep_safe ;
- X --gleep_count ;
- X }
- X else {
- X printf("Gleep dropped. \n") ;
- X --gleep_count ;
- X ++room[n][M_gleep] ;
- X }
- X }
- X else {
- X if (tag[V_safe]) {
- X if (tag[V_NUMBER]) {
- X if (number_word == 0) {
- X printf("Don't be silly.\n") ;
- X return ;
- X }
- X if (number_word > gleep_count) {
- Xprintf("I don't have that many gleeps!\n") ;
- X return ;
- X }
- X else {
- Xprintf("You put %d gleeps into the safe.\n", number_word) ;
- X gleep_safe += number_word ;
- X gleep_count -= number_word ;
- X }
- X }
- X else {
- X printf("Gleeps put into safe.\n") ;
- X gleep_safe += gleep_count ;
- X gleep_count = 0 ;
- X }
- X }
- X else {
- X if (tag[V_NUMBER]) {
- X if (number_word == 0) {
- X printf("Don't be silly.\n") ;
- X return ;
- X }
- X if (number_word > gleep_count) {
- Xprintf("I don't have that many gleeps!\n") ;
- X return ;
- X }
- X else {
- Xprintf("You drop %d gleeps.\n", number_word) ;
- X room[n][M_gleep] += number_word ;
- X gleep_count -= number_word ;
- X }
- X }
- X else {
- X printf("Gleeps dropped. \n") ;
- X room[n][M_gleep] += gleep_count ;
- X gleep_count = 0 ;
- X }
- X }
- X }
- X gleep_drop = TRUE ;
- X return ;
- X }
- X
- X /* drop objects(including gleeps) into a gleep tank */
- X else {
- X sw_found = FALSE ;
- X if (n != R_gleep_tank) {
- X printf("I don't see a gleep tank here. \n") ;
- X return ;
- X }
- X if (tag[V_gleep]) {
- X if (gleep_count <= 0) {
- Xprintf("You have no gleeps to put in the tank. \n") ;
- X return ;
- X }
- X sw_found = TRUE ;
- X if ((!tag[V_PLURAL])||(gleep_count == 1)) {
- Xprintf("Your gleep falls into the tank with a \"plonk\".\n") ;
- X ++Tank->Status ;
- X --gleep_count ;
- X }
- X if (tag[V_PLURAL]) {
- X if (tag[V_NUMBER]) {
- X if (number_word == 0) {
- X printf("Don't be silly.\n") ;
- X return ;
- X }
- X if (number_word > gleep_count) {
- Xprintf("I don't have that many gleeps!\n") ;
- X return ;
- X }
- X else {
- Xprintf("You drop %d gleeps into the gleep tank.\n", number_word) ;
- X Tank->Status += number_word ;
- X gleep_count -= number_word ;
- X }
- X }
- X else {
- Xprintf("Your gleeps fall into the tank causing a splash.\n") ;
- X Tank->Status += gleep_count ;
- X gleep_count = 0 ;
- X }
- X }
- X } /* end of the tag[V_gleep] block */
- X
- X /* Drop non-gleeps into the tank */
- X /* the "drop all" routine */
- X if (tag[V_all]) {
- X sw_possess = FALSE ;
- X pnt = object ;
- X for (i = 0; i < Objcnt; i++) {
- X if ((pnt->Location == B_have)&&
- X ((!tag[V_treasure])||
- X (pnt->Value > 0))) {
- X sw_possess = TRUE ;
- X pnt->Location = B_destroyed;
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X }
- X pnt++ ;
- X }
- X if (gleep_count == 0) {
- X if (sw_possess) {
- Xprintf("You dump everything into the gleep tank. There is a furious\n");
- Xprintf("bubbling as the corrosive fluid of the tank turns the\n");
- Xprintf("objects into NOTHING.\n") ;
- X }
- X else
- Xprintf("You've got nothing to throw into the tank.\n") ;
- X }
- X else {
- X if (sw_possess) {
- Xprintf("You fling everything into the gleep tank. The gleep");
- X if (gleep_count > 1) {
- Xprintf("s\nsplash into the tank and settle to the bottom of the\n") ;
- X }
- X else {
- Xprintf("\nplonks into the tank and settles to the bottom of the\n") ;
- X }
- Xprintf("tank. However the other objects begin to dissolve the\n");
- Xprintf("moment the tank's fluid touches them. Time passes and\n");
- Xprintf("the objects dissolve into NOTHING.\n") ;
- X }
- X /* you possess no non-gleeps */
- X else {
- X if (gleep_count == 1)
- Xprintf("Your gleep falls into the tank with a \"plonk\".\n") ;
- X else
- Xprintf("Your gleeps fall into the tank causing a splash.\n") ;
- X }
- X Tank->Status += gleep_count ;
- X gleep_count = 0 ;
- X }
- X return ;
- X } /* end of the "drop all" if block */
- X
- X /* Individual non-gleeps are dropped into the tank */
- X
- X /* see if your are holding the object(s) */
- X pnt = object ;
- X for (i = 0; i < Objcnt; i++) {
- X if (tag[pnt->ID] && (pnt->ID != V_tank)) {
- X if (pnt->Location == B_have) {
- Xprintf ("You fling the %s into the gleep tank. As soon as it\n",
- X vocab[pnt->ID - 1]);
- Xprintf ("touched the tank's fluid there was a furious effervescence\n");
- Xprintf ("as it began to dissolve. With the passage of time, the\n") ;
- Xprintf ("fluid stills and there is NOTHING left.\n") ;
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X pnt->Location = B_destroyed;
- X }
- X else {
- Xprintf("You don't have a %s to toss into the gleep tank.\n",
- X vocab[pnt->ID - 1]);
- X }
- X return ;
- X }
- X pnt++ ;
- X } /* object scan "for" loop */
- X
- X /* deal with garbage object to drop */
- Xif (!sw_found) printf("I don't understand what you want me to drop.\n") ;
- X return ;
- X }
- X}
- X
- Xsw_done = FALSE ;
- X
- X/* the "drop all" routine */
- Xif (tag[V_all]) {
- X
- X /* Deal with throwing stuff into water */
- X if(tag[V_stream]) {
- X if (n == R_stream) {
- Xprintf("You fling everything into the stream.\n");
- X destroy_all() ;
- X return ;
- X }
- X else
- Xprintf("I see no stream to toss stuff into.\n") ;
- X return ;
- X }
- X if(tag[V_billabong]) {
- X if ((n == R_stream)||(n == R_slime)||
- X (n == R_billabong)) {
- Xprintf("You fling everything into the billabong.\n");
- X destroy_all() ;
- X return ;
- X }
- X else
- Xprintf("I see no billabong to toss stuff into.\n") ;
- X return ;
- X }
- X if(tag[V_river]) {
- X if ((n == R_dike)||(n == R_river_edge)||
- X (n == R_river_exit)) {
- Xprintf("You fling everything into the river.\n");
- X destroy_all() ;
- X return ;
- X }
- X else
- Xprintf("I see no river to toss stuff into.\n") ;
- X return ;
- X }
- X
- X if (!tag[V_safe]) {
- X/* normal drop */
- Xif (room[n][M_rm_type] != T_looping) {
- X /* normal room */
- X pnt = object ;
- X for (i = 0; i < Objcnt; i++) {
- X if ((pnt->Location == B_have)&&
- X ((!tag[V_treasure]) || (pnt->Value > 0))) {
- X
- X sw_done = TRUE ;
- X
- X /* see if the blasting cap was hard dropped */
- X if ((pnt->ID == V_cap)&&(verb != V_slow_drop)) {
- X cap_drop() ;
- X return ;
- X }
- X
- X/* see if the dynamite with blasting cap was hard dropped */
- X if ((pnt->ID == V_dynamite)&&(Dynamite->Type == Z_alias)
- X &&(verb != V_slow_drop)) dynamite_drop() ;
- X ++room[n][M_obj_cnt] ;
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X pnt->Location = n;
- X/* set valuable switch if valuable object dropped in Ned's area */
- X if (pnt->Value > 0) {
- X for (k = 22; k <= 41; k++)
- X if (k == n) sw_valuable = TRUE;
- X for (k = 144; k <= 146; k++)
- X if (k == n) sw_valuable = TRUE;
- X }
- X }
- X pnt++ ;
- X}
- X /* drop all gleeps */
- X if ((gleep_count > 0) &&
- X (!tag[V_treasure])) {
- X room[n][M_gleep] += gleep_count ;
- X gleep_count = 0 ;
- X sw_done = TRUE ;
- X gleep_drop = TRUE ;
- X }
- X
- X if (sw_done) {
- X printf ("Done\n");
- X objlooker(n) ;
- X gleeper(n) ;
- X }
- X else printf("Don't have it to drop.\n") ;
- X return ;
- X }
- X /* object destroyer room */
- X else {
- X /* Code assumes that player has something to drop */
- Xprintf ("You dropped everything you had in a heap, which \n");
- Xprintf ("promptly vaporized into a bright blue flash followed \n");
- Xprintf ("by a low \"BOOM\". \n") ;
- Xprintf (" --- You've blown it Bozo!! ---\n") ;
- X destroy_all() ;
- X return ;
- X }
- X }
- X /* "drop all into the safe" routine */
- X else {
- X pnt = object ;
- X for (i = 0; i < Objcnt; i++) {
- X if ((pnt->Location == B_have) &&
- X ((!tag[V_treasure])||
- X (pnt->Value > 0))) {
- X pnt->Location = B_in_safe ;
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X sw_done = TRUE ;
- X }
- X pnt++ ;
- X }
- X if (!tag[V_treasure]) {
- X gleep_safe += gleep_count ;
- X gleep_count = 0 ;
- X sw_done = TRUE ;
- X }
- X if (sw_done) printf ("Done \n");
- X else printf("You don't have it to put in the safe!\n") ;
- X return ;
- X }
- X}
- X
- X/* see if your are holding the object(s) */
- Xfor (i = 0; i < Objcnt; i++) {
- X if (i == 0) pnt = object ;
- X else pnt++ ;
- X sw_object = FALSE ;
- X if (tag[pnt->ID]) {
- X sw_object = TRUE ;
- X if (pnt->Location == B_have) {
- X /* Safe storage routine */
- X if (tag[V_safe]) {
- X pnt->Location = B_in_safe ;
- Xprintf ("The %s is now inside the safe. \n",
- X vocab[pnt->ID - 1]);
- X sw_done = TRUE ;
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X continue ;
- X }
- X
- X /* Single 'drop' routine */
- X if (tag[V_river]||tag[V_billabong]||
- X tag[V_stream]) {
- X /* The object is to be dropped in water */
- X if(tag[V_stream]) {
- X if (n == R_stream) {
- Xprintf("You fling the %s into the stream.\n",
- X vocab[pnt->ID - 1]);
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X pnt->Location = B_destroyed;
- X return ;
- X }
- X else
- Xprintf("I see no stream to toss it into.\n") ;
- X return ;
- X }
- X if(tag[V_billabong]) {
- X if ((n == R_stream)||
- X (n == R_slime)||(n == R_billabong)) {
- Xprintf("You fling the %s into the billabong.\n",
- X vocab[pnt->ID - 1]);
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X pnt->Location = B_destroyed;
- X return ;
- X }
- X else
- Xprintf("I see no billabong to toss it into.\n") ;
- X return ;
- X }
- X if(tag[V_river]) {
- X if ((n == R_dike)||(n == R_river_edge)||
- X (n == R_river_exit)) {
- Xprintf("You fling the %s into the river.\n",
- X vocab[pnt->ID - 1]);
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X pnt->Location = B_destroyed;
- X return ;
- X }
- X else
- Xprintf("I see no river to toss it into.\n") ;
- X return ;
- X }
- X }
- X /* Normal Drop */
- X else if (room[n][M_rm_type] != T_looping) {
- X if ((pnt->ID == V_cap)&&(verb != V_slow_drop)) {
- X cap_drop() ;
- X return ;
- X }
- X if ((pnt->ID == V_dynamite)&&(verb != V_slow_drop)&&
- X (Dynamite->Type == Z_alias)) dynamite_drop();
- X
- X/* If the he rifle is dropped. See if it kills the player */
- Xif (pnt->ID == V_rifle) {
- X if ((clip_flag != F_no_clip) &&
- X(Rifle->Status > 0)) switch(rifle_flag) {
- X case F_safety:
- X break ;
- X
- X case F_single:
- X printf("\nBam!\n") ;
- X dropped_gun() ;
- X
- X case F_triple:
- X printf("\n") ;
- X if (Rifle->Status >= 3) {
- X printf("Bam! Bam! Bam! \n\n") ;
- X }
- X else {
- X for (k = 1; k <= Rifle->Status; k++)
- X printf("Bam! ") ;
- X }
- X dropped_gun() ;
- X
- X case F_auto:
- X printf("\n") ;
- X if (Rifle->Status >= 30) {
- X for (k = 1; k <= 3; k++)
- Xprintf("Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! \n") ;
- X }
- X else {
- X i_10 = Rifle->Status / 10 ;
- X i_fract = Rifle->Status - (i_10 * 10) ;
- X for (k = 1; k <= i_10; k++)
- Xprintf("Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! \n") ;
- X for (k = 1; k <= i_fract; k++)
- X printf("Bam! ") ;
- X }
- X dropped_gun() ;
- X } /* end of the switch block */
- X} /* end of "drop rifle" block */
- X
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X ++room[n][M_obj_cnt] ;
- X pnt->Location = n;
- X sw_done = TRUE ;
- X/* set valuable switch if valuable object dropped in Ned's area */
- X if (pnt->Value > 0) {
- X for (k = 22; k <= 41; k++)
- X if (k == n) sw_valuable = TRUE ;
- X for (k = 144; k <= 146; k++)
- X if (k == n) sw_valuable = TRUE ;
- X }
- X continue ;
- X }
- X else {
- Xprintf ("As the %s left your possession there was a bright \n",
- X vocab[pnt->ID - 1]);
- Xprintf ("blue flash, followed by a low \"BOOM\" as it vaporized \n");
- Xprintf ("into nonexistence. \n");
- X carry_count-- ;
- X carry_weight -= pnt->Weight ;
- X pnt->Location = B_destroyed;
- X return ;
- X }
- X }
- X if (pnt->Location == B_unmade) continue ;
- X } /* end of the object requested block */
- X if ((!sw_done)&&sw_object) {
- Xprintf("You do not possess a %s.\n", vocab[pnt->ID - 1]);
- X return ;
- X }
- X} /* end of the object scan loop */
- Xif (sw_done) {
- X printf ("Done \n");
- X objlooker(n) ;
- X gleeper(n) ;
- X}
- Xelse
- Xprintf("I don't understand what it is I'm supposed to drop.\n") ;
- X
- Xreturn ;
- X
- X
- X} /* --- end of the "dropper" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid cap_drop(void)
- X#else
- Xvoid cap_drop()
- X#endif
- X/*********************************************************/
- X/* */
- X/* --- Blasing Cap Dropping Subroutine --- */
- X/* */
- X/* Program by Gary A. Allen, Jr. 6 December 1992 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/*********************************************************/
- X{
- Xprintf("Bang!! The blasting cap you were carrying detonated when\n") ;
- Xprintf("it hit the ground. Fortunately no damage was caused.\n") ;
- XCap->Location = B_destroyed;
- Xcarry_count-- ;
- Xcarry_weight -= Cap->Weight ;
- X
- X} /* --- end of the "cap_drop" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid dynamite_drop(void)
- X#else
- Xvoid dynamite_drop()
- X#endif
- X/*********************************************************/
- X/* */
- X/* --- Dynamite Dropping Subroutine --- */
- X/* */
- X/* Program by Gary A. Allen, Jr. 6 December 1992 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/*********************************************************/
- X{
- X#if (PROTOTYPE)
- Xvoid ender(int), boom(void) ;
- X#endif
- X
- Xboom() ;
- Xprintf("Dropping a stick of dynamite with a blasting cap in it\n");
- Xprintf("ranks high as one of the dumbest things a person can do.\n") ;
- Xprintf("Needless to say you were blown to bits. Next time drop\n") ;
- Xprintf("the dynamite slowly or gently.\n") ;
- Xender(F_died) ;
- X
- X} /* --- end of the "dynamite_drop" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid destroy_all(void)
- X#else
- Xvoid destroy_all()
- X#endif
- X/*********************************************************/
- X/* */
- X/* --- Destroy Everything Held Subroutine --- */
- X/* */
- X/* Program by Gary A. Allen, Jr. 6 December 1992 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/*********************************************************/
- X{
- Xregister int i ;
- XOBJECT_STRUCT *pnt ;
- X
- Xgleep_count = 0 ;
- Xcarry_count = 0 ;
- Xcarry_weight = 0 ;
- Xpnt = object ;
- Xfor (i = 0; i < Objcnt; i++) {
- X if (pnt->Location == B_have) pnt->Location = B_destroyed;
- X pnt++ ;
- X}
- X} /* --- end of the "destroy_all" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid dropped_gun(void)
- X#else
- Xvoid dropped_gun()
- X#endif
- X/*********************************************************/
- X/* */
- X/* --- Player Suicides by Dropping Armed Rifle --- */
- X/* */
- X/* Program by Gary A. Allen, Jr. 31 December 1992 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/*********************************************************/
- X{
- X#if (PROTOTYPE)
- Xvoid ender(int) ;
- X#endif
- X
- Xprintf("\n") ;
- Xprintf("Dropping a loaded and armed automatic rifle is a stupid way\n");
- Xif ((Rifle->Status == 1) || (rifle_flag == F_single)) {
- Xprintf("to commit suicide. Needless to say you were hit by the\n") ;
- Xprintf("bullet after the rifle went off.\n") ;
- X}
- Xelse {
- Xprintf("to commit suicide. The bullets shot from the rifle fly\n") ;
- Xprintf("around. One of them bounces back and hits you!\n") ;
- X}
- Xender(F_died) ;
- X} /* --- end of the "dropped_gun" subroutine --- */
- END_OF_FILE
- if test 35391 -ne `wc -c <'taker.c'`; then
- echo shar: \"'taker.c'\" unpacked with wrong size!
- fi
- # end of 'taker.c'
- fi
- echo shar: End of archive 3 \(of 7\).
- cp /dev/null ark3isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 7 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-