* Made the evaluation screen even more attractive.

* Fixed an unused variable warning in lua_skinlib.c.
- fixed post-level cutscenes playing when you get game over in MP (still kinda on-topic)
Also with apologies to MI:
- golden egg statue mode for tutorial, since the grey doesn't contrast enough with the blue and lime green
- fixed closed captions for replaced player sounds being incorrect
- fixed closed captions overlapping tutorial text
This commit is contained in:
toaster 2019-07-29 14:55:36 +01:00
parent 384533165c
commit 47554b57e4
12 changed files with 76 additions and 51 deletions

View file

@ -234,7 +234,7 @@ extern textprompt_t *textprompts[MAX_PROMPTS];
// For the Custom Exit linedef. // For the Custom Exit linedef.
extern INT16 nextmapoverride; extern INT16 nextmapoverride;
extern boolean skipstats; extern UINT8 skipstats;
extern UINT32 ssspheres; // Total # of spheres in a level extern UINT32 ssspheres; // Total # of spheres in a level

View file

@ -110,7 +110,7 @@ static INT32 sparklloop;
// //
// PROMPT STATE // PROMPT STATE
// //
static boolean promptactive = false; boolean promptactive = false;
static mobj_t *promptmo; static mobj_t *promptmo;
static INT16 promptpostexectag; static INT16 promptpostexectag;
static boolean promptblockcontrols; static boolean promptblockcontrols;
@ -1284,6 +1284,7 @@ boolean F_CreditResponder(event_t *event)
// ============ // ============
// EVALUATION // EVALUATION
// ============ // ============
#define SPARKLLOOPTIME 7 // must be odd #define SPARKLLOOPTIME 7 // must be odd
void F_StartGameEvaluation(void) void F_StartGameEvaluation(void)
@ -1322,14 +1323,11 @@ void F_GameEvaluationDrawer(void)
angle_t fa; angle_t fa;
INT32 eemeralds_cur; INT32 eemeralds_cur;
char patchname[7] = "CEMGx0"; char patchname[7] = "CEMGx0";
const char* endingtext = (goodending ? "CONGRATULATIONS!" : "TRY AGAIN...");
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
// Draw all the good crap here. // Draw all the good crap here.
if (goodending)
V_DrawString(114, 16, 0, "GOT THEM ALL!");
else
V_DrawString(124, 16, 0, "TRY AGAIN!");
if (finalecount > 0) if (finalecount > 0)
{ {
@ -1420,6 +1418,9 @@ void F_GameEvaluationDrawer(void)
V_DrawFixedPatch(x, y, FRACUNIT, ((emeralds & (1<<i)) ? 0 : V_80TRANS), W_CachePatchName(patchname, PU_LEVEL), NULL); V_DrawFixedPatch(x, y, FRACUNIT, ((emeralds & (1<<i)) ? 0 : V_80TRANS), W_CachePatchName(patchname, PU_LEVEL), NULL);
} }
V_DrawCreditString((BASEVIDWIDTH - V_CreditStringWidth(endingtext))<<(FRACBITS-1), (BASEVIDHEIGHT-100)<<(FRACBITS-1), 0, endingtext);
#if 0 // the following looks like hot garbage the more unlockables we add, and we now have a lot of unlockables
if (finalecount >= 5*TICRATE) if (finalecount >= 5*TICRATE)
{ {
V_DrawString(8, 16, V_YELLOWMAP, "Unlocked:"); V_DrawString(8, 16, V_YELLOWMAP, "Unlocked:");
@ -1444,28 +1445,18 @@ void F_GameEvaluationDrawer(void)
else else
V_DrawString(8, 96, V_YELLOWMAP, "Prizes not\nawarded in\nmodified games!"); V_DrawString(8, 96, V_YELLOWMAP, "Prizes not\nawarded in\nmodified games!");
} }
#endif
} }
void F_GameEvaluationTicker(void) void F_GameEvaluationTicker(void)
{ {
finalecount++; if (++finalecount > 10*TICRATE)
{
F_StartGameEnd();
return;
}
if (goodending) if (!goodending)
{
if (++sparklloop == SPARKLLOOPTIME) // time to roll the randomisation again
{
angle_t workingangle = FixedAngle((M_RandomKey(360))<<FRACBITS)>>ANGLETOFINESHIFT;
fixed_t workingradius = M_RandomKey(26);
sparkloffs[2][0] = sparkloffs[1][0];
sparkloffs[2][1] = sparkloffs[1][1];
sparkloffs[1][0] = sparkloffs[0][0];
sparkloffs[1][1] = sparkloffs[0][1];
sparkloffs[0][0] = (30<<FRACBITS) + workingradius*FINECOSINE(workingangle);
sparkloffs[0][1] = (30<<FRACBITS) + workingradius*FINESINE(workingangle);
sparklloop = 0;
}
}
else
{ {
if (sparklloop) if (sparklloop)
sparklloop--; sparklloop--;
@ -1478,10 +1469,31 @@ void F_GameEvaluationTicker(void)
sparklloop = 10; sparklloop = 10;
} }
} }
else if (++sparklloop == SPARKLLOOPTIME) // time to roll the randomisation again
{
angle_t workingangle = FixedAngle((M_RandomKey(360))<<FRACBITS)>>ANGLETOFINESHIFT;
fixed_t workingradius = M_RandomKey(26);
sparkloffs[2][0] = sparkloffs[1][0];
sparkloffs[2][1] = sparkloffs[1][1];
sparkloffs[1][0] = sparkloffs[0][0];
sparkloffs[1][1] = sparkloffs[0][1];
sparkloffs[0][0] = (30<<FRACBITS) + workingradius*FINECOSINE(workingangle);
sparkloffs[0][1] = (30<<FRACBITS) + workingradius*FINESINE(workingangle);
sparklloop = 0;
}
if (finalecount == 5*TICRATE) if (finalecount == 5*TICRATE)
{ {
if ((!modifiedgame || savemoddata) && !(netgame || multiplayer)) if (netgame || multiplayer) // modify this when we finally allow unlocking stuff in 2P
{
HU_SetCEchoFlags(V_YELLOWMAP|V_RETURN8);
HU_SetCEchoDuration(6);
HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Prizes only awarded in singleplayer!");
S_StartSound(NULL, sfx_s3k68);
}
else if (!modifiedgame || savemoddata)
{ {
++timesBeaten; ++timesBeaten;
@ -1496,10 +1508,14 @@ void F_GameEvaluationTicker(void)
G_SaveGameData(); G_SaveGameData();
} }
else
{
HU_SetCEchoFlags(V_YELLOWMAP|V_RETURN8);
HU_SetCEchoDuration(6);
HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Prizes not awarded in modified games!");
S_StartSound(NULL, sfx_s3k68);
}
} }
if (finalecount > 10*TICRATE)
F_StartGameEnd();
} }
#undef SPARKLLOOPTIME #undef SPARKLLOOPTIME
@ -1508,8 +1524,8 @@ void F_GameEvaluationTicker(void)
// ENDING // ENDING
// ========== // ==========
#define SPARKLLOOPTIME 15 // must be odd
#define INFLECTIONPOINT (6*TICRATE) #define INFLECTIONPOINT (6*TICRATE)
#define SPARKLLOOPTIME 15 // must be odd
void F_StartEnding(void) void F_StartEnding(void)
{ {
@ -1594,10 +1610,14 @@ void F_StartEnding(void)
void F_EndingTicker(void) void F_EndingTicker(void)
{ {
angle_t workingangle; if (++finalecount > INFLECTIONPOINT*2)
fixed_t workingradius; {
F_StartCredits();
wipetypepre = INT16_MAX;
return;
}
if (++finalecount == INFLECTIONPOINT && goodending) // time to swap some assets if (goodending && finalecount == INFLECTIONPOINT) // time to swap some assets
{ {
endegrk[0] = W_CachePatchName("ENDEGRK2", PU_LEVEL); endegrk[0] = W_CachePatchName("ENDEGRK2", PU_LEVEL);
endegrk[1] = W_CachePatchName("ENDEGRK3", PU_LEVEL); endegrk[1] = W_CachePatchName("ENDEGRK3", PU_LEVEL);
@ -1610,17 +1630,13 @@ void F_EndingTicker(void)
if (++sparklloop == SPARKLLOOPTIME) // time to roll the randomisation again if (++sparklloop == SPARKLLOOPTIME) // time to roll the randomisation again
{ {
sparklloop = 0; angle_t workingangle = FixedAngle((M_RandomRange(-170, 80))<<FRACBITS)>>ANGLETOFINESHIFT;
workingangle = FixedAngle((M_RandomRange(-170, 80))<<FRACBITS)>>ANGLETOFINESHIFT; fixed_t workingradius = M_RandomKey(26);
workingradius = M_RandomKey(26);
sparkloffs[0][0] = (30<<FRACBITS) + workingradius*FINECOSINE(workingangle); sparkloffs[0][0] = (30<<FRACBITS) + workingradius*FINECOSINE(workingangle);
sparkloffs[0][1] = (30<<FRACBITS) + workingradius*FINESINE(workingangle); sparkloffs[0][1] = (30<<FRACBITS) + workingradius*FINESINE(workingangle);
}
if (finalecount > INFLECTIONPOINT*2) sparklloop = 0;
{
F_StartCredits();
wipetypepre = INT16_MAX;
} }
} }
@ -2005,7 +2021,6 @@ void F_EndingDrawer(void)
} }
#undef SPARKLLOOPTIME #undef SPARKLLOOPTIME
#undef INFLECTIONPOINT
// ========== // ==========
// GAME END // GAME END

View file

@ -152,7 +152,7 @@ cutscene_t *cutscenes[128];
textprompt_t *textprompts[MAX_PROMPTS]; textprompt_t *textprompts[MAX_PROMPTS];
INT16 nextmapoverride; INT16 nextmapoverride;
boolean skipstats; UINT8 skipstats;
// Pointers to each CTF flag // Pointers to each CTF flag
mobj_t *redflag; mobj_t *redflag;
@ -2651,7 +2651,7 @@ void G_DoReborn(INT32 playernum)
//nextmapoverride = spstage_start; //nextmapoverride = spstage_start;
nextmapoverride = gamemap; nextmapoverride = gamemap;
countdown2 = TICRATE; countdown2 = TICRATE;
skipstats = true; skipstats = 2;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
@ -3180,7 +3180,7 @@ void G_AfterIntermission(void)
{ {
HU_ClearCEcho(); HU_ClearCEcho();
if (mapheaderinfo[gamemap-1]->cutscenenum && !modeattacking) // Start a custom cutscene. if (mapheaderinfo[gamemap-1]->cutscenenum && !modeattacking && skipstats <= 1) // Start a custom cutscene.
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false); F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false);
else else
{ {

View file

@ -56,6 +56,8 @@ extern INT16 rw_maximums[NUM_WEAPONS];
extern INT32 pausedelay; extern INT32 pausedelay;
extern boolean pausebreakkey; extern boolean pausebreakkey;
extern boolean promptactive;
// used in game menu // used in game menu
extern consvar_t cv_tutorialprompt; extern consvar_t cv_tutorialprompt;
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection, cv_compactscoreboard; extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection, cv_compactscoreboard;

View file

@ -2601,12 +2601,12 @@ static int lib_gSetCustomExitVars(lua_State *L)
nextmapoverride = (INT16)luaL_checknumber(L, 1); nextmapoverride = (INT16)luaL_checknumber(L, 1);
lua_remove(L, 1); // remove nextmapoverride; skipstats now 1 if available lua_remove(L, 1); // remove nextmapoverride; skipstats now 1 if available
} }
skipstats = lua_optboolean(L, 1); skipstats = luaL_optinteger(L, 2, 0);
} }
else else
{ {
nextmapoverride = 0; nextmapoverride = 0;
skipstats = false; skipstats = 0;
} }
// --- // ---

