v10i015: xtrek, Part04/11

Dan A. Dickey ddickey at aspen.cray.com
Wed Oct 24 18:33:41 AEST 1990


Submitted-by: ddickey at aspen.cray.com (Dan A. Dickey)
Posting-number: Volume 10, Issue 15
Archive-name: xtrek/part04

#! /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
# If this archive is complete, you will see the following message at the end:
#		"End of archive 4 (of 11)."
#
# Contents:
#   getship.c inform.c sintab.c trigtab.c xtrek_ship.man
#
# Wrapped by ddickey at cray.com on Thu Oct 11 11:43:53 1990
#
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f getship.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"getship.c\"
else
echo shar: Extracting \"getship.c\" \(9270 characters\)
sed "s/^X//" >getship.c <<'END_OF_getship.c'
Xstatic char sccsid[] = "@(#)getship.c	3.1";
X/*
X
X	Copyright (c) 1986 	Chris Guthrie
X
XPermission to use, copy, modify, and distribute this
Xsoftware and its documentation for any purpose and without
Xfee is hereby granted, provided that the above copyright
Xnotice appear in all copies and that both that copyright
Xnotice and this permission notice appear in supporting
Xdocumentation.  No representations are made about the
Xsuitability of this software for any purpose.  It is
Xprovided "as is" without express or implied warranty.
X
X*/
X
X/*
X * Enhancements added by Jeff Weinstein (jeff at polyslo.calpoly.edu).
X */
X
X
X#include <X11/Xlib.h>
X#include <X11/Xos.h>
X#include <stdio.h>
X#include <ctype.h>
X#include <math.h>
X#include "defs.h"
X#include "data.h"
X
Xstruct ship_features {
X    int s_turns;
X    short s_accs;
X    short s_torpdamage;
X    short s_phaserdamage;
X    short s_phasedist;
X    short s_torpspeed;
X    short s_maxspeed;
X    short s_repair;
X    short s_maxfuel;
X    short s_torpcost;
X    short s_phasercost;
X    short s_detcost;
X    short s_warpcost;
X    short s_cloakcost;
X    short s_recharge;
X    int s_accint;
X    int s_decint;
X    short s_maxarmies;
X
X    short s_wcool;
X    short s_ecool;
X    short s_maxdamage;
X    short s_maxshields;
X
X    short s_dcloak;	/* if more damage than this, then cloaks are flaky */
X    short s_dcloak_on;	/* chance for damaged cloaks to start working */
X    short s_dcloak_off;	/* chance for damaged cloaks to stop working */
X};
X
Xstatic struct ship_features def_ship_chars[NUMTEAM] = {
X/*TURNS ACCS TORPDAM PHASDAM PHASDIST TORPSPD MAXSPD REPAIR MAXFUEL TORPCOST */
X/*PHASCOST DETCOST WARPCOST CLOAKCOST RECHARGE ACCINT DECINT MAXARM */
X/*WCOOL ECOOL MAXDAM MAXSHLD  DCLOAK DCLOAK_ON DCLOAK_OFF */
X{ 512000, 21, 300,    2500,   60,      11,     9,    100,   10000,   0,
X  0,        100,    20,      45,       13,      12,    12,   10,
X  4,      6,   100,   100,	25,	25,	25 },	/* FED */
X{ 256000, 21, 600,    3125,   75,       14,     7,    150,   20000,   0,
X  0,         75,    25,      30,       12,      11,    15,   14,
X  8,      4,   100,   125,	25,	25,	25},	/* ROM */
X{ 512000, 21, 300,    2500,   60,      11,     9,    100,   10000,   0,
X  0,        100,    20,      45,       13,      12,    12,   10,
X  4,      6,   100,   100,	25,	25,	25},	/* KLI */
X{ 1024000,21, 100,    2000,   50,      14,    11,    100,    7500,   0,
X  0,        100,    15,      45,       15,      14,    14,   6,
X  3,      8,   100,   100,	25,	25,	25 }	/* ORI */
X};
X
Xextern int	debug;
Xvoid becomegod();
X
X/* fill in ship characteristics */
X
Xchar *
Xgetship(p, customship)
Xstruct player	*p;
Xchar		*customship;
X{
X    struct ship *shipp;
X    struct ship_features *dshipc;
X    int feature[128];
X    char *savecs = customship;
X    double ppower, tpower;
X    char	ebuf[128];
X
X    shipp = p->p_ship;
X    bzero(feature,128 * sizeof(int));
X    dshipc = &def_ship_chars[p->p_ship->s_team-1];
X    shipp->s_turns = dshipc->s_turns;
X    shipp->s_accs = dshipc->s_accs;
X    shipp->s_torpdamage = dshipc->s_torpdamage;
X    shipp->s_phaserdamage = dshipc->s_phaserdamage;
X    shipp->s_phasedist = dshipc->s_phasedist;
X    shipp->s_torpspeed = dshipc->s_torpspeed;
X    shipp->s_maxspeed = dshipc->s_maxspeed;
X    shipp->s_repair = dshipc->s_repair;
X    shipp->s_maxfuel = dshipc->s_maxfuel;
X    shipp->s_torpcost = dshipc->s_torpcost;
X    shipp->s_phasercost = dshipc->s_phasercost;
X    shipp->s_detcost = dshipc->s_detcost;
X    shipp->s_warpcost = dshipc->s_warpcost;
X    shipp->s_cloakcost = dshipc->s_cloakcost;
X    shipp->s_recharge = dshipc->s_recharge;
X    shipp->s_accint = dshipc->s_accint;
X    shipp->s_decint = dshipc->s_decint;
X    shipp->s_maxarmies = dshipc->s_maxarmies;
X    shipp->s_wcool = dshipc->s_wcool;
X    shipp->s_ecool = dshipc->s_ecool;
X    shipp->s_maxdamage = dshipc->s_maxdamage;
X    shipp->s_maxshields = dshipc->s_maxshields;
X    shipp->s_dcloak = dshipc->s_dcloak;
X    shipp->s_dcloak_on = dshipc->s_dcloak_on;
X    shipp->s_dcloak_off = dshipc->s_dcloak_off;
X
X    if (customship)
X	for (; *customship > 0; customship++) {
X	    if (islower(*customship)) {
X		    (feature[*customship])--;
X	    } else if (isupper(*customship)) {
X		    (feature[tolower(*customship)])++;
X	    }
X	}
X
X    /*
X     * The following are the configurable options:
X     * a/A  Army Transport
X     * c/C  Cloaking Cost
X     * d/D  Heat Dissipation (weapons & engines)
X     * e/E  Engine Efficiency
X     * f/F  Fuel Capacity
X     * g/G  Fuel Generation
X     * i/I  Invisibility While Cloaked	(NOT IMPLEMENTED)
X     * m/M  Maneuverablity
X     * p/P  Phaser Power (affects damage & range)
X     * r/R  Repair Rate
X     * s/S  Shield Strength
X     * t/T  Torpedo Size
X     * v/V  Torpedo Speed
X     * w/W  Warp Engines (affects acceleration & top speed)
X     * x/X  Ship Size
X     * z/Z  Change to GOD Team - SPECIAL FEATURE
X     */
X
X    if (feature['z'])
X	becomegod(p);
X
X    /* check sanity of options */
X    if (!isGod(p) && ((feature['a'] + feature['c'] + feature['d'] + feature['e'] + 
X	 feature['f'] + feature['g'] + feature['i'] + feature['m'] +
X	 feature['p'] + feature['r'] + feature['s'] + feature['t'] +
X	 feature['v'] + feature['w'] + feature['x']) > 0))
X    {
X	sprintf(ebuf,"ship has too many additions: %s", savecs);
X	warning(p, ebuf);
X        bzero(feature,128 * sizeof(int));
X    }
X#define rangecheck(plyr,min,value,max) \
X	if (!isGod((plyr)) && (feature[(value)] < (min))) \
X	{ \
X	    sprintf(ebuf,"ship out of range:%c < %d",(value),(min)); \
X	    warning((plyr), ebuf); \
X            bzero(feature,128 * sizeof(int)); \
X	} \
X	if (!isGod((plyr)) && (feature[(value)] > (max))) \
X	{ \
X	    sprintf(ebuf,"ship out of range:%c > %d",(value),(max)); \
X	    warning((plyr), ebuf); \
X            bzero(feature,128 * sizeof(int)); \
X	}
X
X    /* Check all ranges before making any modification. */
X    rangecheck(p,-2,'a',1000);
X    rangecheck(p,0,'c',3);
X    rangecheck(p,-5,'d',1000);
X    rangecheck(p,-4,'e',16);
X    rangecheck(p,-3,'f',9);
X    rangecheck(p,-5,'g',1000);
X    rangecheck(p,-2,'i',1000);
X    rangecheck(p,-5,'m',1000);
X    rangecheck(p,-4,'p',1000);
X    rangecheck(p,-2,'r',1000);
X    rangecheck(p,-4,'s',1000);
X    rangecheck(p,-2,'t',1000);
X    rangecheck(p,-4,'v',1000);
X    rangecheck(p,-5,'w',1000);
X    rangecheck(p,-5,'x',1000);
X
X    shipp->s_maxarmies += 4 * feature['a'];
X    if (shipp->s_maxarmies < 0)
X	shipp->s_maxarmies = 0;
X
X    shipp->s_cloakcost -= 10 * feature['c'];
X    if (shipp->s_cloakcost < 0)
X	shipp->s_cloakcost = 0;
X
X    shipp->s_ecool += feature['d'];
X    shipp->s_wcool += feature['d'];
X    if (shipp->s_ecool < 0)
X	shipp->s_ecool = 0;
X    if (shipp->s_wcool < 0)
X	shipp->s_wcool = 0;
X
X    shipp->s_warpcost /= (5 + feature['e']);
X
X    /*
X     * this limit is artificial, an artifact of the status
X     * display code, which requires fuel to be a short. YUK!!
X     * I should fix it some time.
X     */
X    shipp->s_maxfuel += 2500 * feature['f'];
X
X    shipp->s_recharge += 2 * feature['g'];
X    if (shipp->s_recharge < 0)
X	shipp->s_recharge = 0;
X
X    shipp->s_accs += feature['i'] * 10;
X
X    if (feature['m'] > 0) {
X	shipp->s_turns <<= feature['m'];
X    } else {
X	shipp->s_turns >>= -(feature['m']);
X    }
X
X    ppower=(4 + feature['p']) * shipp->s_phaserdamage;
X    shipp->s_phaserdamage = (int) sqrt(ppower);
X    shipp->s_phasedist = shipp->s_phaserdamage * 60;
X
X    shipp->s_repair += 50 * feature['r'];
X    if (shipp->s_repair < 0)
X	shipp->s_repair = 0;
X
X    shipp->s_maxshields += 25 * feature['s'];
X    if (shipp->s_maxshields < 0)
X	shipp->s_maxshields = 0;
X
X    tpower=(2 + feature['t']) * shipp->s_torpdamage;
X    if (tpower < (double) 0.0)
X      tpower = (double) 0.0;
X    shipp->s_torpdamage = (int) sqrt(tpower);
X
X    shipp->s_torpspeed += 6 * feature['v'];
X    if (shipp->s_torpspeed < 0)
X	shipp->s_torpspeed = 0;
X
X    shipp->s_maxspeed += 2 * feature['w'];
X    if (shipp->s_maxspeed < 1)
X	shipp->s_maxspeed = 1;
X    shipp->s_accint *= (1 + shipp->s_maxspeed);
X    shipp->s_decint *= (1 + shipp->s_maxspeed);
X
X    shipp->s_maxdamage += 15 * feature['x'];
X	
X    shipp->s_detcost = 100;
X    shipp->s_torpcost = (shipp->s_torpspeed/2 + 4) * shipp->s_torpdamage;
X    shipp->s_phasercost = 10 * shipp->s_phaserdamage;
X    return((char *) NULL);
X}
X
Xvoid
Xbecomegod(p)
Xregister struct player	*p;
X{
X	register int	i;
X	register char	*cp;
X	char		cbuf[256];
X
X	sprintf(cbuf, "%s:%s", p->p_login, p->p_monitor);
X	if (debug)
X		printf("God Attempt by <%s>\n", cbuf);
X	for (i = 0, cp = universe.god_names[0]; i < MAXPLAYER && cp && *cp;) {
X		if (strcmp(cbuf, cp) == 0) {
X			p->p_ship->s_team = GOD;
X			return;
X		}
X		cp = universe.god_names[++i];
X	}
X}
X
Xupdate_weapons(p)
Xregister struct player	*p;
X{
X	struct ship *shipp;
X	double ppower, tpower;
X
X	shipp = p->p_ship;
X	return;
X
X	/* 10% more phaser power for each kill */
X	shipp->s_phaserdamage += (shipp->s_phaserdamage * (shipp->s_stats.st_kills / 10.0));
X	ppower = shipp->s_phaserdamage * shipp->s_phaserdamage;
X	shipp->s_phaserdamage = (int) sqrt(ppower);
X	shipp->s_phasedist = shipp->s_phaserdamage * 60;
X
X	/* 10% more torp power for each kill */
X	shipp->s_torpdamage += (shipp->s_torpdamage * (shipp->s_stats.st_kills / 10.0));
X	tpower = shipp->s_torpdamage * shipp->s_torpdamage;
X	if (tpower < (double) 0.0)
X		tpower = (double) 0.0;
X	shipp->s_torpdamage = (int) sqrt(tpower);
X}
END_OF_getship.c
if test 9270 -ne `wc -c <getship.c`; then
    echo shar: \"getship.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f inform.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"inform.c\"
