MAP HELL IS REAL

* Force map hell if there are two or more non-spectators (ie, same condition as to not be in FREE PLAY) and everyone has selected the RANDOM level slot.
* Unique gasp-and-Shulk-based sounds for both forced and non-forced map hell occourances.
This commit is contained in:
toaster 2018-07-22 21:02:31 +01:00
parent b4a0e0a83f
commit 992b1dc795
7 changed files with 92 additions and 55 deletions

View File

@ -1969,21 +1969,21 @@ void D_SetupVote(void)
char buf[8]; char buf[8];
char *p = buf; char *p = buf;
INT32 i; INT32 i;
INT16 gt;
for (i = 0; i < 4; i++) for (i = 0; i < 5; i++)
{ {
if (i == 2) // sometimes a different gametype if (i == 2) // sometimes a different gametype
{ {
WRITEUINT16(p, G_RandMap(G_TOLFlag(gt = G_SometimesGetDifferentGametype()), prevmap, false, false, false, true)); INT16 gt = G_SometimesGetDifferentGametype();
WRITEUINT16(p, G_RandMap(G_TOLFlag(gt), prevmap, false, false, 0, true));
WRITEUINT16(p, gt); WRITEUINT16(p, gt);
} }
else else
{ {
if (i == 3) // unknown-random if (i >= 3) // unknown-random and force-unknown MAP HELL
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, true, false, true, false)); WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, true, false, (i-2), (i < 4)));
else else
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, false, false, false, true)); WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, false, false, 0, true));
WRITEUINT16(p, gametype); WRITEUINT16(p, gametype);
} }
} }
@ -2011,7 +2011,9 @@ void D_PickVote(void)
char* p = buf; char* p = buf;
SINT8 temppicks[MAXPLAYERS]; SINT8 temppicks[MAXPLAYERS];
SINT8 templevels[MAXPLAYERS]; SINT8 templevels[MAXPLAYERS];
SINT8 votecompare = -1;
UINT8 numvotes = 0, key = 0; UINT8 numvotes = 0, key = 0;
boolean force = true;
INT32 i; INT32 i;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
@ -2023,6 +2025,10 @@ void D_PickVote(void)
temppicks[numvotes] = i; temppicks[numvotes] = i;
templevels[numvotes] = votes[i]; templevels[numvotes] = votes[i];
numvotes++; numvotes++;
if (votecompare == -1)
votecompare = votes[i];
else if (votes[i] != votecompare)
force = false;
} }
} }
@ -2031,7 +2037,10 @@ void D_PickVote(void)
if (numvotes > 0) if (numvotes > 0)
{ {
WRITESINT8(p, temppicks[key]); WRITESINT8(p, temppicks[key]);
WRITESINT8(p, templevels[key]); if (force && templevels[key] == 3 && numvotes > 1)
WRITESINT8(p, 4);
else
WRITESINT8(p, templevels[key]);
} }
else else
{ {
@ -4588,7 +4597,7 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
return; return;
} }
for (i = 0; i < 4; i++) for (i = 0; i < 5; i++)
{ {
votelevels[i][0] = (INT16)READUINT16(*cp); votelevels[i][0] = (INT16)READUINT16(*cp);
votelevels[i][1] = (INT16)READUINT16(*cp); votelevels[i][1] = (INT16)READUINT16(*cp);

View File

@ -459,7 +459,7 @@ extern boolean legitimateexit;
extern boolean comebackshowninfo; extern boolean comebackshowninfo;
extern tic_t curlap, bestlap; extern tic_t curlap, bestlap;
extern INT16 votelevels[4][2]; extern INT16 votelevels[5][2];
extern SINT8 votes[MAXPLAYERS]; extern SINT8 votes[MAXPLAYERS];
extern SINT8 pickedvote; extern SINT8 pickedvote;

View File

@ -252,7 +252,7 @@ boolean franticitems; // Frantic items currently enabled?
boolean comeback; // Battle Mode's karma comeback is on/off boolean comeback; // Battle Mode's karma comeback is on/off
// Voting system // Voting system
INT16 votelevels[4][2]; // Levels that were rolled by the host INT16 votelevels[5][2]; // Levels that were rolled by the host
SINT8 votes[MAXPLAYERS]; // Each player's vote SINT8 votes[MAXPLAYERS]; // Each player's vote
SINT8 pickedvote; // What vote the host rolls SINT8 pickedvote; // What vote the host rolls
@ -3172,7 +3172,7 @@ static INT32 TOLMaps(INT16 tolflags)
* \author Graue <graue@oceanbase.org> * \author Graue <graue@oceanbase.org>
*/ */
static INT16 *okmaps = NULL; static INT16 *okmaps = NULL;
INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignorebuffer, boolean maphell, boolean callagainsoon) INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignorebuffer, UINT8 maphell, boolean callagainsoon)
{ {
INT32 numokmaps = 0; INT32 numokmaps = 0;
INT16 ix, bufx; INT16 ix, bufx;
@ -3191,7 +3191,8 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb
if ((mapheaderinfo[ix]->typeoflevel & tolflags) != tolflags if ((mapheaderinfo[ix]->typeoflevel & tolflags) != tolflags
|| ix == pprevmap || ix == pprevmap
|| (!dedicated && M_MapLocked(ix+1)) || (!dedicated && M_MapLocked(ix+1))
|| (!maphell && (mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU))) // the highest quality memes || (!maphell && (mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU)) // this is bad
|| ((maphell == 2) && !(mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU))) // gasp
isokmap = false; isokmap = false;
if (!ignorebuffer) if (!ignorebuffer)
@ -3216,6 +3217,8 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb
{ {
if (!ignorebuffer) if (!ignorebuffer)
return G_RandMap(tolflags, pprevmap, dontadd, true, maphell, callagainsoon); // If there's no matches, (An incredibly silly function chain, buuut... :V) return G_RandMap(tolflags, pprevmap, dontadd, true, maphell, callagainsoon); // If there's no matches, (An incredibly silly function chain, buuut... :V)
if (maphell)
return G_RandMap(tolflags, pprevmap, dontadd, true, maphell-1, callagainsoon);
ix = 0; // Sorry, none match. You get MAP01. ix = 0; // Sorry, none match. You get MAP01.
for (bufx = 0; bufx < NUMMAPS+1; bufx++) for (bufx = 0; bufx < NUMMAPS+1; bufx++)
@ -3388,7 +3391,7 @@ static void G_DoCompleted(void)
if (cv_advancemap.value == 0) // Stay on same map. if (cv_advancemap.value == 0) // Stay on same map.
nextmap = prevmap; nextmap = prevmap;
else if (cv_advancemap.value == 2) // Go to random map. else if (cv_advancemap.value == 2) // Go to random map.
nextmap = G_RandMap(G_TOLFlag(gametype), prevmap, false, false, false, false); nextmap = G_RandMap(G_TOLFlag(gametype), prevmap, false, false, 0, false);
} }
// We are committed to this map now. // We are committed to this map now.

View File

@ -249,6 +249,6 @@ FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics);
// Don't split up TOL handling // Don't split up TOL handling
INT16 G_TOLFlag(INT32 pgametype); INT16 G_TOLFlag(INT32 pgametype);
INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignorebuffer, boolean maphell, boolean callagainsoon); INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignorebuffer, UINT8 maphell, boolean callagainsoon);
#endif #endif