View file

@ -98,7 +98,6 @@ static int skin_get(lua_State *L)
{ {
skin_t *skin = *((skin_t **)luaL_checkudata(L, 1, META_SKIN)); skin_t *skin = *((skin_t **)luaL_checkudata(L, 1, META_SKIN));
enum skin field = luaL_checkoption(L, 2, NULL, skin_opt); enum skin field = luaL_checkoption(L, 2, NULL, skin_opt);
INT32 i;
// skins are always valid, only added, never removed // skins are always valid, only added, never removed
I_Assert(skin != NULL); I_Assert(skin != NULL);

View file

@ -240,7 +240,7 @@ UINT8 M_UpdateUnlockablesAndExtraEmblems(void)
if (cechoLines) if (cechoLines)
{ {
char slashed[1024] = ""; char slashed[1024] = "";
for (i = 0; (i < 21) && (i < 24 - cechoLines); ++i) for (i = 0; (i < 19) && (i < 24 - cechoLines); ++i)
slashed[i] = '\\'; slashed[i] = '\\';
slashed[i] = 0; slashed[i] = 0;

View file

@ -11100,6 +11100,12 @@ You should think about modifying the deathmatch starts to take full advantage of
else else
skyboxviewpnts[mthing->extrainfo] = mobj; skyboxviewpnts[mthing->extrainfo] = mobj;
break; break;
case MT_EGGSTATUE:
if (tutorialmode != (mthing->options & MTF_OBJECTSPECIAL))
{
mobj->color = SKINCOLOR_GOLD;
mobj->colorized = true;
}
case MT_EGGMOBILE3: case MT_EGGMOBILE3:
mobj->cusval = mthing->extrainfo; mobj->cusval = mthing->extrainfo;
break; break;

View file

@ -3126,7 +3126,7 @@ boolean P_SetupLevel(boolean skipprecip)
R_PrecacheLevel(); R_PrecacheLevel();
nextmapoverride = 0; nextmapoverride = 0;
skipstats = false; skipstats = 0;
if (!(netgame || multiplayer) && (!modifiedgame || savemoddata)) if (!(netgame || multiplayer) && (!modifiedgame || savemoddata))
mapvisited[gamemap-1] |= MV_VISITED; mapvisited[gamemap-1] |= MV_VISITED;

View file

@ -4624,7 +4624,7 @@ DoneSection2:
nextmapoverride = (INT16)(lines[lineindex].frontsector->floorheight>>FRACBITS); nextmapoverride = (INT16)(lines[lineindex].frontsector->floorheight>>FRACBITS);
if (lines[lineindex].flags & ML_NOCLIMB) if (lines[lineindex].flags & ML_NOCLIMB)
skipstats = true; skipstats = 1;
} }
} }
break; break;

