home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-26 | 52.4 KB | 1,718 lines |
- Path: uunet!news.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v15i024: dinkum - australian text adventure game, Part04/06
- Message-ID: <3982@master.CNA.TEK.COM>
- Date: 29 Nov 92 20:31:50 GMT
- Sender: news@master.CNA.TEK.COM
- Lines: 1706
- Approved: billr@saab.CNA.TEK.COM
- Xref: uunet comp.sources.games:1523
-
- Submitted-by: Gary Allen <gary@sun.mech.uq.oz.au>
- Posting-number: Volume 15, Issue 24
- Archive-name: dinkum/Part04
- 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 4 (of 6)."
- # Contents: dinkum.c monster.c
- # Wrapped by billr@saab on Sun Nov 29 12:25:49 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'dinkum.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dinkum.c'\"
- else
- echo shar: Extracting \"'dinkum.c'\" \(26298 characters\)
- sed "s/^X//" >'dinkum.c' <<'END_OF_FILE'
- X#define DINKUM.C
- X#include "dink_sym.h"
- X#include "dink_glb.h"
- X#include <stdlib.h>
- X#define Failed 0
- X#define Request 1
- X
- X/* ---------------- Version Date --------------- */
- Xchar *lb_date = "24 August 1992" ;
- X/* --------------------------------------------- */
- X
- X/* ---- Version Number ---- */
- Xchar *lb_version = "1.27" ;
- X/* ------------------------- */
- X
- X/* ---------------- Version Type --------------- */
- Xchar *lb_share = "[Shareware Version]" ;
- X/* --------------------------------------------- */
- X
- X/* ---- Serial Number ---- */
- X#define S_number 1
- Xint serial = S_number ;
- X/* ------------------------ */
- X
- X/* Global variables local to this file only */
- Xint sw_help = FALSE, sw_null = FALSE, sw_number = FALSE, sw_standard = FALSE ;
- X
- X/* MAIN PROGRAM --- MAIN PROGRAM --- MAIN PROGRAM --- MAIN PROGRAM */
- Xvoid main(argc,argv)
- X/********************************************************************/
- X/* */
- X/* --- The Dinkum Program --- */
- X/* */
- X/* Software by Gary A. Allen, Jr. 24 August 1992 Version: Mk 1.27 */
- X/* (c) Copyright 1990 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- X
- Xint argc ;
- Xchar *argv[] ;
- X{
- Xregister int i, j ;
- X
- Xint dig_1, dig_2 ;
- Xint pnt, n, i_rand1, i_rand2, i_rand3, old_n = 0, n_back ;
- Xlong l_pass, l_time, l_base, start_time, *time_arg = 0 ;
- Xchar chr, cmd[8] ;
- X
- X#ifdef __TURBOC__
- X/* Function prototypes */
- Xvoid switch_list(void) ;
- Xvoid cmd_switch(char[8], int, int, char *[]) ;
- Xvoid bugs(int), help(void) ;
- Xvoid kelly(int), long_descp(int), objlooker(int), killer(int) ;
- Xvoid gleeper(int), actor(int), ender(int), closer(int), opener(int) ;
- Xvoid dialer(int), taker(int), dropper(int), describe(int), rdtxt(int) ;
- Xvoid igniter(int), switcher(int), unlocker(int), sounder(int) ;
- Xvoid loader(void), eater(void), filler(void), looker(int), exit(int) ;
- Xvoid monster(int*,int*), new_score(void), boom(void), parse(void) ;
- Xvoid inventer(void), drinker(void), reader(void), pusher(int*);
- Xvoid pass(void), unloader(int) ;
- Xlong time(long*) ;
- Xchar getch(void), getche(void) ;
- X#endif
- X
- X/* Software security */
- Xif (serial != S_number) exit(0) ; /* abort if serial number changed */
- X
- X/* Scan the after the DOS/Unix command for switches or file name */
- Xif (argc > 1) {
- Xfor (i = 1; i <= argc-1; i++) {
- X /* Flush command vector */
- X for (j = 0; j <= 7; j++) cmd[j] = '\0' ;
- X /* Get command vector */
- X sscanf(argv[i],"%c%c%c%c%c%c%c%c%c", &chr, &cmd[0], &cmd[1],
- X &cmd[2], &cmd[3], &cmd[4], &cmd[5], &cmd[6], &cmd[7]) ;
- X sw_null = FALSE ;
- X if (chr == '?') help() ;
- X if (chr == '-') {
- X for (j = 0; j <= 7; j++) {
- X cmd_switch(cmd, j, i, argv) ;
- X if (sw_number) {
- X i++ ;
- X sw_number = FALSE ;
- X break ;
- X }
- X if (sw_null) break ;
- X } /* end of command "for" loop */
- X
- X if (j >= 7) {
- Xprintf("\n!!!! Too many commands on one \"-\" switch group.\n") ;
- Xprintf("!!!! Break up the commands into several \"-\" switch groups.\n") ;
- X bugs(Failed) ;
- X }
- X } /* end of the "-" marker block */
- X
- X /* Deal with garbage on the command line */
- X else {
- Xprintf ("\n!!!! The following on the command line was not understood: %s \n",
- X argv[i]);
- X bugs(Failed) ;
- X } /* Nondefault scratch file opening block */
- X
- X} /* end of argument token "for" loop */
- X
- Xif (sw_help) help() ;
- X} /* end of the command switch block */
- X
- X/* Deal with someone cheating with switch "-s" */
- Xif (sw_standard && (!sw_wizard)) {
- X printf("!!!! Command line switch -s is unknown.\n") ;
- X bugs(Failed) ;
- X}
- X
- X/* Software security */
- Xif (serial != S_number) exit(0) ; /* abort if serial number changed */
- X
- X/* Initialize the program */
- Xsw_warned = FALSE ;
- Xl_time = time(time_arg) ;
- Xl_base = l_time/10 ;
- Xl_base *= 10 ;
- Xl_pass = l_time - l_base ;
- Xdig_1 = (int)l_pass ;
- X
- Xprintf(" ") ;
- Xprintf(" --- Dinkum --- \n");
- Xprintf(" ") ;
- Xprintf(" (c) Copyright 1990 by Gary A. Allen, Jr.\n") ;
- Xprintf(" ") ;
- Xprintf(" All Rights Reserved. Version %s, %s\n\n",
- X lb_version, lb_date);
- X
- Xprintf("Would like some initial help with Dinkum?\n") ;
- X
- Xfor (;;) {
- X
- X#ifndef __TURBOC__
- X do {
- X printf("(Answer: Yes or No) ") ;
- X } while ('\n' == (chr = getchar())) ;
- X
- X while ('\n' != getchar()) ;
- X#endif
- X
- X#ifdef __TURBOC__
- X printf("\n") ;
- X do {
- X printf("(Answer: Yes or No) ") ;
- X } while ('\n' == (chr = getch())) ;
- X printf("\n") ;
- X#endif
- X
- X if (('n' == chr)||('N' == chr)||('y' == chr)||('Y' == chr)) {
- X if (('y' == chr)||('Y' == chr)) {
- Xprintf("\nG'day Mate! Welcome to \"Dinkum\" the Australian adventure");
- Xprintf("\ngame. In Dinkum you'll search for treasure in the\n") ;
- Xprintf("Australian Outback. You give the commands and I'll do the\n");
- Xprintf("dangerous work. I understand most plain English sentences.\n");
- Xprintf("If you want me to go east then type \"Will you please go\n");
- Xprintf("east?\" and press the RETURN or ENTER key. If you don't\n") ;
- Xprintf("enjoy typing then just type \"e\" and press RETURN. I'll\n");
- Xprintf("still go east. After you have gathered up some things\n") ;
- Xprintf("you can see what you have by typing \"inventory\".\n") ;
- Xprintf("Sometimes you can learn more about an object by typing\n");
- Xprintf("\"examine NAME-OF-OBJECT\". I understand many other\n") ;
- Xprintf("commands and words. However I'll let you have the fun of\n") ;
- Xprintf("finding out what I can and can not understand. Good luck!\n\n");
- X }
- X break ;
- X }
- X}
- X
- X/* produce two random numbers ranging from 0-9 based on system clock*/
- Xl_time = time(time_arg) ;
- Xstart_time = l_time ;
- Xl_base = l_time/10 ;
- Xl_base *= 10 ;
- Xl_pass = l_time - l_base ;
- Xdig_2 = (int)l_pass ;
- X
- X/* generate the actual random array pointers */
- Xif (sw_standard) {
- X i_rand1 = 1 ;
- X i_rand2 = 0 ;
- X i_rand3 = 7 ;
- X}
- Xelse {
- X i_rand3 = (dig_1 + dig_2)/2 ;
- X i_rand2 = dig_2/3 ;
- X i_rand1 = (dig_1/3) + 1 ;
- X}
- X
- Xprintf("\nIt's a hot summer day (in January) in ") ;
- Xprintf("Queensland, Australia.\n") ;
- Xn_back = R_meadow ;
- Xn = R_meadow ;
- X
- X/* Software security */
- Xif (serial != S_number) exit(0) ; /* abort if serial number changed */
- X
- X/* load objects into the rooms */
- Xfor (i = 0; i <= obj_init_max; i++)
- X object[obj_init[i][0]][J_loc] = obj_init[i][i_rand1] ;
- X
- Xcarry_count = 0 ;
- Xcarry_weight = 0 ;
- X
- Xfor (i = 0; i <= objcnt; i++) {
- X j = object[i][J_loc] ;
- X if ((j >= 0) && (object[i][J_type] != Z_unmovable))
- X ++room[j][M_obj_cnt] ;
- X}
- X
- X/* load monsters into the rooms */
- Xfor (i = 0; i <= mon_init_max; i++)
- X enemy[i+1][E_location] = mon_init[i][i_rand2] ;
- X
- Xfor (i = 0; i <= enemy_max; i++) {
- X j = enemy[i][E_location] ;
- X if (j != B_unmade) ++room[j][M_monster] ;
- X}
- X
- X/* load the gleep reproductive locations and seed gleep */
- Xfor (i = 0; i <= 9; i++)
- X gleep_spot[i] = gleep_init[i][i_rand2] ;
- Xroom[gleep_spot[0]-1][M_gleep] = 1 ; /* seed a nonreproductive spot */
- X
- X/* load safe passage for end-game killing passages */
- Xroom[218 + i_rand3][M_rm_type] = T_short_descp ;
- X
- X/* Beginning of main loop */
- Xloop:
- X/* special action routine */
- Xnew_score() ; /* update the score */
- X
- X/* See if the game has timed out */
- Xl_time = time(time_arg) ;
- Xif ((!sw_warned) && (l_time > start_time + 3300)) {
- X sw_warned = TRUE ;
- X start_time = l_time ;
- Xprintf("There's suddenly a puff of blue smoke which fills the room\n") ;
- Xprintf("with a hazy cloud. Slowly this cloud coalesces into a\n") ;
- Xprintf("ghostly human form. This ethereal being is wearing a grey\n") ;
- Xprintf("flannel suit, a bowler hat, and glancing at a gold pocket\n") ;
- Xprintf("watch which is attached to a long golden chain. You can\n");
- Xprintf("hear \"Waltzing Matilda\" being played softly in the\n") ;
- Xprintf("background. You know what? I think this ethereal being\n") ;
- Xprintf("is none other than the ghost of Banjo Patterson! With\n") ;
- Xprintf("this realization Banjo looks up in your direction and\n") ;
- Xprintf("begins to speak:\n\n") ;
- Xprintf("\"Sorry mate, you've been at this for too long! You've\n") ;
- Xprintf("got five more minutes to go and then you're history!\"\n\n") ;
- Xprintf("Then just as suddenly Banjo Patterson dissolves back into\n") ;
- Xprintf("smoke and disappears from view.\n\n") ;
- X}
- Xif (sw_warned && (l_time > start_time + 300)) {
- Xprintf("You hear someone clearing his throat behind you. You turn\n") ;
- Xprintf("around and see Banjo Patterson has appeared once again. An\n");
- Xprintf("old brass chain is hanging from mid air next to Banjo. On\n") ;
- Xprintf("the end of the chain is a white porcelain tear drop shaped\n");
- Xprintf("nob with the word \"PULL\" written on it in black letters.\n") ;
- Xprintf("Banjo reaches for the nob and says the following:\n\n\"Sorry") ;
- Xprintf(" mate, your time has come! Better luck next time!\"\n\n");
- Xprintf("He gives the chain a quick jerk and everything around you\n") ;
- Xprintf("slowly fades from view.\n\n") ;
- X ender(F_quit) ;
- X}
- X
- Xkelly(n) ; /* check if Ned Kelly can do something */
- X
- X/* Check if there is a long description */
- Xif ((room[R_hideout][M_monster] > 0)&&(n == R_hideout)) goto command ;
- Xif ((monster_flag == F_monster_active)&&(old_n == n)) goto command ;
- X else old_n = 0 ;
- Xif (room[n][M_rm_type] == T_long_descp) {
- X long_descp(n) ; /* do the long description of the room */
- X goto objlook ;
- X}
- Xelse describe(n) ; /* short description */
- X
- X/* describe unmovable action objects and status */
- Xif (room[n][M_rm_type] == T_action_obj) actor(n) ;
- X
- Xobjlook:
- Xobjlooker(n) ; /* Check if there are objects in the room */
- Xgleeper(n) ; /* check for gleeps and update the gleep count */
- X
- X/* see if the spaceship's transporter is active */
- Xif (sw_transport) {
- X if (n == R_ship_passage) sw_transport = FALSE ;
- X else if (n == R_transport) {
- X n = R_closet ;
- X sw_transport = FALSE ;
- Xprintf("\nSuddenly radiant energy seems to surge from the hexagons\n");
- Xprintf("around you. Then there is a bright flash and you find\n");
- Xprintf("yourself in.....\n\n") ;
- Xprintf("A closet stinking of moth balls full of nondescript junk.\n") ;
- Xprintf("The only exit is to the north through a curtain hanging\n");
- Xprintf("over the entrance.\n\n") ;
- X }
- X}
- X
- X/* monster check */
- Xcommand:
- Xif ((room[n][M_monster] > 0)||(monster_flag != F_no_monster)) {
- X if (monster_flag == F_wounded) {
- X monster_flag = F_monster_active ;
- X }
- X else monster(&n,&old_n) ;
- X}
- X
- X/* parse in the command */
- Xparse();
- X
- X/* poison check */
- X/* remove atropine drug with each game cycle */
- Xif (i_poison > 0) {
- X --i_poison ;
- X}
- Xelse {
- X /* accumulate poison if holding the orange clip */
- X if (object[O_org_clip][J_loc] == B_have) {
- X --i_poison ;
- X switch (i_poison) {
- X case -20:
- X printf("You've developed a nervous tick near your eye.\n") ;
- X break ;
- X case -30:
- X printf("You're hands are starting to shake ") ;
- X printf("and you're sweating like a pig.\n") ;
- X break ;
- X case -35:
- X printf("You're shaking so bad you can barely stand and you ");
- X printf("could lose your lunch\nat any moment.\n") ;
- X break ;
- X case -40:
- Xprintf("The toxic fumes coming off of the orange ammo clip you were ") ;
- Xprintf("carrying finally\ncaught up with you. You fall over DEAD!\n") ;
- X ender(F_died) ;
- X }
- X }
- X /* remove poison after release of orange clip */
- X else if (i_poison < 0) ++i_poison ;
- X}
- X
- X/* clock check */
- Xif (sw_clock) {
- X switch (flag_clock) {
- X /* see if the blasting cap is to explode */
- X case V_cap:
- X if (time(time_arg) > clock_explode) {
- X if (object[O_cap][J_loc] == B_have) {
- Xprintf(" POP!!\n") ;
- Xprintf("The blasting cap which you were stupidly holding in your\n") ;
- Xprintf("hand just blew up and took two of your fingers with it!\n") ;
- Xprintf("Good thing you've got another eight fingers to spare!\n\n") ;
- X carry_count-- ;
- X carry_weight -= object[O_cap][J_weight];
- X }
- X else {
- Xprintf("Far down the tunnel you hear a POP!\n") ;
- Xprintf("The blasting cap has finally exploded, not that it\n");
- Xprintf("achieved much except make a loud noise.\n\n") ;
- X }
- X object[O_cap][J_loc] = B_destroyed ;
- X sw_clock = FALSE ;
- X }
- X break ;
- X
- X /* see if the dynamite is to explode */
- X case V_dynamite:
- X if (time(time_arg) > clock_explode) {
- X /* player dies if he is holding the dynamite */
- X if (object[O_dynamite][J_loc] == B_have) {
- X boom () ;
- X
- Xprintf("The dynamite which you were holding and had earlier ignited\n");
- Xprintf("the fuse has finally exploded. That was a rather noisy\n");
- Xprintf("and messy way to commit suicide! Needless to say there is\n");
- Xprintf("nothing left of you but a greasy spot.\n") ;
- X ender(F_died) ;
- X }
- X /* player dies if too close during explosion */
- X else {
- X if (((n <= 185)&&(n >= 178))||((n <= 170)&&(n >= 166))) {
- X boom () ;
- X
- Xprintf("You weren't far enough away from the dynamite when it\n");
- Xprintf("exploded! The shock wave was still strong enough to blow\n");
- Xprintf("your brains out your ears. Good try anyway!\n");
- X ender(F_died) ;
- X }
- X /* dynamite explodes and player survives */
- X else {
- Xprintf("Far down the tunnel you hear a low BOOM!\n") ;
- Xprintf("That dynamite you set burning has finally exploded.\n\n");
- X
- X/* open up the passage to the UFO */
- Xif (object[O_dynamite][J_loc] == R_blast_point) {
- X room[R_blast_point][1] = 186 ;
- X room[R_blast_point][M_descp] = 55 ;
- X }
- X }
- X }
- X object[O_dynamite][J_loc] = B_destroyed ;
- X sw_clock = FALSE ;
- X }
- X break ;
- X }
- X}
- X
- X/* the command is a simple move command */
- Xif (tag[V_MOVE]) {
- X pnt = verb ;
- Xmove:
- X /* see if this movement prohibits blasting caps */
- X if (((pnt == V_u)||(pnt == V_up))&&
- X ((n == R_manhole_1)||(n == R_manhole_2))) {
- X if (object[O_cap][J_loc] == B_have) {
- Xprintf("As you were climbing up through the hole in the ceiling,\n");
- Xprintf("the blasting cap slipped from your grasp and fell to the\n") ;
- Xprintf("floor below where it detonated on impact. The explosion\n") ;
- Xprintf("was deafening, but caused no damage.\n") ;
- X carry_count-- ;
- X carry_weight -= object[O_cap][J_weight] ;
- X object[O_cap][J_loc] = B_destroyed;
- X }
- X else if ((object[O_dynamite][J_loc] == B_have)&&
- X (object[O_dynamite][J_type] == Z_alias)) {
- X boom () ;
- X
- Xprintf("As you were climbing up through the hole in the ceiling,\n");
- Xprintf("the dynamite with the blasting cap inside slipped from\n") ;
- Xprintf("your grasp and fell to the floor below where it detonated\n") ;
- Xprintf("on impact. At that point you literally became a human\n");
- Xprintf("cannon ball as the shock wave carried you up the vertical\n");
- Xprintf("passage and splattered you into protoplasmic jelly on the\n");
- Xprintf("ceiling above.\n") ;
- X ender(F_died) ;
- X }
- X }
- X
- X pnt-- ;
- X if (room[n][pnt] == -1) {
- X printf ("You can't go that way. \n");
- X goto command ;
- X }
- X
- X n_back = n ; /* save previous "n" for "back" */
- X n = room[n][pnt] ;
- X if (room[n][M_rm_type] != T_lethal) goto loop ;
- X
- X/* player walked into a lethal room */
- X long_descp(n) ;
- X ender(F_died) ;
- X}
- X
- X/* complicated command decoder */
- Xswitch (verb) {
- X
- X/* "help" command */
- Xcase V_help:
- Xcase V_info:
- Xprintf("There is no help available. You're on your own!\n") ;
- X break ;
- X
- X/* "quit" command */
- Xcase V_quit:
- X ender(F_quit) ;
- X
- X/* "question" command */
- Xcase V_QUESTION:
- X if (tag[V_VERB_ONLY]) {
- X if (tag[V_how]) {
- Xprintf("That's for you to figure out.\n") ;
- X break ;
- X }
- Xprintf("I don't have a clue!\n") ;
- X break ;
- X }
- X
- X /* Question "Where am I?" */
- X if (tag[V_where] && tag[V_am]) {
- X tag[V_VERB_ONLY] = TRUE ; /* This is for "looker" */
- X looker(n) ;
- X break ;
- X }
- X
- X /* Question "What have I got?" */
- X if (tag[V_what] && tag[V_have]) {
- X inventer() ;
- X break ;
- X }
- X
- X /* Question which can't be processed */
- Xprintf("You asked a question. Unfortunately I have no answers.\n") ;
- X break ;
- X
- X/* "inventory" command */
- Xcase V_inventory:
- Xcase V_invent:
- X inventer() ;
- X break;
- X
- X/* "close" command */
- Xcase V_close:
- Xcase V_shut:
- X closer(n) ;
- X break;
- X
- X/* "open" command */
- Xcase V_open:
- Xcase V_swing:
- X opener(n) ;
- X break;
- X
- X/* "dial" command */
- Xcase V_dial:
- Xcase V_combination:
- X dialer(n) ;
- X break ;
- X
- X/* "drink" command */
- Xcase V_drink:
- X drinker() ;
- X break ;
- X
- X/* "ignite" command */
- Xcase V_ignite:
- Xcase V_light:
- X igniter(n) ;
- X break ;
- X
- X/* "read" command */
- Xcase V_read:
- X reader() ;
- X break;
- X
- X/* "push" command */
- Xcase V_push:
- Xcase V_press:
- X pusher(&n) ;
- X break ;
- X
- X/* "turn", "switch" command */
- Xcase V_switch:
- Xcase V_turn:
- Xcase V_select:
- Xcase V_set:
- X switcher(n) ;
- X break ;
- X
- X/* "shoot" command */
- Xcase V_shoot:
- Xcase V_fire:
- Xcase V_kill:
- X killer(n) ;
- X break;
- X
- X/* "unlock" command */
- Xcase V_unlock:
- X unlocker(n) ;
- X break;
- X
- X/* "eat" command */
- Xcase V_eat:
- Xcase V_swallow:
- X eater() ;
- X break;
- X
- X/* "fill" command */
- Xcase V_fill:
- X filler() ;
- X break;
- X
- X/* "sound" command */
- Xcase V_sound:
- Xcase V_bang:
- Xcase V_hit:
- Xcase V_strike:
- X sounder(n) ;
- X break;
- X
- X/* "SVC" wizard move command */
- Xcase V_svc:
- X if (sw_wizard) {
- X printf ("Enter room coordinate number: ");
- X scanf ("%d",&n);
- X goto loop ;
- X }
- X else {
- Xcheater:
- Xprintf("Rather than cheat at this game by using a disassembler, you\n");
- Xprintf("should send the author $150 and he'll gladly send you\n") ;
- Xprintf("the source code. If you just want a clue, then send $20\n") ;
- Xprintf("registration fee with your question and he'll provide\n") ;
- Xprintf("the answer. You can find the author's address by\n") ;
- Xprintf("typing: dinkum -h\n") ;
- X exit(0) ;
- X }
- X
- X/* "STATS" game statistics */
- Xcase V_stats :
- X printf(" --- Dinkum --- \n");
- X printf("Version: %s, %s\n\n", lb_version, lb_date);
- X printf("i_rand1 = %d, i_rand2 = %d, i_rand3 = %d\n",
- X i_rand1, i_rand2, i_rand3) ;
- X printf("Room Number = %d\n", n) ;
- X printf("Room object count = %d \n",
- X room[n][M_obj_cnt]) ;
- X printf("Room monster count = %d\n",
- X room[n][M_monster]) ;
- X printf("Gleeps on room's floor count = %d\n",
- X room[n][M_gleep]) ;
- X printf("Poison level = %d\n",i_poison) ;
- X printf("Gleep count = %d\n", gleep_count) ;
- X printf("carry_count = %d, carry_weight = %d\n",
- X carry_count, carry_weight) ;
- X break ;
- X
- X/* "SU" wizard initiation command */
- Xcase V_su:
- X pass() ;
- X break ;
- X
- X/* "JSYS" wizard command which deactivates a monster */
- Xcase V_jsys:
- X if (sw_wizard) monster_flag = F_no_monster ;
- X else goto cheater ;
- X break ;
- X
- X/* "score" command */
- Xcase V_score:
- X new_score () ;
- X if ((gleep_score == 0)&&(score == 0)) {
- Xprintf("You haven't scored anything at all, Bozo! Try putting\n");
- Xprintf("a valuable into the safe or find some gleeps.\n") ;
- X break ;
- X }
- X if (score == 0) {
- X if (gleep_score > 1) {
- Xprintf("You haven't scored any points but you splashed ") ;
- Xprintf ("%d gleeps into the gleep tank.\n",gleep_score) ;
- X }
- X else {
- Xprintf("You haven't scored any points at all but you did put a\n");
- Xprintf ("gleep in the gleep tank (big deal!).\n") ;
- X }
- X }
- X else {
- Xprintf ("You scored %d points ",score) ;
- X if (gleep_score == 0)
- Xprintf ("but have yet to put any gleeps in the gleep tank.\n") ;
- X else {
- X if (gleep_score > 1)
- Xprintf ("and put %d gleeps into the gleep tank.\n",gleep_score) ;
- X
- X else
- Xprintf ("and put a gleep in the gleep tank.\n") ;
- X }
- X }
- X break ;
- X
- X/* "enter" command */
- Xcase V_enter:
- Xswitch (n) {
- X
- X /* Lift entrance at the ground level */
- X case R_lift_entr:
- X if (room[R_lift_entr][2] == -1) goto door_shut ;
- X pnt = 3 ;
- X break ;
- X /* office door */
- X case R_office_entr:
- X if (room[R_office_entr][2] == -1) goto door_shut ;
- X pnt = 3 ;
- X break ;
- X /* Lift entrance at level #49 */
- X case R_L49_entr:
- X pnt = 3 ;
- X break ;
- X /* Entrance to Ned Kelly's hideout */
- X case R_hideout_entr:
- X pnt = 3 ;
- X break ;
- X default:
- X printf("I don't understand exactly how to enter. \n");
- X goto command ;
- X}
- Xgoto move ;
- Xdoor_shut:
- Xprintf("I can't do it! The door needs to be opened.\n") ;
- Xgoto command ;
- X
- X/* "exit" command */
- Xcase V_exit:
- Xcase V_leave:
- Xcase V_depart:
- Xswitch (n) {
- X
- X /* Lift entrance at the ground level */
- X case R_lift_inside:
- X pnt = 4 ;
- X break ;
- X /* office door */
- X case R_office_hall:
- X pnt = 4 ;
- X break ;
- X /* Ned Kelly's hideout */
- X case R_hideout :
- X pnt = 4 ;
- X break ;
- X default:
- Xprintf("I don't understand exactly how you want to exit.\n");
- X goto command ;
- X}
- Xgoto move ;
- X
- X/* "dig" command */
- Xcase V_dig:
- Xprintf("You get on your knees and scrape away at the ground for\n") ;
- Xprintf("awhile. Except for getting your hands dirty you didn't\n") ;
- Xprintf("achieve much.\n") ;
- X break ;
- X
- X/* "stand" command */
- Xcase V_stand:
- Xprintf("You're standing there very nicely. However you're not\n");
- Xprintf("achieving much by doing so.\n") ;
- X break ;
- X
- X/* "load" rifle command */
- Xcase V_load:
- X loader() ;
- X break ;
- X
- X/* "unload" rifle command */
- Xcase V_unload:
- X unloader(n) ;
- X break ;
- X
- X/* "pull" command */
- Xcase V_pull:
- X if (tag[V_trigger]) {
- X /* alias in the "shoot" command */
- X verb = V_shoot ;
- X tag[V_VERB_ONLY] = TRUE ;
- X killer(n) ; /* "pull trigger" */
- X }
- X else printf("I don't see how I could pull that.\n") ;
- X break ;
- X
- X/* "climb" command */
- Xcase V_climb:
- Xprintf("I'm not climbing anything! (I'm afraid of heights.)\n") ;
- X break ;
- X
- X/* "swim" command */
- Xcase V_swim:
- Xprintf("I'm not going for a swim! (I'm afraid of the water.)\n") ;
- X break ;
- X
- X/* Go backwards to previous location */
- Xcase V_back:
- X n = n_back ;
- X goto loop ;
- X
- X/* "take", "get", "lift" command */
- Xcase V_take:
- Xcase V_get:
- Xcase V_lift:
- Xcase V_pick:
- Xcase V_grab:
- Xcase V_remove:
- Xcase V_attach:
- Xcase V_hold:
- X taker(n) ;
- X break ;
- X
- X/* "drop", "throw", "put" command */
- Xcase V_drop:
- Xcase V_throw:
- Xcase V_put:
- Xcase V_fling:
- Xcase V_insert:
- Xcase V_give:
- Xcase V_eject:
- Xcase V_slow_drop:
- X dropper(n) ;
- X break ;
- X
- X/* "look" command */
- Xcase V_look:
- Xcase V_l:
- Xcase V_examine:
- Xcase V_describe:
- X looker(n) ;
- X break;
- X
- X/* gibberish command */
- Xdefault:
- Xprintf("Huh? You will have to make yourself clearer! \n");
- X
- X} /* end of "decoder" switch */
- Xgoto command;
- X
- X} /* --- end of Main routine --- */
- X
- Xvoid cmd_switch(cmd, cmd_arg, i_point, argv)
- X/*****************************************************/
- X/* */
- X/* --- Command line Switch Parser --- */
- X/* */
- X/* (c) Copyright 1992, University of Queensland */
- X/* Program written by Gary A. Allen, Jr. */
- X/* Version: Mk 1.1 24 February 1992 */
- X/* */
- X/*****************************************************/
- X
- Xchar cmd[8], *argv[] ;
- Xint cmd_arg, i_point ;
- X{
- Xvoid switch_list(), description() ;
- X
- Xswitch (cmd[cmd_arg]) {
- Xcase '\0':
- Xcase -1:
- X sw_null = TRUE ;
- X return ;
- X
- X/* Version verification command switch */
- Xcase 'v':
- X if ((cmd[cmd_arg+1] == 'e')&&(cmd[cmd_arg+2] == 'r')) {
- X printf("Version: %s, Serial Number: %06d %s \n",
- X lb_version, serial, lb_share) ;
- X bugs(Request) ;
- X }
- X else {
- X printf("!!!! Command line switch -v is unknown.\n") ;
- X bugs(Failed) ;
- X }
- X
- X/* Wizard mode command switch */
- Xcase 'w':
- Xcase 'W':
- X pass() ;
- X break ;
- X
- X/* Standard matrix load command switch */
- Xcase 's':
- Xcase 'S':
- X sw_standard = TRUE ;
- X break ;
- X
- X
- X/* Rubbish option to supress a warning */
- Xcase 'y':
- Xcase 'Y':
- X sw_number = TRUE ;
- X printf("y = %d\n", atoi(argv[i_point+1])) ;
- X return ;
- X
- X/* Help option */
- Xcase '?':
- Xcase 'h':
- Xcase 'H':
- X sw_help = TRUE ;
- X return ;
- X
- Xcase ' ':
- Xcase '-':
- Xcase '1':
- Xcase '2':
- Xcase '3':
- Xcase '4':
- Xcase '5':
- Xcase '6':
- Xcase '7':
- Xcase '8':
- Xcase '9':
- X return ;
- X
- Xdefault:
- Xprintf("!!!! Command line switch -%c is unknown.\n", cmd[cmd_arg]) ;
- X bugs(Failed) ;
- X}
- X} /* --- end of the cmd_switch subroutine --- */
- X
- Xvoid bugs(i_type)
- X/***************************************************************/
- X/* */
- X/* (c) Copyright 1992, University of Queensland */
- X/* Program written by Gary A. Allen, Jr. */
- X/* Version: Mk 1.0 24 April 1992 */
- X/* */
- X/***************************************************************/
- Xint i_type ;
- X{
- Xswitch(i_type) {
- Xcase Failed:
- X printf("!!!! If confused, type: dinkum -h \n");
- X printf("!!!! --- Program ABORTED --- \n");
- X break ;
- X
- Xcase Request:
- X printf("Program terminated by user request.\n") ;
- X break ;
- X}
- Xexit (0) ;
- X} /* --- end of the "bugs" subroutine --- */
- X
- Xvoid help()
- X/*****************************************************/
- X/* */
- X/* Help Routine */
- X/* */
- X/* (c) Copyright 1992, University of Queensland */
- X/* Program written by Gary A. Allen, Jr. */
- X/* Version: Mk 1.0 24 April 1992 */
- X/* */
- X/*****************************************************/
- X{
- Xchar chr ;
- X
- Xprintf(" --- Dinkum --- \n");
- Xprintf(" (c) Copyright 1990 by Gary A. Allen, Jr.\n") ;
- Xprintf(" All Rights Reserved. Version: %s, %s\n\n",
- X lb_version, lb_date);
- X
- Xprintf(" Dinkum is a text style \"adventure\" game.\n\n") ;
- X
- Xprintf("You are free to use, copy and distribute Dinkum provided:\n") ;
- Xprintf(" NO FEE IS CHARGED FOR USE, COPYING OR DISTRIBUTION.\n") ;
- Xprintf(" THIS PROGRAM IS FOR PRIVATE, NONCOMMERICAL USE ONLY.\n");
- Xprintf(" THE PROGRAM MAY NOT BE MODIFIED IN ANY WAY.\n\n") ;
- X
- Xprintf("This program is provided AS IS without any warranty,\n") ;
- Xprintf("expressed or implied, including but not limited to fitness\n") ;
- Xprintf("for any particular purpose.\n\n") ;
- X
- X/* keep the screen from scrolling */
- X#ifndef __TURBOC__
- Xprintf(" [Press RETURN or ENTER to continue]") ;
- Xchr = getchar() ;
- X#endif
- X
- X#ifdef __TURBOC__
- Xprintf(" [Press \"q\" to quit or any other key to continue]") ;
- Xchr = getche() ;
- Xprintf("\r \r") ;
- X#endif
- X
- Xif ((chr == 'q')||(chr == 'Q')) exit (0) ;
- X
- Xprintf("When corresponding please state the current version of\n") ;
- Xprintf("Dinkum which you are using. Contributions and questions\n") ;
- Xprintf("about this program should be sent to the following address:\n\n") ;
- Xprintf(" E-mail address: gary@sun.mech.uq.oz.au\n\n") ;
- Xprintf(" Postal address: Gary A. Allen, Jr. \n");
- Xprintf(" P.O. Box 13\n") ;
- Xprintf(" St. Lucia, Queensland 4067\n");
- Xprintf(" Australia\n") ;
- X
- Xexit(0);
- X} /* ---- end of the "help" subroutine ---- */
- X
- END_OF_FILE
- if test 26298 -ne `wc -c <'dinkum.c'`; then
- echo shar: \"'dinkum.c'\" unpacked with wrong size!
- fi
- # end of 'dinkum.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'\" \(23544 characters\)
- sed "s/^X//" >'monster.c' <<'END_OF_FILE'
- X#define MNSTR
- X#include "dink_sym.h"
- X#include "dink_glb.h"
- X
- Xvoid monster(i_n, old_n)
- X/********************************************************************/
- X/* */
- X/* --- The Monster Subroutine --- */
- X/* */
- X/* monster_flag is a global variable input parameters */
- X/* */
- X/* Software by Gary A. Allen, Jr. 7 Sept. 1989, Version: Mk 1.5 */
- X/* (c) Copyright 1989 by Gary A. Allen, Jr. */
- X/* */
- X/********************************************************************/
- Xint *i_n, *old_n ;
- X{
- X#ifdef __TURBOC__
- Xvoid ender(int), long_descp(int), hold_it(void), boom(void) ;
- X#endif
- X
- Xregister int i, j ;
- Xint n, sw_chasing, sw_local, j_chase, j_local ;
- Xstatic int sw_snaked = FALSE, sw_hoop = FALSE, bear_flag = 0 ;
- Xstatic int old_n_1, old_n_2, sw_replaced = FALSE, sw_wombat = FALSE ;
- Xstatic int sw_nogo = FALSE, sw_guarded = TRUE, sw_letter = FALSE ;
- Xstatic int count_down = 0 ;
- X
- X/* set up some of the input variables */
- Xn = *i_n ;
- 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 (n == 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_max; j++) {
- X if (enemy[j][E_location] == n) {
- X sw_local = TRUE;
- X j_local = j ;
- X }
- X else if (enemy[j][E_status] != F_asleep){
- X if ((N_mullah == j)||(N_guards == j)||((N_ned == j)&&
- X (enemy[j][E_status] == F_stealing))) continue ;
- X sw_chasing = TRUE;
- X j_chase = j ;
- 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(j_chase) {
- 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 enemy[j_local][E_status] = F_asleep ;
- X enemy[j_local][E_location] = enemy[N_wombat][E_location] ;
- X goto chaser ;
- X
- X/* Hoop Snake breaks off the chase */
- X case 6:
- X case 7:
- X case 8:
- X case 9:
- X case 10:
- X case 11:
- X case 12:
- X case 13:
- 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 enemy[j_chase][E_status] = F_asleep ;
- X sw_chasing = FALSE;
- X}
- X
- X/* local monster routines */
- Xj = j_local ;
- Xswitch(j) {
- 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 (object[O_rifle][J_loc] == 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! Ten seconds later you look like ");
- Xprintf("a piece of Swiss cheese.\n\n") ;
- X ender(F_died) ;
- X}
- X
- Xswitch (enemy[N_guards][E_status]) {
- X case F_asleep:
- X enemy[N_guards][E_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 (enemy[N_mullah][E_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 *i_n = R_prayer;
- X long_descp(R_prayer) ;
- X goto tossed ;
- 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 enemy[N_guards][E_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 *i_n = 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 (enemy[N_mullah][E_status]) {
- X case F_asleep:
- Xtossed:
- X printf("\n") ;
- X hold_it() ;
- X enemy[N_mullah][E_status] = F_aggressive ;
- X enemy[N_guards][E_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 user has any valuables or the letter */
- X for (i = 0; i <= objcnt; i++) {
- X if ((object[i][J_loc] == B_have)&&
- X ((O_letter == i)||(object[i][J_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_down = 0 ;
- X return ;
- 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") ;
- X goto mullah_kills ;
- X
- X case F_aggressive:
- X if (object[O_letter][J_loc]==R_prayer) goto see_letter;
- 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 impaitent. You had better\n") ;
- Xprintf("do something soon!\n") ;
- X enemy[N_mullah][E_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 (object[O_letter][J_loc]==R_prayer) goto see_letter;
- Xprintf("\"You are a brainless idiot!\" screams the Mullah!\n") ;
- X goto mullah_kills ;
- X} /* end of mullah status switch block */
- X
- X/* The mullah sees Gaddafi's letter */
- Xsee_letter:
- 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
- Xenemy[N_mullah][E_status] = F_passive ;
- Xenemy[N_guards][E_status] = F_passive ;
- Xobject[O_letter][J_loc] = B_destroyed ;
- X--room[R_prayer][M_obj_cnt] ;
- Xobject[O_clapper][J_loc] = B_have ;
- Xobject[O_detector][J_loc] = R_guard ;
- X++room[R_guard][M_obj_cnt] ;
- Xsw_letter = TRUE ;
- Xcount_down = 0 ;
- 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 *i_n = R_hideout_entr ;
- X monster_flag = F_monster_active ;
- X enemy[N_ned][E_status] = F_passive ;
- X return ;
- X}
- Xelse {
- X if (enemy[N_ned][E_status] == F_killing) goto 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 *i_n = R_hideout_entr ;
- X enemy[N_ned][E_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 enemy[N_wombat][E_status] = F_aggressive ;
- X old_n_1 = n ;
- X old_n_2 = 0 ; /* zero out the previous location */
- X *old_n = old_n_2 ;
- X return ;
- X}
- Xelse {
- X if (enemy[N_wombat][E_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 enemy[N_wombat][E_status] = F_killing ;
- X return ;
- X }
- X if (enemy[N_wombat][E_status] == F_killing) goto wombat_kills ;
- X}
- X
- X/* Drop Bear monster behavior */
- Xcase 2:
- Xcase 3:
- Xcase 4:
- Xcase 5:
- 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 ;
- Xenemy[j][E_status] = F_aggressive ;
- Xreturn ;
- X}
- Xelse {
- X if (enemy[j][E_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 enemy[j][E_status] = F_killing ;
- X return ;
- X }
- X if (enemy[j][E_status] == F_killing) goto bear_kills ;
- X}
- X
- X/* Hoop Snake monster behavior */
- Xcase 6:
- Xcase 7:
- Xcase 8:
- Xcase 9:
- Xcase 10:
- Xcase 11:
- Xcase 12:
- Xcase 13:
- 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 enemy[j][E_status] = F_aggressive ;
- X old_n_1 = n ;
- X old_n_2 = 0 ; /* zero out the previous location */
- X *old_n = old_n_2 ;
- X return ;
- X}
- Xelse {
- X if (enemy[j][E_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 enemy[j][E_status] = F_killing ;
- X return ;
- X }
- X if (enemy[j][E_status] == F_killing) goto snake_kills ;
- X}
- X} /* end of the local monster switch group */
- X}
- X
- X/* chasing monster routines */
- Xchaser:
- Xj = j_chase ;
- Xswitch(j) {
- X/* Ned Kelly */
- Xcase N_ned:
- X if (n == R_hideout_entr) {
- X if (enemy[N_ned][E_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 enemy[N_ned][E_status] = F_aggressive ;
- X return ;
- X }
- X if (enemy[N_ned][E_status] == F_aggressive) {
- Xprintf("\nNed seems to be getting impaitent 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 enemy[N_ned][E_status] = F_killing ;
- X return ;
- X }
- X if (enemy[N_ned][E_status] != F_killing) break ;
- X else goto ned_kills ;
- X }
- X else break ;
- X
- X/* Mutant wombat chases */
- Xcase N_wombat:
- X if (n == 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 (n == old_n_2) {
- Xprintf("The wombat is in that direction. You can't go that way!\n");
- X *i_n = old_n_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 enemy[j][E_status] = F_aggressive ;
- X --room[enemy[j][E_location]][M_monster] ;
- X ++room[n][M_monster] ;
- X enemy[j][E_location] = n ;
- X old_n_2 = old_n_1 ;
- X old_n_1 = n ;
- X *old_n = old_n_2 ;
- X return ;
- X
- X/* Hoop Snake chases */
- Xcase 6:
- Xcase 7:
- Xcase 8:
- Xcase 9:
- Xcase 10:
- Xcase 11:
- Xcase 12:
- Xcase 13:
- X if (n == 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 (n == old_n_2) {
- X if (enemy[j][E_status] == F_killing) {
- Xprintf("The hoop snake is in that direction. ") ;
- Xprintf("You can't go that way!\n");
- X *i_n = old_n_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 enemy[j][E_status] = F_aggressive ;
- X --room[enemy[j][E_location]][M_monster] ;
- X ++room[n][M_monster] ;
- X enemy[j][E_location] = n ;
- X old_n_2 = old_n_1 ;
- X old_n_1 = n ;
- X *old_n = old_n_2 ;
- X return ;
- X} /* end of the chasing monster switch group */
- X
- X/* player has fled the monster, so turn it off */
- Xmonster_flag = F_no_monster ;
- Xenemy[j][E_status] = F_asleep ;
- Xreturn ;
- X
- X/* Ned Kelly kills the player */
- Xned_kills:
- 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") ;
- Xender(F_died) ;
- X
- X/* The Mutant Wombat kills the player */
- Xwombat_kills:
- 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") ;
- Xender(F_died) ;
- X
- X/* The Hoop Snake kills the player */
- Xsnake_kills:
- 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") ;
- Xender(F_died) ;
- X
- X/* The drop bear kills the player */
- Xbear_kills:
- 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") ;
- Xender(F_died) ;
- X
- X/* The Mullah kills the player */
- Xmullah_kills:
- 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") ;
- Xender(F_died) ;
- X
- X} /* --- end of the "monster" subroutine --- */
- END_OF_FILE
- if test 23544 -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 4 \(of 6\).
- cp /dev/null ark4isdone
- MISSING=""
- for I in 1 2 3 4 5 6 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 6 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
-