2020-06-11 07:22:16 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
2020-07-20 21:07:44 +00:00
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
Copyright (C) 2017-2019 Nuke.YKT
|
|
|
|
Copyright (C) 2020 - Christoph Oelckers
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-20 21:07:44 +00:00
|
|
|
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-20 21:07:44 +00:00
|
|
|
Duke Nukem 3D is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2020-07-20 21:07:44 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
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
|
2020-07-20 21:07:44 +00:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
Original Source: 1996 - Todd Replogle
|
|
|
|
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
2020-06-11 07:22:16 +00:00
|
|
|
*/
|
2020-07-20 21:07:44 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "ns.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
#include "global.h"
|
2020-06-21 20:18:12 +00:00
|
|
|
#include "duke3d.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
2020-11-29 14:09:23 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// variables that need a script export
|
|
|
|
//
|
|
|
|
//-------------------------------------------------------------------------
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-11-29 14:09:23 +00:00
|
|
|
user_defs ud; // partially serialized
|
2020-07-19 20:34:59 +00:00
|
|
|
|
2020-11-29 14:09:23 +00:00
|
|
|
// not serialized - read only
|
|
|
|
DukeGameInfo gs;
|
2020-07-19 21:09:10 +00:00
|
|
|
int screenpeek;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-11-29 14:09:23 +00:00
|
|
|
// serialized
|
|
|
|
player_struct ps[MAXPLAYERS];
|
2020-06-30 15:30:48 +00:00
|
|
|
|
2020-11-29 14:09:23 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// variables that only need an export if the entire game logic gets scriptified.
|
|
|
|
// Otherwise all code referencing these variables should remain native.
|
|
|
|
//
|
|
|
|
//-------------------------------------------------------------------------
|
2020-07-14 19:42:46 +00:00
|
|
|
|
2020-11-29 14:09:23 +00:00
|
|
|
int lastvisinc; // weapon flash
|
|
|
|
DDukeActor* camsprite; // active camera
|
2020-07-19 21:09:10 +00:00
|
|
|
int earthquaketime;
|
2020-11-29 14:09:23 +00:00
|
|
|
int global_random; // readonly - one single global per-frame random value. Ugh...
|
|
|
|
|
|
|
|
// Redneck Rampage
|
|
|
|
int chickenplant; // readonly - used to trigger some special behavior if a special item is found in a map.
|
|
|
|
int thunderon; // readonly - enables thunder effect in RR if true.
|
|
|
|
int ufospawn; // UFO spawn flag
|
|
|
|
int ufocnt; // UFO spawn count
|
|
|
|
int hulkspawn; // Spawn a hulk?
|
|
|
|
int lastlevel; // Set at the end of RRRA's E2L7.
|
|
|
|
short fakebubba_spawn, mamaspawn_count, banjosound; // RRRA special effects
|
|
|
|
short BellTime;
|
|
|
|
DDukeActor* BellSprite /* word_119BE0*/;
|
|
|
|
int WindTime, WindDir;
|
|
|
|
uint8_t enemysizecheat /*raat607*/, ufospawnsminion, pistonsound, chickenphase /* raat605*/, RRRA_ExitedLevel, fogactive;
|
2020-07-19 21:09:10 +00:00
|
|
|
|
2020-11-29 14:09:23 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// variables that do not need a script export.
|
|
|
|
//
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// not serialized
|
|
|
|
int otherp; // internal helper
|
|
|
|
int actor_tog; // cheat helper
|
|
|
|
int playerswhenstarted; // why is this needed?
|
|
|
|
int show_shareware; // display only.
|
|
|
|
int rtsplaying; // RTS playback state
|
|
|
|
int tempwallptr; // msx/y index.
|
|
|
|
int msx[MAXANIMPOINTS], msy[MAXANIMPOINTS];
|
|
|
|
bool sound445done; // used in checksectors_r. This was local state inside a function, but this must be maintained globally and serialized
|
|
|
|
|
|
|
|
// serialized
|
|
|
|
uint8_t sectorextra[MAXSECTORS]; // something about keys, all access through the haskey function.
|
2021-08-30 06:12:39 +00:00
|
|
|
DDukeActor hittype[MAXSPRITES + 1]; // +1 to have a blank entry for serialization, all access in game code through the iterators.
|
2020-11-29 14:09:23 +00:00
|
|
|
int spriteqamount = 64; // internal sprite queue
|
|
|
|
int spriteqloc;
|
|
|
|
DDukeActor* spriteq[1024];
|
|
|
|
uint8_t shadedsector[MAXSECTORS]; // display hackiness
|
|
|
|
animwalltype animwall[MAXANIMWALLS]; // animated walls
|
|
|
|
int numanimwalls;
|
|
|
|
int animatecnt; // sector plane movement
|
2021-11-06 13:22:16 +00:00
|
|
|
int animatesect[MAXANIMATES];
|
2020-07-20 18:40:29 +00:00
|
|
|
int8_t animatetype[MAXANIMATES];
|
|
|
|
int16_t animatetarget[MAXANIMATES];
|
2020-07-19 21:09:10 +00:00
|
|
|
int animategoal[MAXANIMATES];
|
|
|
|
int animatevel[MAXANIMATES];
|
2020-11-29 14:09:23 +00:00
|
|
|
int numclouds; // cloudy skies
|
2020-07-19 21:09:10 +00:00
|
|
|
int16_t clouds[256];
|
2020-12-06 19:49:32 +00:00
|
|
|
float cloudx;
|
|
|
|
float cloudy;
|
2020-08-25 23:33:40 +00:00
|
|
|
int cloudclock;
|
2020-11-29 14:09:23 +00:00
|
|
|
int numcyclers; // sector lighting effects
|
2021-11-06 20:53:15 +00:00
|
|
|
Cycler cyclers[MAXCYCLERS];
|
2020-11-29 14:09:23 +00:00
|
|
|
int mirrorcnt;
|
2021-11-06 13:22:16 +00:00
|
|
|
int mirrorsector[64]; // mirrors
|
|
|
|
int mirrorwall[64];
|
2020-11-29 14:09:23 +00:00
|
|
|
int numplayersprites; // player management for some SEs.
|
|
|
|
player_orig po[MAXPLAYERS];
|
|
|
|
unsigned ambientfx; // used by soundtag and soundtagonce script commands. If exported, export the commands, not the data!
|
|
|
|
short ambientlotag[64];
|
|
|
|
short ambienthitag[64];
|
|
|
|
uint32_t everyothertime; // Global animation ticker helper.
|
2020-07-19 21:09:10 +00:00
|
|
|
|
|
|
|
// Redneck Rampage
|
2020-11-29 14:09:23 +00:00
|
|
|
int thunder_brightness;
|
|
|
|
int wupass; // used to play the level entry sound only once.
|
|
|
|
int geosectorwarp[MAXGEOSECTORS]; // geometry render hack (overlay a secondary scene)
|
2020-07-19 21:09:10 +00:00
|
|
|
int geosectorwarp2[MAXGEOSECTORS];
|
|
|
|
int geosector[MAXGEOSECTORS];
|
|
|
|
int geox[MAXGEOSECTORS];
|
|
|
|
int geoy[MAXGEOSECTORS];
|
|
|
|
int geox2[MAXGEOSECTORS];
|
|
|
|
int geoy2[MAXGEOSECTORS];
|
|
|
|
int geocnt;
|
|
|
|
|
2020-07-19 18:04:11 +00:00
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
END_DUKE_NS
|