new upstream

git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@10080 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
joey
2004-02-14 21:35:37 +00:00
parent 26fb70d304
commit a02c126403
224 changed files with 5624 additions and 2217 deletions

View File

@@ -1,31 +0,0 @@
1997-12-19
I have replaced the old hunt port, which was rather a mess, with a version
based on that in NetBSD-current. This version now uses internet domain
sockets rather than Unix domain sockets, but is almost completely untested.
The original README.linux is below.
Joseph S. Myers
jsm@polyomino.org.uk
8/25/93
Finally, we have a version of hunt that appears to work!!!!!!
It hasn't been extensively tested, and may contain many bugs. Note,
any problems would most likely be due to my mangling/porting the code.
The original authors have done a nice job.
Also, you can go through the Makefile and specify your desired game
parameters. Be careful what you change, this Linux version is rather
fragile. Any volunteers to sort out running over a network?
One hint for those who have never played hunt before ...
1. Start the hunt driver: % /usr/sbin/huntd &
2. Now start hunt: % /usr/games/hunt [options]
In other words, for best results, get the driver running first.
Happy hunting! (And if you ever see "black tite" show up in one of your
hunt games, RUN!!!!!)
Curt Olson
curt@sledge.mn.org

View File

@@ -1,4 +1,4 @@
/* $NetBSD: hunt.c,v 1.20 2003/06/11 12:04:06 wiz Exp $ */
/* $NetBSD: hunt.c,v 1.22 2004/02/08 22:23:50 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hunt.c,v 1.20 2003/06/11 12:04:06 wiz Exp $");
__RCSID("$NetBSD: hunt.c,v 1.22 2004/02/08 22:23:50 jsm Exp $");
#endif /* not lint */
# include <sys/param.h>
@@ -112,15 +112,15 @@ static int in_visual;
extern int cur_row, cur_col;
void dump_scores __P((SOCKET));
long env_init __P((long));
void fill_in_blanks __P((void));
void leave __P((int, const char *)) __attribute__((__noreturn__));
void leavex __P((int, const char *)) __attribute__((__noreturn__));
void fincurs __P((void));
int main __P((int, char *[]));
void dump_scores(SOCKET);
long env_init(long);
void fill_in_blanks(void);
void leave(int, const char *) __attribute__((__noreturn__));
void leavex(int, const char *) __attribute__((__noreturn__));
void fincurs(void);
int main(int, char *[]);
# ifdef INTERNET
SOCKET *list_drivers __P((void));
SOCKET *list_drivers(void);
# endif
extern int Otto_mode;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: otto.c,v 1.5 2003/06/11 12:00:21 wiz Exp $ */
/* $NetBSD: otto.c,v 1.7 2004/02/08 22:23:50 jsm Exp $ */
# ifdef OTTO
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -45,7 +45,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: otto.c,v 1.5 2003/06/11 12:00:21 wiz Exp $");
__RCSID("$NetBSD: otto.c,v 1.7 2004/02/08 22:23:50 jsm Exp $");
#endif /* not lint */
# include <sys/time.h>
@@ -142,15 +142,15 @@ STATIC int num_turns; /* for wandering */
STATIC char been_there[HEIGHT][WIDTH2];
STATIC struct itimerval pause_time = { { 0, 0 }, { 0, 55000 }};
STATIC void attack __P((int, struct item *));
STATIC void duck __P((int));
STATIC void face_and_move_direction __P((int, int));
STATIC int go_for_ammo __P((char));
STATIC void ottolook __P((int, struct item *));
STATIC void look_around __P((void));
STATIC SIGNAL_TYPE nothing __P((int));
STATIC int stop_look __P((struct item *, char, int, int));
STATIC void wander __P((void));
STATIC void attack(int, struct item *);
STATIC void duck(int);
STATIC void face_and_move_direction(int, int);
STATIC int go_for_ammo(char);
STATIC void ottolook(int, struct item *);
STATIC void look_around(void);
STATIC SIGNAL_TYPE nothing(int);
STATIC int stop_look(struct item *, char, int, int);
STATIC void wander(void);
extern int Otto_count;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: playit.c,v 1.7 2003/06/11 12:00:21 wiz Exp $ */
/* $NetBSD: playit.c,v 1.8 2004/01/27 20:30:29 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: playit.c,v 1.7 2003/06/11 12:00:21 wiz Exp $");
__RCSID("$NetBSD: playit.c,v 1.8 2004/01/27 20:30:29 jsm Exp $");
#endif /* not lint */
# include <sys/file.h>
@@ -95,8 +95,8 @@ static unsigned char ibuf[256], *iptr = ibuf;
extern int _putchar();
#endif
static unsigned char getchr __P((void));
static void send_stuff __P((void));
static unsigned char getchr(void);
static void send_stuff(void);
/*
* playit:

View File

@@ -1,4 +1,4 @@
/* $NetBSD: driver.c,v 1.9 2003/06/11 12:00:22 wiz Exp $ */
/* $NetBSD: driver.c,v 1.10 2004/01/27 20:30:29 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: driver.c,v 1.9 2003/06/11 12:00:22 wiz Exp $");
__RCSID("$NetBSD: driver.c,v 1.10 2004/01/27 20:30:29 jsm Exp $");
#endif /* not lint */
# include <sys/ioctl.h>
@@ -69,13 +69,13 @@ u_short stat_port; /* port # of statistics tcp socket */
# define DAEMON_SIZE (sizeof Daemon - 1)
# endif
static void clear_scores __P((void));
static int havechar __P((PLAYER *, int));
static void init __P((void));
int main __P((int, char *[], char *[]));
static void makeboots __P((void));
static void send_stats __P((void));
static void zap __P((PLAYER *, FLAG, int));
static void clear_scores(void);
static int havechar(PLAYER *, int);
static void init(void);
int main(int, char *[], char *[]);
static void makeboots(void);
static void send_stats(void);
static void zap(PLAYER *, FLAG, int);
/*

View File

@@ -1,4 +1,4 @@
/* $NetBSD: execute.c,v 1.3 2003/06/11 12:00:22 wiz Exp $ */
/* $NetBSD: execute.c,v 1.4 2004/01/27 20:30:29 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,19 +32,19 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: execute.c,v 1.3 2003/06/11 12:00:22 wiz Exp $");
__RCSID("$NetBSD: execute.c,v 1.4 2004/01/27 20:30:29 jsm Exp $");
#endif /* not lint */
# include <stdlib.h>
# include "hunt.h"
static void cloak __P((PLAYER *));
static void face __P((PLAYER *, int));
static void fire __P((PLAYER *, int));
static void fire_slime __P((PLAYER *, int));
static void move_player __P((PLAYER *, int));
static void pickup __P((PLAYER *, int, int, int, int));
static void scan __P((PLAYER *));
static void cloak(PLAYER *);
static void face(PLAYER *, int);
static void fire(PLAYER *, int);
static void fire_slime(PLAYER *, int);
static void move_player(PLAYER *, int);
static void pickup(PLAYER *, int, int, int, int);
static void scan(PLAYER *);
# ifdef MONITOR

