/* Declarations of glabal variables */
int demo=1;
// 0 is full game, 1 = demo, 2 = webdemo
char version[]="Secession ALPHA Demo version 1.03, 28th November.\nPlease see README.TXT for more details.\n";
char notice[]="Copyright Spideractive Ltd. 1996.\n3D Engine by Virtek International Ltd.\nThis software may not be altered without the permission of Spideractive Ltd.\n";
//Unauthorised copying, lending or trading is prohibited.\nNo part of this software may be reproduced, stored in a retrieval system,\ntransmitted or copyied by any form or any means without the prior permission\nof the owners. Any failure to comply with the above will result in prosecution.\n";
char credits[]="CONCEPT: Joseph Waller\n GAME: Joseph Waller, Jason McCallion\n GRAPHICS: Joseph Waller, Jason McCallion, Ben Broadhurst\n MISSIONS: Joseph Waller, Ben Broadhurst\n SOUND: Joseph Waller, Jason Brome\n";
int ships=50;   // The number of ships in the game
int dddshapes=129; // The number of shapes ddd is allowed
int shapes=300; // The number of projectiles in the game
int maxstars=2000; // The maximum number of stars
int comms=25;   // The number of communications
float velconst=2; // The games velocity constant
int nowaypoints=9; // Number of waypoints
int complines=4; //Number of lines of computer screen
int numguiobjects=10;
float ar=1.8;

// The replacement detail levels are as follows:
int rendermethod=FULL;
int cockpitrendermethod=FULL;
float renderdist=96000L;
float effectsrenderdist=16000L;
int lightsourcing=ON;
int smalldetails=FLAT;
int sparks=ON;
int complexity=4;
int planets=ON;
int starfield=300;
int debrisremoval=ON;
int longlaser=OFF;
int flames=ON;
int attachedobjects=ON;
/*
int ioncharge=60; //20
int gunpower[12]={0,7,5,10,300,500,150,80,14,14,60,11}; // the 60 was 110 - too harsh though - wipes bomber out in one!!
int gunrange[12]={0,4000,12000,6000,5500,3500,6500,6500,4000,12000,5000,5000};
int gunrate[12]={0,6,0,90,40,40,50,15,5,0,10,40};
int gunkey[12]={0,_R_CTRL,_R_CTRL,_R_CTRL,_RETURN,_RETURN,_RETURN,_RETURN,_R_CTRL,_R_CTRL,_RETURN,_R_CTRL};
int gunmouse[12]={0,1,1,1,3,3,3,3,1,1,3,1};
int gunprojectile[12]={0,100,101,102,103,104,105,106,111,101,112,113};
float gunvelocity[12]={0,0.83,0.71,0.50,0.15,0.15,0.17,0.20,0.83,0.71,0.5,0.83};
*/
int ioncharge=60;
int gunpower[12]={0,7,5,10,300,500,150,80,14,14,60,11}; // the 60 was 110 - too harsh though - wipes bomber out in one!!
int gunrange[12]={0,4000,12000,6000,5500,3500,6500,6500,4000,12000,5000,5000};
int gunrate[12]={0,6,0,90,40,40,50,15,5,0,10,40};
int gunkey[12]={0,_R_CTRL,_R_CTRL,_R_CTRL,_RETURN,_RETURN,_RETURN,_RETURN,_R_CTRL,_R_CTRL,_RETURN,_R_CTRL};
int gunmouse[12]={0,1,1,1,3,3,3,3,1,1,3,1};
int gunprojectile[12]={0,100,101,102,103,104,105,106,111,101,112,113};
float gunvelocity[12]={0,0.83,0.71,0.50,0.15,0.15,0.17,0.20,0.83,0.71,0.5,0.93};

