home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 7 Games
/
07-Games.zip
/
MVTREK.ZIP
/
VTREK.H
< prev
next >
Wrap
C/C++ Source or Header
|
1989-12-26
|
5KB
|
150 lines
/* vtrek.h -- header file for visual star trek */
#ifdef HI_TECH_C /* The Hi-Tech C compiler provides sufficient
environmental information that we do not have
to depend on user-supplied #defines */
#ifdef DOS
#define OS2
#endif
#else /* not Hi-Tech C */
/* Select an operating system by enabling one and only one of the
/* following #defines. (Choose OS2 if you are compiling for MSDOS) */
#define OS2
/* #define UNIX */
/* #define CPM */
/* and select a compiler by enabling one of the following */
#ifndef UNIX
#define MSC /* Microsoft C (5.1 for MSDOS & OS/2) */
#undef AZTEC /* Aztec C (for CP/M. The MSDOS one is untested) */
#endif /* not UNIX */
#endif /* not Hi-Tech C */
#ifdef AZTEC
#include "libc.h"
#include "math.h"
#else
#include <stdio.h>
#include <math.h>
#include <ctype.h>
#endif
#define VTREKINS "vtrek.hlp" /* instructions */
#ifndef ERROR
#define ERROR -1
#endif
#ifndef PI
#define PI 3.1415926
#endif
#define Toupper(x) (islower(x) ? toupper(x) : x)
#ifndef abs
#define abs(x) (x < 0 ? -x : x)
#endif
/* used for damaging klingon */
#define AUTOKILL 9999
/* used for fixing/damaging devices */
#define ABS 0 /* absolute fix */
#define REL 1 /* relative fix */
#define RND -1 /* pick a random device */
/* status of a ship */
#define ALIVE 0 /* ship is still here */
#define DEAD 1 /* ship has been destroyed */
/* used for replot calls */
#define TEXT 1 /* replot text portion */
#define INFO 2 /* replot information portion */
#define ELEMENT 4 /* replot individual element */
#define ALL (TEXT | INFO) /* replot all */
/* legal condition values */
#define GREEN 0 /* everything OK */
#define YELLOW 1 /* reason to be cautious */
#define RED 2 /* imminent danger */
#define DOCKED 3 /* docked at base (no danger) */
/* legal quadrant values (used in s.r.s) */
#define EMPTY 0 /* sector is empty */
#define KLINGON 1 /* sector contains klingon */
#define STARBASE 2 /* sector contains star base */
#define STAR 3 /* sector contains star */
#define PLAYER 4 /* sector contains player */
#define TBLAST 5 /* torpedo */
/* legal damage control indices */
#define WARP 0 /* warp drive */
#define SRS 1 /* short range sensors */
#define LRS 2 /* long range sensors */
#define PHASER 3 /* phaser control */
#define DAMAGE 4 /* damage control */
#define DEFENSE 5 /* defense control (shields) */
#define COMPUTER 6 /* computer (galaxy map, calculations) */
#define TUBES 7 /* torpedo tubes */
/* legal status items */
#define STARDATE 0
#define CONDITION 1
#define QUADRANT 2
#define SECTOR 3
#define ENERGY 4
#define TORPS 5
#define SHIELDS 6
/* used for readout calls */
#define CLEAR 0 /* clear readout */
#define ADDLINE 1 /* add line to readout */
/* sructure used to store quandrant information */
typedef struct {
char nkling; /* number of klingons in quadrant */
char nbase; /* number of bases in quadrant */
char nstar; /* number of stars in quadrant */
char known; /* tells if info is known to player */
} QUADINFO;
/* structure used to store klingon information */
typedef struct {
int xs, ys; /* sector coordinates */
int sh; /* shield level */
} KLINGINFO;
extern KLINGINFO klingon[3];
extern QUADINFO galaxy[8][8]; /* galaxy */
extern int numbases; /* number of bases in galaxy */
extern int numkling; /* number of klingons in galaxy */
extern int begkling; /* beginning number of klingons */
extern int condition; /* current condition (GREEN,YELLOW,RED,DOCKED) */
extern int xquad, yquad; /* current quadrant */
extern int xsect, ysect; /* current sector */
extern int old_xquad, old_yquad; /* quadrant before last movement */
extern int old_xsect, old_ysect; /* sector before last movement */
extern int energy; /* energy level */
extern int shields; /* shield level */
extern int torps; /* number of torps left */
extern int quadrant[8][8]; /* current quadrant picture (EMPTY,KLINGON,STARBASE,STAR,PLAYER) */
extern int rolines; /* number of lines used in current readout */
extern int damage[8]; /* % effectiveness of devices, normal range
is 0-100 */
/* if < 0 then device is damaged beyond use */
extern char playership[]; /* image of player's ship for s.r.s */
extern char captain[11]; /* captain's name */
extern char shipname[11]; /* ship's name */
extern float stardate; /* current star date */
extern float lastdate; /* last star date before federation is conquered */
extern float begdate; /* beginning star date */
extern int base_xsect, base_ysect; /* starbase sector, if one is present */
extern int numkmove; /* number of klingon moves allowed */
extern int skill; /* skill level */