View File

@@ -1,4 +1,4 @@
/* $NetBSD: expl.c,v 1.3 2003/06/11 12:00:22 wiz Exp $ */
/* $NetBSD: expl.c,v 1.4 2004/01/27 20:30:29 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,13 +32,13 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: expl.c,v 1.3 2003/06/11 12:00:22 wiz Exp $");
__RCSID("$NetBSD: expl.c,v 1.4 2004/01/27 20:30:29 jsm Exp $");
#endif /* not lint */
# include <stdlib.h>
# include "hunt.h"
static void remove_wall __P((int, int));
static void remove_wall(int, int);
/*

View File

@@ -1,4 +1,4 @@
/* $NetBSD: faketalk.c,v 1.8 2003/06/11 12:00:22 wiz Exp $ */
/* $NetBSD: faketalk.c,v 1.10 2004/02/08 22:23:50 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: faketalk.c,v 1.8 2003/06/11 12:00:22 wiz Exp $");
__RCSID("$NetBSD: faketalk.c,v 1.10 2004/02/08 22:23:50 jsm Exp $");
#endif /* not lint */
#include "bsd.h"
@@ -66,8 +66,8 @@ extern char *my_machine_name;
extern char *First_arg, *Last_arg;
extern char **environ;
static void do_announce __P((char *));
SIGNAL_TYPE exorcise __P((int));
static void do_announce(char *);
SIGNAL_TYPE exorcise(int);
/*
* exorcise - disspell zombies
*/

View File

