[comp.sources.games] v04i009: sail - multi-user wooden ships and iron men

games@tekred.TEK.COM (04/14/88)

Submitted by: bostic@okeeffe.Berkeley.EDU (Keith Bostic)
Comp.sources.games: Volume 4, Issue 9
Archive-name: sail/Part01

	[Here's another goodie from the Berkeley Software Distribution.
	 This source is freely distributable (see the copyright notices
	 for details). It will run on Suns, Vaxen and I don't know
	 what else.	-br]

#! /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 1 (of 4)."
# Contents:  README MANIFEST dr_1.c pl_5.c sail.6
# Wrapped by billr@saab on Wed Apr 13 13:38:20 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(270 characters\)
sed "s/^X//" >README <<'END_OF_README'
XThis is the game sail that is distributed as part of the Berkeley
X4.3BSD system.  The Makefile dependencies are for a 4.3 Vax.  It
Xwill compile and run on a Sun (and probably other machines) by
Xremoving the lines below the one that says "DO NOT REMOVE" in the
XMakefile.
END_OF_README
if test 270 -ne `wc -c <README`; then
    echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f MANIFEST -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"MANIFEST\"
else
echo shar: Extracting \"MANIFEST\" \(1146 characters\)
sed "s/^X//" >MANIFEST <<'END_OF_MANIFEST'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X :file                     4	
X :scene                    4	
X :ship                     4	
X :specs                    2	
X MANIFEST                  1	
X Makefile                  3	
X README                    1	
X assorted.c                2	
X dr_1.c                    1	
X dr_2.c                    3	
X dr_3.c                    2	
X dr_4.c                    4	
X dr_5.c                    4	
X dr_main.c                 4	
X driver.h                  4	
X externs.h                 3	
X game.c                    4	
X globals.c                 2	
X lo_main.c                 4	
X machdep.h                 3	
X main.c                    4	
X misc.c                    3	
X parties.c                 4	
X pl_1.c                    3	
X pl_2.c                    3	
X pl_3.c                    3	
X pl_4.c                    3	
X pl_5.c                    1	
X pl_6.c                    3	
X pl_7.c                    2	
X pl_main.c                 3	
X player.h                  3	
X sail.6                    1	
X sync.c                    2	
X version.c                 4	
END_OF_MANIFEST
if test 1146 -ne `wc -c <MANIFEST`; then
    echo shar: \"MANIFEST\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f dr_1.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"dr_1.c\"
