DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T d

⟦03bb0be1e⟧ TextFile

    Length: 5962 (0x174a)
    Types: TextFile
    Names: »defs.h«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/X/Xtrek/defs.h« 

TextFile

/* static char sccsid[] = "@(#)defs.h	1.1"; */
/*

	Copyright (c) 1986 	Chris Guthrie

Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation.  No representations are made about the
suitability of this software for any purpose.  It is
provided "as is" without express or implied warranty.

*/

#include "xtrekfont.h"

#define	PROGRAM_NAME	"xtrek"

#define MAXPLAYER 16
#define MAXPLANETS 40
#define MAXTORP 12

/* These are configuration definitions */

/* Timing */
#define UPDATE 200000			/* Update time is 200000 us */
#define UPS (1000000/UPDATE)
#define WARP1 (200 / UPS) 		/* warp 1 moves 200 spaces per sec */
#define DEATHTIME (6 * UPS) 		/* Player is dead for 6 seconds */
#define PFIRETIME (1 * UPS) 		/* Phaser fires for 1 second */
#define TFIREMIN (3 * UPS) 		/* Torp lives at least 3 sec */
#define TFIREVAR (6 * UPS)		/* Torp may live up to 6 more sec */
#define TEXPTIME (1 * UPS)		/* Torp explodes for 1 sec */
#define PEXPTIME (1 * UPS)		/* Player explodes for 1 sec */
#define PWEAPCOOL (20 / UPS)		/* Weapons cool 20 per sec */
#define PWEAPLOCKMIN (10 * UPS)		/* Weapons lock for at least 10 sec */
#define PWEAPLOCKVAR (15 * UPS)		/* Weapons may lock for 15 sec more */
#define PENGCOOL (50 / UPS)		/* Engines cool 50 per sec */
#define PENGLOCKMIN (10 * UPS) 		/* Engines lock for at least 10 sec */
#define PENGLOCKVAR (15 * UPS) 		/* Engines may lock for 15 sec more */
#define PREFUEL (20 / UPS)		/* Fuel recharges per sec */
#define PREPAIR (10 / UPS)		/* Repairs per sec */
#define PCLOAKRATE (10 / UPS)		/* Cloak cost per sec */
#define PFUELRATE (10 / UPS)		/* Engine cost per sec */
#define PTURNRATE (10 / UPS)		/* Turns per sec */
#define PACCELRATE (10 / UPS)		/* Accelerations per sec */
#define PSELFDESTTIME (10 * UPS)	/* Self destruct in 10 sec */
#define RGIVEUPTIME (60 * UPS)		/* Robot gives up in 60 sec */
#define ORBSPEED 2	/* This is the fastest a person can go into orbit */

/* Space */
#define GWIDTH 100000   /* galaxy is 100000 spaces on a side */
#define SCALE 40	/* Window will be one pixel for this many spaces */
#define EXPDIST 400	/* At this range a torp will explode */
#define DETDIST 2500	/* At this range a player can detonate a torp */
#define TDAMDIST 1500   /* At this range a torp does damage when it explodes */
#define ORBDIST 900	/* At this range a player can orbit a planet */
#define PFIREDIST 1500	/* At this range a planet will shoot at a player */
#define PHITANG 5       /*<not used> Number of degrees that a phaser will hit*/
#define PHITDIST 400	/* Perpendicular distance at which phaser will hit */

#define AUTOQUIT 60	/* auto logout in 60 secs */

/* These are memory sections */
#define PLAYER 1
#define MAXMESSAGE 50

#define rosette(x)	((((x) + 256/VIEWS/2) / (256/VIEWS)) % VIEWS)

/* These are the teams */
/* Note that I used bit types for these mostly for messages and
   war status.  This was probably a mistake.  It meant that Ed
   had to add the 'remap' area to map these (which are used throughout
   the code as the proper team variable) into a nice four team deep
   array for his color stuff.  Oh well.
*/
#define NOBODY 0x0
#define FED 0x1
#define ROM 0x2
#define KLI 0x4
#define ORI 0x8
#define ALLTEAM (FED|ROM|KLI|ORI)
#define MAXTEAM (ORI)
#define NUMTEAM 4
/*
** These are random configuration variables
*/
#define VICTORY 30	/* Number of planets needed to conquer the galaxy */
#define WARNTIME 30	/* Number of updates to have a warning on the screen */
#define MESSTIME 30	/* Number of updates to have a message on the screen */

#define TARG_PLAYER	0x1	/* Flags for gettarget */
#define TARG_PLANET	0x2
#define TARG_CLOAK	0x4	/* Include cloaked ships in search */
#define	TARG_MYSELF	0x8	/* Allow myself */

/* Data files to make the game play across daemon restarts. */

#define DIR		"/usr/games/lib/xtrek"

#define PLFILE		"/usr/games/lib/xtrek/.planets"
#define SCOREFILE	"/usr/games/lib/xtrek/scores"
#define MOTD		"/usr/games/lib/xtrek/.motd"

#include "struct.h"

/* Other stuff that Ed added */

#define ABS(a)			/* abs(a) */ (((a) < 0) ? -(a) : (a))

#define myTorp(t)		(p->p_no == (t)->t_owner)
#define friendlyTorp(t)		((!(p->p_team & (t)->t_war)) || (myTorp(t)))
#define myPhaser(x)		(&phasers[p->p_no] == (x))
#define friendlyPhaser(x)	(p->p_team == players[(x) - phasers].p_team)
#define myPlayer(x)		(p == (x))
#define myPlanet(x)		(p->p_team == (x)->pl_owner)
#define friendlyPlayer(x)	((!(p->p_team & \
				    ((x)->p_swar | (x)->p_hostile))) && \
				    (!((x)->p_team & \
				    (p->p_swar | p->p_hostile))))
#define isAlive(x)		((x)->p_status == PALIVE)
#define friendlyPlanet(x)	((x)->pl_info & p->p_team && \
			     !((x)->pl_owner & (p->p_swar | p->p_hostile)))

#define torpColor(t)		\
	(myTorp(t) ? p->myColor : p->shipCol[remap[players[(t)->t_owner].p_team]])
#define phaserColor(x)		\
	(myPhaser(x) ? p->myColor : p->shipCol[remap[players[(x) - phasers].p_team]])
#define playerColor(x)		\
	(myPlayer(x) ? p->myColor : p->shipCol[remap[(x)->p_team]])
#define planetColor(x)		\
	(((x)->pl_info & p->p_team) ? p->shipCol[remap[(x)->pl_owner]] : p->unColor)
#define mplanetGlyph(x)		\
	((((x)->pl_info & p->p_team) ? \
	( p->mono ? remap[(x)->pl_owner] : 0 ) : 0)+MPLANET_GLYPHS)
#define planetGlyph(x)		\
	((((x)->pl_info & p->p_team) ? \
	( p->mono ? remap[(x)->pl_owner] : 0 ) : 0)+PLANET_GLYPHS)

#define planetFont(x)		\
	(myPlanet(x) ? p->bfont : friendlyPlanet(x) ? p->ifont : p->dfont)
#define shipFont(x)		\
	(myPlayer(x) ? p->bfont : friendlyPlayer(x) ? p->ifont : p->dfont)

/* Macros for X11 (nurk) */
#define fontWidth(f)	((f)->max_bounds.width)
#define fontHeight(f)	((f)->max_bounds.ascent + (f)->max_bounds.descent)

#define	TRIGSCALE	13	/* trig values are multiplied by 8K */