else
echo shar: Extracting \"inform.c\" \(7156 characters\)
sed "s/^X//" >inform.c <<'END_OF_inform.c'
Xstatic char sccsid[] = "@(#)inform.c	3.1";
X/*
X
X	Copyright (c) 1986 	Chris Guthrie
X
XPermission to use, copy, modify, and distribute this
Xsoftware and its documentation for any purpose and without
Xfee is hereby granted, provided that the above copyright
Xnotice appear in all copies and that both that copyright
Xnotice and this permission notice appear in supporting
Xdocumentation.  No representations are made about the
Xsuitability of this software for any purpose.  It is
Xprovided "as is" without express or implied warranty.
X
X*/
X
X#include <X11/Xlib.h>
X#include <stdio.h>
X#include <math.h>
X#include <signal.h>
X#include "defs.h"
X#include "data.h"
X
X/* Display information about the nearest objext to mouse */
X
X/*
X** When the player asks for info, this routine finds the object
X** nearest the mouse, either player or planet, and pops up a window
X** with the desired information in it.
X** 
X** We intentionally provide less information than is actually
X** available.  Keeps the fog of war up.
X**
X** There is a different sized window for each type player/planet
X** and we take care to keep it from extending beyond the main
X** window boundaries.
X*/
X
Xinform(p, ww, x, y)
Xregister struct player	*p;
XWindow ww;
Xint x, y;
X{
X    int mx, my;
X    int rx, ry;
X    int		maskr;
X    Window subw;
X    struct obtype *gettarget(), *target;
X    XWindowAttributes	wa;
X
X    p->p_infomapped = 1;
X    target = gettarget(p, ww, x, y, TARG_PLAYER|TARG_PLANET|TARG_MYSELF);
X    p->p_info_target = *target;
X
X    XGetWindowAttributes(p->display, ww, &wa);
X
X    XQueryPointer(p->display, ww, &subw, &subw, &rx, &ry, &mx, &my, &maskr);
X
X    if (target->o_type == PLAYERTYPE) {
X	/* Too close to the edge? */
X	if (mx + 23 * fontWidth(p->dfont) + 2 > wa.width)
X	    mx = wa.width - 23 * fontWidth(p->dfont) - 2;
X	if (my + 7 * fontHeight(p->dfont) + 2 > wa.height)
X	    my = wa.height - 7 * fontHeight(p->dfont) - 2;
X
X	p->infow = XCreateWindow(p->display, ww, mx, my, (unsigned) 23 * fontWidth(p->dfont),
X	    (unsigned) 7 * fontHeight(p->dfont), 2, DefaultDepth(p->display, p->screen), InputOutput, (Visual *)CopyFromParent, 0L, (XSetWindowAttributes *)0);
X    } else {  /* Planet */
X	/* Too close to the edge? */
X	if (mx + 20 * fontWidth(p->dfont) + 2 > wa.width)
X	    mx = wa.width - 20 * fontWidth(p->dfont) - 2;
X	if (my + 3 * fontHeight(p->dfont) + 2 > wa.height)
X	    my = wa.height - 3 * fontHeight(p->dfont) - 2;
X
X	p->infow = XCreateWindow(p->display, ww, mx, my, (unsigned) 20 * fontWidth(p->dfont),
X	    (unsigned) 3 * fontHeight(p->dfont), 2, DefaultDepth(p->display, p->screen), InputOutput, (Visual *)CopyFromParent, 0L, (XSetWindowAttributes *)0);
X    }
X    XSelectInput(p->display, p->infow, ExposureMask|SubstructureNotifyMask);
X    XSetWindowBackground(p->display, p->infow, p->backColor);
X    XClearWindow(p->display, p->infow);
X    XMapWindow(p->display, p->infow);
X}
X
Xdrawinfo(p)
Xregister struct player	*p;
X{
X    register struct obtype	*target;
X    register struct player	*j;
X    register struct planet	*k;
X    char buf[BUFSIZ*2];
X    int line = 0;
X    double dist;
X
X    if (!p->p_infomapped) {
X	fprintf(stderr, "drawinfo: Player %d no info window\n", p->p_no);
X    }
X    target = &p->p_info_target;
X    if (target->o_type == PLAYERTYPE) {
X	j = &players[target->o_num];
X	dist = hypot((double) (p->p_ship->s_x - j->p_ship->s_x),
X	    (double) (p->p_ship->s_y - j->p_ship->s_y));
X	(void) sprintf(buf, "%s (%c%1x):", j->p_name, 
X		teamlet[j->p_ship->s_team], j->p_ship->s_no);
X	XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	(void) sprintf(buf, "Login   %-s", j->p_login);
X	XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	(void) sprintf(buf, "Display %-s", j->p_monitor);
X	XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	(void) sprintf(buf, "Speed   %-d", j->p_ship->s_speed);
X	XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X
X	/*  Too much information.  Let 'em wonder	NOTE: Give info to team members
X	(void) sprintf(buf, "Damage  %-d", j->p_ship->s_damage);
X	XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	(void) sprintf(buf, "Shields %-d", j->p_ship->s_shield);
X	XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	*/
X
X	(void) sprintf(buf, "kills   %-4.2f", j->p_ship->s_stats.st_kills);
X	XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	(void) sprintf(buf, "dist    %-d", (int) dist);
X	XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	if (j->p_ship->s_swar & (1 << p->p_ship->s_team))
X	    XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, "WAR", 3);
X	else if (j->p_ship->s_hostile & (1 << p->p_ship->s_team))
X	    XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, "HOSTILE", 7);
X	else
X	    XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, "PEACEFUL", 8);
X    } else {  /* Planet */
X	k = &planets[target->o_num];
X	dist = hypot((double) (p->p_ship->s_x - k->pl_x),
X	    (double) (p->p_ship->s_y - k->pl_y));
X	if (k->pl_info & (1 << p->p_ship->s_team)) {
X	    (void) sprintf(buf, "%s (%c)", k->pl_name, teamlet[k->pl_owner]);
X	    XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	    if (k->pl_type != SUN) {
X		    (void) sprintf(buf, "Armies %d", k->pl_armies);
X		    XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X			p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	    }
X	    (void) sprintf(buf, "%c%c%c%c  (%s)",
X		(k->pl_info & (1 << FED) ? 'F' : ' '),
X		(k->pl_info & (1 << ROM) ? 'R' : ' '),
X		(k->pl_info & (1 << KLI) ? 'K' : ' '),
X		(k->pl_info & (1 << ORI) ? 'O' : ' '),
X		k->pl_tname);
X	    XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	}
X	else {
X	    (void) sprintf(buf, "%s", k->pl_name);
X	    XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	    (void) sprintf(buf, "No other info");
X	    XDrawImageString(p->display, p->infow, p->dfgc, fontWidth(p->dfont),
X		p->dfont->ascent + fontHeight(p->dfont) * line++, buf, strlen(buf));
X	}
X    }
X}
X
X
XdestroyInfo(p)
Xregister struct player	*p;
X{
X    XDestroyWindow(p->display, p->infow);
X    p->infow = (Window) NULL;
X    p->p_infomapped = 0;
X}
END_OF_inform.c
if test 7156 -ne `wc -c <inform.c`; then
    echo shar: \"inform.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f sintab.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"sintab.c\"