else
echo shar: Extracting \"dr_1.c\" \(10300 characters\)
sed "s/^X//" >dr_1.c <<'END_OF_dr_1.c'
X/*
X * Copyright (c) 1983 Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that this notice is preserved and that due credit is given
X * to the University of California at Berkeley. The name of the University
X * may not be used to endorse or promote products derived from this
X * software without specific prior written permission. This software
X * is provided ``as is'' without express or implied warranty.
X */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)dr_1.c	5.2 (Berkeley) 3/9/88";
X#endif /* not lint */
X
X#include "driver.h"
X
Xunfoul()
X{
X	register struct ship *sp;
X	struct ship *to;
X	register int nat;
X	register i;
X
X	foreachship(sp) {
X		if (sp->file->captain[0])
X			continue;
X		nat = capship(sp)->nationality;
X		foreachship(to) {
X			if (nat != capship(to)->nationality &&
X			    !toughmelee(sp, to, 0, 0))
X				continue;
X			for (i = fouled2(sp, to); --i >= 0;)
X				if (die() <= 2)
X					cleanfoul(sp, to, 0);
X		}
X	}
X}
X
Xboardcomp()
X{
X	int crew[3];
X	register struct ship *sp, *sq;
X
X	foreachship(sp) {
X		if (*sp->file->captain)
X			continue;
X		if (sp->file->dir == 0)
X			continue;
X		if (sp->file->struck || sp->file->captured != 0)
X			continue;
X		if (!snagged(sp))
X			continue;
X		crew[0] = sp->specs->crew1 != 0;
X		crew[1] = sp->specs->crew2 != 0;
X		crew[2] = sp->specs->crew3 != 0;
X		foreachship(sq) {
X			if (!Xsnagged2(sp, sq))
X				continue;
X			if (meleeing(sp, sq))
X				continue;
X			if (!sq->file->dir
X				|| sp->nationality == capship(sq)->nationality)
X				continue;
X			switch (sp->specs->class - sq->specs->class) {
X			case -3: case -4: case -5:
X				if (crew[0]) {
X					/* OBP */
X					sendbp(sp, sq, crew[0]*100, 0);
X					crew[0] = 0;
X				} else if (crew[1]){
X					/* OBP */
X					sendbp(sp, sq, crew[1]*10, 0);
X					crew[1] = 0;
X				}
X				break;
X			case -2:
X				if (crew[0] || crew[1]) {
X					/* OBP */
X					sendbp(sp, sq, crew[0]*100+crew[1]*10,
X						0);
X					crew[0] = crew[1] = 0;
X				}
X				break;
X			case -1: case 0: case 1:
X				if (crew[0]) {
X					/* OBP */
X					sendbp(sp, sq, crew[0]*100+crew[1]*10,
X						0);
X					crew[0] = crew[1] = 0;
X				}
X				break;
X			case 2: case 3: case 4: case 5:
X				/* OBP */
X				sendbp(sp, sq, crew[0]*100+crew[1]*10+crew[2],
X					0);
X				crew[0] = crew[1] = crew[2] = 0;
X				break;
X			}
X		}
X	}
X}
X
Xfightitout(from, to, key)
Xstruct ship *from, *to;
Xint key;
X{
X	struct ship *fromcap, *tocap;
X	int crewfrom[3], crewto[3], menfrom, mento;
X	int pcto, pcfrom, fromstrength, strengthto, frominjured, toinjured;
X	int topoints;
X	int index, totalfrom = 0, totalto = 0;
X	int count;
X	char message[60];
X
X	menfrom = mensent(from, to, crewfrom, &fromcap, &pcfrom, key);
X	mento = mensent(to, from, crewto, &tocap, &pcto, 0);
X	if (fromcap == 0)
X		fromcap = from;
X	if (tocap == 0)
X		tocap = to;
X	if (key) {
X		if (!menfrom) {		 /* if crew surprised */
X			if (fromcap == from)
X				menfrom = from->specs->crew1
X					+ from->specs->crew2
X					+ from->specs->crew3;
X			else
X				menfrom = from->file->pcrew;
X		} else {
X			menfrom *= 2;	/* DBP's fight at an advantage */
X		}
X	}
X	fromstrength = menfrom * fromcap->specs->qual;
X	strengthto = mento * tocap->specs->qual;
X	for (count = 0;
X	     (fromstrength < strengthto * 3 && strengthto < fromstrength * 3
X	      || fromstrength == -1) && count < 4;
X	     count++) {
X		index = fromstrength/10;
X		if (index > 8)
X			index = 8;
X		toinjured = MT[index][2 - die() / 3];
X		totalto += toinjured;
X		index = strengthto/10;
X		if (index > 8)
X			index = 8;
X		frominjured = MT[index][2 - die() / 3];
X		totalfrom += frominjured;
X		menfrom -= frominjured;
X		mento -= toinjured;
X		fromstrength = menfrom * fromcap->specs->qual;
X		strengthto = mento * tocap->specs->qual;
X	}
X	if (fromstrength >= strengthto * 3 || count == 4) {
X		unboard(to, from, 0);
X		subtract(from, totalfrom, crewfrom, fromcap, pcfrom);
X		subtract(to, totalto, crewto, tocap, pcto);
X		makesignal(from, "boarders from %s repelled", to);
X		(void) sprintf(message, "killed in melee: %d.  %s: %d",
X			totalto, from->shipname, totalfrom);
X		Write(W_SIGNAL, to, 1, (int) message, 0, 0, 0);
X		if (key)
X			return 1;
X	} else if (strengthto >= fromstrength * 3) {
X		unboard(from, to, 0);
X		subtract(from, totalfrom, crewfrom, fromcap, pcfrom);
X		subtract(to, totalto, crewto, tocap, pcto);
X		if (key) {
X			if (fromcap != from)
X				Write(W_POINTS, fromcap, 0,
X					fromcap->file->points -
X						from->file->struck
X						? from->specs->pts
X						: 2 * from->specs->pts,
X					0, 0, 0);
X
X/* ptr1 points to the shipspec for the ship that was just unboarded.
X   I guess that what is going on here is that the pointer is multiplied
X   or something. */
X
X			Write(W_CAPTURED, from, 0, to->file->index, 0, 0, 0);
X			topoints = 2 * from->specs->pts + to->file->points;
X			if (from->file->struck)
X				topoints -= from->specs->pts;
X			Write(W_POINTS, to, 0, topoints, 0, 0, 0);
X			mento = crewto[0] ? crewto[0] : crewto[1];
X			if (mento) {
X				subtract(to, mento, crewto, tocap, pcto);
X				subtract(from, - mento, crewfrom, to, 0);
X			}
X			(void) sprintf(message, "captured by the %s!",
X				to->shipname);
X			Write(W_SIGNAL, from, 1, (int) message, 0, 0, 0);
X			(void) sprintf(message, "killed in melee: %d.  %s: %d",
X				totalto, from->shipname, totalfrom);
X			Write(W_SIGNAL, to, 1, (int) message, 0, 0, 0);
X			mento = 0;
X			return 0;
X		}
X	}
X	return 0;
X}
X
Xresolve()
X{
X	int thwart;
X	register struct ship *sp, *sq;
X
X	foreachship(sp) {
X		if (sp->file->dir == 0)
X			continue;
X		for (sq = sp + 1; sq < ls; sq++)
X			if (sq->file->dir && meleeing(sp, sq) && meleeing(sq, sp))
X				(void) fightitout(sp, sq, 0);
X		thwart = 2;
X		foreachship(sq) {
X			if (sq->file->dir && meleeing(sq, sp))
X				thwart = fightitout(sp, sq, 1);
X			if (!thwart)
X				break;
X		}
X		if (!thwart) {
X			foreachship(sq) {
X				if (sq->file->dir && meleeing(sq, sp))
X					unboard(sq, sp, 0);
X				unboard(sp, sq, 0);
X			}
X			unboard(sp, sp, 1);
X		} else if (thwart == 2)
X			unboard(sp, sp, 1);
X	}
X}
X
Xcompcombat()
X{
X	register n;
X	register struct ship *sp;
X	struct ship *closest;
X	int crew[3], men = 0, target, temp;
X	int r, guns, ready, load, car;
X	int index, rakehim, sternrake;
X	int shootat, hit;
X
X	foreachship(sp) {
X		if (sp->file->captain[0] || sp->file->dir == 0)
X			continue;
X		crew[0] = sp->specs->crew1;
X		crew[1] = sp->specs->crew2;
X		crew[2] = sp->specs->crew3;
X		for (n = 0; n < 3; n++) {
X			if (sp->file->OBP[n].turnsent)
X				men += sp->file->OBP[n].mensent;
X		}
X		for (n = 0; n < 3; n++) {
X			if (sp->file->DBP[n].turnsent)
X				men += sp->file->DBP[n].mensent;
X		}
X		if (men){
X			crew[0] = men/100 ? 0 : crew[0] != 0;
X			crew[1] = (men%100)/10 ? 0 : crew[1] != 0;
X			crew[2] = men%10 ? 0 : crew[2] != 0;
X		}
X		for (r = 0; r < 2; r++) {
X			if (!crew[2])
X				continue;
X			if (sp->file->struck)
X				continue;
X			if (r) {
X				ready = sp->file->readyR;
X				guns = sp->specs->gunR;
X				car = sp->specs->carR;
X			} else {
X				ready = sp->file->readyL;
X				guns = sp->specs->gunL;
X				car = sp->specs->carL;
X			}
X			if (!guns && !car)
X				continue;
X			if ((ready & R_LOADED) == 0)
X				continue;
X			closest = closestenemy(sp, r ? 'r' : 'l', 0);
X			if (closest == 0)
X				continue;
X			if (range(closest, sp) > range(sp, closestenemy(sp, r ? 'r' : 'l', 1)))
X				continue;
X			if (closest->file->struck)
X				continue;
X			target = range(sp, closest);
X			if (target > 10)
X				continue;
X			if (!guns && target >= 3)
X				continue;
X			load = L_ROUND;
X			if (target == 1 && sp->file->loadwith == L_GRAPE)
X				load = L_GRAPE;
X			if (target <= 3 && closest->file->FS)
X				load = L_CHAIN;
X			if (target == 1 && load != L_GRAPE)
X				load = L_DOUBLE;
X			if (load > L_CHAIN && target < 6)
X				shootat = HULL;
X			else
X				shootat = RIGGING;
X			rakehim = gunsbear(sp, closest)
X				&& !gunsbear(closest, sp);
X			temp = portside(closest, sp, 1)
X				- closest->file->dir + 1;
X			if (temp < 1)
X				temp += 8;
X			if (temp > 8)
X				temp -= 8;
X			sternrake = temp > 4 && temp < 6;
X			index = guns;
X			if (target < 3)
X				index += car;
X			index = (index - 1) / 3;
X			index = index > 8 ? 8 : index;
X			if (!rakehim)
X				hit = HDT[index][target-1];
X			else
X				hit = HDTrake[index][target-1];
X			if (rakehim && sternrake)
X				hit++;
X			hit += QUAL[index][capship(sp)->specs->qual - 1];
X			for (n = 0; n < 3 && sp->file->captured == 0; n++)
X				if (!crew[n])
X					if (index <= 5)
X						hit--;
X					else
X						hit -= 2;
X			if (ready & R_INITIAL) {
X				if (!r)
X					sp->file->readyL &= ~R_INITIAL;
X				else
X					sp->file->readyR &= ~R_INITIAL;
X				if (index <= 3)
X					hit++;
X				else
X					hit += 2;
X			}
X			if (sp->file->captured != 0)
X				if (index <= 1)
X					hit--;
X				else
X					hit -= 2;
X			hit += AMMO[index][load - 1];
X			temp = sp->specs->class;
X			if ((temp >= 5 || temp == 1) && windspeed == 5)
X				hit--;
X			if (windspeed == 6 && temp == 4)
X				hit -= 2;
X			if (windspeed == 6 && temp <= 3)
X				hit--;
X			if (hit >= 0) {
X				if (load != L_GRAPE)
X					hit = hit > 10 ? 10 : hit;
X				table(shootat, load, hit, closest, sp, die());
X			}
X		}
X	}
X}
X
Xnext()
X{
X	if (++turn % 55 == 0)
X		if (alive)
X			alive = 0;
X		else
X			people = 0;
X	if (people <= 0 || windspeed == 7) {
X		register struct ship *s;
X		struct ship *bestship;
X		float net, best = 0.0;
X		foreachship(s) {
X			if (*s->file->captain)
X				continue;
X			net = (float)s->file->points / s->specs->pts;
X			if (net > best) {
X				best = net;
X				bestship = s;
X			}
X		}
X		if (best > 0.0) {
X			char *p = getenv("WOTD");
X			if (p == 0)
X				p = "Driver";
X			if (islower(*p))
X				*p = toupper(*p);
X			(void) strncpy(bestship->file->captain, p,
X				sizeof bestship->file->captain);
X			bestship->file->captain
X				[sizeof bestship->file->captain - 1] = 0;
X			log(bestship);
X		}
X		return -1;
X	}
X	Write(W_TURN, SHIP(0), 0, turn, 0, 0, 0);
X	if (turn % 7 == 0 && (die() >= cc->windchange || !windspeed)) {
X		switch (die()) {
X		case 1:
X			winddir = 1;
X			break;
X		case 2:
X			break;
X		case 3:
X			winddir++;
X			break;
X		case 4:
X			winddir--;
X			break;
X		case 5:
X			winddir += 2;
X			break;
X		case 6:
X			winddir -= 2;
X			break;
X		}
X		if (winddir > 8)
X			winddir -= 8;
X		if (winddir < 1)
X			winddir += 8;
X		if (windspeed)
X			switch (die()) {
X			case 1:
X			case 2:
X				windspeed--;
X				break;
X			case 5:
X			case 6:
X				windspeed++;
X				break;
X			}
X		else
X			windspeed++;
X		Write(W_WIND, SHIP(0), 0, winddir, windspeed, 0, 0);
X	}
X	return 0;
X}
END_OF_dr_1.c
if test 10300 -ne `wc -c <dr_1.c`; then
    echo shar: \"dr_1.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f pl_5.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"pl_5.c\"
