home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!news.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v17i010: dinkum3 - australian text adventure game, V2.12, Part05/07
- Message-ID: <4521@master.CNA.TEK.COM>
- Date: 9 Feb 93 20:02:35 GMT
- Article-I.D.: master.4521
- Sender: news@master.CNA.TEK.COM
- Lines: 1592
- Approved: billr@saab.CNA.TEK.COM
- Xref: uunet comp.sources.games:1689
-
- Submitted-by: Gary Allen <gary@sun.mech.uq.oz.au>
- Posting-number: Volume 17, Issue 10
- Archive-name: dinkum3/Part05
- 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 5 (of 7)."
- # Contents: actor.c monster.c
- # Wrapped by billr@saab on Mon Feb 8 13:40:51 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'actor.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'actor.c'\"
- else
- echo shar: Extracting \"'actor.c'\" \(19048 characters\)
- sed "s/^X//" >'actor.c' <<'END_OF_FILE'
- X#define ACTOR
- X#include "dink_sym.h"
- X#include "dink_glb.h"
- X
- X#if (PROTOTYPE)
- Xvoid actor(int n)
- X#else
- Xvoid actor(n)
- Xint n ;
- X#endif
- X/********************************************************************/
- X/* */
- X/* Software by Gary A. Allen, Jr. 12 December 1992, Version: Mk 1.3 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- Xregister int i, j ;
- Xint sw_found ;
- Xstatic int sw_door_kick = FALSE ;
- X
- XOBJECT_STRUCT *pnt, *point ;
- X
- X#if (PROTOTYPE)
- Xvoid objector(OBJECT_STRUCT*) ;
- X#endif
- X
- Xswitch(n) {
- X
- X/* mine elevator */
- Xcase R_lift_entr:
- X switch(Lift_door->Status) {
- X case S_closed:
- X printf("The lift doors are closed and the lift call button ");
- X printf("is not glowing. It \nseems the electrical power has ");
- X printf("been turned off at the main switch. \n");
- X break ;
- X
- X case S_flashing:
- X printf("The lift doors are closed. However the call button");
- X printf(" is flashing. There \n") ;
- X printf("is the sound of electrical equipment ");
- X printf("humming within the mine lift. \n");
- X break ;
- X
- X case S_open:
- X printf("The lift doors are standing open. \n");
- X break ;
- X }
- X break;
- X
- X/* office building door */
- Xcase R_office_entr:
- X switch(Door->Status) {
- X case S_open:
- X printf(" --- The office front door is open. --- \n");
- X break;
- X
- X case S_kicked:
- X if (!sw_door_kick) {
- Xprintf("The lock of the front door has been shot at several times.\n");
- Xprintf("The door itself has been kicked in and is broken off at\n") ;
- Xprintf("the hinges. The passage way is free to enter.\n");
- X sw_door_kick = TRUE ;
- X }
- X else {
- Xprintf("The front door of the office has been kicked in. \n") ;
- X }
- X break ;
- X
- X default:
- Xprintf("The office has a front door with a sun faded sign \n");
- Xprintf("upon which is written: \"Sorry, We are CLOSED\". \n");
- Xprintf(" --- The office door is shut. --- \n");
- X break ;
- X }
- X break ;
- X
- X/* Site Managers Office */
- Xcase R_office_mang:
- X if (Picture->Status == S_closed) {
- Xprintf("On the wall is a picture of a platypus wearing a hat with");
- X printf(" corks \ndangling from the hat's rim.\n");
- X break;
- X }
- X if ((Safe->Status != S_open)&&(Picture->Status == S_open)) {
- Xprintf("Before you is a picture hinged to the wall that has been ");
- Xprintf("swung \nopen revealing a closed combination dial wall safe.\n");
- X break;
- X }
- X if ((Safe->Status == S_open)&&(Picture->Status == S_open)) {
- Xprintf("Before you is a picture hinged to the wall that has been");
- Xprintf(" swung \nout revealing a wall safe with an open door.\n");
- X sw_found = FALSE ;
- X pnt = object ;
- X for (i = 0; i < Objcnt; i++) {
- X if (pnt->Location == B_in_safe) {
- X sw_found = TRUE ;
- Xprintf ("You see the following inside the safe: \n");
- X point = object ;
- X for (j = 0; j < Objcnt; j++) {
- X if (point->Location == B_in_safe) {
- X printf (" ");
- X objector(point) ;
- X printf("\n") ;
- X }
- X point++ ;
- X }
- X if (gleep_safe != 0) {
- X printf (" ");
- X if (gleep_safe == 1)
- X printf("one gleep\n") ;
- X else printf("%d gleeps\n",gleep_safe) ;
- X }
- X break;
- X }
- X pnt++ ;
- X }
- X if (sw_found) break ;
- X if (gleep_safe != 0) {
- Xprintf("There is nothing in the safe except ") ;
- X if (gleep_safe == 1)
- X printf("a single gleep.\n") ;
- X else
- X printf("%d gleeps.\n",gleep_safe) ;
- X break ;
- X }
- X printf("---The safe is empty.--- \n");
- X break ;
- X } /* end of the "safe open" block */
- X
- X/* store room */
- Xcase R_store_room:
- X printf("There is a 1500 Volt circuit breaker box on the wall");
- X if (Circuit_breaker->Status)
- Xprintf(" which has \na switch set in the \"on\" position. \n");
- X else
- Xprintf(" which has \na switch set in the \"off\" position. \n");
- X break;
- X
- X/* lift compartment */
- Xcase R_lift_inside:
- X printf("The level button with the number ");
- X switch(Lift->Status) {
- X case L0:
- X printf("zero");
- X break ;
- X case L49:
- X printf("forty-nine");
- X break ;
- X case L67:
- X printf("sixty-seven");
- X break ;
- X case L82:
- X printf("eighty-two");
- X break ;
- X } /* end of the Lift->Status "switch" block */
- X printf(" is flashing. \n");
- X break;
- X
- X} /* end of the "switch" block */
- X} /* --- end of subroutine "actor"--- */
- X
- X#if (PROTOTYPE)
- Xvoid objector(OBJECT_STRUCT *pnt)
- X#else
- Xvoid objector(pnt)
- XOBJECT_STRUCT *pnt ;
- X#endif
- X{
- X/* Deal with transformed objects */
- Xif (pnt->Type == Z_alias) {
- X if (pnt->ID == V_rifle) {
- Xprintf("an M16 infantry rifle with an ammunition clip inserted") ;
- X return ;
- X }
- X if (pnt->ID == V_dynamite) {
- Xprintf("a large stick of dynamite with a fuse type blasting cap") ;
- X return ;
- X }
- X}
- Xelse printf("%s",pnt->Text) ;
- X} /* --- end of subroutine "objector"--- */
- X
- X#if (PROTOTYPE)
- Xvoid killer(int n)
- X#else
- Xvoid killer(n)
- Xint n ;
- X#endif
- X/********************************************************************/
- X/* */
- X/* This subroutine had a serious error in it which was discovered */
- X/* by Byron Rakitzis. Thanks, Byron! */
- X/* */
- X/* Software by Gary A. Allen, Jr. 19 January 1992 Version: Mk 1.4 */
- X/* (c) Copyright 1993 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- Xregister int j ;
- X
- Xint hits ;
- Xint sw_other_object ;
- Xstatic int sw_hurt = FALSE ;
- X
- XMONSTER_STRUCT *mnstr ;
- XOBJECT_STRUCT *pnt ;
- X
- X#if (PROTOTYPE)
- Xvoid boom(void), ender(int), gleeper(int), the_fork(void) ;
- Xint shoot_it(void) ;
- X
- X#else
- X/* Function prototype for K&R-C */
- Xint shoot_it() ;
- X#endif
- X
- X/* Insult the user if he asks for suicide */
- Xif (tag[V_self]) {
- X the_fork() ;
- X return ;
- X}
- X
- X/* Deal with the wrong sorts of "kill" commands */
- Xif (verb == V_kill) {
- X /* Verb "kill" only */
- X if (tag[V_VERB_ONLY]) {
- Xprintf("It may be obvious to you, but you are going to have to tell\n");
- Xprintf("me exactly what it is you want to have killed, and \n") ;
- Xprintf("with what sort of weapon. \n") ;
- X return;
- X }
- X
- X if (!tag[V_rifle]) {
- X if (tag[V_dynamite]) {
- X if (Dynamite->Location == B_have) {
- Xprintf("You'll find the dynamite is not all that formidable of a weapon.\n") ;
- Xprintf("Try lighting some with a match and you'll see why.\n") ;
- X }
- X else
- Xprintf("You silly gallah! You don't have any dynamite in your possession!\n") ;
- X }
- X else printf("What weapon am I suppose to use? \n") ;
- X return ;
- X }
- X}
- X
- Xsw_other_object = FALSE ;
- X
- X/* shoot Ned Kely */
- Xif (tag[V_ned]) {
- X if (Ned->Location == B_destroyed) {
- Xprintf("Forget it, you drongo!! Ned Kelly is already dead!\n") ;
- X return ;
- X }
- X if (Ned->Status == F_asleep) {
- Xprintf("There is no Ned Kelly here for me to kill! \n") ;
- X return ;
- X }
- X
- X /* Fire the rifle */
- X if ((hits = shoot_it()) == 0) return ;
- X
- Xprintf("Ned Kelly keels over dead. His body suddenly glows a bright ");
- Xprintf("orange like it\nis being consummed by a heatless flame ");
- Xprintf("and then the late Ned Kelly disappears\ninto a puff of ") ;
- Xprintf("blue smoke. \n\n") ;
- Xprintf("By the way, the recently deceased bushranger ***was*** ");
- Xprintf("wearing iron body\narmour. However thin sheets of iron ");
- Xprintf("would just barely work against nineteenth\ncentury firearms ");
- Xprintf("at long range. Against a modern infantry rifle, Ned's\n");
- Xprintf("armour offered about as much protection as a dunny paper ");
- Xprintf("bandage. \n") ;
- X Ned->Location = B_destroyed ;
- X Ned->Status = F_asleep ;
- X monster_flag = F_no_monster ;
- X room[R_hideout][M_monster] = 0 ;
- X
- X /* create Ned Kelly's silver teapot */
- X ++room[R_hideout][M_obj_cnt] ;
- X Teapot->Location = R_hideout ;
- X return ;
- X} /* end of the Ned Kelly block */
- X
- X/* shoot the drop bear */
- Xif (tag[V_bear]) {
- X for (j = 2; j <= 5; j++) {
- X mnstr = (monster_start + j) ; /* point to the monster */
- X if (mnstr->Status != F_asleep) break ;
- X }
- X if (j > 5) {
- X printf("I see no drop bear for me to kill! \n") ;
- X return ;
- X }
- X
- X /* Fire the rifle */
- X if ((hits = shoot_it()) == 0) return ;
- X
- X /* Toggle the hurt switch if this is the first hit */
- X if (mnstr->Hits == 0) sw_hurt = FALSE ;
- X mnstr->Hits += hits ;
- X
- X if (mnstr->Hits < 30) {
- X /* Bear freaks out from being shot too much */
- X if (sw_hurt && (mnstr->Hits >= 10)) {
- Xprintf("The drop bear has been shot at so many times, that it ");
- Xprintf("has gone mad\n") ;
- Xprintf("with rage. It leaps three metres and rips out your ") ;
- Xprintf("throat with a\n");
- Xprintf("single swish of its claws. You die instantly. \n") ;
- X ender(F_died) ;
- X }
- X
- X if (mnstr->Hits == 1) {
- Xprintf("Your bullet hit the drop bear causing it to howl in ");
- Xprintf("anguish. However drop\n");
- Xprintf("bears are pretty tough and just one bullet isn't ");
- Xprintf("going to kill it.\n") ;
- X }
- X else {
- X if (!sw_hurt) {
- Xprintf("You've hit the drop bear and it is bleeding fairly ");
- Xprintf("heavily.\n");
- Xprintf("Unfortunately it is still alive and kicking and wants ") ;
- Xprintf("your blood \n");
- Xprintf("in payment for its.\n") ;
- X sw_hurt = TRUE ;
- X }
- X else {
- Xprintf("You've hit the drop bear again. It is weakening but still ");
- Xprintf("alive.\n");
- X }
- X }
- X monster_flag = F_wounded ;
- X return ;
- X }
- X
- X if (rifle_flag == F_single) {
- Xprintf("That last bullet was the straw which broke the drop ") ;
- Xprintf("bear's back.\n") ;
- Xprintf("The blasted thing is finally dead! \n") ;
- X }
- X else {
- Xprintf("The bullets riddled the drop bear with holes, killing it ") ;
- Xprintf("instantly.\n") ;
- X }
- Xprintf("Suddenly the drop bear's corpse turns into a cloud of greasy ");
- Xprintf("blue smoke,\n") ;
- Xprintf("which floats away without a trace.\n") ;
- X sw_hurt = FALSE ;
- X mnstr->Location = B_destroyed ;
- X mnstr->Status = F_asleep ;
- X monster_flag = F_no_monster ;
- X room[n][M_monster] = 0 ;
- X return ;
- X
- X} /* end of the drop bear block */
- X
- X/* shoot the mutant wombat */
- Xif (tag[V_wombat]) {
- X if (Wombat->Status == F_asleep) {
- X printf("I see no wombat for me to kill!\n");
- X return ;
- X }
- X
- X /* Fire the rifle */
- X if ((hits = shoot_it()) == 0) return ;
- X
- X /* Toggle the hurt switch if this is the first hit */
- X if (Wombat->Hits == 0) sw_hurt = FALSE ;
- X Wombat->Hits += hits ;
- X
- X if (Wombat->Hits < 300) {
- X if (Wombat->Hits == 1) {
- Xprintf("Your bullet hit the wombat causing it some minor discomfort.");
- Xprintf(" Judging from its \n");
- Xprintf("behavior, killing this beast is going to be tough! \n") ;
- X }
- X else {
- X if (!sw_hurt) {
- Xprintf("You've hit the wombat and got its attention ") ;
- Xprintf("but you've not\n");
- Xprintf("seriously wounded it. In fact, you've made it more fierce ");
- Xprintf("than before.\n");
- X sw_hurt = TRUE ;
- X }
- X else {
- Xprintf("You've hit the wombat again, but it is still going ");
- Xprintf("strong.\n");
- X }
- X }
- X monster_flag = F_wounded ;
- X return ;
- X }
- X
- X if (rifle_flag == F_single) {
- Xprintf("That last bullet was the straw which broke the ") ;
- Xprintf("wombat's back.\n") ;
- Xprintf("The blasted thing is finally dead!\n\n") ;
- X }
- X else {
- Xprintf("The bullets did the trick on the wretched thing. It's ") ;
- Xprintf("dead as a doornail.\n\n") ;
- X }
- Xprintf("Suddenly the wombat's corpse starts to glow with an intense");
- Xprintf(" white light.\n") ;
- Xprintf("There is then a crackling sound as its body starts to burn.");
- Xprintf(" You can\n");
- Xprintf("smell the stench of burning hair. Then the white light");
- Xprintf(" begins to dim,\n");
- Xprintf("leaving no trace left of the once formidable monster.\n");
- X sw_hurt = FALSE ;
- X Wombat->Location = B_destroyed ;
- X Wombat->Status = F_asleep ;
- X monster_flag = F_no_monster ;
- X room[n][M_monster] = 0 ;
- X return ;
- X} /* end of the mutant wombat block */
- X
- X/* shoot the hoop snake */
- Xif (tag[V_snake]) {
- X for (j = 6; j <= 13; j++) {
- X mnstr = (monster_start + j) ; /* point to the monster */
- X if (mnstr->Status != F_asleep) break ;
- X }
- X if (j > 13) {
- X printf("I see no hoop snake for me to kill! \n") ;
- X return ;
- X }
- X
- X /* Fire the rifle */
- X if ((hits = shoot_it()) == 0) return ;
- X
- X /* Toggle the hurt switch if this is the first hit */
- X if (mnstr->Hits == 0) sw_hurt = FALSE ;
- X mnstr->Hits += hits ;
- X
- X if ((rifle_flag == F_single)&&(mnstr->Hits < 3)) {
- X if (mnstr->Hits == 1) {
- Xprintf("Your bullet hit the hoop snake. However the hoop snake's ");
- Xprintf("thick scales \n");
- Xprintf("slowed the bullet down. The hoop snake is now hissing ");
- Xprintf("furiously. \n") ;
- X }
- X else {
- Xprintf("You've hit the hoop snake again, and it's hurting. However ");
- Xprintf("it is still \n");
- Xprintf("alive and full of venom. \n") ;
- X }
- X monster_flag = F_wounded ;
- X return ;
- X }
- X
- X if (rifle_flag == F_single) {
- Xprintf("The bullet hit the hoop snake finishing the horrible ") ;
- Xprintf("creature off. \n") ;
- X }
- X else {
- Xprintf("The bullets hit the hoop snake splatting it into a mass of ") ;
- Xprintf("mince meat. \n") ;
- X }
- Xprintf("Suddenly the bullet holed snake glows red and whooshes ");
- Xprintf("into a cloud \n") ;
- Xprintf("steam, leaving no traces behind.\n\n") ;
- X mnstr->Location = B_destroyed ;
- X mnstr->Status = F_asleep ;
- X monster_flag = F_no_monster ;
- X room[n][M_monster] = 0 ;
- X return ;
- X} /* end of the hoop snake block */
- X
- X/* see if the target is in the room or holding it */
- Xpnt = object ;
- Xfor (j = 0; j < Objcnt; j++) {
- X if (tag[pnt->ID]){
- X if (pnt->ID == V_rifle) continue ;
- X sw_other_object = TRUE ;
- X if (pnt->Location == n) break ;
- X if (pnt->Location == B_have) {
- Xprintf("I will ***NOT*** shoot at something that I'm holding!!\n");
- X return ;
- X }
- X }
- X pnt++ ;
- X}
- X/* Object shoot at */
- Xif (j < Objcnt) {
- X
- X switch(pnt->ID) {
- X
- X case V_can:
- X case V_beer:
- X case V_fourex:
- X case V_Fourex:
- X if ((hits = shoot_it()) == 0) return ;
- Xprintf("The can is hit by a bullet and flies off out of sight.\n");
- X Can->Location = B_destroyed ;
- X return;
- X
- X case V_bottle:
- X case V_lager:
- X if ((hits = shoot_it()) == 0) return ;
- Xprintf("It is hit by a bullet and shatters into a million pieces.\n");
- X Bottle->Location = B_destroyed ;
- X return;
- X
- X case V_dynamite:
- X if ((hits = shoot_it()) == 0) return ;
- Xprintf("Nothing happens! The \"dynamite\" is actually a very safe\n") ;
- Xprintf("mining explosive which won't detonate even if impacted by a high\n") ;
- Xprintf("speed bullet (TRUE story!). However this sort of explosive will\n") ;
- Xprintf("always detonate with a blasting cap.\n") ;
- X return;
- X
- X case V_cap:
- X if ((hits = shoot_it()) == 0) return ;
- Xprintf("POP!! The blasting cap explodes but causes no damage.\n") ;
- X Cap->Location = B_destroyed ;
- X return;
- X
- X case V_gong:
- X if ((hits = shoot_it()) == 0) return ;
- X printf("The bullet") ;
- X if (hits > 1) printf("s") ;
- Xprintf(" went cleanly through the soft silver metal of\n") ;
- Xprintf("the gong making a weird humming noise in the process. It's\n") ;
- Xprintf("a pointless waste of ammunition vandalizing this beautiful\n") ;
- Xprintf("gong.\n") ;
- X return;
- X
- X case V_safe:
- X if (Picture->Status == S_open) {
- X if ((hits = shoot_it()) == 0) return ;
- Xprintf("The safe is made out of harden steel. You'll only waste ") ;
- Xprintf("ammunition \nshooting at it. Try to unlock it instead. \n") ;
- X }
- X else printf("I don't see a safe to shoot at.\n") ;
- X return ;
- X
- X case V_letter:
- X if ((hits = shoot_it()) == 0) return ;
- X boom() ; /* cause an explosion */
- Xprintf("That was clever of you to realize the letter was really\n") ;
- Xprintf("a letter bomb. However shooting a letter bomb while you're\n") ;
- Xprintf("right next to it was less than clever. Too bad you got blown\n") ;
- Xprintf("to pieces discovering that bit of wisdom.\n\n") ;
- X ender(F_died) ;
- X
- X default:
- X if ((hits = shoot_it()) == 0) return ;
- Xprintf("Except for wasting ammunition nothing much happened.\n") ;
- X return ;
- X } /* end of target switch group */
- X} /* end of the "object shot at" block */
- X
- Xif (sw_other_object) {
- Xprintf("I don't see the target.\n") ;
- X return ;
- X}
- X
- X/* There was no target specified so the shot was wasted */
- Xif (tag[V_DIRECTION]) {
- X /* Fire the rifle */
- X if ((hits = shoot_it()) == 0) return ;
- Xprintf("You shoot in that direction but didn't accomplish anything\n") ;
- Xprintf("except waste ammunition.\n") ;
- X}
- Xelse {
- Xprintf("It may be obvious to you, but I don't understand what you\n") ;
- Xprintf("want to shoot at.\n");
- X}
- Xreturn ;
- X
- X} /* --- end of the "killer" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xint shoot_it(void)
- X#else
- Xint shoot_it()
- X#endif
- X/********************************************************************/
- X/* */
- X/* Software by Gary A. Allen, Jr. 23 January 1993 Version: Mk 1.0 */
- X/* (c) Copyright 1993 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- Xregister int i ;
- X
- Xint hits, i_10, i_fract ;
- X
- Xif (Rifle->Location != B_have) {
- Xprintf("I would do that. Only there is one small problem.... \n") ;
- X printf("I don't have a rifle in my possession! \n") ;
- X return(0) ;
- X}
- X
- X/* Shoot the gun (or at least try to) */
- Xprintf("You pull the trigger... \n\n") ;
- X
- Xif (clip_flag == F_no_clip) {
- Xprintf("Nothing happens! \n") ;
- Xprintf("Your rifle doesn't have an ammunition clip in it.\n") ;
- X return(0) ;
- X}
- X
- Xif (Rifle->Status <= 0) {
- X printf("Nothing happens! The ammo clip is out of bullets.\n") ;
- X return(0) ;
- X}
- X
- Xswitch(rifle_flag) {
- Xcase F_safety:
- X printf("Nothing happens! The rifle's safety is still on.\n");
- X return(0) ;
- X
- Xcase F_single:
- X printf("Bam! \n\n") ;
- X --Rifle->Status ;
- X if (clip_flag == F_normal_clip) hits = 1;
- X else hits = 100 ;
- X break ;
- X
- Xcase F_triple:
- X if (Rifle->Status >= 3) {
- X printf("Bam! Bam! Bam! \n\n") ;
- X Rifle->Status -= 3 ;
- X if (clip_flag == F_normal_clip) hits = 3;
- X else hits = 300 ;
- X }
- X else {
- X for (i = 1; i <= Rifle->Status; i++) printf("Bam! ") ;
- X printf("\n\nYou've run out of bullets. \n\n") ;
- X if (clip_flag == F_normal_clip) hits = Rifle->Status ;
- X else hits = Rifle->Status * 100 ;
- X Rifle->Status = 0 ;
- X }
- X break ;
- X
- Xcase F_auto:
- X if (Rifle->Status >= 30) {
- X for (i = 1; i <= 3; i++)
- Xprintf("Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! \n") ;
- X Rifle->Status -= 30 ;
- X hits = 30;
- X }
- X else {
- X i_10 = Rifle->Status / 10 ;
- X i_fract = Rifle->Status - (i_10 * 10) ;
- X for (i = 1; i <= i_10; i++)
- Xprintf("Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! Bam! \n") ;
- X for (i = 1; i <= i_fract; i++) printf("Bam! ") ;
- X printf("\n\nYou've run out of bullets. \n") ;
- X if (clip_flag == F_normal_clip) hits = Rifle->Status ;
- X else hits = Rifle->Status * 100 ;
- X Rifle->Status = 0 ;
- X }
- X printf("\n") ;
- X break ;
- X} /* end of rifle_flag "switch" block */
- X
- Xreturn(hits) ;
- X} /* --- end of the "shoot_it" function --- */
- X
- X#if (PROTOTYPE)
- Xvoid the_fork(void)
- X#else
- Xvoid the_fork()
- X#endif
- X{
- Xprintf("If you could see me now then you'd see me giving you a well\n") ;
- Xprintf("known Australian finger sign called \"The Fork\". This is\n") ;
- Xprintf("similar to the \"V\" for victory sign but has an entirely\n") ;
- Xprintf("different meaning which I trust you understand.\n") ;
- X} /* --- end of the "the_fork" function --- */
- END_OF_FILE
- if test 19048 -ne `wc -c <'actor.c'`; then
- echo shar: \"'actor.c'\" unpacked with wrong size!
- fi
- # end of 'actor.c'
- fi
- if test -f 'monster.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'monster.c'\"
- else
- echo shar: Extracting \"'monster.c'\" \(29700 characters\)
- sed "s/^X//" >'monster.c' <<'END_OF_FILE'
- X#define MNSTR
- X#include "dink_sym.h"
- X#include "dink_glb.h"
- X
- Xint sw_snaked = FALSE, sw_wombat = FALSE ;
- X
- X#if (PROTOTYPE)
- Xvoid monster(int loc_pnt[3])
- X#else
- Xvoid monster(loc_pnt)
- Xint loc_pnt[3] ;
- X#endif
- X/********************************************************************/
- X/* */
- X/* --- The Monster Subroutine --- */
- X/* */
- X/* monster_flag is a global variable input parameters */
- X/* */
- X/* Software by Gary A. Allen, Jr. 24 January 1993, Version: Mk 1.6 */
- X/* (c) Copyright 1993 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- Xregister int j ;
- Xint sw_chasing, sw_local ;
- Xstatic int sw_hoop = FALSE, bear_flag = 0 ;
- Xstatic int sw_replaced = FALSE ;
- Xstatic int sw_nogo = FALSE, sw_guarded = TRUE ;
- Xstatic int sw_letter = FALSE ;
- Xstatic int count_down = 0 ;
- X
- XMONSTER_STRUCT *mnstr, *mnstr_local, *mnstr_chase ;
- X
- X#if (PROTOTYPE)
- Xvoid ender(int), long_descp(int), hold_it(void), boom(void) ;
- Xvoid ned_kills(void), mullah_kills(void) ;
- Xvoid see_letter(int*, int*) ;
- Xvoid chief_mullah(int*) ;
- Xint bribe_mullah(int*) ;
- Xvoid chaser(MONSTER_STRUCT*, int[3]) ;
- X#else
- Xint bribe_mullah() ;
- X#endif
- X
- X/* set up some of the input variables */
- Xsw_chasing = FALSE ; /* turn off the chasing monster switch */
- Xsw_local = FALSE ; /* turn off the local monster switch */
- X
- X/* There can be no active monsters while in the closet */
- Xif (loc_pnt[0] == R_closet) {
- X monster_flag = F_no_monster ;
- X if (sw_letter == TRUE) {
- X sw_letter = FALSE ;
- X sw_nogo = TRUE ;
- Xprintf("\nYou hear a loud \"BOOM!\" from the Prayer Room followed\n");
- Xprintf("by the sounds of people shouting and cursing in Farsi. I\n");
- Xprintf("think it is definitely time that we leave.\n") ;
- X }
- X return ;
- X}
- X
- X/* scan the enemy table for the local and/or chasing monsters */
- Xfor (j = 0; j <= Enemy_cnt; j++) {
- X mnstr = (monster_start + j) ; /* point to the monster */
- X if (mnstr->Location == loc_pnt[0]) {
- X sw_local = TRUE;
- X mnstr_local = mnstr ;
- X }
- X else if (mnstr->Status != F_asleep){
- X if ((N_mullah == j)||(N_guards == j)||((N_ned == j)&&
- X (mnstr->Status == F_stealing))) continue ;
- X sw_chasing = TRUE;
- X mnstr_chase = mnstr ;
- X }
- X}
- X
- X/* see if the monster is local */
- Xif (sw_local) {
- X/* deal with case of being chased by monster to another monster */
- Xif (sw_chasing) {
- X
- X switch(mnstr_chase->Type) {
- X/* Mutant wombat scares off the local monser */
- X case N_wombat:
- X/* put the local monster to sleep and swap location with wombat */
- X mnstr_local->Status = F_asleep ;
- X --room[mnstr_local->Location][M_monster] ;
- X mnstr_local->Location = Wombat->Location ;
- X ++room[Wombat->Location][M_monster] ;
- X chaser(mnstr_chase, loc_pnt) ;
- X return ;
- X
- X/* Hoop Snake breaks off the chase */
- X case N_hoop_snake:
- Xprintf(" ---- What a relief!! ---- \n") ;
- Xprintf(" The dreaded hoop snake has broken off pursuit.\n");
- Xprintf(" But what is this!!\n\n") ;
- Xprintf("You see yet another terrible creature!\n");
- X sw_replaced = TRUE ;
- X break ;
- X }
- X
- X /* put the chasing monster to sleep */
- X monster_flag = F_no_monster ;
- X mnstr_chase->Status = F_asleep ;
- X sw_chasing = FALSE;
- X}
- X
- X/* local monster routines */
- Xswitch(mnstr_local->Type) {
- X
- X/* Revolutionary Guard local (only) behavior */
- Xcase N_guards:
- Xmonster_flag = F_monster_active ;
- X
- X/* guards always kill after the letter bomb has exploded */
- Xif (sw_nogo) {
- Xprintf("\nWith you are three men dressed in ripped and shredded ");
- Xprintf("clothes which have\nbeen blackened by an explosion. They ") ;
- Xprintf("are armed to the teeth and insane\nwith rage. They take ");
- Xprintf("one look at you and proceed to cut you to pieces with\n");
- Xprintf("their automatic weapons!\n\n");
- X ender(F_died) ;
- X}
- X
- X/* guards always kill if they see a rifle */
- Xif (Rifle->Location == B_have) {
- Xprintf("With you are four men dressed in rather shabby clothes. ");
- Xprintf("Three of them\nare clutching AK-47 assault rifles while ");
- Xprintf("the fourth one is holding an Uzi\nmachine gun. They ") ;
- Xprintf("take one look at the M-16 rifle which you are clutching,\n");
- Xprintf("point their own weapons at you and proceed to hose you ");
- Xprintf("with a hail of\nlead! Five seconds later you look like ");
- Xprintf("a piece of Swiss cheese.\n\n") ;
- X ender(F_died) ;
- X}
- X
- Xswitch (Guards->Status) {
- X case F_asleep:
- X Guards->Status = F_passive ;
- Xprintf("With you are four men dressed in rather shabby clothes. ");
- Xprintf("Three of them\nare clutching AK-47 assault rifles while ");
- Xprintf("the fourth one is holding an Uzi\nmachine gun. They ") ;
- Xprintf("search you but find nothing that is obviously a\n") ;
- Xprintf("weapon. They are in a quandary on what to do with ") ;
- Xprintf("you, since you\nliterally appeared out of thin air.\n");
- X return ;
- X
- X case F_passive:
- X if (Mullah->Status == F_asleep) {
- Xprintf("\nThe four men have concluded that the best thing to do\n");
- Xprintf("with you is to take you to their superiors. Two of the men\n");
- Xprintf("roughly grab hold of you and fling you bodily through the\n");
- Xprintf("doorway to the east.\n\n") ;
- X loc_pnt[0] = R_prayer;
- X long_descp(R_prayer) ;
- X chief_mullah(&count_down) ;
- X return ;
- X }
- X if (sw_guarded) {
- Xprintf("\nAll of the guards are currently in the prayer room.\n") ;
- X sw_guarded = FALSE ;
- X }
- X return ;
- X
- X case F_aggressive:
- X Guards->Status = F_killing ;
- Xprintf("\nThe four guards grab you by the arms and legs, and frog\n");
- Xprintf("march you back into the prayer room.\n");
- X loc_pnt[0] = R_prayer;
- X return ;
- X
- X case F_killing:
- Xprintf("\nThe guards are tired of fooling with you. One of them\n") ;
- Xprintf("hits you on the head with the butt of his rifle. Then the\n");
- Xprintf("other two guards drag you outside where you are executed\n");
- Xprintf("before a jeering mob of 30,000 people!\n\n") ;
- X ender(F_died) ;
- X
- X} /* end of the Guards local routine and switch block */
- X
- X
- X/* Chief Mullah local (only) behaivor */
- Xcase N_mullah:
- Xswitch (Mullah->Status) {
- X case F_asleep:
- X chief_mullah(&count_down) ;
- X return ;
- X
- X case F_aggressive:
- X /* The Mullah takes any valuables dropped */
- X if (bribe_mullah(&count_down)) return ;
- X
- X /* The Mullah sees and takes the letter */
- X if (Letter->Location == R_prayer) {
- X see_letter(&count_down, &sw_letter);
- X return ;
- X }
- X count_down++ ;
- X switch(count_down) {
- X case 1:
- Xprintf("\nThe Mullah is waiting for you to give him something.\n") ;
- X return ;
- X case 2:
- Xprintf("\nThe Mullah is becoming quite impatient. You had better\n") ;
- Xprintf("do something soon!\n") ;
- X Mullah->Status = F_killing ;
- X }
- X return ;
- X
- X case F_passive:
- X count_down++ ;
- X switch(count_down) {
- X
- X case 1:
- Xprintf("\nThe Mullah is examining the envelope of Muammar's letter.\n");
- X return ;
- X
- X case 2:
- Xprintf("\nThe Mullah has turned the envelope over and is just\n") ;
- Xprintf("about to open it.\n") ;
- X return ;
- X
- X case 3:
- X boom() ;
- Xprintf("The Mullah opened the letter. Needless to say, the letter\n") ;
- Xprintf("was a bomb. The good news is the nasty old Mullah died.\n");
- Xprintf("The bad news is you died in the explosion as well!\n\n") ;
- X ender(F_died) ;
- X }
- X
- X case F_killing:
- X if (bribe_mullah(&count_down)) {
- X Mullah->Status = F_aggressive ;
- X return ;
- X }
- X if (Letter->Location==R_prayer) {
- X see_letter(&count_down, &sw_letter);
- X return ;
- X }
- Xprintf("\n\"You are a brainless idiot!\" screams the Mullah!\n") ;
- X mullah_kills() ;
- X} /* end of mullah status switch block */
- X
- X/* The mullah sees Gaddafi's letter (this might be dead code) */
- X/* temporary */
- Xsee_letter(&count_down, &sw_letter);
- Xreturn ;
- X/* end of the mullah local behavior routine */
- X
- X/* Ned Kelly local behavior */
- Xcase N_ned:
- Xif (monster_flag == F_no_monster) {
- Xprintf("\nAs you approached the entrance of Ned Kelly's hide out, a ") ;
- Xprintf("man walked out\n") ;
- Xprintf("the front door and prevented you from entering. He is ");
- Xprintf("wearing an iron\n") ;
- Xprintf("helmet with thin eye slits which completely covers ");
- Xprintf("his head. He has\n") ;
- Xprintf("body armour made of thin sheets of iron that covers ");
- Xprintf("his chest and abdomen.\n") ;
- Xprintf("He is holding a 12 guage double barrel shotgun ");
- Xprintf("and has a pistol on\nhis hip. ") ;
- Xprintf("I could be wrong but I think this is Ned Kelly!\n\n");
- X loc_pnt[0] = R_hideout_entr ;
- X monster_flag = F_monster_active ;
- X Ned->Status = F_passive ;
- X return ;
- X}
- Xelse {
- X if (Ned->Status == F_killing) ned_kills() ;
- Xprintf("\nNed is not about to allow you to enter his hide out. He ");
- Xprintf("is now expressing\n") ;
- Xprintf("his displeasure with your continued presence by cocking both ");
- Xprintf("of the hammers on\n") ;
- Xprintf("his shotgun and pointing it at your head. I believe it is ");
- Xprintf("time to go!!\n\n") ;
- X loc_pnt[0] = R_hideout_entr ;
- X Ned->Status = F_killing ;
- X return ;
- X}
- X
- X/* Mutant Wombat monster behavior */
- Xcase N_wombat:
- Xsw_replaced = FALSE ;
- Xif (monster_flag == F_no_monster) {
- Xprintf("\n ----- OH NO!! -----\n") ;
- Xprintf(" You are in ***SERIOUS TROUBLE*** !!!\n") ;
- Xprintf("Forget about hoop snakes, and forget about drop bears. This ");
- Xprintf("is the WORST\n") ;
- Xprintf("thing that can be found in the ACME Mine. You see before ");
- Xprintf("you the awful\n") ;
- Xprintf("spawn of the Pommy nuclear weapon's tests. Its ancestors ");
- Xprintf("were inoffensive\n") ;
- Xprintf("creatures, but gamma radiation has transformed this into...\n");
- Xprintf(" The Dreadful Mutant Wombat!! \n") ;
- Xprintf("Normally I would advise you to run for your life. However ");
- Xprintf("there's really\n");
- Xprintf("no point. You can not out run this thing, and it's almost ");
- Xprintf("impossible to\n");
- Xprintf("kill. You might as well just stand here and let it finish ");
- Xprintf("you off as\n") ;
- Xprintf("quickly and painlessly as possible.\n\n") ;
- X monster_flag = F_monster_active ;
- X Wombat->Status = F_aggressive ;
- X loc_pnt[1] = loc_pnt[0] ;
- X loc_pnt[2] = 0 ; /* zero out the previous location */
- X}
- Xelse {
- X if (Wombat->Status == F_aggressive) {
- Xprintf("\nThe wombat is approaching you. Its mouth is wide open ") ;
- Xprintf("showing its\n") ;
- Xprintf("enormous canines. Its claws are fully extended. The ") ;
- Xprintf("wombat sees\n") ;
- Xprintf("you as an easy meal and is preparing to feast.\n") ;
- X Wombat->Status = F_killing ;
- X return ;
- X }
- X if (Wombat->Status == F_killing) {
- X /* The Mutant Wombat kills the player */
- Xprintf("\nThe obscene creature has grasped you with its terrible ");
- Xprintf("claws! First the\n");
- Xprintf("wombat rips off your right arm with a single jerk and ");
- Xprintf("tosses it down its\n");
- Xprintf("throat like it was an appetizer (which it was!). Next ");
- Xprintf("the monster studies\n");
- Xprintf("you for a moment and then twists off your left leg and ") ;
- Xprintf("chews on it like\n") ;
- Xprintf("a turkey drumstick. After savoring your left leg, it ");
- Xprintf("opens its mouth wide\n");
- Xprintf("and stuffs you in head first! Your last memory was ") ;
- Xprintf("hearing the crunching\n");
- Xprintf("of your own bones as the wombat's jaws clamped down!\n") ;
- X ender(F_died) ;
- X }
- X}
- Xreturn ;
- X
- X/* Drop Bear monster behavior */
- Xcase N_drop_bear:
- Xsw_replaced = FALSE ;
- Xif (monster_flag == F_no_monster) {
- X switch(bear_flag) {
- Xcase 0:
- Xprintf("\nAs you walk in, you see something that looks vaguely like") ;
- Xprintf(" a koala bear\n") ;
- Xprintf("sitting in the middle of the floor. However this \"koala\"") ;
- Xprintf(" has vampire\n") ;
- Xprintf("teeth and blood drooling down the sides of its mouth. The") ;
- Xprintf(" bear takes\n") ;
- Xprintf("one look at you and climbs up the wall onto the ceiling.") ;
- Xprintf(" It \n") ;
- Xprintf("clings to the ceiling much like a fly and seems to be") ;
- Xprintf(" positioning\n") ;
- Xprintf("itself to be directly over you. I could be wrong but I") ;
- Xprintf(" think this is\n") ;
- Xprintf("the deadly DROP BEAR! \n\n") ;
- X bear_flag = 1 ;
- X break ;
- X
- Xcase 1:
- Xprintf("\nJust as you walk in, a drop bear flashes by and hits") ;
- Xprintf(" the ground with\n");
- Xprintf("a THUNK. That was close! Had it hit you, and caught ") ;
- Xprintf("hold with its\n");
- Xprintf("claws, you would have been finished. The dreaded ");
- Xprintf("beast is now\n") ;
- Xprintf("running up the wall towards the ceiling to give it ") ;
- Xprintf("another go. I\n");
- Xprintf("think we had better leave and soon!\n\n") ;;
- X bear_flag = 2 ;
- X break ;
- X
- Xcase 2:
- Xprintf("\nAs you walk in, you see a drop bear lounging lazily in") ;
- Xprintf(" the middle of\n");
- Xprintf("the floor. It rolls over and takes one look at you, ") ;
- Xprintf("runs towards\n");
- Xprintf("the wall and scampers up to the ceiling. It is now ");
- Xprintf("positioning\n") ;
- Xprintf("itself to be directly over you.\n\n") ;
- X bear_flag = 1 ;
- X }
- X
- Xmonster_flag = F_monster_active ;
- Xmnstr_local->Status = F_aggressive ;
- X}
- Xelse {
- X if (mnstr_local->Status == F_aggressive) {
- Xprintf("\nThe drop bear is now positioned directly above you. It is") ;
- Xprintf(" hanging batlike\n") ;
- Xprintf("by its rear paws, with its front arms reaching out with");
- Xprintf(" claws fully \n") ;
- Xprintf("extended. Its mouth is wide open with its vampire teeth ");
- Xprintf("clearly visible.\n") ;
- Xprintf("I think this thing means business! Let's make a hasty ");
- Xprintf("departure!!\n") ;
- X mnstr_local->Status = F_killing ;
- X return ;
- X }
- X if (mnstr_local->Status == F_killing) {
- X /* The drop bear kills the player */
- Xprintf("\nThe drop bear drops on top of you! First it grabs hold ") ;
- Xprintf("of you with its \n") ;
- Xprintf("sharp claws that sink deep into your flesh. Then it bites ");
- Xprintf("into your neck \n") ;
- Xprintf("at the jugular vein and begins sucking your blood. You ");
- Xprintf("try desperately \n") ;
- Xprintf("to pull the horrible monster off, but it only clamps on ");
- Xprintf("harder and sucks \n") ;
- Xprintf("more vigorously. Soon you grow weak from lack of blood, ");
- Xprintf("and lapse into death. \n") ;
- X ender(F_died) ;
- X }
- X}
- Xreturn ;
- X
- X/* Hoop Snake monster behavior */
- Xcase N_hoop_snake:
- Xif (monster_flag == F_no_monster) {
- X if (sw_replaced) {
- X sw_replaced = FALSE ;
- Xprintf("\nA new and rested hoop snake rolls into view. The ");
- Xprintf("snake sees you, lets go of\n") ;
- Xprintf("its tail and starts slithering towards you with fangs ");
- Xprintf("at the ready. \n\n");
- X }
- X else {
- X if (!sw_hoop) {
- Xprintf("\nSomething that looks vaguely like a barrel hoop rolls into ");
- Xprintf("the passage. You \n") ;
- Xprintf("suddenly realize to your horror that this is no hoop but a ");
- Xprintf("snake biting its \n") ;
- Xprintf("own tail. The snake lets go of its tail and starts to ");
- Xprintf("slither towards you \n") ;
- Xprintf("like a regular, highly aggressive snake. \n\n");
- X sw_hoop = TRUE ;
- X }
- X else {
- Xprintf("\nA hoop snake rolls towards you. It lets go of its ");
- Xprintf("tail and starts slithering\n") ;
- Xprintf("in your direction. \n\n");
- X }
- X }
- X monster_flag = F_monster_active ;
- X mnstr_local->Status = F_aggressive ;
- X loc_pnt[1] = loc_pnt[0] ;
- X loc_pnt[2] = 0 ; /* zero out the previous location */
- X return ;
- X}
- Xelse {
- X if (mnstr_local->Status == F_aggressive) {
- Xprintf("\nThe hoop snake is coiling up in front of you and ") ;
- Xprintf("hissing very aggressively. \n") ;
- Xprintf("Venom is dripping from its sharp fangs and seems ") ;
- Xprintf("to be burning holes into\n") ;
- Xprintf("the stone floor.\n\n") ;
- Xprintf("I think it would be wise for us to leave.... Quickly!!\n") ;
- X mnstr_local->Status = F_killing ;
- X return ;
- X }
- X if (mnstr_local->Status == F_killing) {
- X /* The Hoop Snake kills the player */
- Xprintf("\nThe hoop snake strikes and bites you right on the nose!") ;
- Xprintf("\n\nYou begin to thrash around ") ;
- Xprintf("like a Baygon sprayed cocky. The nerve poison \n") ;
- Xprintf("makes you jerk around onto your back with your arms and ") ;
- Xprintf("legs flailing about\n") ;
- Xprintf("in the air. With time your spasmodic twitching reduces") ;
- Xprintf(" in frequency. You\n") ;
- Xprintf("slowly grind down to a halt with the coming of death. \n") ;
- X ender(F_died) ;
- X }
- X
- X}
- X} /* end of the local monster switch group */
- X}
- X
- Xchaser(mnstr_chase, loc_pnt) ;
- Xreturn ;
- X
- X} /* --- end of the "monster" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid chaser(MONSTER_STRUCT *mnstr, int loc_pnt[3])
- X#else
- Xvoid chaser(mnstr, loc_pnt)
- XMONSTER_STRUCT *mnstr ;
- Xint loc_pnt[3] ;
- X#endif
- X/********************************************************************/
- X/* */
- X/* --- Monster Chasing Subroutine --- */
- X/* */
- X/* Software by Gary A. Allen, Jr. 8 December 1992, Version: Mk 2.0 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- X
- X#if (PROTOTYPE)
- Xvoid ned_kills(void), ender(int) ;
- Xvoid bugs(int) ;
- X#endif
- X
- Xswitch(mnstr->Type) {
- X/* Ned Kelly */
- Xcase N_ned:
- X if (loc_pnt[0] == R_hideout_entr) {
- X if (Ned->Status == F_passive) {
- Xprintf("\nNed Kelly is standing in front of you and is holding a ");
- Xprintf("12 guage shotgun\n") ;
- Xprintf("in a rather menacing manner. This guy is really game!\n\n") ;
- Xprintf("I suggest we leave..... and quickly!!\n\n") ;
- X Ned->Status = F_aggressive ;
- X return ;
- X }
- X if (Ned->Status == F_aggressive) {
- Xprintf("\nNed seems to be getting impatient with you. He is now ");
- Xprintf("expressing his\n") ;
- Xprintf("displeasure with your continued presence by cocking both ");
- Xprintf("of the hammers on\n") ;
- Xprintf("his shotgun and pointing it at your head. I really think ");
- Xprintf("we should be\n") ;
- Xprintf("making a hasty departure!!\n\n") ;
- X Ned->Status = F_killing ;
- X return ;
- X }
- X if (Ned->Status != F_killing) {
- X monster_flag = F_no_monster ;
- X Ned->Status = F_asleep ;
- X return ;
- X }
- X else ned_kills() ;
- X }
- X else {
- X monster_flag = F_no_monster ;
- X Ned->Status = F_asleep ;
- X return ;
- X }
- X
- X/* Mutant wombat chases */
- Xcase N_wombat:
- X if (loc_pnt[0] == R_lift_inside) {
- Xprintf("\nYou run as fast as you can into the lift. You've made it! ") ;
- Xprintf(" You're in the\n") ;
- Xprintf("lift! However as you turn around, you realize to your horror") ;
- Xprintf(" that the\n") ;
- Xprintf("wombat has also made it inside the lift, and the door ");
- Xprintf("is closing!!\n\n") ;
- Xprintf(" Ah, Stuff of Nightmares!!!\n") ;
- Xprintf(" ---Trapped in a Lift with a Mutant Wombat!!!---\n\n");
- Xprintf("This is just too horrible. Let it suffice... You died. \n");
- X ender(F_died) ;
- X }
- X if (loc_pnt[0] == loc_pnt[2]) {
- Xprintf("The wombat is in that direction. You can't go that way!\n");
- X loc_pnt[0] = loc_pnt[1] ;
- X return ;
- X }
- X if (!sw_wombat) {
- Xprintf("\nAs you flee down the passage, you hear the ");
- Xprintf("\"THUD, THUD, THUD\" of the wombat\n") ;
- Xprintf("trudging down the passage. The horrible thing is after") ;
- Xprintf(" you! Give up\n") ;
- Xprintf("all hope! The wombat is driven by nuclear energy and") ;
- Xprintf(" will never stop.\n\n") ;
- X sw_wombat = TRUE ;
- X }
- X else {
- Xprintf("\nThe wombat is still chasing you and not tiring. \n") ;
- X }
- X monster_flag = F_monster_active ;
- X mnstr->Status = F_aggressive ;
- X --room[mnstr->Location][M_monster] ;
- X ++room[loc_pnt[0]][M_monster] ;
- X mnstr->Location = loc_pnt[0] ;
- X loc_pnt[2] = loc_pnt[1] ;
- X loc_pnt[1] = loc_pnt[0] ;
- X return ;
- X
- X/* Hoop Snake chases */
- Xcase N_hoop_snake:
- X if (loc_pnt[0] == R_lift_inside) {
- Xprintf("\nYou seek refuge from the hoop snake by fleeing into the ") ;
- Xprintf("lift. Just as you\n") ;
- Xprintf("enter the lift, its door begins to close. Unfortunately the") ;
- Xprintf(" hoop snake\n") ;
- Xprintf("rolls in the instant before the door is fully closed.\n\n") ;
- Xprintf("We will not describe the unpleasant events that occur behind");
- Xprintf(" the closed door\n");
- Xprintf("of the lift. However one can hear screams, curses, futile ");
- Xprintf("banging on the\n");
- Xprintf("lift door and loud snake hissing. After a few minutes ");
- Xprintf("there is again silence.\n");
- Xprintf("The lift door opens and the hoop snake rolls out and away. ");
- Xprintf("A peek inside the\n");
- Xprintf("lift reveals your corpse which is in the early phases of ");
- Xprintf("rigor mortis.\n") ;
- X ender(F_died) ;
- X }
- X if (loc_pnt[0] == loc_pnt[2]) {
- X if (mnstr->Status == F_killing) {
- Xprintf("The hoop snake is in that direction. ") ;
- Xprintf("You can't go that way!\n");
- X loc_pnt[0] = loc_pnt[1] ;
- X return ;
- X }
- X else {
- Xprintf("You have run back the way you came and passed the hoop ");
- Xprintf("snake, which\n") ;
- Xprintf("is still biting its tail and rolling like a hoop. The ") ;
- Xprintf("vile creature\n") ;
- Xprintf("hisses in frustration and does a U-turn to continue ") ;
- Xprintf("the chase.\n\n") ;
- X }
- X }
- X else {
- X if (!sw_snaked) {
- Xprintf("\nAs you flee down the passage, you hear the characteristic ") ;
- Xprintf("sound of reptilian\n") ;
- Xprintf("scales rubbing the stone floor. You look over your shoulder") ;
- Xprintf(" and see the\n") ;
- Xprintf("hoop snake is rolling along right behind you! The dreaded") ;
- Xprintf(" thing is chasing you!!\n\n") ;
- X sw_snaked = TRUE ;
- X }
- X else {
- Xprintf("\nThe hoop snake is rolling along behind you, and still") ;
- Xprintf(" in hot pursuit!\n\n") ;
- X }
- X }
- X monster_flag = F_monster_active ;
- X mnstr->Status = F_aggressive ;
- X --room[mnstr->Location][M_monster] ;
- X ++room[loc_pnt[0]][M_monster] ;
- X mnstr->Location = loc_pnt[0] ;
- X loc_pnt[2] = loc_pnt[1] ;
- X loc_pnt[1] = loc_pnt[0] ;
- X return ;
- X
- X/* Deactive all other possible monsters */
- Xcase N_drop_bear:
- Xcase N_mullah:
- Xcase N_guards:
- X monster_flag = F_no_monster ;
- X mnstr->Status = F_asleep ;
- X return ;
- X} /* end of the chasing monster switch group */
- X
- X/* This logic detects a potentially bad error. */
- X/* Normally this is dead code. */
- Xprintf("Run time error detected in \"chaser\" subroutine.\n") ;
- Xprintf("\"mnstr->Type\" value was %d.\n", mnstr->Type) ;
- Xbugs(Logic_error) ;
- Xreturn ; /* this is just a dummy return for Lint */
- X
- X} /* --- end of the "chaser" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid ned_kills(void)
- X#else
- Xvoid ned_kills()
- X#endif
- X/********************************************************************/
- X/* */
- X/* --- Ned Killy Kills the Player Subroutine --- */
- X/* */
- X/* Software by Gary A. Allen, Jr. 7 December 1992, Version: Mk 1.0 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- X
- X#if (PROTOTYPE)
- Xvoid ender(int) ;
- X#endif
- X
- Xprintf("\nWith an air of professional detachment, Ned Kelly pulls ");
- Xprintf("both triggers\n") ;
- Xprintf("on his shotgun and blows your head clean off your ") ;
- Xprintf("shoulders. \n\n") ;
- X ender(F_died) ;
- X} /* --- end of the ned_kills" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid mullah_kills(void)
- X#else
- Xvoid mullah_kills()
- X#endif
- X/********************************************************************/
- X/* */
- X/* --- Mullah Kills the Player Subroutine --- */
- X/* */
- X/* Software by Gary A. Allen, Jr. 7 December 1992, Version: Mk 1.0 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- X
- X#if (PROTOTYPE)
- Xvoid ender(int) ;
- X#endif
- X
- Xprintf("\nWith that pronouncement, the chief Mullah claps his hands\n");
- Xprintf("twice. Two Revolutionary Guards drag you outside where you\n");
- Xprintf("are executed before a jeering mob of 30,000 people!\n") ;
- X ender(F_died) ;
- X} /* --- end of the "mullah_kills" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid see_letter(int *count_on, int *sw_letter)
- X#else
- Xvoid see_letter(count_on, sw_letter)
- Xint *count_on, *sw_letter ;
- X#endif
- X/********************************************************************/
- X/* */
- X/* --- Mullah see Gaddafi's Letter Subroutine --- */
- X/* */
- X/* Software by Gary A. Allen, Jr. 7 December 1992, Version: Mk 1.0 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- Xprintf("\nThe Mullah gives the letter a casual glance, then\n");
- Xprintf("suddenly his face lights up and he claps his hands with\n") ;
- Xprintf("glee.\n\n") ;
- Xprintf("\"It's a letter from my old friend Muammar!\", he exclaims!\n");
- Xprintf("\"This is an occasion for much jubulation. As a token of\n");
- Xprintf("my esteem take this ancient gong clapper made of gold and\n");
- Xprintf("ivory. It was recovered from the personal collection of\n") ;
- Xprintf("the deposed Shah. It once belonged to the ancient Persian\n") ;
- Xprintf("King Cyrus and is priceless!\"\n\n") ;
- Xprintf("With this glad tiding the Mullah hands you the ancient\n") ;
- Xprintf("clapper and then reaches down to pick up the letter from\n") ;
- Xprintf("his old friend.\n") ;
- X
- XMullah->Status = F_passive ;
- XGuards->Status = F_passive ;
- XLetter->Location = B_destroyed ;
- X--room[R_prayer][M_obj_cnt] ;
- XClapper->Location = B_have ;
- XDetector->Location = R_guard ;
- X++room[R_guard][M_obj_cnt] ;
- Xcarry_count++ ;
- Xcarry_weight += Clapper->Weight ;
- X*sw_letter = TRUE ;
- X*count_on = 0 ;
- X
- X} /* --- end of the "see_letter" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xvoid chief_mullah(int *count_on)
- X#else
- Xvoid chief_mullah(count_on)
- Xint *count_on ;
- X#endif
- X/********************************************************************/
- X/* */
- X/* --- Chief Mullah Subroutine --- */
- X/* */
- X/* Software by Gary A. Allen, Jr. 8 December 1992, Version: Mk 1.0 */
- X/* (c) Copyright 1992 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- Xregister int i ;
- X
- XOBJECT_STRUCT *pnt ;
- X
- X#if (PROTOTYPE)
- Xvoid hold_it(void) ;
- Xvoid mullah_kills(void) ;
- X#endif
- X
- Xprintf("\n") ;
- Xhold_it() ;
- XMullah->Status = F_aggressive ;
- XGuards->Status = F_aggressive ;
- X
- Xprintf("The chief Mullah (or whatever he is) who is sitting on the\n");
- Xprintf("dias glares in your direction and begins expounding in a\n");
- Xprintf("long monologue in Farsi. One of his Revolutionary Guards\n") ;
- Xprintf("starts translating the Mullah's words into fairly good\n");
- Xprintf("English (with an American accent!). Here is what he said:\n") ;
- Xprintf("\n\"I can see by your slouch hat, singlet and short pants\n");
- Xprintf("that you are a good-for-nothing satanic Australian. I am\n");
- Xprintf("compelled to point out that your sort is most unwelcomed in\n");
- X
- X/* see if the player has any valuables or the letter */
- Xpnt = object ;
- Xfor (i = 0; i < Objcnt; i++) {
- X if ((pnt->Location == B_have)&&
- X ((V_letter == pnt->ID)||(pnt->Value > 0))) {
- X
- X/* Player has something the Mullah wants, so he lives */
- Xprintf("this holy precinct. Unless you can provide some good\n");
- Xprintf("reasons (preferably financial ones) to the contrary, I\n");
- Xprintf("shall order you to be executed immediately for the\n");
- Xprintf("amusement and edification of the local populace!\"\n") ;
- X *count_on = 0 ;
- X return ;
- X }
- X pnt++ ;
- X}
- X
- X/* Player has no valuables and doesn't have the letter so he dies */
- Xprintf("this holy precinct. Since you have nothing of value, our\n");
- Xprintf("usual practice would be to take you hostage and extract a\n");
- Xprintf("ransom from your government. However the Ozzie Dollar\n") ;
- Xprintf("doesn't buy all that much anymore, so we'll just execute\n");
- Xprintf("you and leave it at that.\"\n") ;
- Xmullah_kills() ;
- X
- X} /* --- end of the "chief_mullah" subroutine --- */
- X
- X#if (PROTOTYPE)
- Xint bribe_mullah(int *count_on)
- X#else
- Xint bribe_mullah(count_on)
- Xint *count_on ;
- X#endif
- X/********************************************************************/
- X/* */
- X/* --- Chief Mullah Subroutine --- */
- X/* */
- X/* Software by Gary A. Allen, Jr. 3 January 1993 , Version: Mk 1.0 */
- X/* (c) Copyright 1993 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X{
- Xregister int j ;
- Xint sw_bribe ;
- XOBJECT_STRUCT *pnt ;
- X
- X/* The Mullah takes any valuables dropped */
- Xsw_bribe = FALSE ;
- Xpnt = object ;
- Xfor (j = 0; j < Objcnt; j++) {
- X if ((pnt->Location == R_prayer) && (pnt->Value > 0)) {
- X pnt->Location = B_destroyed ;
- X --room[R_prayer][M_obj_cnt] ;
- X sw_bribe = TRUE ;
- X }
- X pnt++ ;
- X}
- Xif (sw_bribe) {
- Xprintf("\nOne of the guards picks up the treasure and hands it over to\n") ;
- Xprintf("the chief Mullah who discretely pockets it within his robe. The\n") ;
- Xprintf("Mullah then looks expectantly towards you... I think he wants\n") ;
- Xprintf("more treasure.\n") ;
- X *count_on = 0 ;
- X return(TRUE) ;
- X}
- Xreturn(FALSE) ;
- X
- X} /* --- end of the "bribe_mullah" function --- */
- X
- END_OF_FILE
- if test 29700 -ne `wc -c <'monster.c'`; then
- echo shar: \"'monster.c'\" unpacked with wrong size!
- fi
- # end of 'monster.c'
- fi
- echo shar: End of archive 5 \(of 7\).
- cp /dev/null ark5isdone
- 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
-