|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T v
Length: 4651 (0x122b)
Types: TextFile
Names: »vars.h«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Gb/vars.h«
/*
* Galactic Bloodshed (Robert Chansky, smq@b)
* main bunch of variables
*/
/* bit routines stolen from UNIX <sys/param.h> */
#define setbit(a,i) ((a)[(i)/8] |= 1<<((i)%8))
#define clrbit(a,i) ((a)[(i)/8] &= ~(1<<((i)%8)))
#define xbit(a,i) ((a)[(i)/8] ^= (1<<((i)%8)))
#define isset(a,i) ((a)[(i)/8] & (1<<((i)%8)))
#define isclr(a,i) (((a)[(i)/8] & (1<<((i)%8))) == 0)
#define howmanybytes(x) (((x)+7)/8)
#define Bzero(x) bzero( (char *)&(x), sizeof(x) )
#define Malloc(x) (x *)malloc( sizeof(x) )
#include "files.h"
#include "tweakables.h"
#include <sys/types.h>
#include <sys/file.h>
#include <stdio.h>
#define LEVEL_UNIV 0
#define LEVEL_STAR 1
#define LEVEL_PLAN 2
/*#define LEVEL_MOON 3*/
#define LEVEL_SHIP 3
#define MAXPLAYERS 30
#define BITS_MAXPLAYERS 5 /* # bits req'd to represent */
typedef char bool; /* 1 or 0 */
typedef unsigned char percent; /* 0-100 */
typedef unsigned long ul;
typedef unsigned short us;
typedef struct sector sectortype;
typedef struct planet planettype;
typedef struct star startype;
struct plinfo { /* planetary stockpiles */
unsigned fuel : 17; /* fuel for powering things */
unsigned destruct : 17; /* destructive potential */
unsigned resource : 17; /* resources in storage */
unsigned numsectsowned : 10;
unsigned comread : 7; /* combat readiness */
unsigned mob_set : 7; /* mobilization target */
/*unsigned quota_resource : 7;
unsigned quota_destruct : 7;
unsigned quota_fuel : 7;*/
unsigned explored : 1; /* 1 bit: explored by each player */
unsigned autorep : 3; /* player wants autoreport */
unsigned spied_on : 1; /* spied on */
};
struct sector {
unsigned eff : 7; /* efficiency (0-100) */
unsigned resource : 8;
unsigned fert : 7; /* max popn is proportional to this */
unsigned popn : 10;
unsigned mobilization : 7; /* percent popn is mobilized for war */
unsigned owner : BITS_MAXPLAYERS; /* owner of place */
unsigned is_wasted : 1; /* 1 bit: is a wasted sector */
/*unsigned is_cloaked : 1; /* 1 bit: is cloaked sector */
unsigned des : 3; /* kind of land the place is */
unsigned VN : 1; /* has a VN machine on it */
};
struct planet {
float xpos,ypos; /* x,y relative to orbit */
char conditions[TOXIC+1]; /* atmospheric conditions for terraforming */
/*int nummoons;*/
/*int moonpos[MAXMOONS]; /* filepos moons or ast around it */
short shipnums[MAXPSHIPS]; /* ship #'s that orbit it */
percent numships; /* # of ships there are */
percent Maxx,Maxy; /* size of map */
int sectormappos; /* file posn for sector map */
struct plinfo info[MAXPLAYERS-1]; /* planetary stockpiles */
unsigned popn : 20;
unsigned maxpopn : 20; /* maximum population */
unsigned slaved_to : BITS_MAXPLAYERS; /* owner of place */
/*unsigned is_sheep : 1; /* 1 bit: is emotion suppressed */
unsigned type : 2; /* what type planet is */
unsigned expltimer : 3; /* timer for explorations */
unsigned is_explored : 1; /* is explored by owner */
};
struct star {
float xpos,ypos;
char stability; /* how close to nova it is */
char name[NAMESIZE];
char numplanets; /* # of same */
char pnames[MAXPLANETS][NAMESIZE]; /* names of planets */
int planetpos[MAXPLANETS]; /* file posns of planets */
char numships; /* get rid of this */
short shipnums[MAXSSHIPS]; /* what ships are orbiting */
float gravity; /* attraction of star in "Standards". */
char explored[howmanybytes(MAXPLAYERS)]; /* who's been here */
char inhabited[howmanybytes(MAXPLAYERS)]; /* who lives here now */
char AP[MAXPLAYERS]; /* action pts alotted */
unsigned nova_stage : 4; /* stage of nova */
/*unsigned is_cloaked : 1; /* pl is cloaked */
};
/* this data will all be read at once */
struct data {
int numstars; /* # of stars */
int numships; /* # of ships floating around */
short shipnums[MAXUSHIPS];
char AP[MAXPLAYERS]; /* Action pts for each player */
} Sdata;
struct directory {
unsigned level : 2; /* what directory level */
int snum; /* what star system obj # (level=0) */
int pnum; /* number of planet */
int shipno; /* # of ship */
/*int moon; /* ptr to moon of planet obj # (lev=2)*/
char prompt[NAMESIZE+NAMESIZE+NAMESIZE+5]; /* just to be safe */
float lastx, lasty, zoom; /* last coords for zoom */
} Dir;
sectortype Smap[(MAX_X+1)*(MAX_Y+1) + 1];
startype *Stars[NUMSTARS];
int Playernum; /* what player you are */
extern float powscale(),logscale(),float_rand(),gravity();
char *malloc();