Skip to content

Commit

Permalink
copy in from cvs; cvs2svn fucked up big time
Browse files Browse the repository at this point in the history
git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@9775 a4a2c43b-8ac3-0310-8836-e0e880c912e2
  • Loading branch information
joey committed Dec 19, 2003
1 parent 351c8ca commit 51eabc0
Show file tree
Hide file tree
Showing 310 changed files with 7,835 additions and 4,988 deletions.
6 changes: 3 additions & 3 deletions adventure/Makefile.bsd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 1998/08/01 23:02:35 hubertf Exp $
# $NetBSD: Makefile,v 1.9 2002/03/05 21:28:12 thorpej Exp $
# @(#)Makefile 8.1 (Berkeley) 6/12/93

PROG= adventure
Expand All @@ -8,9 +8,9 @@ HIDEGAME=hidegame
CLEANFILES+=setup data.c

data.c: glorkz setup
${.OBJDIR}/setup ${.CURDIR}/glorkz > data.c
./setup ${.CURDIR}/glorkz > data.c

setup: setup.c hdr.h
${HOST_CC} -o setup ${.CURDIR}/setup.c
${HOST_LINK.c} -o setup ${.CURDIR}/setup.c

.include <bsd.prog.mk>
26 changes: 26 additions & 0 deletions adventure/Makefrag
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
# Makefrag - makefile fragment for adventure
#
# Copyright (c) 1997, 1998 Joseph Samuel Myers.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

adventure_CLEANFILES := data.c
adventure_DIRS := $(GAMESDIR) $(MAN6DIR)
Expand Down
4 changes: 2 additions & 2 deletions adventure/crc.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: crc.c,v 1.6 1998/09/13 00:07:24 hubertf Exp $ */
/* $NetBSD: crc.c,v 1.7 1999/02/10 00:29:21 hubertf Exp $ */

/*-
* Copyright (c) 1993
Expand Down Expand Up @@ -42,7 +42,7 @@
static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 5/31/93";
static char ORIGINAL_sccsid[] = "@(#)crc.c 5.2 (Berkeley) 4/4/91";
#else
__RCSID("$NetBSD: crc.c,v 1.6 1998/09/13 00:07:24 hubertf Exp $");
__RCSID("$NetBSD: crc.c,v 1.7 1999/02/10 00:29:21 hubertf Exp $");
#endif
#endif /* not lint */

Expand Down
5 changes: 3 additions & 2 deletions adventure/done.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: done.c,v 1.6 1998/09/13 15:21:36 hubertf Exp $ */
/* $NetBSD: done.c,v 1.7 2000/07/03 03:57:39 matt Exp $ */

/*-
* Copyright (c) 1991, 1993
Expand Down Expand Up @@ -43,13 +43,14 @@
#if 0
static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: done.c,v 1.6 1998/09/13 15:21:36 hubertf Exp $");
__RCSID("$NetBSD: done.c,v 1.7 2000/07/03 03:57:39 matt Exp $");
#endif
#endif /* not lint */

/* Re-coding of advent in C: termination routines */

#include <stdio.h>
#include <stdlib.h>
#include "hdr.h"
#include "extern.h"

Expand Down
75 changes: 37 additions & 38 deletions adventure/hdr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: hdr.h,v 1.5 1998/08/29 20:19:56 hubertf Exp $ */
/* $NetBSD: hdr.h,v 1.9 2001/02/05 00:20:05 christos Exp $ */

/*-
* Copyright (c) 1991, 1993
Expand Down Expand Up @@ -51,97 +51,96 @@
*
* The data file distributed with the fortran source is assumed to be called
* "glorkz" in the directory where the program is first run.
*
* The original FORTRAN version can be found at
* <URL:ftp://ftp.gmd.de/if-archive/games/source/advent-original.tar.gz>.
*/

/* hdr.h: included by c advent files */

#include <signal.h>

int datfd; /* message file descriptor */
volatile sig_atomic_t delhit;
int yea;
extern int datfd; /* message file descriptor */
extern volatile sig_atomic_t delhit;
extern int yea;
extern char data_file[]; /* Virtual data file */

#define TAB 011
#define LF 012
#define FLUSHLINE do { int flushline_ch; while ((flushline_ch = getchar()) != EOF && flushline_ch != '\n'); } while (0)
#define FLUSHLF while (next()!=LF)

int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2;
char *wd1, *wd2; /* the complete words */
int verb, obj, spk;
extern int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2;
extern char *wd1, *wd2; /* the complete words */
extern int verb, obj, spk;
extern int blklin;
int saved, savet, mxscor, latncy;
extern int saveday, savet, mxscor, latncy;

