- flag SW's cutscenes as 'boss death only'.

This commit is contained in:
Christoph Oelckers 2021-08-13 22:25:13 +02:00
parent d5c9768414
commit 5aa27bad3b
11 changed files with 21 additions and 12 deletions

View file

@ -51,6 +51,7 @@
#include "s_music.h"
#include "m_argv.h"
#include "i_interface.h"
#include "gamecontrol.h"
CVAR(Bool, inter_subtitles, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);

View file

@ -212,6 +212,7 @@ void CompleteLevel(MapRecord* map)
gameaction = ga_completed;
g_nextmap = !currentLevel || !(currentLevel->flags & MI_FORCEEOG)? map : nullptr;
g_nextskill = -1; // This does not change the skill
g_bossexit = false;
}
//---------------------------------------------------------------------------
@ -223,6 +224,7 @@ void CompleteLevel(MapRecord* map)
void changeMap(int player, uint8_t** stream, bool skip)
{
int skill = (int8_t)ReadByte(stream);
int bossexit = (int8_t)ReadByte(stream);
auto mapname = ReadStringConst(stream);
if (skip) return;
auto map = FindMapByName(mapname);
@ -231,6 +233,7 @@ void changeMap(int player, uint8_t** stream, bool skip)
gameaction = ga_completed;
g_nextmap = map;
g_nextskill = skill;
g_bossexit = bossexit;
}
}
@ -251,10 +254,11 @@ void endScreenJob(int player, uint8_t** stream, bool skip)
//
//---------------------------------------------------------------------------
void ChangeLevel(MapRecord* map, int skill)
void ChangeLevel(MapRecord* map, int skill, bool bossexit)
{
Net_WriteByte(DEM_CHANGEMAP);
Net_WriteByte(skill);
Net_WriteByte(bossexit);
Net_WriteString(map? map->labelName : nullptr);
}
@ -268,6 +272,7 @@ void DeferredStartGame(MapRecord* map, int skill, bool nostopsound)
{
g_nextmap = map;
g_nextskill = skill;
g_bossexit = false;
gameaction = nostopsound? ga_newgamenostopsound : ga_newgame;
}

View file

@ -649,6 +649,7 @@ MapFlagHandlers[] =
{ "sw_deathexit_sumo", MITYPE_SETFLAGG,LEVEL_SW_DEATHEXIT_SUMO, 0, GAMEFLAG_SW },
{ "sw_deathexit_zilla", MITYPE_SETFLAGG,LEVEL_SW_DEATHEXIT_ZILLA, 0, GAMEFLAG_SW },
{ "sw_spawnmines", MITYPE_SETFLAGG,LEVEL_SW_SPAWNMINES, 0, GAMEFLAG_SW },
{ "bossonlycutscene", MITYPE_SETFLAGG,LEVEL_BOSSONLYCUTSCENE, 0, -1 },
{ NULL, MITYPE_IGNORE, 0, 0}
};

View file

@ -122,6 +122,7 @@ gameaction_t gameaction = ga_nothing;
// gameaction state
MapRecord* g_nextmap;
int g_nextskill;
int g_bossexit;
FILE* hashfile;

View file

@ -32,6 +32,7 @@ extern bool crouch_toggle;
struct MapRecord;
extern MapRecord* g_nextmap;
extern int g_nextskill;
extern int g_bossexit;
extern FMemArena dump; // this is for memory blocks than cannot be deallocated without some huge effort. Put them in here so that they do not register on shutdown.
@ -44,7 +45,7 @@ int GetAutomapZoom(int gZoom);
void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double scale, PalEntry color = 0xffffffff);
void updatePauseStatus();
void DeferredStartGame(MapRecord* map, int skill, bool nostopsound = false);
void ChangeLevel(MapRecord* map, int skill);
void ChangeLevel(MapRecord* map, int skill, bool bossexit = false);
void CompleteLevel(MapRecord* map);
struct UserConfig

View file

@ -55,7 +55,7 @@ enum EMapGameFlags
LEVEL_WT_BOSSSPAWN = 16384,
LEVEL_BOSSONLYCUTSCENE = 32768,
};
// These get filled in by the map definition parsers of the front ends.

View file

@ -187,6 +187,9 @@ void ShowScoreboard(int numplayers, const CompletionFunc& completion_)
void ShowIntermission(MapRecord* fromMap, MapRecord* toMap, SummaryInfo* info, CompletionFunc completion_)
{
bool bossexit = g_bossexit;
g_bossexit = false;
completion = completion_;
runner = CreateRunner();
GC::WriteBarrier(runner);
@ -200,7 +203,7 @@ void ShowIntermission(MapRecord* fromMap, MapRecord* toMap, SummaryInfo* info, C
try
{
if (fromMap)
if (fromMap && (!(fromMap->gameflags & LEVEL_BOSSONLYCUTSCENE) || bossexit))
{
if (!CreateCutscene(&fromMap->outro, runner, fromMap, !!toMap))
{
@ -212,7 +215,7 @@ void ShowIntermission(MapRecord* fromMap, MapRecord* toMap, SummaryInfo* info, C
if (fromMap || (g_gameType & GAMEFLAG_PSEXHUMED))
CallCreateSummaryFunction(globalCutscenes.SummaryScreen, runner, fromMap, info, toMap);
if (toMap)
if (toMap)
{
if (!CreateCutscene(&toMap->intro, runner, toMap, !!fromMap))
{

View file

@ -7206,7 +7206,7 @@ domovethings(void)
{
map = FindNextMap(currentLevel);
}
ChangeLevel(map, g_nextskill);
ChangeLevel(map, g_nextskill, true);
}
}
}

View file

@ -5330,7 +5330,7 @@ ActorHealth(short SpriteNum, short amt)
// Hack for Last Warrior which apparently needs to continue with the next level here.
if (!(currentLevel->gameflags & LEVEL_SW_DEATHEXIT_SERPENT_NEXT))
{
ChangeLevel(nullptr, g_nextskill);
ChangeLevel(nullptr, g_nextskill, true);
return true;
}
else FinishTimer = 1;

View file

@ -1,5 +0,0 @@
map { 9 }
{
sw_spawnmines
}

View file

@ -25,6 +25,7 @@ map { 4 }
}
sw_bossmeter_serpent
sw_deathexit_serpent
bossonlycutscene
}
map { 5 }
@ -40,6 +41,7 @@ map { 11 }
}
sw_bossmeter_sumo
sw_deathexit_sumo
bossonlycutscene
}
map { 20 }