@@ -1,4 +1,4 @@
/* $NetBSD: hunt.h,v 1.9 2003/06/11 12:04:06 wiz Exp $ */
/* $NetBSD: hunt.h,v 1.11 2004/02/08 22:23:50 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -416,69 +416,69 @@ extern FLAG no_beep;
* function types
*/
void add_shot __P((int, int, int, char, int, PLAYER *, int, char));
int answer __P((void));
void bad_con __P((void)) __attribute__((__noreturn__));
void bad_ver __P((void)) __attribute__((__noreturn__));
int broadcast_vec __P((int, struct sockaddr **));
void ce __P((PLAYER *));
void cgoto __P((PLAYER *, int, int));
void check __P((PLAYER *, int, int));
void checkdam __P((PLAYER *, PLAYER *, IDENT *, int, char));
void clearwalls __P((void));
void clear_eol __P((void));
void clear_the_screen __P((void));
void clrscr __P((PLAYER *));
BULLET *create_shot __P((int, int, int, char, int, int, PLAYER *,
IDENT *, int, char));
void do_connect __P((const char *, char, long));
void do_message __P((void));
void drawmaze __P((PLAYER *));
void drawplayer __P((PLAYER *, FLAG));
void drawstatus __P((PLAYER *));
void execute __P((PLAYER *));
void faketalk __P((void));
void find_driver __P((FLAG));
void fixshots __P((int, int, char));
IDENT *get_ident __P((u_long, u_long, const char *, char));
void get_local_name __P((const char *));
int get_remote_name __P((char *));
BULLET *is_bullet __P((int, int));
void look __P((PLAYER *));
void makemaze __P((void));
void message __P((PLAYER *, const char *));
void mon_execute __P((PLAYER *));
void moveshots __P((void));
void open_ctl __P((void));
int opposite __P((int, char));
void otto __P((int, int, char));
void outch __P((PLAYER *, int));
void outstr __P((PLAYER *, const char *, int));
int player_sym __P((const PLAYER *, int, int));
PLAYER *play_at __P((int, int));
void playit __P((void));
void put_ch __P((char));
void add_shot(int, int, int, char, int, PLAYER *, int, char);
int answer(void);
void bad_con(void) __attribute__((__noreturn__));
void bad_ver(void) __attribute__((__noreturn__));
int broadcast_vec(int, struct sockaddr **);
void ce(PLAYER *);
void cgoto(PLAYER *, int, int);
void check(PLAYER *, int, int);
void checkdam(PLAYER *, PLAYER *, IDENT *, int, char);
void clearwalls(void);
void clear_eol(void);
void clear_the_screen(void);
void clrscr(PLAYER *);
BULLET *create_shot(int, int, int, char, int, int, PLAYER *,
IDENT *, int, char);
void do_connect(const char *, char, long);
void do_message(void);
void drawmaze(PLAYER *);
void drawplayer(PLAYER *, FLAG);
void drawstatus(PLAYER *);
void execute(PLAYER *);
void faketalk(void);
void find_driver(FLAG);
void fixshots(int, int, char);
IDENT *get_ident(u_long, u_long, const char *, char);
void get_local_name(const char *);
int get_remote_name(char *);
BULLET *is_bullet(int, int);
void look(PLAYER *);
void makemaze(void);
void message(PLAYER *, const char *);
void mon_execute(PLAYER *);
void moveshots(void);
void open_ctl(void);
int opposite(int, char);
void otto(int, int, char);
void outch(PLAYER *, int);
void outstr(PLAYER *, const char *, int);
int player_sym(const PLAYER *, int, int);
PLAYER *play_at(int, int);
void playit(void);
void put_ch(char);
# ifndef USE_CURSES
void put_str __P((const char *));
void put_str(const char *);
# endif
int quit __P((int));
int rand_dir __P((void));
int rand_num __P((int));
void redraw_screen __P((void));
void rmnl __P((char *));
void rollexpl __P((void));
void see __P((PLAYER *, int));
void sendcom __P((PLAYER *, int, ...));
void showexpl __P((int, int, char));
void showstat __P((PLAYER *));
void start_driver __P((void));
void stmonitor __P((PLAYER *));
void stplayer __P((PLAYER *, int));
char translate __P((char));
SIGNAL_TYPE cleanup __P((int)) __attribute__((__noreturn__));
SIGNAL_TYPE intr __P((int));
SIGNAL_TYPE sigalrm __P((int));
SIGNAL_TYPE sigemt __P((int)) __attribute__((__noreturn__));
SIGNAL_TYPE sigterm __P((int)) __attribute__((__noreturn__));
SIGNAL_TYPE sigusr1 __P((int)) __attribute__((__noreturn__));
SIGNAL_TYPE tstp __P((int));
int quit(int);
int rand_dir(void);
int rand_num(int);
void redraw_screen(void);
void rmnl(char *);
void rollexpl(void);
void see(PLAYER *, int);
void sendcom(PLAYER *, int, ...);
void showexpl(int, int, char);
void showstat(PLAYER *);
void start_driver(void);
void stmonitor(PLAYER *);
void stplayer(PLAYER *, int);
char translate(char);
SIGNAL_TYPE cleanup(int) __attribute__((__noreturn__));
SIGNAL_TYPE intr(int);
SIGNAL_TYPE sigalrm(int);
SIGNAL_TYPE sigemt(int) __attribute__((__noreturn__));
SIGNAL_TYPE sigterm(int) __attribute__((__noreturn__));
SIGNAL_TYPE sigusr1(int) __attribute__((__noreturn__));
SIGNAL_TYPE tstp(int);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: makemaze.c,v 1.3 2003/06/11 12:00:22 wiz Exp $ */
/* $NetBSD: makemaze.c,v 1.4 2004/01/27 20:30:29 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: makemaze.c,v 1.3 2003/06/11 12:00:22 wiz Exp $");
__RCSID("$NetBSD: makemaze.c,v 1.4 2004/01/27 20:30:29 jsm Exp $");
#endif /* not lint */
# include "hunt.h"
@@ -40,10 +40,10 @@ __RCSID("$NetBSD: makemaze.c,v 1.3 2003/06/11 12:00:22 wiz Exp $");
# define ISCLEAR(y,x) (Maze[y][x] == SPACE)
# define ODD(n) ((n) & 01)
static int candig __P((int, int));
static void dig __P((int, int));
static void dig_maze __P((int, int));
static void remap __P((void));
static int candig(int, int);
static void dig(int, int);
static void dig_maze(int, int);
static void remap(void);
void
makemaze()