else
echo shar: Extracting \"sintab.c\" \(6968 characters\)
sed "s/^X//" >sintab.c <<'END_OF_sintab.c'
Xstatic char sccsid[] = "@(#)sintab.c	3.1";
X
X/*
X
X	Copyright (c) 1986 	Chris Guthrie
X
XPermission to use, copy, modify, and distribute this
Xsoftware and its documentation for any purpose and without
Xfee is hereby granted, provided that the above copyright
Xnotice appear in all copies and that both that copyright
Xnotice and this permission notice appear in supporting
Xdocumentation.  No representations are made about the
Xsuitability of this software for any purpose.  It is
Xprovided "as is" without express or implied warranty.
X
X*/
X
Xdouble Sin[] = {
X    -1.0000,
X    -0.9997,
X    -0.9988,
X    -0.9973,
X    -0.9952,
X    -0.9925,
X    -0.9892,
X    -0.9853,
X    -0.9808,
X    -0.9757,
X    -0.9701,
X    -0.9638,
X    -0.9570,
X    -0.9496,
X    -0.9416,
X    -0.9330,
X    -0.9239,
X    -0.9143,
X    -0.9040,
X    -0.8933,
X    -0.8820,
X    -0.8701,
X    -0.8578,
X    -0.8449,
X    -0.8315,
X    -0.8176,
X    -0.8033,
X    -0.7884,
X    -0.7731,
X    -0.7573,
X    -0.7410,
X    -0.7243,
X    -0.7072,
X    -0.6896,
X    -0.6716,
X    -0.6533,
X    -0.6345,
X    -0.6153,
X    -0.5958,
X    -0.5759,
X    -0.5557,
X    -0.5351,
X    -0.5142,
X    -0.4930,
X    -0.4715,
X    -0.4497,
X    -0.4277,
X    -0.4054,
X    -0.3828,
X    -0.3600,
X    -0.3370,
X    -0.3138,
X    -0.2904,
X    -0.2668,
X    -0.2431,
X    -0.2192,
X    -0.1952,
X    -0.1711,
X    -0.1469,
X    -0.1225,
X    -0.0982,
X    -0.0737,
X    -0.0492,
X    -0.0247,
X    -0.0001,
X    0.0244,
X    0.0489,
X    0.0734,
X    0.0979,
X    0.1223,
X    0.1466,
X    0.1708,
X    0.1949,
X    0.2190,
X    0.2428,
X    0.2666,
X    0.2901,
X    0.3135,
X    0.3367,
X    0.3598,
X    0.3825,
X    0.4051,
X    0.4274,
X    0.4495,
X    0.4713,
X    0.4928,
X    0.5140,
X    0.5349,
X    0.5554,
X    0.5757,
X    0.5956,
X    0.6151,
X    0.6343,
X    0.6531,
X    0.6714,
X    0.6894,
X    0.7070,
X    0.7241,
X    0.7408,
X    0.7571,
X    0.7729,
X    0.7882,
X    0.8031,
X    0.8175,
X    0.8314,
X    0.8448,
X    0.8576,
X    0.8700,
X    0.8818,
X    0.8931,
X    0.9039,
X    0.9141,
X    0.9238,
X    0.9329,
X    0.9415,
X    0.9495,
X    0.9569,
X    0.9637,
X    0.9700,
X    0.9757,
X    0.9808,
X    0.9852,
X    0.9891,
X    0.9925,
X    0.9952,
X    0.9973,
X    0.9988,
X    0.9997,
X    1.0000,
X    0.9997,
X    0.9988,
X    0.9973,
X    0.9952,
X    0.9925,
X    0.9892,
X    0.9853,
X    0.9808,
X    0.9757,
X    0.9700,
X    0.9638,
X    0.9569,
X    0.9495,
X    0.9415,
X    0.9330,
X    0.9239,
X    0.9142,
X    0.9040,
X    0.8932,
X    0.8819,
X    0.8701,
X    0.8577,
X    0.8449,
X    0.8315,
X    0.8176,
X    0.8032,
X    0.7884,
X    0.7730,
X    0.7572,
X    0.7410,
X    0.7243,
X    0.7071,
X    0.6896,
X    0.6716,
X    0.6532,
X    0.6344,
X    0.6153,
X    0.5957,
X    0.5758,
X    0.5556,
X    0.5350,
X    0.5141,
X    0.4929,
X    0.4714,
X    0.4496,
X    0.4276,
X    0.4053,
X    0.3827,
X    0.3599,
X    0.3369,
X    0.3137,
X    0.2903,
X    0.2667,
X    0.2430,
X    0.2191,
X    0.1951,
X    0.1710,
X    0.1468,
X    0.1225,
X    0.0981,
X    0.0736,
X    0.0491,
X    0.0246,
X    0.0000,
X    -0.0245,
X    -0.0490,
X    -0.0735,
X    -0.0980,
X    -0.1224,
X    -0.1467,
X    -0.1709,
X    -0.1950,
X    -0.2190,
X    -0.2429,
X    -0.2667,
X    -0.2902,
X    -0.3136,
X    -0.3368,
X    -0.3598,
X    -0.3826,
X    -0.4052,
X    -0.4275,
X    -0.4496,
X    -0.4713,
X    -0.4928,
X    -0.5140,
X    -0.5349,
X    -0.5555,
X    -0.5758,
X    -0.5956,
X    -0.6152,
X    -0.6343,
X    -0.6531,
X    -0.6715,
X    -0.6895,
X    -0.7071,
X    -0.7242,
X    -0.7409,
X    -0.7572,
X    -0.7730,
X    -0.7883,
X    -0.8032,
X    -0.8175,
X    -0.8314,
X    -0.8448,
X    -0.8577,
X    -0.8700,
X    -0.8819,
X    -0.8932,
X    -0.9040,
X    -0.9142,
X    -0.9238,
X    -0.9330,
X    -0.9415,
X    -0.9495,
X    -0.9569,
X    -0.9638,
X    -0.9700,
X    -0.9757,
X    -0.9808,
X    -0.9853,
X    -0.9892,
X    -0.9925,
X    -0.9952,
X    -0.9973,
X    -0.9988,
X    -0.9997
X};
Xdouble Cos[] = {
X    0.0000,
X    0.0245,
X    0.0491,
X    0.0736,
X    0.0980,
X    0.1224,
X    0.1467,
X    0.1710,
X    0.1951,
X    0.2191,
X    0.2430,
X    0.2667,
X    0.2903,
X    0.3137,
X    0.3369,
X    0.3599,
X    0.3827,
X    0.4052,
X    0.4275,
X    0.4496,
X    0.4714,
X    0.4929,
X    0.5141,
X    0.5350,
X    0.5556,
X    0.5758,
X    0.5957,
X    0.6152,
X    0.6344,
X    0.6532,
X    0.6715,
X    0.6895,
X    0.7071,
X    0.7242,
X    0.7409,
X    0.7572,
X    0.7730,
X    0.7883,
X    0.8032,
X    0.8176,
X    0.8315,
X    0.8448,
X    0.8577,
X    0.8701,
X    0.8819,
X    0.8932,
X    0.9040,
X    0.9142,
X    0.9239,
X    0.9330,
X    0.9415,
X    0.9495,
X    0.9569,
X    0.9638,
X    0.9700,
X    0.9757,
X    0.9808,
X    0.9853,
X    0.9892,
X    0.9925,
X    0.9952,
X    0.9973,
X    0.9988,
X    0.9997,
X    1.0000,
X    0.9997,
X    0.9988,
X    0.9973,
X    0.9952,
X    0.9925,
X    0.9892,
X    0.9853,
X    0.9808,
X    0.9757,
X    0.9700,
X    0.9638,
X    0.9570,
X    0.9495,
X    0.9416,
X    0.9330,
X    0.9239,
X    0.9142,
X    0.9040,
X    0.8933,
X    0.8819,
X    0.8701,
X    0.8578,
X    0.8449,
X    0.8315,
X    0.8176,
X    0.8032,
X    0.7884,
X    0.7731,
X    0.7573,
X    0.7410,
X    0.7243,
X    0.7072,
X    0.6896,
X    0.6716,
X    0.6532,
X    0.6344,
X    0.6153,
X    0.5958,
X    0.5759,
X    0.5556,
X    0.5351,
X    0.5142,
X    0.4930,
X    0.4715,
X    0.4497,
X    0.4276,
X    0.4053,
X    0.3828,
X    0.3600,
X    0.3370,
X    0.3138,
X    0.2904,
X    0.2668,
X    0.2431,
X    0.2192,
X    0.1952,
X    0.1710,
X    0.1468,
X    0.1225,
X    0.0981,
X    0.0737,
X    0.0492,
X    0.0246,
X    0.0001,
X    -0.0244,
X    -0.0490,
X    -0.0735,
X    -0.0979,
X    -0.1223,
X    -0.1466,
X    -0.1709,
X    -0.1950,
X    -0.2190,
X    -0.2429,
X    -0.2666,
X    -0.2902,
X    -0.3136,
X    -0.3368,
X    -0.3598,
X    -0.3826,
X    -0.4051,
X    -0.4275,
X    -0.4495,
X    -0.4713,
X    -0.4928,
X    -0.5140,
X    -0.5349,
X    -0.5555,
X    -0.5757,
X    -0.5956,
X    -0.6151,
X    -0.6343,
X    -0.6531,
X    -0.6715,
X    -0.6895,
X    -0.7070,
X    -0.7242,
X    -0.7409,
X    -0.7571,
X    -0.7729,
X    -0.7883,
X    -0.8031,
X    -0.8175,
X    -0.8314,
X    -0.8448,
X    -0.8577,
X    -0.8700,
X    -0.8819,
X    -0.8932,
X    -0.9039,
X    -0.9142,
X    -0.9238,
X    -0.9329,
X    -0.9415,
X    -0.9495,
X    -0.9569,
X    -0.9637,
X    -0.9700,
X    -0.9757,
X    -0.9808,
X    -0.9853,
X    -0.9892,
X    -0.9925,
X    -0.9952,
X    -0.9973,
X    -0.9988,
X    -0.9997,
X    -1.0000,
X    -0.9997,
X    -0.9988,
X    -0.9973,
X    -0.9952,
X    -0.9925,
X    -0.9892,
X    -0.9853,
X    -0.9808,
X    -0.9757,
X    -0.9701,
X    -0.9638,
X    -0.9570,
X    -0.9496,
X    -0.9416,
X    -0.9330,
X    -0.9239,
X    -0.9143,
X    -0.9041,
X    -0.8933,
X    -0.8820,
X    -0.8702,
X    -0.8578,
X    -0.8449,
X    -0.8316,
X    -0.8177,
X    -0.8033,
X    -0.7884,
X    -0.7731,
X    -0.7573,
X    -0.7411,
X    -0.7244,
X    -0.7072,
X    -0.6897,
X    -0.6717,
X    -0.6533,
X    -0.6345,
X    -0.6154,
X    -0.5958,
X    -0.5759,
X    -0.5557,
X    -0.5351,
X    -0.5142,
X    -0.4930,
X    -0.4715,
X    -0.4498,
X    -0.4277,
X    -0.4054,
X    -0.3828,
X    -0.3601,
X    -0.3371,
X    -0.3138,
X    -0.2905,
X    -0.2669,
X    -0.2432,
X    -0.2193,
X    -0.1953,
X    -0.1711,
X    -0.1469,
X    -0.1226,
X    -0.0982,
X    -0.0737,
X    -0.0493,
X    -0.0247
X};
END_OF_sintab.c
if test 6968 -ne `wc -c <sintab.c`; then
    echo shar: \"sintab.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f trigtab.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"trigtab.c\"