else
echo shar: Extracting \"pl_5.c\" \(5417 characters\)
sed "s/^X//" >pl_5.c <<'END_OF_pl_5.c'
X/*
X * Copyright (c) 1983 Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that this notice is preserved and that due credit is given
X * to the University of California at Berkeley. The name of the University
X * may not be used to endorse or promote products derived from this
X * software without specific prior written permission. This software
X * is provided ``as is'' without express or implied warranty.
X */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)pl_5.c	5.2 (Berkeley) 3/9/88";
X#endif /* not lint */
X
X#include "player.h"
X
X#define turnfirst(x) (*x == 'r' || *x == 'l')
X
Xacceptmove()
X{
X	int ta;
X	int ma;
X	char af;
X	int moved = 0;
X	int vma, dir;
X	char prompt[60];
X	char buf[60], last = '\0';
X	register char *p;
X
X	if (!mc->crew3 || snagged(ms) || !windspeed) {
X		Signal("Unable to move", (struct ship *)0);
X		return;
X	}
X
X	ta = maxturns(ms, &af);
X	ma = maxmove(ms, mf->dir, 0);
X	(void) sprintf(prompt, "move (%d,%c%d): ", ma, af ? '\'' : ' ', ta);
X	sgetstr(prompt, buf, sizeof buf);
X	dir = mf->dir;
X	vma = ma;
X	for (p = buf; *p; p++)
X		switch (*p) {
X		case 'l':
X			dir -= 2;
X		case 'r':
X			if (++dir == 0)
X				dir = 8;
X			else if (dir == 9)
X				dir = 1;
X			if (last == 't') {
X				Signal("Ship can't turn that fast.",
X					(struct ship *)0);
X				*p-- = '\0';
X			}
X			last = 't';
X			ma--;
X			ta--;
X			vma = min(ma, maxmove(ms, dir, 0));
X			if (ta < 0 && moved || vma < 0 && moved)
X				*p-- = '\0';
X			break;
X		case 'b':
X			ma--;
X			vma--;
X			last = 'b';
X			if (ta < 0 && moved || vma < 0 && moved)
X				*p-- = '\0';
X			break;
X		case '0':
X		case 'd':
X			*p-- = '\0';
X			break;
X		case '\n':
X			*p-- = '\0';
X			break;
X		case '1': case '2': case '3': case '4':
X		case '5': case '6': case '7':
X			if (last == '0') {
X				Signal("Can't move that fast.",
X					(struct ship *)0);
X				*p-- = '\0';
X			}
X			last = '0';
X			moved = 1;
X			ma -= *p - '0';
X			vma -= *p - '0';
X			if (ta < 0 && moved || vma < 0 && moved)
X				*p-- = '\0';
X			break;
X		default:
X			if (!isspace(*p)) {
X				Signal("Input error.", (struct ship *)0);
X				*p-- = '\0';
X			}
X		}
X	if (ta < 0 && moved || vma < 0 && moved
X	    || af && turnfirst(buf) && moved) {
X		Signal("Movement error.", (struct ship *)0);
X		if (ta < 0 && moved) {
X			if (mf->FS == 1) {
X				Write(W_FS, ms, 0, 0, 0, 0, 0);
X				Signal("No hands to set full sails.",
X					(struct ship *)0);
X			}
X		} else if (ma >= 0)
X			buf[1] = '\0';
X	}
X	if (af && !moved) {
X		if (mf->FS == 1) {
X			Write(W_FS, ms, 0, 0, 0, 0, 0);
X			Signal("No hands to set full sails.",
X				(struct ship *)0);
X		}
X	}
X	if (*buf)
X		(void) strcpy(movebuf, buf);
X	else
X		(void) strcpy(movebuf, "d");
X	Write(W_MOVE, ms, 1, (int)movebuf, 0, 0, 0);
X	Signal("Helm: %s.", (struct ship *)0, movebuf);
X}
X
Xacceptboard()
X{
X	register struct ship *sp;
X	register int n;
X	int crew[3];
X	int men = 0;
X	char c;
X
X	crew[0] = mc->crew1;
X	crew[1] = mc->crew2;
X	crew[2] = mc->crew3;
X	for (n = 0; n < NBP; n++) {
X		if (mf->OBP[n].turnsent)
X			    men += mf->OBP[n].mensent;
X	}
X	for (n = 0; n < NBP; n++) {
X		if (mf->DBP[n].turnsent)
X			    men += mf->DBP[n].mensent;
X	}
X	if (men) {
X		crew[0] = men/100 ? 0 : crew[0] != 0;
X		crew[1] = (men%100)/10 ? 0 : crew[1] != 0;
X		crew[2] = men%10 ? 0 : crew[2] != 0;
X	} else {
X		crew[0] = crew[0] != 0;
X		crew[1] = crew[1] != 0;
X		crew[2] = crew[2] != 0;
X	}
X	foreachship(sp) {
X		if (sp == ms || sp->file->dir == 0 || range(ms, sp) > 1)
X			continue;
X		if (ms->nationality == capship(sp)->nationality)
X			continue;
X		if (meleeing(ms, sp) && crew[2]) {
X			c = sgetch("How many more to board the %s (%c%c)? ",
X				sp, 1);
X			parties(crew, sp, 0, c);
X		} else if ((fouled2(ms, sp) || grappled2(ms, sp)) && crew[2]) {
X			c = sgetch("Crew sections to board the %s (%c%c) (3 max) ?", sp, 1);
X			parties(crew, sp, 0, c);
X		}
X	}
X	if (crew[2]) {
X		c = sgetch("How many sections to repel boarders? ",
X			(struct ship *)0, 1);
X		parties(crew, ms, 1, c);
X	}
X	blockalarm();
X	draw_slot();
X	unblockalarm();
X}
X
Xparties(crew, to, isdefense, buf)
Xregister struct ship *to;
Xint crew[3];
Xchar isdefense;
Xchar buf;
X{
X	register int k, j, men; 
X	struct BP *ptr;
X	int temp[3];
X
X	for (k = 0; k < 3; k++)
X		temp[k] = crew[k];
X	if (isdigit(buf)) {
X		ptr = isdefense ? to->file->DBP : to->file->OBP; 
X		for (j = 0; j < NBP && ptr[j].turnsent; j++)
X			;
X		if (!ptr[j].turnsent && buf > '0') {
X			men = 0;
X			for (k = 0; k < 3 && buf > '0'; k++) {
X				men += crew[k]
X					* (k == 0 ? 100 : (k == 1 ? 10 : 1));
X				crew[k] = 0;
X				if (men)
X					buf--;
X			}
X			if (buf > '0')
X				Signal("Sending all crew sections.",
X					(struct ship *)0);
X			Write(isdefense ? W_DBP : W_OBP, ms, 0,
X				j, turn, to->file->index, men);
X			if (isdefense) {
X				(void) wmove(slot_w, 2, 0);
X				for (k=0; k < NBP; k++)
X					if (temp[k] && !crew[k])
X						(void) waddch(slot_w, k + '1');
X					else
X						(void) wmove(slot_w, 2, 1 + k);
X				(void) mvwaddstr(slot_w, 3, 0, "DBP");
X				makesignal(ms, "repelling boarders",
X					(struct ship *)0);
X			} else {
X				(void) wmove(slot_w, 0, 0);
X				for (k=0; k < NBP; k++)
X					if (temp[k] && !crew[k])
X						(void) waddch(slot_w, k + '1');
X					else
X						(void) wmove(slot_w, 0, 1 + k);
X				(void) mvwaddstr(slot_w, 1, 0, "OBP");
X				makesignal(ms, "boarding the %s (%c%c)", to);
X			}
X			blockalarm();
X			(void) wrefresh(slot_w);
X			unblockalarm();
X		} else
X			Signal("Sending no crew sections.", (struct ship *)0);
X	}
X}
END_OF_pl_5.c
if test 5417 -ne `wc -c <pl_5.c`; then
    echo shar: \"pl_5.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f sail.6 -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"sail.6\"