View File

@@ -1,4 +1,4 @@
/* $NetBSD: shots.c,v 1.4 2003/06/11 12:00:23 wiz Exp $ */
/* $NetBSD: shots.c,v 1.5 2004/01/27 20:30:29 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: shots.c,v 1.4 2003/06/11 12:00:23 wiz Exp $");
__RCSID("$NetBSD: shots.c,v 1.5 2004/01/27 20:30:29 jsm Exp $");
#endif /* not lint */
# include <err.h>
@@ -43,21 +43,21 @@ __RCSID("$NetBSD: shots.c,v 1.4 2003/06/11 12:00:23 wiz Exp $");
# define PLUS_DELTA(x, max) if (x < max) x++; else x--
# define MINUS_DELTA(x, min) if (x > min) x--; else x++
static void chkshot __P((BULLET *, BULLET *));
static void chkslime __P((BULLET *, BULLET *));
static void explshot __P((BULLET *, int, int));
static void find_under __P((BULLET *, BULLET *));
static int iswall __P((int, int));
static void mark_boot __P((BULLET *));
static void mark_player __P((BULLET *));
static void chkshot(BULLET *, BULLET *);
static void chkslime(BULLET *, BULLET *);
static void explshot(BULLET *, int, int);
static void find_under(BULLET *, BULLET *);
static int iswall(int, int);
static void mark_boot(BULLET *);
static void mark_player(BULLET *);
#ifdef DRONE
static void move_drone __P((BULLET *));
static void move_drone(BULLET *);
#endif
static void move_flyer __P((PLAYER *));
static int move_normal_shot __P((BULLET *));
static void move_slime __P((BULLET *, int, BULLET *));
static void save_bullet __P((BULLET *));
static void zapshot __P((BULLET *, BULLET *));
static void move_flyer(PLAYER *);
static int move_normal_shot(BULLET *);
static void move_slime(BULLET *, int, BULLET *);
static void save_bullet(BULLET *);
static void zapshot(BULLET *, BULLET *);
/*
* moveshots:

View File

@@ -1,4 +1,4 @@
/* $NetBSD: talk_ctl.h,v 1.5 2003/06/11 12:00:23 wiz Exp $ */
/* $NetBSD: talk_ctl.h,v 1.6 2004/01/27 20:30:29 jsm Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -103,4 +103,4 @@ extern CTL_MSG msg;
#define p_error(str) warn(str)
#endif
void ctl_transact __P((struct in_addr, CTL_MSG, int, CTL_RESPONSE *));
void ctl_transact(struct in_addr, CTL_MSG, int, CTL_RESPONSE *);