else
echo shar: Extracting \"trigtab.c\" \(7990 characters\)
sed "s/^X//" >trigtab.c <<'END_OF_trigtab.c'
Xstatic char sccsid[] = "@(#)trigtab.c	3.1";
Xlong isin[] = {
X    -8192,
X    -8189,
X    -8182,
X    -8169,
X    -8152,
X    -8130,
X    -8103,
X    -8071,
X    -8034,
X    -7992,
X    -7947,
X    -7895,
X    -7839,
X    -7779,
X    -7713,
X    -7643,
X    -7568,
X    -7489,
X    -7405,
X    -7317,
X    -7225,
X    -7127,
X    -7027,
X    -6921,
X    -6811,
X    -6697,
X    -6580,
X    -6458,
X    -6333,
X    -6203,
X    -6070,
X    -5933,
X    -5793,
X    -5649,
X    -5501,
X    -5351,
X    -5197,
X    -5040,
X    -4880,
X    -4717,
X    -4552,
X    -4383,
X    -4212,
X    -4038,
X    -3862,
X    -3683,
X    -3503,
X    -3321,
X    -3135,
X    -2949,
X    -2760,
X    -2570,
X    -2378,
X    -2185,
X    -1991,
X    -1795,
X    -1599,
X    -1401,
X    -1203,
X    -1003,
X    -804,
X    -603,
X    -403,
X    -202,
X    0,
X    199,
X    400,
X    601,
X    801,
X    1001,
X    1200,
X    1399,
X    1596,
X    1794,
X    1989,
X    2183,
X    2376,
X    2568,
X    2758,
X    2947,
X    3133,
X    3318,
X    3501,
X    3682,
X    3860,
X    4037,
X    4210,
X    4381,
X    4549,
X    4716,
X    4879,
X    5038,
X    5196,
X    5350,
X    5500,
X    5647,
X    5791,
X    5931,
X    6068,
X    6202,
X    6331,
X    6456,
X    6578,
X    6696,
X    6810,
X    6920,
X    7025,
X    7127,
X    7223,
X    7316,
X    7404,
X    7488,
X    7567,
X    7642,
X    7712,
X    7778,
X    7838,
X    7894,
X    7946,
X    7992,
X    8034,
X    8070,
X    8102,
X    8130,
X    8152,
X    8169,
X    8182,
X    8189,
X    8192,
X    8189,
X    8182,
X    8169,
X    8152,
X    8130,
X    8103,
X    8071,
X    8034,
X    7992,
X    7946,
X    7895,
X    7838,
X    7778,
X    7712,
X    7643,
X    7568,
X    7489,
X    7405,
X    7317,
X    7224,
X    7127,
X    7026,
X    6921,
X    6811,
X    6697,
X    6579,
X    6458,
X    6332,
X    6202,
X    6070,
X    5933,
X    5792,
X    5649,
X    5501,
X    5351,
X    5197,
X    5040,
X    4879,
X    4716,
X    4551,
X    4382,
X    4211,
X    4037,
X    3861,
X    3683,
X    3502,
X    3320,
X    3135,
X    2948,
X    2759,
X    2569,
X    2378,
X    2184,
X    1990,
X    1794,
X    1598,
X    1400,
X    1202,
X    1003,
X    803,
X    602,
X    402,
X    201,
X    0,
X    -200,
X    -401,
X    -602,
X    -802,
X    -1002,
X    -1201,
X    -1400,
X    -1597,
X    -1794,
X    -1989,
X    -2184,
X    -2377,
X    -2569,
X    -2759,
X    -2947,
X    -3134,
X    -3319,
X    -3502,
X    -3683,
X    -3860,
X    -4037,
X    -4210,
X    -4381,
X    -4550,
X    -4716,
X    -4879,
X    -5039,
X    -5196,
X    -5350,
X    -5500,
X    -5648,
X    -5792,
X    -5932,
X    -6069,
X    -6202,
X    -6332,
X    -6457,
X    -6579,
X    -6696,
X    -6810,
X    -6920,
X    -7026,
X    -7127,
X    -7224,
X    -7317,
X    -7405,
X    -7489,
X    -7567,
X    -7643,
X    -7712,
X    -7778,
X    -7838,
X    -7895,
X    -7946,
X    -7992,
X    -8034,
X    -8071,
X    -8103,
X    -8130,
X    -8152,
X    -8169,
X    -8182,
X    -8189
X};
Xlong icos[] = {
X    0,
X    200,
X    402,
X    602,
X    802,
X    1002,
X    1201,
X    1400,
X    1598,
X    1794,
X    1990,
X    2184,
X    2378,
X    2569,
X    2759,
X    2948,
X    3135,
X    3319,
X    3502,
X    3683,
X    3861,
X    4037,
X    4211,
X    4382,
X    4551,
X    4716,
X    4879,
X    5039,
X    5197,
X    5351,
X    5500,
X    5648,
X    5792,
X    5932,
X    6069,
X    6202,
X    6332,
X    6457,
X    6579,
X    6697,
X    6811,
X    6920,
X    7026,
X    7127,
X    7224,
X    7317,
X    7405,
X    7489,
X    7568,
X    7643,
X    7712,
X    7778,
X    7838,
X    7895,
X    7946,
X    7992,
X    8034,
X    8071,
X    8103,
X    8130,
X    8152,
X    8169,
X    8182,
X    8189,
X    8192,
X    8189,
X    8182,
X    8169,
X    8152,
X    8130,
X    8103,
X    8071,
X    8034,
X    7992,
X    7946,
X    7895,
X    7839,
X    7778,
X    7713,
X    7643,
X    7568,
X    7489,
X    7405,
X    7317,
X    7224,
X    7127,
X    7027,
X    6921,
X    6811,
X    6697,
X    6579,
X    6458,
X    6333,
X    6203,
X    6070,
X    5933,
X    5793,
X    5649,
X    5501,
X    5351,
X    5197,
X    5040,
X    4880,
X    4717,
X    4551,
X    4383,
X    4212,
X    4038,
X    3862,
X    3683,
X    3502,
X    3320,
X    3135,
X    2949,
X    2760,
X    2570,
X    2378,
X    2185,
X    1991,
X    1795,
X    1599,
X    1400,
X    1202,
X    1003,
X    803,
X    603,
X    403,
X    201,
X    0,
X    -199,
X    -401,
X    -602,
X    -801,
X    -1001,
X    -1200,
X    -1400,
X    -1597,
X    -1794,
X    -1989,
X    -2183,
X    -2377,
X    -2569,
X    -2759,
X    -2947,
X    -3134,
X    -3318,
X    -3502,
X    -3682,
X    -3860,
X    -4037,
X    -4210,
X    -4381,
X    -4550,
X    -4716,
X    -4879,
X    -5038,
X    -5196,
X    -5350,
X    -5500,
X    -5648,
X    -5791,
X    -5932,
X    -6069,
X    -6202,
X    -6331,
X    -6457,
X    -6578,
X    -6696,
X    -6810,
X    -6920,
X    -7026,
X    -7127,
X    -7224,
X    -7317,
X    -7404,
X    -7489,
X    -7567,
X    -7642,
X    -7712,
X    -7778,
X    -7838,
X    -7894,
X    -7946,
X    -7992,
X    -8034,
X    -8071,
X    -8103,
X    -8130,
X    -8152,
X    -8169,
X    -8182,
X    -8189,
X    -8192,
X    -8189,
X    -8182,
X    -8169,
X    -8152,
X    -8130,
X    -8103,
X    -8071,
X    -8034,
X    -7992,
X    -7947,
X    -7895,
X    -7839,
X    -7779,
X    -7713,
X    -7643,
X    -7568,
X    -7489,
X    -7406,
X    -7317,
X    -7225,
X    -7128,
X    -7027,
X    -6921,
X    -6812,
X    -6698,
X    -6580,
X    -6458,
X    -6333,
X    -6203,
X    -6071,
X    -5934,
X    -5793,
X    -5650,
X    -5502,
X    -5351,
X    -5197,
X    -5041,
X    -4880,
X    -4717,
X    -4552,
X    -4383,
X    -4212,
X    -4038,
X    -3862,
X    -3684,
X    -3503,
X    -3321,
X    -3135,
X    -2949,
X    -2761,
X    -2570,
X    -2379,
X    -2186,
X    -1992,
X    -1796,
X    -1599,
X    -1401,
X    -1203,
X    -1004,
X    -804,
X    -603,
X    -403,
X    -202
X};
X
X
X/*
X** table for computing inverse tangent values
X*/
X
X
Xlong iatan[] = {
X0,
X201,
X402,
X604,
X806,
X1010,
X1215,
X1421,
X1629,
X1839,
X2051,
X2267,
X2485,
X2706,
X2931,
X3160,
X3393,
X3631,
X3874,
X4123,
X4378,
X4640,
X4910,
X5187,
X5473,
X5769,
X6075,
X6393,
X6723,
X7066,
X7424,
X7799,
X8192,
X8604,
X9038,
X9496,
X9981,
X10497,
X11045,
X11631,
X12260,
X12936,
X13667,
X14460,
X15326,
X16274,
X17320,
X18480,
X19777,
X21236,
X22895,
X24797,
X27005,
X29602,
X32704,
X36480,
X41183,
X47211,
X55225,
X66418,
X83174,
X111056,
X166751,
X333705
X};
X
X#include <X11/Xlib.h>
X#include "defs.h"
X
Xunsigned char iatan2(y, x)
Xint x, y;
X{
X  int bottom, top, i;
X  long z, scaled_y;
X
X  scaled_y = y << TRIGSCALE;
X  if (x == 0) i = (y >= 0 ? 64 : 192);
X  else {
X    z = abs(scaled_y/x);
X
X#ifdef DEBUG
X    printf("Looking for closest table value to %ld\n", z);
X#endif DEBUG
X
X    bottom = 0;
X    top = sizeof(iatan)/sizeof(long) - 1;
X
X/*-------------------------------------------------------------------------
X * Loop Invariant: top - bottom > 1    &&   iatan[bottom] < z <= iatan[top]
X * 
X * At end of loop this guarantees:
X * top-bottom <= 1 && top-prev_bottom > 1  ==> top-bottom = 1
X * Also iatan[bottom] < z <= iatan[top].  So we will return the closer of
X * these two values.
X *-------------------------------------------------------------------------
X */
X    while (top-bottom > 1) {
X      i = bottom + ((top-bottom)>>1);
X      if (iatan[i] < z) bottom = i;
X      else top = i;
X    }
X
X    /* Choose the closer of the two values */
X    i = (abs(iatan[top] - z) < abs(iatan[bottom] - z)) ? top : bottom;
X  } /* else */
X 
X#ifdef DEBUG
X      printf("original i: %d; ", i);
X#endif DEBUG
X  if (y == 0) i = (x >= 0) ? 0 : 128;
X  else if (x < 0 && y > 0) i = 128-i;
X  else if (x < 0 && y < 0) i += 128;
X  else if (x > 0 && y < 0) i = 256-i;
X  
X#ifdef DEBUG
X  printf("iatan2(%d, %d) = %d\n", y, x, i);
X#endif DEBUG
X
X  return(i);
X}
X
X/*
X * The isin and icos routines in trigtab.c are made to work in the obscure
X * coordinate system used by xtrek (angles measured from the positive y axis).
X * This routine snags out 1/4 of the isin table and uses it to produce
X * values of the sin function from the normal coordinate system.  This
X * has the advantage of making things like the law of sines work.
X */
Xint
Xnormal_isin(in_angle)
Xunsigned char in_angle;
X{
X  int minus = 1;
X  unsigned char angle = in_angle;
X
X  /* sin(a) = -sin(a-pi) */
X  if (angle > 128) {
X    angle = angle - 128;
X    minus *= -1;
X  }
X  /* sin(a) = sin(pi-a) */
X  if (angle > 64) {
X    angle = 128 - angle;
X  }
X
X  angle = angle + 64; /* stupid isin table is broken */
X  return(isin[angle]);
X}
X
X
X
X
END_OF_trigtab.c
if test 7990 -ne `wc -c <trigtab.c`; then
    echo shar: \"trigtab.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f xtrek_ship.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"xtrek_ship.man\"