View File

@ -148,6 +148,8 @@ sfxinfo_t S_sfx[NUMSFX] =
{"fizzle", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR}, {"fizzle", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"gbeep", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grenade beep {"gbeep", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grenade beep
{"yeeeah", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"yeeeah", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"noooo1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"noooo2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},

View File

@ -220,6 +220,8 @@ typedef enum
sfx_fizzle, sfx_fizzle,
sfx_gbeep, sfx_gbeep,
sfx_yeeeah, sfx_yeeeah,
sfx_noooo1,
sfx_noooo2,
sfx_ghit, sfx_ghit,
sfx_gloop, sfx_gloop,
sfx_gspray, sfx_gspray,

View File

@ -144,7 +144,7 @@ typedef struct
UINT8 rendoff; UINT8 rendoff;
} y_voteclient; } y_voteclient;
static y_votelvlinfo levelinfo[4]; static y_votelvlinfo levelinfo[5];
static y_voteclient voteclient; static y_voteclient voteclient;
static INT32 votetic; static INT32 votetic;
static INT32 voteendtic = -1; static INT32 voteendtic = -1;
@ -988,7 +988,7 @@ void Y_VoteDrawer(void)
{ {
char str[40]; char str[40];
patch_t *pic; patch_t *pic;
UINT8 sizeadd = selected[i], j, color; UINT8 j, color;
if (i == 3) if (i == 3)
{ {
@ -1004,6 +1004,8 @@ void Y_VoteDrawer(void)
if (selected[i]) if (selected[i])
{ {
UINT8 sizeadd = selected[i];
for (j = 0; j <= splitscreen; j++) // another loop for drawing the selection backgrounds in the right order, grumble grumble.. for (j = 0; j <= splitscreen; j++) // another loop for drawing the selection backgrounds in the right order, grumble grumble..
{ {
INT32 handy = y; INT32 handy = y;
@ -1101,7 +1103,7 @@ void Y_VoteDrawer(void)
{ {
patch_t *pic; patch_t *pic;
if (votes[i] == 3 && (i != pickedvote || voteendtic == -1)) if (votes[i] >= 3 && (i != pickedvote || voteendtic == -1))
pic = randomlvl; pic = randomlvl;
else else
pic = levelinfo[votes[i]].pic; pic = levelinfo[votes[i]].pic;
@ -1162,12 +1164,17 @@ void Y_VoteDrawer(void)
SINT8 deferredlevel = 0; SINT8 deferredlevel = 0;
static void Y_VoteStops(SINT8 pick, SINT8 level) static void Y_VoteStops(SINT8 pick, SINT8 level)
{ {
if (!splitscreen && pick == consoleplayer)
S_StartSound(NULL, sfx_yeeeah);
else
S_StartSound(NULL, sfx_kc48);
nextmap = votelevels[level][0]; nextmap = votelevels[level][0];
if (level == 4)
S_StartSound(NULL, sfx_noooo2); // gasp
else if (mapheaderinfo[nextmap] && (mapheaderinfo[nextmap]->menuflags & LF2_HIDEINMENU))
S_StartSound(NULL, sfx_noooo1); // this is bad
else if (!splitscreen && pick == consoleplayer)
S_StartSound(NULL, sfx_yeeeah); // yeeeah!
else
S_StartSound(NULL, sfx_kc48); // just a cool sound
if (gametype != votelevels[level][1]) if (gametype != votelevels[level][1])
{ {
INT16 lastgametype = gametype; INT16 lastgametype = gametype;
@ -1414,40 +1421,44 @@ void Y_StartVote(void)
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
votes[i] = -1; votes[i] = -1;
for (i = 0; i < 4; i++) for (i = 0; i < 5; i++)
{ {
lumpnum_t lumpnum; lumpnum_t lumpnum;
//INT16 j;
// set up the str // set up the str
if (strlen(mapheaderinfo[votelevels[i][0]]->zonttl) > 0) if (i == 4)
{ levelinfo[i].str[0] = '\0';
if (strlen(mapheaderinfo[votelevels[i][0]]->actnum) > 0)
snprintf(levelinfo[i].str,
sizeof levelinfo[i].str,
"%.32s %.32s %s",
mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl, mapheaderinfo[votelevels[i][0]]->actnum);
else
snprintf(levelinfo[i].str,
sizeof levelinfo[i].str,
"%.32s %.32s",
mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl);
}
else else
{ {
if (strlen(mapheaderinfo[votelevels[i][0]]->actnum) > 0) if (strlen(mapheaderinfo[votelevels[i][0]]->zonttl) > 0)
snprintf(levelinfo[i].str, {
sizeof levelinfo[i].str, if (strlen(mapheaderinfo[votelevels[i][0]]->actnum) > 0)
"%.32s %s", snprintf(levelinfo[i].str,
mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum); sizeof levelinfo[i].str,
"%.32s %.32s %s",
mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl, mapheaderinfo[votelevels[i][0]]->actnum);
else
snprintf(levelinfo[i].str,
sizeof levelinfo[i].str,
"%.32s %.32s",
mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl);
}
else else
snprintf(levelinfo[i].str, {
sizeof levelinfo[i].str, if (strlen(mapheaderinfo[votelevels[i][0]]->actnum) > 0)
"%.32s", snprintf(levelinfo[i].str,
mapheaderinfo[votelevels[i][0]]->lvlttl); sizeof levelinfo[i].str,
} "%.32s %s",
mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum);
else
snprintf(levelinfo[i].str,
sizeof levelinfo[i].str,
"%.32s",
mapheaderinfo[votelevels[i][0]]->lvlttl);
}
levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0'; levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0';
}
// set up the gtc and gts // set up the gtc and gts
levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]); levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]);
@ -1491,6 +1502,7 @@ static void Y_UnloadVoteData(void)
UNLOAD(cursor4); UNLOAD(cursor4);
UNLOAD(randomlvl); UNLOAD(randomlvl);
UNLOAD(levelinfo[4].pic);
UNLOAD(levelinfo[3].pic); UNLOAD(levelinfo[3].pic);
UNLOAD(levelinfo[2].pic); UNLOAD(levelinfo[2].pic);
UNLOAD(levelinfo[1].pic); UNLOAD(levelinfo[1].pic);
@ -1526,6 +1538,15 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
if (votes[i] == -1 || endtype > 1) // Don't need to go on if (votes[i] == -1 || endtype > 1) // Don't need to go on
continue; continue;
if (level == 4)
{
votes[i] = 4;
continue;
}
if (endtype == 2)
continue;
if (votecompare == -1) if (votecompare == -1)
{ {
votecompare = votes[i]; votecompare = votes[i];
@ -1535,19 +1556,19 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
endtype = 2; endtype = 2;
} }
if (endtype == 0) // Might as well put this here, too. if (level == 4 || endtype == 1) // Only one unique vote, so just end it immediately.
{
voteendtic = votetic + (5*TICRATE);
S_ChangeMusicInternal("voteeb", false);
Y_VoteStops(pick, level);
}
else if (endtype == 0) // Might as well put this here, too.
{ {
timer = 0; timer = 0;
Y_UnloadVoteData(); Y_UnloadVoteData();
Y_FollowIntermission(); Y_FollowIntermission();
return; return;
} }
else if (endtype == 1) // Only one unique vote, so just end it immediately.
{
voteendtic = votetic + (5*TICRATE);
S_ChangeMusicInternal("voteeb", false);
Y_VoteStops(pick, level);
}
else else
S_ChangeMusicInternal("voteea", true); S_ChangeMusicInternal("voteea", true);
} }