From fc4bc3ef7009ebf012b81ebb5dd3406e0cfcbae4 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 5 Jan 2007 22:30:35 +0000 Subject: [PATCH] CON command for earthquakes git-svn-id: https://svn.eduke32.com/eduke32@444 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/duke3d.h | 6 ++---- polymer/eduke32/source/game.c | 33 ++++++++++++------------------- polymer/eduke32/source/gamedef.c | 4 +++- polymer/eduke32/source/gamedef.h | 1 + polymer/eduke32/source/gameexec.c | 6 ++++++ 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 3142cf92b..002087634 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -521,11 +521,9 @@ extern short mirrorwall[64], mirrorsector[64], mirrorcnt; #define NUMKEYS 19 -extern long frameplace, chainplace, chainnumpages; - #include "funct.h" -extern char screencapt; +extern int screencapt; extern short soundps[NUM_SOUNDS],soundpe[NUM_SOUNDS],soundvo[NUM_SOUNDS]; extern char soundpr[NUM_SOUNDS],soundm[NUM_SOUNDS]; extern long soundsiz[NUM_SOUNDS]; @@ -569,7 +567,7 @@ extern char num_volumes; extern int32 SoundToggle,MusicToggle; extern int last_threehundred,lastsavedpos; -extern char restorepalette; +extern int restorepalette; extern int buttonstat; extern long cachecount; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index b3801c8cf..94892391f 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -94,10 +94,10 @@ extern char syncstate; extern int32 numlumps; FILE *frecfilep = (FILE *)NULL; -void pitch_test(void); -char restorepalette,screencapt,nomorelogohack; -int sendmessagecommand = -1; +int restorepalette,screencapt; +static int nomorelogohack; +static int sendmessagecommand = -1; char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp"; char *duke3dgrp = defaultduke3dgrp; @@ -105,33 +105,26 @@ static char *duke3ddef = "duke3d.def"; extern long lastvisinc; -// JBF 20031221: These ought to disappear when things mature -extern int showmultidiags; -extern int netmode, nethostplayers; -extern char netjoinhost[64]; -int startupnetworkgame(void); -int processnetworkrequests(void); - -char colstrip[1024]; +static char colstrip[1024]; int shareware = 0; int gametype = 0; #define MAXUSERQUOTES 4 -long quotebot, quotebotgoal; -short user_quote_time[MAXUSERQUOTES]; -char user_quote[MAXUSERQUOTES][178]; +static long quotebot, quotebotgoal; +static int user_quote_time[MAXUSERQUOTES]; +static char user_quote[MAXUSERQUOTES][178]; // char typebuflen,typebuf[41]; #ifdef JFAUD -int MAXCACHE1DSIZE = (16*1048576); +static int MAXCACHE1DSIZE = (16*1048576); #else -int MAXCACHE1DSIZE = (32*1048576); +static int MAXCACHE1DSIZE = (32*1048576); #endif long tempwallptr; -long nonsharedtimer; +static long nonsharedtimer; static void cameratext(short i); static int moveloop(void); @@ -7585,7 +7578,7 @@ FOUNDCHEAT: static void nonsharedkeys(void) { - short i,ch; + int i,ch; long j; if (ud.recstat == 2) @@ -8093,8 +8086,8 @@ FAKE_F3: if (KB_KeyPressed(sc_F11)) { KB_ClearKeyDown(sc_F11); - if (SHIFTS_IS_PRESSED) ud.brightness-=8; - else ud.brightness+=8; + ud.brightness+=8; + if (SHIFTS_IS_PRESSED) ud.brightness-=16; if (ud.brightness > (7<<3)) ud.brightness = 0; diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 31daa5fc8..bc4f7fb62 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -427,6 +427,7 @@ static const char *keyw[] = { "jump", // 298 "qstrlen", // 299 "getincangle", // 300 + "quake", // 301 "" }; @@ -2374,6 +2375,7 @@ static int parsecommand(void) case CON_CLIPDIST: case CON_LOTSOFGLASS: case CON_SAVE: + case CON_QUAKE: if (!CheckEventSync(current_event)) ReportError(WARNING_EVENTSYNC); case CON_ANGOFF: @@ -2388,9 +2390,9 @@ static int parsecommand(void) { if (*(scriptptr-1) == 32767) { + *(scriptptr-1) = 32768; ReportError(-1); initprintf("%s:%ld: warning: tried to set cstat 32767, using 32768 instead.\n",compilefile,line_number); - *(scriptptr-1) = 32768; } else if ((*(scriptptr-1) & 32) && (*(scriptptr-1) & 16)) { diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index c142475af..34a288162 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -775,5 +775,6 @@ enum keywords { CON_JUMP, // 298 CON_QSTRLEN, // 299 CON_GETINCANGLE, // 300 + CON_QUAKE, // 301 END }; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index c753dc0d1..0f7e1bc4a 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5033,6 +5033,12 @@ static int parse(void) break; } + case CON_QUAKE: + insptr++; + earthquaketime = (char)GetGameVarID(*insptr++,g_i,g_p); + spritesound(EARTHQUAKE,ps[screenpeek].i); + break; + case CON_IFMOVE: insptr++; parseifelse(g_t[1] == *insptr);