2006-04-13 20:47:06 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
2007-02-08 04:19:39 +00:00
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
|
|
|
|
Copyright (C) 2004, 2007 - EDuke32 developers
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
This file is part of EDuke32
|
|
|
|
|
|
|
|
EDuke32 is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
#include "duke3d.h"
|
|
|
|
|
2008-03-09 08:14:12 +00:00
|
|
|
char *MusicPtr = NULL;
|
|
|
|
int Musicsize;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
short global_random;
|
|
|
|
short neartagsector, neartagwall, neartagsprite;
|
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
int neartaghitdist,lockclock,start_armour_amount;
|
2006-04-13 20:47:06 +00:00
|
|
|
// JBF: gc modified to default to Atomic ed. default when using 1.3d CONs
|
2007-12-12 17:42:14 +00:00
|
|
|
int gc=176;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
// int temp_data[MAXSPRITES][6];
|
2007-09-11 05:26:38 +00:00
|
|
|
actordata_t hittype[MAXSPRITES];
|
2007-03-08 21:07:10 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
short spriteq[1024],spriteqloc,spriteqamount=64;
|
2007-08-27 00:20:15 +00:00
|
|
|
animwalltype animwall[MAXANIMWALLS];
|
2006-04-13 20:47:06 +00:00
|
|
|
short numanimwalls;
|
2008-04-24 09:53:16 +00:00
|
|
|
int *animateptr[MAXANIMATES];
|
2008-02-29 04:37:37 +00:00
|
|
|
int animategoal[MAXANIMATES], animatevel[MAXANIMATES], animatecnt;
|
2007-12-12 17:42:14 +00:00
|
|
|
// int oanimateval[MAXANIMATES];
|
2006-04-13 20:47:06 +00:00
|
|
|
short animatesect[MAXANIMATES];
|
2007-12-12 17:42:14 +00:00
|
|
|
int msx[2048],msy[2048];
|
2006-04-13 20:47:06 +00:00
|
|
|
short cyclers[MAXCYCLERS][6],numcyclers;
|
|
|
|
|
2006-04-24 18:52:29 +00:00
|
|
|
char *fta_quotes[MAXQUOTES],*redefined_quotes[MAXQUOTES];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-08-03 11:45:15 +00:00
|
|
|
char tempbuf[2048], packbuf[576], menutextbuf[128];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
short camsprite;
|
|
|
|
short mirrorwall[64], mirrorsector[64], mirrorcnt;
|
|
|
|
|
|
|
|
int current_menu;
|
|
|
|
|
2008-03-08 05:23:15 +00:00
|
|
|
map_t map[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
2007-08-26 11:28:32 +00:00
|
|
|
|
2006-04-15 03:12:08 +00:00
|
|
|
char volume_names[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" };
|
2006-04-13 20:47:06 +00:00
|
|
|
char skill_names[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD" };
|
|
|
|
|
2006-08-20 22:17:12 +00:00
|
|
|
char gametype_names[MAXGAMETYPES][33] = { "DUKEMATCH (SPAWN)","COOPERATIVE PLAY","DUKEMATCH (NO SPAWN)","TEAM DM (SPAWN)","TEAM DM (NO SPAWN)"};
|
|
|
|
int gametype_flags[MAXGAMETYPES] = {4+8+16+1024+2048+16384,1+2+32+64+128+256+512+4096+8192+32768,2+4+8+16+16384,4+8+16+1024+2048+16384+65536+131072,2+4+8+16+16384+65536+131072};
|
|
|
|
char num_gametypes = 5;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
short title_zoom;
|
|
|
|
|
2006-06-19 19:28:49 +00:00
|
|
|
int framerate;
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
char num_volumes = 3;
|
|
|
|
|
|
|
|
short timer=120;
|
|
|
|
//fx_device device;
|
|
|
|
|
2007-10-24 06:48:13 +00:00
|
|
|
sound_t g_sounds[ MAXSOUNDS ];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
char numplayersprites,loadfromgrouponly=0,earthquaketime;
|
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
int fricxv,fricyv;
|
2007-08-27 00:20:15 +00:00
|
|
|
playerdata_t g_player[MAXPLAYERS];
|
|
|
|
input inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
|
2007-10-24 06:48:13 +00:00
|
|
|
playerspawn_t g_PlayerSpawnPoints[MAXPLAYERS];
|
2007-08-27 00:20:15 +00:00
|
|
|
user_defs ud;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
char pus, pub;
|
2007-08-27 00:20:15 +00:00
|
|
|
char syncstat;
|
2007-12-12 17:42:14 +00:00
|
|
|
int syncvaltail, syncvaltottail;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-08-27 00:20:15 +00:00
|
|
|
input loc;
|
2006-04-13 20:47:06 +00:00
|
|
|
input recsync[RECSYNCBUFSIZ];
|
2007-12-12 17:42:14 +00:00
|
|
|
int avgfvel, avgsvel, avgavel, avghorz, avgbits, avgextbits;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
int movefifosendplc;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
//Multiplayer syncing variables
|
2008-01-04 04:41:13 +00:00
|
|
|
int screenpeek;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
//Game recording variables
|
|
|
|
|
2007-08-27 00:20:15 +00:00
|
|
|
char ready2send;
|
2007-12-12 17:42:14 +00:00
|
|
|
int vel, svel, angvel, horiz, ototalclock, respawnactortime=768, respawnitemtime=768, groupfile;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-02-17 05:08:18 +00:00
|
|
|
intptr_t *scriptptr,*insptr,*labelcode,*labeltype;
|
|
|
|
int labelcnt,defaultlabelcnt;
|
|
|
|
intptr_t *actorscrptr[MAXTILES],*parsing_actor;
|
2006-12-20 03:27:25 +00:00
|
|
|
char *label;
|
2006-04-13 20:47:06 +00:00
|
|
|
char *music_pointer;
|
|
|
|
char actortype[MAXTILES];
|
2008-02-17 05:08:18 +00:00
|
|
|
intptr_t *script = NULL;
|
2007-08-29 04:01:21 +00:00
|
|
|
|
|
|
|
int g_ScriptSize = 16384;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-04-10 08:24:06 +00:00
|
|
|
char typebuflen,typebuf[141];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-12-04 22:05:30 +00:00
|
|
|
char *music_fn[MAXVOLUMES+1][MAXLEVELS],music_select;
|
|
|
|
char env_music_fn[MAXVOLUMES+1][BMAX_PATH];
|
2006-04-13 20:47:06 +00:00
|
|
|
char rtsplaying;
|
|
|
|
|
|
|
|
|
2007-08-25 01:05:00 +00:00
|
|
|
short weaponsandammosprites[15] =
|
|
|
|
{
|
|
|
|
RPGSPRITE__STATIC,
|
|
|
|
CHAINGUNSPRITE__STATIC,
|
|
|
|
DEVISTATORAMMO__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
JETPACK__STATIC,
|
|
|
|
SHIELD__STATIC,
|
|
|
|
FIRSTAID__STATIC,
|
|
|
|
STEROIDS__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
RPGSPRITE__STATIC,
|
|
|
|
RPGAMMO__STATIC,
|
|
|
|
FREEZESPRITE__STATIC,
|
|
|
|
FREEZEAMMO__STATIC
|
|
|
|
};
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
int impact_damage;
|
2007-08-27 06:46:31 +00:00
|
|
|
int g_ScriptDebug;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
//GLOBAL.C - replace the end "my's" with this
|
2007-12-12 17:42:14 +00:00
|
|
|
int myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
|
2006-04-13 20:47:06 +00:00
|
|
|
short myhoriz, omyhoriz, myhorizoff, omyhorizoff;
|
2007-08-27 00:20:15 +00:00
|
|
|
short myang, omyang, mycursectnum, myjumpingcounter;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
char myjumpingtoggle, myonground, myhardlanding, myreturntocenter;
|
|
|
|
signed char multiwho, multipos, multiwhat, multiflag;
|
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
int fakemovefifoplc,movefifoplc;
|
|
|
|
int myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
|
|
|
int myhorizbak[MOVEFIFOSIZ],dukefriction = 0xcc00, show_shareware;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
short myangbak[MOVEFIFOSIZ];
|
2007-03-22 20:58:13 +00:00
|
|
|
char myname[32];
|
|
|
|
int camerashitable,freezerhurtowner=0,lasermode=0;
|
|
|
|
int networkmode = 255, movesperpacket = 1,gamequit = 0,everyothertime;
|
2007-12-12 17:42:14 +00:00
|
|
|
int numfreezebounces=3,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
|
2006-04-13 20:47:06 +00:00
|
|
|
STATUSBARTYPE sbar;
|
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
int mymaxlag, otherminlag, bufferjitter = 1;
|
2006-04-13 20:47:06 +00:00
|
|
|
short numclouds,clouds[128],cloudx[128],cloudy[128];
|
2007-12-12 17:42:14 +00:00
|
|
|
int cloudtotalclock = 0,totalmemory = 0;
|
|
|
|
int numinterpolations = 0, startofdynamicinterpolations = 0;
|
2008-04-24 09:53:16 +00:00
|
|
|
int oldipos[MAXINTERPOLATIONS];
|
|
|
|
int bakipos[MAXINTERPOLATIONS];
|
|
|
|
int *curipos[MAXINTERPOLATIONS];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
int nextvoxid = 0;
|
|
|
|
|
2007-09-11 05:26:38 +00:00
|
|
|
int spriteflags[MAXTILES];
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-07-12 23:44:07 +00:00
|
|
|
projectile_t projectile[MAXTILES], thisprojectile[MAXSPRITES], defaultprojectile[MAXTILES];
|
2006-04-22 22:33:52 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
char cheatkey[2] = { sc_D, sc_N };
|
2006-11-24 04:25:13 +00:00
|
|
|
char setupfilename[BMAX_PATH]= "duke3d.cfg";
|
2007-01-26 00:28:44 +00:00
|
|
|
char datetimestring[] = ""__DATE__" "__TIME__"";
|
2006-12-09 23:41:43 +00:00
|
|
|
|
2008-06-30 07:30:48 +00:00
|
|
|
int doquicksave = 0;
|
|
|
|
|