float maxspeed=40000L;          // The maximum tick rate of the game
float minspeed=50000L;          // The minimum tick rate
int statistics=1;                               // Statistics booleans
int computer=1;
int drawcockpit=1,drawdebris=1;
int targetstatistics=1;
int friendly=1;                         // Number of friendly ships
int enemy=0;                                    // Enemy ships
int neutral=0;                                  // Neutral ships
int total=1;                                    // Total ships
int view=0;                                             // The current battle view
char views[10][16]={"FRONT\0","REAR\0","RIGHT\0","LEFT\0","CHASE\0","FORWARD\0","DEATHCAM\0","ABOVE\0","TARGET CHASE\0","TARGET FRONT\0"};
float friendlypower=1;                  // The powers of the sides
float enemypower=1;
float neutralpower=1;
float totalpower=1;
float distance;
float viewx,viewy,viewz;                // View x y z
float viewrx,viewry,viewrz;             // View rx ry rz
char Semaphores=0;
float a=(PI*2)/100;                   // Pi
int frame1,frame2,frame3;             // Frames for animation
int targetinfo=10;          //Target info position - 0=down 10=up
int targetinfoupdown=10;
int targetframe;                                        // A general keypressing frame
int incoming;                                           // incoming fire boolean type
int videomode;                                          // The integer videomode
int currentcomm=0;                      // Communication variables
int commtimer=0;
int currentprintcomm=0;
int col1,col2,col3,col4,var1;   // Colors and wotnot for messages
struct GUIOBJECT *gui;
struct OBJECT *o;                                                       // Object
struct PROJECTILE *p;
struct COMMUNICATION *c;             // Communication
struct STAR *star;                                                      // Star
struct SHAPEDATA *shapedata;         // Shapedata
struct WAYPOINT *w;
struct CREATEOBJECT *co;
struct OBJECTEVENT *oe;
struct COMMUNICATIONEVENT *ce;
struct MOUSE m;
struct JOY j;
struct PILOTSTRUCT pilot;
struct DEBRIS *d;
struct GROUND *gr;
int ground;
float height;

VtkObj ShapeHandle[150];                  // The shapehandle for each shape
int dpt[50];
int *matter;
char comp[20][20];
int compside[20];
int complatest=0;
int complatesttimer=0;
long missiontime=0;
int control=0;
float judx,judy;
//int flames=0;
short myXpos,myYpos;
int jcenterx,jcentery,jmaxx,jmaxy;
float first_time=0;                     // Timing counters.
float this_time=0;
float old_time=0;
int removal,debris=50;
                            // A removal picture
MOD *modsong[10];
MOD *tempmodsong;
SAMPLE *sound1[20];
DWORD length1[20];
long size1[20];
int playing[20];

int triciacomputer;
SAMPLE *triciasound1[40];
DWORD tricialength1[40];
long triciasize1[40];
int tricia;
int triciaplaying[40];

DWORD id1;
SAMPLE *tempsound;
DWORD templength;
SAMPLE *msound1[20];
DWORD mlength1[20];
long msize1[20];
int music=0,fx=0,sampling=0,jsens=16,msens=16,volume=1,soundblaster=0;
int thereisnosound=0;

long scale=10000L;
int ccpp;
int no_projectiles;
int projectilefield=1;

int numcampaigns,nummissions,actualmission,missioncompleted;
int  missiontype[12];
int  missionessential[12];
char missionname[12][13];
int missiontune[12];
int startflag;
int terminateflag;
int norand=0;
int finishtime=0;
int notcompleted=0;
int completedcount=0,critical=0;

int debug=0;
int quiet=0;

unsigned char apikeypressed[128];// Table to track scancodes
int apimouse_x,apimouse_y,apilbutton,apirbutton,apibuttons;
int apijoystick_x_position,apijoystick_y_position,apijoystick_left_button,apijoystick_right_button;

long old_video_mode;
VtkPal MyPal,FullPal;
VtkObj light,camera,ccamera,spare,sun,cock,targetbox,targ,cockpit,red;
VtkObj lgun[10],rgun[10];
int modex,modey;

int keyAdd;
char key[256];
void (__interrupt __far *biosKeyboardHandler)();
char keyboardHandlerInstalled=0;
unsigned int jjj_num_timers=0;
unsigned long *jjj_start_times=NULL;
unsigned char jjjtimer_not_initailized=1;

float speedconst=1.5;
int difficulty;
int successflag;

int tat;
int targetturret,targetturretflash;
//int tat2,tat2x,tat2y;

// Tar stuff.
int handle;
char tempofile[256];
struct jjjtar_mainheader mainh;   // Contains the information about the whole file
struct jjjtar_filepointer *filep; // Pointer to the array of headers at the start of the file