View file

@ -519,6 +519,7 @@ void S_StartCaption(sfxenum_t sfx_id, INT32 cnum, UINT16 lifespan)
void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
{ {
INT32 sep, pitch, priority, cnum; INT32 sep, pitch, priority, cnum;
const sfxenum_t actual_id = sfx_id;
sfxinfo_t *sfx; sfxinfo_t *sfx;
const mobj_t *origin = (const mobj_t *)origin_p; const mobj_t *origin = (const mobj_t *)origin_p;
@ -657,7 +658,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
#endif #endif
// Handle closed caption input. // Handle closed caption input.
S_StartCaption(sfx_id, cnum, MAXCAPTIONTICS); S_StartCaption(actual_id, cnum, MAXCAPTIONTICS);
// Assigns the handle to one of the channels in the // Assigns the handle to one of the channels in the
// mix/output buffer. // mix/output buffer.
@ -710,7 +711,7 @@ dontplay:
#endif #endif
// Handle closed caption input. // Handle closed caption input.
S_StartCaption(sfx_id, cnum, MAXCAPTIONTICS); S_StartCaption(actual_id, cnum, MAXCAPTIONTICS);
// Assigns the handle to one of the channels in the // Assigns the handle to one of the channels in the
// mix/output buffer. // mix/output buffer.

View file

@ -438,7 +438,9 @@ void SCR_ClosedCaptions(void)
if (gamestate == GS_LEVEL) if (gamestate == GS_LEVEL)
{ {
if (splitscreen) if (promptactive)
basey -= 28;
else if (splitscreen)
basey -= 8; basey -= 8;
else if ((modeattacking == ATTACKING_NIGHTS) else if ((modeattacking == ATTACKING_NIGHTS)
|| (!(maptol & TOL_NIGHTS) || (!(maptol & TOL_NIGHTS)