else
echo shar: Extracting \"sail.6\" \(34609 characters\)
sed "s/^X//" >sail.6 <<'END_OF_sail.6'
X.\" Copyright (c) 1988 Regents of the University of California.
X.\" All rights reserved.
X.\"
X.\" Redistribution and use in source and binary forms are permitted
X.\" provided that this notice is preserved and that due credit is given
X.\" to the University of California at Berkeley. The name of the University
X.\" may not be used to endorse or promote products derived from this
X.\" software without specific prior written permission. This software
X.\" is provided ``as is'' without express or implied warranty.
X.\"
X.\"	@(#)sail.6	5.4 (Berkeley) 3/12/88
X.\"
X.TH SAIL 6 "March 12, 1988"
X.UC 4
X.SH NAME
Xsail \- multi-user wooden ships and iron men
X.SH SYNOPSIS
X.B sail
X[
X.B \-s
X[
X.B \-l
X] ] [
X.B \-x
X] [
X.B \-b
X] [
X.B num
X]
X.br
X.fi
X.SH DESCRIPTION
X.I Sail
Xis a computer version of Avalon Hill's game of fighting sail
Xoriginally developed by S. Craig Taylor.
X.PP
XPlayers of
X.I Sail
Xtake command of an old fashioned Man of War and fight other
Xplayers or the computer.  They may re-enact one of the many
Xhistorical sea battles recorded in the game, or they can choose
Xa fictional battle.
X.PP
XAs a sea captain in the 
X.I Sail
XNavy, the player has complete control over the workings of his ship.
XHe must order every maneuver, change the set of his sails, and judge the
Xright moment to let loose the terrible destruction of his broadsides.
XIn addition to fighting the enemy, he must harness the powers of the wind
Xand sea to make them work for him.  The outcome of many battles during the
Xage of sail was decided by the ability of one captain to hold the `weather
Xgage.'
X.PP
XThe flags are:
X.TP
X.B \-s
XPrint the names and ships of the top ten sailors.
X.TP
X.B \-l
XShow the login name.  Only effective with \fB-s\fP.
X.TP
X.B \-x
XPlay the first available ship instead of prompting for a choice.
X.TP
X.B \-b
XNo bells.
X.SH IMPLEMENTATION
X.I Sail
Xis really two programs in one.  Each player starts up a process which
Xruns his own ship.  In addition, a
X.I driver
Xprocess is forked (by the first player) to run the computer ships
Xand take care of global bookkeeping.
X.PP
XBecause the
X.I driver
Xmust calculate moves for each ship it controls, the
Xmore ships the computer is playing, the slower the game will appear.
X.PP
XIf a player joins a game in progress, he will synchronize
Xwith the other players (a rather slow process for everyone), and 
Xthen he may play along with the rest.
X.PP
XTo implement a multi-user game in Version 7 UNIX, which was the operating
Xsystem
X.I Sail
Xwas first written under, the communicating processes must use a common
Xtemporary file as a place to read and write messages.  In addition, a
Xlocking mechanism must be provided to ensure exclusive access to the
Xshared file.  For example,
X.I Sail
Xuses a temporary file named /tmp/#sailsink.21 for scenario 21, and
Xcorresponding file names for the other scenarios.  To provide exclusive
Xaccess to the temporary file, 
X.I Sail
Xuses a technique stolen from an old game called "pubcaves" by Jeff Cohen.
XProcesses do a busy wait in the loop
X.br
X.sp
X.ce 2
X	for (n = 0; link(sync_file, sync_lock) < 0 && n < 30; n++)
X		sleep(2);
X.br
X.sp
Xuntil they are able to create a link to a file named "/tmp/#saillock.??".
XThe "??" correspond to the scenario number of the game.  Since UNIX 
Xguarantees that a link will point to only one file, the process that succeeds
Xin linking will have exclusive access to the temporary file.
X.PP
XWhether or not this really works is open to speculation.  When ucbmiro
Xwas rebooted after a crash, the file system check program found 3 links
Xbetween the
X.I Sail
Xtemporary file and its link file.
X.SH CONSEQUENCES OF SEPARATE PLAYER AND DRIVER PROCESSES
XWhen players do something of global interest, such as moving or firing,
Xthe driver must coordinate the action with the other ships in the game.
XFor example, if a player wants to move in a certain direction, he writes a
Xmessage into the temporary file requesting the driver to move his ship.
XEach ``turn,'' the driver reads all the messages sent from the players and
Xdecides what happened.  It then writes back into the temporary file new
Xvalues of variables, etc.
X.PP
XThe most noticeable effect this communication has on the game is the
Xdelay in moving.  Suppose a player types a move for his ship and hits
Xreturn.  What happens then?  The player process saves up messages to
Xbe written to the temporary file in a buffer.  Every 7 seconds or so, the
Xplayer process gets exclusive access to the temporary file and writes 
Xout its buffer to the file.  The driver, running asynchronously, must
Xread in the movement command, process it, and write out the results.  This
Xtakes two exclusive accesses to the temporary file.  Finally, when the player 
Xprocess gets around to doing another 7 second update, the results of the
Xmove are displayed on the screen.  Hence, every movement requires four
Xexclusive accesses to the temporary file (anywhere from 7 to 21 seconds
Xdepending upon asynchrony) before the player sees the results of his moves.
X.PP
XIn practice, the delays are not as annoying as they would appear.  There
Xis room for "pipelining" in the movement.  After the player writes out
Xa first movement message, a second movement command can then be issued.
XThe first message will be in the temporary file waiting for the driver, and
Xthe second will be in the file buffer waiting to be written to the file.
XThus, by always typing moves a turn ahead of the time, the player can
Xsail around quite quickly.
X.PP
XIf the player types several movement commands between two 7 second updates,
Xonly the last movement command typed will be seen by the driver.  Movement
Xcommands within the same update "overwrite" each other, in a sense.
X.SH THE HISTORY OF SAIL 
XI wrote the first version of
X.I Sail
Xon a PDP 11/70 in the fall of 1980.  Needless to say, the code was horrendous,
Xnot portable in any sense of the word, and didn't work.  The program was not
Xvery modular and had fseeks() and fwrites() every few lines.  After a
Xtremendous rewrite from the top down, I got the first working version up by
X1981.  There were several annoying bugs concerning firing broadsides and
Xfinding angles.
X.I Sail
Xuses no floating point, by the way, so the direction routines are rather 
Xtricky.
XEd Wang rewrote my angle() routine in 1981 to be more correct (although
Xit still doesn't work perfectly), and he added code to let a player select
Xwhich ship he wanted at the start of the game (instead of the first one
Xavailable).
X.PP
XCaptain Happy (Craig Leres) is responsible for making
X.I Sail
Xportable for the first time.  This was no easy task, by the way.  Constants
Xlike 2 and 10 were very frequent in the code.  I also became famous for
Xusing "Riggle Memorial Structures" in
X.I Sail.
XMany of my structure references are so long that they run off the line
Xprinter page.  Here is an example, if you promise not to laugh.
X.br
X.sp
X.ce
Xspecs[scene[flog.fgamenum].ship[flog.fshipnum].shipnum].pts
X.br
X.sp
X.PP
X.I Sail
Xreceived its fourth and most thorough rewrite in the summer and fall
Xof 1983.  Ed Wang rewrote and modularized the code (a monumental feat)
Xalmost from scratch.  Although he introduced many new bugs, the final
Xresult was very much cleaner and (?) faster.  He added window movement
Xcommands and find ship commands.
X.SH HISTORICAL INFO
XOld Square Riggers were very maneuverable ships capable of intricate
Xsailing.  Their only disadvantage was an inability to sail very 
Xclose to the wind.  The design of a wooden ship allowed only for the
Xguns to bear to the left and right sides.  A few guns of small
Xaspect (usually 6 or 9 pounders) could point forward, but their
Xeffect was small compared to a 68 gun broadside of 24 or 32 pounders.
XThe guns bear approximately like so:
X.nf
X
X       \\
X        b----------------
X    ---0
X        \\
X         \\
X          \\     up to a range of ten (for round shot)
X           \\
X            \\
X             \\
X
X.fi
XAn interesting phenomenon occurred when a broadside was fired
Xdown the length of an enemy ship.  The shot tended to bounce along
Xthe deck and did several times more damage.  This phenomenon was called
Xa rake.  Because the bows of a ship are very strong and present a smaller
Xtarget than the stern, a stern rake (firing from the stern to the bow) causes
Xmore damage than a bow rake.
X.nf
X
X                        b
X                       00   ----  Stern rake!
X                         a
X
X.fi
XMost ships were equipped with carronades, which were very large, close
Xrange cannons.  American ships from the revolution until the War of 1812
Xwere almost entirely armed with carronades.
X.PP
XThe period of history covered in
X.I Sail
Xis approximately from the 1770's until the end of Napoleanic France in 1815.
XThere are many excellent books about the age of sail.  My favorite author
Xis Captain Frederick Marryat.  More contemporary authors include C.S. Forester
Xand Alexander Kent.
X.PP
XFighting ships came in several sizes classed by armament.  The mainstays of
Xany fleet were its "Ships of the Line", or "Line of Battle Ships".  They
Xwere so named because these ships fought together in great lines.  They were
Xclose enough for mutual support, yet every ship could fire both its broadsides.
XWe get the modern words "ocean liner," or "liner," and "battleship" from
X"ship of the line."  The most common size was the the 74 gun two decked
Xship of the line.  The two gun decks usually mounted 18 and 24 pounder guns.
X.PP
XThe pride of the fleet were the first rates.  These were huge three decked
Xships of the line mounting 80 to 136 guns.  The guns in the three tiers
Xwere usually 18, 24, and 32 pounders in that order from top to bottom.
X.PP
XVarious other ships came next.  They were almost all "razees," or ships
Xof the line with one deck sawed off.  They mounted 40-64 guns and were
Xa poor cross between a frigate and a line of battle ship.  They neither
Xhad the speed of the former nor the firepower of the latter.
X.PP
XNext came the "eyes of the fleet."  Frigates came in many sizes mounting
Xanywhere from 32 to 44 guns.  They were very handy vessels.  They could
Xoutsail anything bigger and outshoot anything smaller.  Frigates didn't
Xfight in lines of battle as the much bigger 74's did.  Instead, they
Xharassed the enemy's rear or captured crippled ships.  They were much
Xmore useful in missions away from the fleet, such as cutting out expeditions
Xor boat actions.  They could hit hard and get away fast.
X.PP
XLastly, there were the corvettes, sloops, and brigs.  These were smaller
Xships mounting typically fewer than 20 guns.  A corvette was only slightly
Xsmaller than a frigate, so one might have up to 30 guns.  Sloops were used
Xfor carrying dispatches or passengers.  Brigs were something you built for 
Xland-locked lakes.
X.SH SAIL PARTICULARS
XShips in
X.I Sail
Xare represented by two characters.  One character represents the bow of
Xthe ship, and the other represents the stern.  Ships have nationalities
Xand numbers.  The first ship of a nationality is number 0, the second
Xnumber 1, etc.  Therefore, the first British ship in a game would be
Xprinted as "b0".  The second Brit would be "b1", and the fifth Don
Xwould be "s4".  
X.PP
XShips can set normal sails, called Battle Sails, or bend on extra canvas
Xcalled Full Sails.  A ship under full sail is a beautiful sight indeed,
Xand it can move much faster than a ship under Battle Sails.  The only
Xtrouble is, with full sails set, there is so much tension on sail and
Xrigging that a well aimed round shot can burst a sail into ribbons where
Xit would only cause a little hole in a loose sail.  For this reason,
Xrigging damage is doubled on a ship with full sails set.  Don't let
Xthat discourage you from using full sails.  I like to keep them up
Xright into the heat of battle.  A ship
Xwith full sails set has a capital letter for its nationality.  E.g.,
Xa Frog, "f0", with full sails set would be printed as "F0".
X.PP
XWhen a ship is battered into a listing hulk, the last man aboard "strikes
Xthe colors."  This ceremony is the ship's formal surrender.  The nationality
Xcharacter
Xof a surrendered ship is printed as "!".  E.g., the Frog of our last example
Xwould soon be "!0".
X.PP
XA ship has a random chance of catching fire or sinking when it reaches the
Xstage of listing hulk.  A sinking ship has a "~" printed for its nationality,
Xand a ship on fire and about to explode has a "#" printed.
X.PP
XCaptured ships become the nationality of the prize crew.  Therefore, if
Xan American ship captures a British ship, the British ship will have an
X"a" printed for its nationality.  In addition, the ship number is changed
Xto "&","'", "(", ,")", "*", or "+" depending upon the original number,
Xbe it 0,1,2,3,4, or 5.  E.g., the "b0" captured by an American becomes the
X"a&".  The "s4" captured by a Frog becomes the "f*".
X.PP
XThe ultimate example is, of course, an exploding Brit captured by an
XAmerican: "#&".
X.SH MOVEMENT
XMovement is the most confusing part of 
X.I Sail
Xto many.  Ships can head in 8 directions:
X.nf
X
X                                 0      0      0
X        b       b       b0      b       b       b       0b      b
X        0        0                                             0
X
X.fi
XThe stern of a ship moves when it turns.  The bow remains stationary.
XShips can always turn, regardless of the wind (unless they are becalmed).
XAll ships drift when they lose headway.  If a ship doesn't move forward
Xat all for two turns, it will begin to drift.  If a ship has begun to
Xdrift, then it must move forward before it turns, if it plans to do
Xmore than make a right or left turn, which is always possible.
X.PP
XMovement commands to 
X.I Sail
Xare a string of forward moves and turns.  An example is "l3".  It will
Xturn a ship left and then move it ahead 3 spaces.  In the drawing above,
Xthe "b0" made 7 successive left turns.  When 
X.I Sail
Xprompts you for a move, it prints three characters of import.  E.g., 
X.nf
X	move (7, 4): 
X.fi
XThe first number is the maximum number of moves you can make,
Xincluding turns.  The second number is the maximum number of turns
Xyou can make.  Between the numbers is sometimes printed a quote "'".
XIf the quote is present, it means that your ship has been drifting, and
Xyou must move ahead to regain headway before you turn (see note above).
XSome of the possible moves for the example above are as follows:
X.nf
X
X	move (7, 4): 7
X	move (7, 4): 1
X	move (7, 4): d		/* drift, or do nothing */
X	move (7, 4): 6r
X	move (7, 4): 5r1
X	move (7, 4): 4r1r
X	move (7, 4): l1r1r2
X	move (7, 4): 1r1r1r1
X
X.fi
XBecause square riggers performed so poorly sailing into the wind, if at
Xany point in a movement command you turn into the wind, the movement stops
Xthere.  E.g.,
X.nf
X
X	move (7, 4): l1l4
X	Movement Error;
X	Helm: l1l
X
X.fi
XMoreover, whenever you make a turn, your movement allowance drops to
Xmin(what's left, what you would have at the new attitude).  In short,
Xif you turn closer to the wind, you most likely won't be able to sail the
Xfull allowance printed in the "move" prompt.
X.PP
XOld sailing captains had to keep an eye constantly on the wind.  Captains
Xin 
X.I Sail
Xare no different.  A ship's ability to move depends on its attitide to the
Xwind.  The best angle possible is to have the wind off your quarter, that is,
Xjust off the stern.  The direction rose on the side of the screen gives the
Xpossible movements for your ship at all positions to the wind.  Battle
Xsail speeds are given first, and full sail speeds are given in parenthesis.
X.nf
X
X				 0 1(2)
X				\\|/
X				-^-3(6)
X				/|\\
X				 | 4(7)
X				3(6)  
X
X.fi
XPretend the bow of your ship (the "^") is pointing upward and the wind is
Xblowing from the bottom to the top of the page.  The
Xnumbers at the bottom "3(6)" will be your speed under battle or full
Xsails in such a situation.  If the wind is off your quarter, then you
Xcan move "4(7)".  If the wind is off your beam, "3(6)".  If the wind is
Xoff your bow, then you can only move "1(2)".  Facing into the wind, you
Xcan't move at all.  Ships facing into the wind were said to be "in irons".
X.SH WINDSPEED AND DIRECTION
XThe windspeed and direction is displayed as a little weather vane on the
Xside of the screen.  The number in the middle of the vane indicates the wind
Xspeed, and the + to - indicates the wind direction.  The wind blows from
Xthe + sign (high pressure) to the - sign (low pressure).  E.g.,
X.nf
X
X				|
X				3
X				+
X
X.fi
X.PP
XThe wind speeds are 0 = becalmed, 1 = light breeze, 2 = moderate breeze,
X3 = fresh breeze, 4 = strong breeze, 5 = gale, 6 = full gale, 7 = hurricane.
XIf a hurricane shows up, all ships are destroyed.
X.SH GRAPPLING AND FOULING
XIf two ships collide, they run the risk of becoming tangled together.  This
Xis called "fouling."  Fouled ships are stuck together, and neither can move.
XThey can unfoul each other if they want to.  Boarding parties can only be
Xsent across to ships when the antagonists are either fouled or grappled.
X.PP
XShips can grapple each other by throwing grapnels into the rigging of
Xthe other.
X.PP
XThe number of fouls and grapples you have are displayed on the upper
Xright of the screen.
X.SH BOARDING
XBoarding was a very costly venture in terms of human life.  Boarding parties
Xmay be formed in 
X.I Sail
Xto either board an enemy ship or to defend your own ship against attack.
XMen organized as Defensive Boarding Parties fight twice as hard to save
Xtheir ship as men left unorganized.
X.PP
XThe boarding strength of a crew depends upon its quality and upon the
Xnumber of men sent.
X.SH CREW QUALITY
XThe British seaman was world renowned for his sailing abilities.  American
Xsailors, however, were actually the best seamen in the world.  Because the
XAmerican Navy offered twice the wages of the Royal Navy, British seamen 
Xwho liked the sea defected to America by the thousands.
X.PP
XIn 
X.I Sail,
Xcrew quality is quantized into 5 energy levels.  "Elite" crews can outshoot
Xand outfight all other sailors.  "Crack" crews are next.  "Mundane" crews
Xare average, and "Green" and "Mutinous" crews are below average.  A good
Xrule of thumb is that "Crack" or "Elite" crews get one extra hit
Xper broadside compared to "Mundane" crews.  Don't expect too much from
X"Green" crews.
X.SH BROADSIDES
XYour two broadsides may be loaded with four kinds of shot: grape, chain,
Xround, and double.  You have guns and carronades in both the port and starboard
Xbatteries.  Carronades only have a range of two, so you have to get in
Xclose to be able to fire them.  You have the choice of firing at the hull
Xor rigging of another ship.  If the range of the ship is greater than 6,
Xthen you may only shoot at the rigging.
X.PP
XThe types of shot and their advantages are:
X.SH ROUND
XRange of 10.  Good for hull or rigging hits.
X.SH DOUBLE
XRange of 1.  Extra good for hull or rigging hits.
XDouble takes two turns to load.
X.SH CHAIN
XRange of 3.  Excellent for tearing down rigging.
XCannot damage hull or guns, though.
X.SH GRAPE
XRange of 1.  Sometimes devastating against enemy crews.
X.PP
XOn the side of the screen is displayed some vital information about your
Xship:
X.nf
X
X			Load  D! R!
X			Hull  9  
X			Crew  4  4  2
X			Guns  4  4  
X			Carr  2  2 
X			Rigg  5 5 5 5
X
X.fi
X"Load" shows what your port (left) and starboard (right) broadsides are
Xloaded with.  A "!" after the type of shot indicates that it is an initial
Xbroadside.  Initial broadside were loaded with care before battle and before
Xthe decks ran red with blood.  As a consequence, initial broadsides are a
Xlittle more effective than broadsides loaded later.  A "*" after the type of
Xshot indicates that the gun
Xcrews are still loading it, and you cannot fire yet.  "Hull" shows how much
Xhull you have left.  "Crew" shows your three sections of crew.  As your
Xcrew dies off, your ability to fire decreases.  "Guns" and "Carr" show
Xyour port and starboard guns.  As you lose guns, your ability to fire
Xdecreases.  "Rigg" shows how much rigging you have on your 3 or 4 masts.
XAs rigging is shot away, you lose mobility.
X.SH EFFECTIVENESS OF FIRE
XIt is very dramatic when a ship fires its thunderous broadsides, but the
Xmere opportunity to fire them does not guarantee any hits.  Many factors
Xinfluence the destructive force of a broadside.  First of all, and the chief
Xfactor, is distance.  It is harder to hit a ship at range ten than it is
Xto hit one sloshing alongside.  Next is raking.  Raking fire, as
Xmentioned before, 
Xcan sometimes dismast a ship at range ten.  Next, crew size and quality affects
Xthe damage done by a broadside.   The number of guns firing also bears on the
Xpoint,
Xso to speak.  Lastly, weather affects the accuracy of a broadside.  If the
Xseas are high (5 or 6), then the lower gunports of ships of the line can't
Xeven be opened to run out the guns.  This gives frigates and other flush
Xdecked vessels an advantage in a storm.  The scenario 
X.I Pellew vs. The Droits de L'Homme
Xtakes advantage of this peculiar circumstance.
X.SH REPAIRS
XRepairs may be made to your Hull, Guns, and Rigging at the slow rate of
Xtwo points per three turns.  The message "Repairs Completed" will be
Xprinted if no more repairs can be made.
X.SH PECULIARITIES OF COMPUTER SHIPS
XComputer ships in 
X.I Sail
Xfollow all the rules above with a few exceptions.  Computer ships never
Xrepair damage.  If they did, the players could never beat them.  They
Xplay well enough as it is.  As a consolation, the computer ships can fire double
Xshot every turn.  That fluke is a good reason to keep your distance.  The
X.I
XDriver
Xfigures out the moves of the computer ships.   It computes them with a typical
XA.I. distance function and a depth first search to find the maximum "score."
XIt seems to work fairly well, although I'll be the first to admit it isn't
Xperfect.
X.SH HOW TO PLAY
XCommands are given to 
X.I Sail
Xby typing a single character.  You will then be prompted for further
Xinput.  A brief summary of the commands follows.
X.bp
X.SH COMMAND SUMMARY
X.nf
X
X    'f'  Fire broadsides if they bear
X    'l'  Reload
X    'L'  Unload broadsides (to change ammo)
X    'm'  Move 
X    'i'  Print the closest ship
X    'I'  Print all ships
X    'F'  Find a particular ship or ships (e.g. "a?" for all Americans)
X    's'  Send a message around the fleet
X    'b'  Attempt to board an enemy ship
X    'B'  Recall boarding parties
X    'c'  Change set of sail
X    'r'  Repair
X    'u'  Attempt to unfoul
X    'g'  Grapple/ungrapple
X    'v'  Print version number of game
X   '^L'  Redraw screen
X    'Q'  Quit
X
X    'C'      Center your ship in the window
X    'U'	     Move window up
X    'D','N'  Move window down
X    'H'	     Move window left
X    'J'	     Move window right
X    'S'      Toggle window to follow your ship or stay where it is
X
X.fi
X.bg
X.SH SCENARIOS
XHere is a summary of the scenarios in 
X.I Sail:
X
X.br
X.SH Ranger vs. Drake:
X.nf
XWind from the N, blowing a fresh breeze.
X
X(a) Ranger            19 gun Sloop (crack crew) (7 pts)
X(b) Drake             17 gun Sloop (crack crew) (6 pts)
X.SH The Battle of Flamborough Head:
X.nf
XWind from the S, blowing a fresh breeze.
X
X.fi
XThis is John Paul Jones' first famous battle.  Aboard the Bonhomme
XRichard, he was able to overcome the Serapis's greater firepower
Xby quickly boarding her.
X.nf
X
X(a) Bonhomme Rich     42 gun Corvette (crack crew) (11 pts)
X(b) Serapis           44 gun Frigate (crack crew) (12 pts)
X.SH Arbuthnot and Des Touches:
X.nf
XWind from the N, blowing a gale.
X
X(b) America           64 gun Ship of the Line (crack crew) (20 pts)
X(b) Befford           74 gun Ship of the Line (crack crew) (26 pts)
X(b) Adamant           50 gun Ship of the Line (crack crew) (17 pts)
X(b) London            98 gun 3 Decker SOL (crack crew) (28 pts)
X(b) Royal Oak         74 gun Ship of the Line (crack crew) (26 pts)
X(f) Neptune           74 gun Ship of the Line (average crew) (24 pts)
X(f) Duc Bougogne      80 gun 3 Decker SOL (average crew) (27 pts)
X(f) Conquerant        74 gun Ship of the Line (average crew) (24 pts)
X(f) Provence          64 gun Ship of the Line (average crew) (18 pts)
X(f) Romulus           44 gun Ship of the Line (average crew) (10 pts)
X.SH Suffren and Hughes:
X.nf
X
XWind from the S, blowing a fresh breeze.
X
X(b) Monmouth          74 gun Ship of the Line (average crew) (24 pts)
X(b) Hero              74 gun Ship of the Line (crack crew) (26 pts)
X(b) Isis              50 gun Ship of the Line (crack crew) (17 pts)
X(b) Superb            74 gun Ship of the Line (crack crew) (27 pts)
X(b) Burford           74 gun Ship of the Line (average crew) (24 pts)
X(f) Flamband          50 gun Ship of the Line (average crew) (14 pts)
X(f) Annibal           74 gun Ship of the Line (average crew) (24 pts)
X(f) Severe            64 gun Ship of the Line (average crew) (18 pts)
X(f) Brilliant         80 gun Ship of the Line (crack crew) (31 pts)
X(f) Sphinx            80 gun Ship of the Line (average crew) (27 pts)
X.SH Nymphe vs. Cleopatre:
X.nf
XWind from the S, blowing a fresh breeze.
X
X(b) Nymphe            36 gun Frigate (crack crew) (11 pts)
X(f) Cleopatre         36 gun Frigate (average crew) (10 pts)
X.SH Mars vs. Hercule:
XWind from the S, blowing a fresh breeze.
X.nf
X(b) Mars              74 gun Ship of the Line (crack crew) (26 pts)
X(f) Hercule           74 gun Ship of the Line (average crew) (23 pts)
X.SH Ambuscade vs. Baionnaise:
X.nf
XWind from the N, blowing a fresh breeze.
X
X(b) Ambuscade         32 gun Frigate (average crew) (9 pts)
X(f) Baionnaise        24 gun Corvette (average crew) (9 pts)
X.SH Constellation vs. Insurgent:
X.nf
XWind from the S, blowing a gale.
X
X(a) Constellation     38 gun Corvette (elite crew) (17 pts)
X(f) Insurgent         36 gun Corvette (average crew) (11 pts)
X.SH Constellation vs. Vengeance:
X.nf
XWind from the S, blowing a fresh breeze.
X
X(a) Constellation     38 gun Corvette (elite crew) (17 pts)
X(f) Vengeance         40 gun Frigate (average crew) (15 pts)
X.SH The Battle of Lissa:
X.nf
XWind from the S, blowing a fresh breeze.
X
X(b) Amphion           32 gun Frigate (elite crew) (13 pts)
X(b) Active            38 gun Frigate (elite crew) (18 pts)
X(b) Volage            22 gun Frigate (elite crew) (11 pts)
X(b) Cerberus          32 gun Frigate (elite crew) (13 pts)
X(f) Favorite          40 gun Frigate (average crew) (15 pts)
X(f) Flore             40 gun Frigate (average crew) (15 pts)
X(f) Danae             40 gun Frigate (crack crew) (17 pts)
X(f) Bellona           32 gun Frigate (green crew) (9 pts)
X(f) Corona            40 gun Frigate (green crew) (12 pts)
X(f) Carolina          32 gun Frigate (green crew) (7 pts)
X.SH Constitution vs. Guerriere:
X.nf
XWind from the SW, blowing a gale.
X
X(a) Constitution      44 gun Corvette (elite crew) (24 pts)
X(b) Guerriere         38 gun Frigate (crack crew) (15 pts)
X.SH United States vs. Macedonian:
X.nf
XWind from the S, blowing a fresh breeze.
X
X(a) United States     44 gun Frigate (elite crew) (24 pts)
X(b) Macedonian        38 gun Frigate (crack crew) (16 pts)
X.SH Constitution vs. Java:
X.nf
XWind from the S, blowing a fresh breeze.
X
X(a) Constitution      44 gun Corvette (elite crew) (24 pts)
X(b) Java              38 gun Corvette (crack crew) (19 pts)
X.SH Chesapeake vs. Shannon:
X.nf
XWind from the S, blowing a fresh breeze.
X
X(a) Chesapeake        38 gun Frigate (average crew) (14 pts)
X(b) Shannon           38 gun Frigate (elite crew) (17 pts)
X.SH The Battle of Lake Erie:
X.nf
XWind from the S, blowing a light breeze.
X
X(a) Lawrence          20 gun Sloop (crack crew) (9 pts)
X(a) Niagara           20 gun Sloop (elite crew) (12 pts)
X(b) Lady Prevost      13 gun Brig (crack crew) (5 pts)
X(b) Detroit           19 gun Sloop (crack crew) (7 pts)
X(b) Q. Charlotte      17 gun Sloop (crack crew) (6 pts)
X.SH Wasp vs. Reindeer:
X.nf
XWind from the S, blowing a light breeze.
X
X(a) Wasp              20 gun Sloop (elite crew) (12 pts)
X(b) Reindeer          18 gun Sloop (elite crew) (9 pts)
X.SH Constitution vs. Cyane and Levant:
X.br
XWind from the S, blowing a moderate breeze.
X
X(a) Constitution      44 gun Corvette (elite crew) (24 pts)
X(b) Cyane             24 gun Sloop (crack crew) (11 pts)
X(b) Levant            20 gun Sloop (crack crew) (10 pts)
X.br
X.SH Pellew vs. Droits de L'Homme:
X.nf
XWind from the N, blowing a gale.
X
X(b) Indefatigable     44 gun Frigate (elite crew) (14 pts)
X(b) Amazon            36 gun Frigate (crack crew) (14 pts)
X(f) Droits L'Hom      74 gun Ship of the Line (average crew) (24 pts)
X.SH Algeciras:
X.nf
XWind from the SW, blowing a moderate breeze.
X
X(b) Caesar            80 gun Ship of the Line (crack crew) (31 pts)
X(b) Pompee            74 gun Ship of the Line (crack crew) (27 pts)
X(b) Spencer           74 gun Ship of the Line (crack crew) (26 pts)
X(b) Hannibal          98 gun 3 Decker SOL (crack crew) (28 pts)
X(s) Real-Carlos       112 gun 3 Decker SOL (green crew) (27 pts)
X(s) San Fernando      96 gun 3 Decker SOL (green crew) (24 pts)
X(s) Argonauta         80 gun Ship of the Line (green crew) (23 pts)
X(s) San Augustine     74 gun Ship of the Line (green crew) (20 pts)
X(f) Indomptable       80 gun Ship of the Line (average crew) (27 pts)
X(f) Desaix            74 gun Ship of the Line (average crew) (24 pts)
X.SH Lake Champlain:
X.nf
XWind from the N, blowing a fresh breeze.
X
X(a) Saratoga          26 gun Sloop (crack crew) (12 pts)
X(a) Eagle             20 gun Sloop (crack crew) (11 pts)
X(a) Ticonderoga       17 gun Sloop (crack crew) (9 pts)
X(a) Preble            7 gun Brig (crack crew) (4 pts)
X(b) Confiance         37 gun Frigate (crack crew) (14 pts)
X(b) Linnet            16 gun Sloop (elite crew) (10 pts)
X(b) Chubb             11 gun Brig (crack crew) (5 pts)
X.SH Last Voyage of the USS President:
X.nf
XWind from the N, blowing a fresh breeze.
X
X(a) President         44 gun Frigate (elite crew) (24 pts)
X(b) Endymion          40 gun Frigate (crack crew) (17 pts)
X(b) Pomone            44 gun Frigate (crack crew) (20 pts)
X(b) Tenedos           38 gun Frigate (crack crew) (15 pts)
X.SH Hornblower and the Natividad:
X.nf
XWind from the E, blowing a gale.
X
X.fi
XA scenario for you Horny fans.  Remember, he sank the Natividad
Xagainst heavy odds and winds.  Hint: don't try to board the Natividad,
Xher crew is much bigger, albeit green.
X.nf
X
X(b) Lydia             36 gun Frigate (elite crew) (13 pts)
X(s) Natividad         50 gun Ship of the Line (green crew) (14 pts)
X.SH Curse of the Flying Dutchman:
X.nf
XWind from the S, blowing a fresh breeze.
X
XJust for fun, take the Piece of cake.
X
X(s) Piece of Cake     24 gun Corvette (average crew) (9 pts)
X(f) Flying Dutchy     120 gun 3 Decker SOL (elite crew) (43 pts)
X.SH The South Pacific:
X.nf
XWind from the S, blowing a strong breeze.
X
X(a) USS Scurvy        136 gun 3 Decker SOL (mutinous crew) (27 pts)
X(b) HMS Tahiti        120 gun 3 Decker SOL (elite crew) (43 pts)
X(s) Australian        32 gun Frigate (average crew) (9 pts)
X(f) Bikini Atoll      7 gun Brig (crack crew) (4 pts)
X.SH Hornblower and the battle of Rosas bay:
X.nf
XWind from the E, blowing a fresh breeze.
X
XThe only battle Hornblower ever lost.  He was able to dismast one
Xship and stern rake the others though.  See if you can do as well.
X.nf
X
X(b) Sutherland        74 gun Ship of the Line (crack crew) (26 pts)
X(f) Turenne           80 gun 3 Decker SOL (average crew) (27 pts)
X(f) Nightmare         74 gun Ship of the Line (average crew) (24 pts)
X(f) Paris             112 gun 3 Decker SOL (green crew) (27 pts)
X(f) Napolean          74 gun Ship of the Line (green crew) (20 pts)
X.SH Cape Horn:
X.nf
XWind from the NE, blowing a strong breeze.
X
X(a) Concord           80 gun Ship of the Line (average crew) (27 pts)
X(a) Berkeley          98 gun 3 Decker SOL (crack crew) (28 pts)
X(b) Thames            120 gun 3 Decker SOL (elite crew) (43 pts)
X(s) Madrid            112 gun 3 Decker SOL (green crew) (27 pts)
X(f) Musket            80 gun 3 Decker SOL (average crew) (27 pts)
X.SH New Orleans:
X.nf
XWind from the SE, blowing a fresh breeze.
X
XWatch that little Cypress go!
X
X(a) Alligator         120 gun 3 Decker SOL (elite crew) (43 pts)
X(b) Firefly           74 gun Ship of the Line (crack crew) (27 pts)
X(b) Cypress           44 gun Frigate (elite crew) (14 pts)
X.SH Botany Bay:
X.nf
XWind from the N, blowing a fresh breeze.
X
X(b) Shark             64 gun Ship of the Line (average crew) (18 pts)
X(f) Coral Snake       44 gun Corvette (elite crew) (24 pts)
X(f) Sea Lion          44 gun Frigate (elite crew) (24 pts)
X.SH Voyage to the Bottom of the Sea:
X.nf
XWind from the NW, blowing a fresh breeze.
X
XThis one is dedicated to Richard Basehart and David Hedison.
X
X(a) Seaview           120 gun 3 Decker SOL (elite crew) (43 pts)
X(a) Flying Sub        40 gun Frigate (crack crew) (17 pts)
X(b) Mermaid           136 gun 3 Decker SOL (mutinous crew) (27 pts)
X(s) Giant Squid       112 gun 3 Decker SOL (green crew) (27 pts)
X.SH Frigate Action:
X.nf
XWind from the E, blowing a fresh breeze.
X
X(a) Killdeer          40 gun Frigate (average crew) (15 pts)
X(b) Sandpiper         40 gun Frigate (average crew) (15 pts)
X(s) Curlew            38 gun Frigate (crack crew) (16 pts)
X.SH The Battle of Midway:
X.nf
XWind from the E, blowing a moderate breeze.
X
X(a) Enterprise        80 gun Ship of the Line (crack crew) (31 pts)
X(a) Yorktown          80 gun Ship of the Line (average crew) (27 pts)
X(a) Hornet            74 gun Ship of the Line (average crew) (24 pts)
X(j) Akagi             112 gun 3 Decker SOL (green crew) (27 pts)
X(j) Kaga              96 gun 3 Decker SOL (green crew) (24 pts)
X(j) Soryu             80 gun Ship of the Line (green crew) (23 pts)
X
X.SH Star Trek:
X.nf
XWind from the S, blowing a fresh breeze.
X
X(a) Enterprise        450 gun Ship of the Line (elite crew) (75 pts)
X(a) Yorktown          450 gun Ship of the Line (elite crew) (75 pts)
X(a) Reliant           450 gun Ship of the Line (elite crew) (75 pts)
X(a) Galileo           450 gun Ship of the Line (elite crew) (75 pts)
X(k) Kobayashi Maru    450 gun Ship of the Line (elite crew) (75 pts)
X(k) Klingon II        450 gun Ship of the Line (elite crew) (75 pts)
X(o) Red Orion         450 gun Ship of the Line (elite crew) (75 pts)
X(o) Blue Orion        450 gun Ship of the Line (elite crew) (75 pts)
X
X.SH CONCLUSION
X
X.I Sail
Xhas been a group effort.
X
X.SH AUTHOR
XDave Riggle
X.SH CO-AUTHOR
XEd Wang 
X.SH REFITTING
XCraig Leres
X.SH CONSULTANTS
X.nf
XChris Guthrie
XCaptain Happy
XHoratio Nelson
X	and many valiant others...
X.fi
X.SH "REFERENCES"
X.nf
XWooden Ships & Iron Men, by Avalon Hill
XCaptain Horatio Hornblower Novels, (13 of them) by C.S. Forester
XCaptain Richard Bolitho Novels, (12 of them) by Alexander Kent
XThe Complete Works of Captain Frederick Marryat, (about 20) especially
X.in +6n
XMr. Midshipman Easy
XPeter Simple
XJacob Faithful
XJaphet in Search of a Father
XSnarleyyow, or The Dog Fiend
XFrank Mildmay, or The Naval Officer
X.in -6n
X.SH BUGS
XProbably a few, and please report them to "riggle@ernie.berkeley.edu" and
X"edward@ucbarpa.berkeley.edu"
END_OF_sail.6
if test 34609 -ne `wc -c <sail.6`; then
    echo shar: \"sail.6\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 1 \(of 4\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 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