#define SHORT 50 /* How short is a demo game? */

#define MAXSTR 20 /* max length of user's words */

#define HTSIZE 512 /* max number of vocab words */
struct hashtab { /* hash table for vocabulary */
extern struct hashtab { /* hash table for vocabulary */
int val; /* word type &index (ktab) */
char *atab; /* pointer to actual string */
} voc[HTSIZE];
#define SEED 1815622 /* "Encryption" seed */

struct text
#ifdef OLDSTUFF
{
int seekadr; /* DATFILE must be < 2**16 */
#endif /* OLDSTUFF */
{
char *seekadr;/* Msg start in virtual disk */
int txtlen; /* length of msg starting here */
};

#define RTXSIZ 205
struct text rtext[RTXSIZ]; /* random text messages */
extern struct text rtext[RTXSIZ]; /* random text messages */

#define MAGSIZ 35
struct text mtext[MAGSIZ]; /* magic messages */
extern struct text mtext[MAGSIZ]; /* magic messages */

int clsses;
extern int clsses;
#define CLSMAX 12
struct text ctext[CLSMAX]; /* classes of adventurer */
int cval[CLSMAX];
extern struct text ctext[CLSMAX]; /* classes of adventurer */
extern int cval[CLSMAX];

struct text ptext[101]; /* object descriptions */
extern struct text ptext[101]; /* object descriptions */

#define LOCSIZ 141 /* number of locations */
struct text ltext[LOCSIZ]; /* long loc description */
struct text stext[LOCSIZ]; /* short loc descriptions */
extern struct text ltext[LOCSIZ]; /* long loc description */
extern struct text stext[LOCSIZ]; /* short loc descriptions */

struct travlist { /* direcs & conditions of travel */
extern struct travlist { /* direcs & conditions of travel */
struct travlist *next; /* ptr to next list entry */
int conditions; /* m in writeup (newloc / 1000) */
int tloc; /* n in writeup (newloc % 1000) */
int tverb; /* the verb that takes you there */
} *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */

int atloc[LOCSIZ];
extern int atloc[LOCSIZ];

int plac[101]; /* initial object placement */
int fixd[101], fixed[101]; /* location fixed? */
extern int plac[101]; /* initial object placement */
extern int fixd[101], fixed[101]; /* location fixed? */

int actspk[35]; /* rtext msg for verb <n> */
extern int actspk[35]; /* rtext msg for verb <n> */

int cond[LOCSIZ]; /* various condition bits */
extern int cond[LOCSIZ]; /* various condition bits */

extern int setbit[16]; /* bit defn masks 1,2,4,... */

int hntmax;
int hints[20][5]; /* info on hints */
int hinted[20], hintlc[20];
extern int hntmax;
extern int hints[20][5]; /* info on hints */
extern int hinted[20], hintlc[20];

int place[101], prop[101], links[201];
int abb[LOCSIZ];
extern int place[101], prop[101], links[201];
extern int abb[LOCSIZ];

int maxtrs, tally, tally2; /* treasure values */
extern int maxtrs, tally, tally2; /* treasure values */

#define FALSE 0
#define TRUE 1

int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
extern int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
bird, door, pillow, snake, fissur, tablet, clam, oyster,
magzin, dwarf, knife, food, bottle, water, oil, plant, plant2,
axe, mirror, dragon, chasm, troll, troll2, bear, messag,
Expand All @@ -150,15 +149,15 @@ struct text
null, entrnc, dprssn, enter, stream, pour, say, lock, throw,
find, invent;

int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */
extern int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */
odloc[7], dflag, daltlc;

int tk[21], stick, dtotal, attack;
int turns, lmwarn, iwest, knfloc, detail, /* various flags and
extern int tk[21], stick, dtotal, attack;
extern int turns, lmwarn, iwest, knfloc, detail, /* various flags and
* counters */
abbnum, maxdie, numdie, holdng, dkill, foobar, bonus, clock1,
clock2, saved, closng, panic, closed, scorng;

int demo, newloc, limit;
extern int demo, limit;

#define DECR(a,b,c,d,e) decr(a+'+',b+'-',c+'#',d+'&',e+'%')
70 changes: 67 additions & 3 deletions adventure/init.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: init.c,v 1.10 1998/08/29 20:19:56 hubertf Exp $ */
/* $NetBSD: init.c,v 1.13 2001/02/05 00:20:05 christos Exp $ */

/*-
* Copyright (c) 1993
Expand Down Expand Up @@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
#else
__RCSID("$NetBSD: init.c,v 1.10 1998/08/29 20:19:56 hubertf Exp $");
__RCSID("$NetBSD: init.c,v 1.13 2001/02/05 00:20:05 christos Exp $");
#endif
#endif /* not lint */

Expand All @@ -64,6 +64,70 @@ int blklin = TRUE;
int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000, 04000,
010000, 020000, 040000, 0100000};

int datfd; /* message file descriptor */
volatile sig_atomic_t delhit;
int yea;

int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2;
char *wd1, *wd2; /* the complete words */
int verb, obj, spk;
int saveday, savet, mxscor, latncy;

struct hashtab voc[HTSIZE];

struct text rtext[RTXSIZ]; /* random text messages */

struct text mtext[MAGSIZ]; /* magic messages */

int clsses;

struct text ctext[CLSMAX]; /* classes of adventurer */
int cval[CLSMAX];

struct text ptext[101]; /* object descriptions */

struct text ltext[LOCSIZ]; /* long loc description */
struct text stext[LOCSIZ]; /* short loc descriptions */

struct travlist *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */

int atloc[LOCSIZ];

int plac[101]; /* initial object placement */
int fixd[101], fixed[101]; /* location fixed? */

int actspk[35]; /* rtext msg for verb <n> */

int cond[LOCSIZ]; /* various condition bits */

int hntmax;
int hints[20][5]; /* info on hints */
int hinted[20], hintlc[20];

int place[101], prop[101], links[201];
int abb[LOCSIZ];

int maxtrs, tally, tally2; /* treasure values */

int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */
bird, door, pillow, snake, fissur, tablet, clam, oyster,
magzin, dwarf, knife, food, bottle, water, oil, plant, plant2,
axe, mirror, dragon, chasm, troll, troll2, bear, messag,
vend, batter, nugget, coins, chest, eggs, tridnt, vase,
emrald, pyram, pearl, rug, chain, spices, back, look, cave,
null, entrnc, dprssn, enter, stream, pour, say, lock, throw,
find, invent;

int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */
odloc[7], dflag, daltlc;

int tk[21], stick, dtotal, attack;
int turns, lmwarn, iwest, knfloc, detail, /* various flags and
* counters */
abbnum, maxdie, numdie, holdng, dkill, foobar, bonus, clock1,
clock2, saved, closng, panic, closed, scorng;

int demo, limit;

void
init() /* everything for 1st time run */
Expand Down Expand Up @@ -217,7 +281,7 @@ linkdata()

void
trapdel(n) /* come here if he hits a del */
int n __attribute__((unused));
int n __attribute__((__unused__));
{
delhit = 1; /* main checks, treats as QUIT */
signal(SIGINT, trapdel);/* catch subsequent DELs */
Expand Down
10 changes: 5 additions & 5 deletions adventure/io.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: io.c,v 1.10 1998/09/14 09:29:08 hubertf Exp $ */
/* $NetBSD: io.c,v 1.12 2000/01/09 17:17:19 jsm Exp $ */

/*-
* Copyright (c) 1991, 1993
Expand Down Expand Up @@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: io.c,v 1.10 1998/09/14 09:29:08 hubertf Exp $");
__RCSID("$NetBSD: io.c,v 1.12 2000/01/09 17:17:19 jsm Exp $");
#endif
#endif /* not lint */

Expand Down Expand Up @@ -361,7 +361,7 @@ rtrav()
if (locc != oldloc) { /* getting a new entry */
t = travel[locc] = (struct travlist *) malloc(sizeof(struct travlist));
if ( t == NULL)
errx(1, "Out of memory!");
err(1, NULL);
/* printf("New travel list for %d\n",locc); */
entries = 0;
oldloc = locc;
Expand All @@ -384,7 +384,7 @@ rtrav()
if (entries++) {
t = t->next = (struct travlist *) malloc(sizeof(struct travlist));
if (t == NULL)
errx(1, "Out of memory!");
err(1, NULL);
}
t->tverb = rnum(); /* get verb from the file */
t->tloc = n; /* table entry mod 1000 */
Expand Down Expand Up @@ -559,7 +559,7 @@ pspeak(m, skip) /* read, decrypt an print a ptext message */

msg = &ptext[m];
if ((tbuf = (char *) malloc(msg->txtlen + 1)) == NULL)
errx(1, "Out of memory!");
err(1, NULL);
memcpy(tbuf, msg->seekadr, msg->txtlen + 1); /* Room to null */
s = tbuf;

Expand Down
Loading

0 comments on commit 51eabc0

Please sign in to comment.