else
echo shar: Extracting \"xtrek_ship.man\" \(10032 characters\)
sed "s/^X//" >xtrek_ship.man <<'END_OF_xtrek_ship.man'
X.\"static char sccsid[] = "@(#)xtrek_ship.man	3.1";
X.TH XTREK_SHIP 6 "08 Mar 1989"
X.SH NAME
Xxtrek_ship - Ship customization for xtrek(6)
X.SH SYNOPSIS
X.B
Xxtrek.ship:
X[ acdefgmprstvwxACDEFGMPRSTVWX ] ...
X.SH DESCRIPTION
X.IR Xtrek (6)
Xis a multi-player game of galactic warfare based on the Star
XTrek universe.
X.PP
XThe following describes the customization of ships allowed
Xby specifying the
X.B ship
Xdefault in your
X.I \&.Xdefaults
Xfile.
XCustomization is done by decreasing your ship's
Xabilities in one area, in order to increase them in another
Xarea.
XThe effect of one Unit of Customization (UoC) is
Xdescribed below for each ability.
X.PP
XThe
X.B ship
Xdefault specifies your ship customization as a list of
Xupper- and lower-case letters.
XUpper-case letters add one
XUoC to the associated abilities, while lower-case letters
Xsubtract one UoC from the associated abilities.
X.PP
XStarting
X.IR xtrek (6)
Xwith a ``-n name'' option will force it to use the
X.I name
Xdefault instead of the
X.B ship
Xdefault.
XThis can be useful for keeping several ship
Xdescriptions available, selecting the desired ship when
Xstarting
X.IR xtrek .
X.PP
XReasonable limits are made on the modifications allowed.
XOne general limitation is that the number of upper-case
Xletters cannot exceed the number of lower-case letters.
XEach ability will also have limitations listed.
X.SH ABILITIES
X.PP
XThe various ship types start out with differing capabilities.
XHere is a table of the defaults:
X.nf
X
X
X       Ability       Federation     Romulan      Klingon       Orion
X    Army Transport       10            14           10            6
X    Cloaking Cost        30            20           30           30
X  Heat Dissipation     2, 5          6, 3         2, 5         1, 7
X Engine Efficiency       20            25           20           15
X    Fuel Capacity     10000         20000        10000         7500
X   Fuel Generation       12            10           12           14
X   Maneuverability        2             1            2            4
X    Phaser Size        2500          3125         2500         2000
X    Repair Rate         100           150          100          100
X   Shield Strength      100           125          100          100
X    Torpedo Size        450           900          450          250
X  Torpedo Velocity       12            18           12           18
X    Warp Engines          9             7            9           11
X    Ship Size           100           100          100          100
X
X.fi
X.PP
XHere are the abilities, and their associated letters.
XThe effect of subtracting a UoC is listed in parenthesis.
X.TP 5
X.IB "Army Transport" \ a/A
XThe default ship can carry a maximum number of armies as listed in
Xthe table.
XEach UoC increases (decreases) the maximum capacity of the
Xship by 4 armies.
XYou cannot decrease this by more than 2 UoC.
X.TP 5
X.IB "Cloaking Cost" \ C
XCloaking costs start at the base value listed in the table above.
XEach UoC lowers
X(raises) the cost for your ship by 10
Xfuel units, within an allowable range of 0-30 fuel units.
XThis cost is then multiplied by your current speed and then subtracted
Xfrom your fuel.
XIt costs more to be cloaked if you are travelling faster.
XNOTE: There is no 'c' option.
X.TP 5
X.IB "Heat Dissipation" \ d/D
XThe table above lists two numbers, the first represents weapon heat
Xdissipation and the second engine heat dissipation.
XEach UoC raises (lowers)
Xyour ship's heat dissipation by 1 heat unit, with a
Xminimum heat dissipation of 0 heat units.
XBoth values are affected equally for each UoC.
X.TP 5
X.IB "Engine Efficiency" \ e/E
XIn regards to engines, you use fuel at the following rate:
X.nf
X
X   amount = warpcost * speed
X   if (shields are up)
X      amount = amount * 2
X   amount = amount + warpcost * number of armies on board
X
X.fi
XStarting with the "Engine Efficiency" value in the table above,
Xthe resulting warpcost is calculated as follows:
X.nf
X
X   warpcost = ee / (5 + UoC)
X
X.fi
XThis translates into the
Xfollowing fuel costs (shown for Federation and Klingon ships):
X.nf
X      UoC Allocation    Starting "EE"      Warp Cost
X	   -4               20                20
X	   -3               20                10
X	   -2               20                6
X	   -1               20                5
X	    0               20                4
X	    1               20                3
X	    2               20                2
X	    3               20                2
X	    4               20                2
X	    5               20                2
X	    6               20                1
X
X.fi
X.TP 5
X.IB "Fuel Capacity" \ f/F
XUn-changed ships have fuel capacities as shown in the beginning table.
XEach UoC
Xraises (lowers) your ship's capacity by 2,500 fuel units.
X.TP 5
X.IB "Fuel Generation" \ g/G
XShips generate fuel as listed in the beginning table.
XEach UoC raises
X(lowers) the fuel generation rate by 2, with a
Xminimum rate of 0 fuel units.
X.TP 5
X.IB "Maneuverability" \ m/M
XThis affects how quickly your ship can change directions
Xwhile moving.
XEach UoC allows your ship to maneuver as well
Xas a normal ship traveling one warp factor slower (faster).
XAt the minimum setting (-5 UoC), warp 1 behaves like warp 6
Xnormally does and navagation requires nearly stopping before
Xturning.
XThe beginning table numbers merely reflect that Federation and
XKlingon ships outmaneuver Romulan ships by a factor of 2:1.
XAnd Orion ships outmaneuver Romulan ships by a factor of 4:1.
X.TP 5
X.IB "Phaser Size" \ p/P
XNormal phasers
Xhave 4 times the value listed in the beginning table for a "size".
XEach UoC increases (decreases)
Xthis by another unit.
XFor base Federation and Klingon ships, this results in a size of
X10000 units, for Romulans a size of 12500, and Orions get an 8000.
XThe damage inflicted by phasers is
Xthe square root of the Phaser Size.
XThe minimum damage is 0 (you've scuttled your phasers).
XPhaser range, fuel required, and weapons heating
Xare proportional to the damage inflicted by the phasers.
XThe following chart correlates damage to the number of UoC
Xallocated to Phaser Size, for Federation and Klingon ships:
X
X.nf
X
X	Point Blank	UoC Allocation
X	Phaser Damage	  Required
X
X	     0		    -4
X	    50		    -3
X	    70		    -2
X	    86		    -1
X	   100		     0
X	   111		     1
X	   122		     2
X	   132		     3
X	   141		     4
X	   158		     6
X	   173		     8
X	   200		    12
X	   223		    16
X.fi
X.TP 5
X.IB "Repair Rate" \ r/R
XShips base repair rate is listed in the beginning table.
XEach UoC increases (decreases) this by 50 damage units, with
Xa minimum repair rate of 0 damage units.
X.TP 5
X.IB "Shield Strength" \ s/S
XShield strength of normal ships is listed in the beginning table.
XEach UoC increases (decreases) this by 25 damage units, with
Xa minimum strength of 0 (no shields at all--not
Xrecommended).
X.TP 5
X.IB "Torpedo Size" \ t/T
XNormal photon torpedoes
Xhave 2 times the value listed in the beginning table for a "size".
XEach UoC increases (decreases)
Xthis by another unit.
XFor base Federation and Klingon ships, this results in a size of
X900 units, for Romulans a size of 1800, and Orions get a 500.
XThe damage inflicted by torpedoes
Xis the square root of the Torpedo Size.
XThe minimum damage is 0 (you've scuttled your torpedoes).
XThe fuel required and weapons heating
Xare proportional to Torpedo Size.
XThe following chart correlates damage to the number of UoC
Xallocated to Torpedo Size, for Federation and Klingon ships:
X
X.nf
X
X	Point Blank	UoC Allocation
X	Torpedo Damage	  Required
X
X	      0		     -2
X	     21		     -1
X	     30		      0
X	     36		      1
X	     42		      2
X	     47		      3
X	     51		      4
X	     60		      6
X	     67		      8
X	     79		     12
X	     90		     16
X.fi
X.TP 5
X.IB "Torpedo Velocity" \ v/V
XNormal photon torpedoes travel at a warp factor as listed in the
Xbeginning table.
XEach UoC
Xincreases (decreases) the torpedo velocity by 6 warp
Xfactors, with a minimum torpedo velocity of warp 0 (your
Xtorpedo launchers simply drop them in space as mines).
XThe
Xrange of torpedoes, fuel required to fire them, and heat generated
Xby them are proportional to their velocity and damage they cause.
X.TP 5
X.IB "Warp Engines" \ w/W
XThe beginning table lists the maximum warp factor for each ship type.
XEach UoC
Xincreases (decreases) the maximum by two warp factors, with a
Xminimum limit of warp 1.
X.TP 5
X.IB "Ship Size" \ x/X
XThe beginning table show how many damage units each type of
Xdefault ship can withstand.
XEach UoC increases (decreases) the
Xstrength of the ship by 15 damage units, with a minimum Ship
XSize withstanding 25 damage units.
X.SH NOTE
XIt may be helpful to some to think of ship customization in
Xthe following manner.
XYou are given a ship hull, and are
Xallocated a base number of UoC with which to convert this hull into a
Xviable starship.
XThe default ship configuration allocates
Xthese UoC to create a general purpose ship.
XObviously, some
Xsystems (eg, Heat Dissipation, Fuel Generation) must have
Xsome UoC allocated to them, while others are less essential
X(eg, Army Transport).
X.SH EXAMPLES
X.TP 8
X.B
Xxtrek.ship: mmmPPP
XThis ship has -3 UoC for Maneuverability, and +3 UoC Phaser
XSize.
X.TP 8
X.B
Xxtrek.ship: agwCCC
XThis ship has -1 UoC each for Army Transport, Fuel Generation,
Xand Warp Engines, but with +3 UoC Cloaking Cost,
Xhe is not an easy target.
X.TP 8
X.B
Xxtrek.torper: appppwDGGVTT
XThis ship has -1 UoC Army Transport,
X-4 UoC Phaser Size, and -1 UoC Warp Speed.
XBut with +1 UoC Heat Dissipation, +2 UoC Fuel Generation, +1 UoC Torpedo 
XVelocity and +2 UoC Torpedo Size, they'll keep you dodging photon
Xtorpedoes.
X.TP 8
X.B
Xxtrek.ship: aattvvEEMMPP
XThis ship has -2 UoC for Army Transport,
X-2 UoC
XTorpedo Size, and -2 UoC Torpedo
XVelocity.
XHowever, this ship has +2 UoC
XEngine Efficiency, +2
XUoC Maneuverability, and +2 UoC for Phaser Size.
XIt's a good fighter.
X.SH "SEE ALSO"
Xxtrek(6)
X.SH DIAGNOSTICS
XIf a specified ship customization is invalid, xtrek will
Xsilently ignore the customization and you'll get the default ship type.
X.SH BUGS
XThe customization parameters need to be balanced.
X
XLetters other than those understood are silently ignored.
X
X
END_OF_xtrek_ship.man
if test 10032 -ne `wc -c <xtrek_ship.man`; then
    echo shar: \"xtrek_ship.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 4 \(of 11\).
cp /dev/null ark4isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 11 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

dan
----------------------------------------------------
O'Reilly && Associates   argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.



More information about the Comp.sources.x mailing list