mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Added MUSICPOSTBOSS level header for boss post-defeat music
This commit is contained in:
parent
68f0a25323
commit
f30cf2b6cc
5 changed files with 21 additions and 1 deletions
|
|
@ -1151,6 +1151,9 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
#endif
|
#endif
|
||||||
else if (fastcmp(word, "MUSICTRACK"))
|
else if (fastcmp(word, "MUSICTRACK"))
|
||||||
mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1);
|
mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1);
|
||||||
|
else if (fastcmp(word, "MUSICPOSTBOSS"))
|
||||||
|
deh_strlcpy(mapheaderinfo[num-1]->muspostbossname, word2,
|
||||||
|
sizeof(mapheaderinfo[num-1]->muspostbossname), va("Level header %d: post-boss music", num));
|
||||||
else if (fastcmp(word, "FORCECHARACTER"))
|
else if (fastcmp(word, "FORCECHARACTER"))
|
||||||
{
|
{
|
||||||
strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, SKINNAMESIZE+1);
|
strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, SKINNAMESIZE+1);
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,9 @@ typedef struct
|
||||||
UINT8 numGradedMares; ///< Internal. For grade support.
|
UINT8 numGradedMares; ///< Internal. For grade support.
|
||||||
nightsgrades_t *grades; ///< NiGHTS grades. Allocated dynamically for space reasons. Be careful.
|
nightsgrades_t *grades; ///< NiGHTS grades. Allocated dynamically for space reasons. Be careful.
|
||||||
|
|
||||||
|
// Music stuff.
|
||||||
|
char muspostbossname[7]; ///< Post-bossdeath music.
|
||||||
|
|
||||||
// Lua stuff.
|
// Lua stuff.
|
||||||
// (This is not ifdeffed so the map header structure can stay identical, just in case.)
|
// (This is not ifdeffed so the map header structure can stay identical, just in case.)
|
||||||
UINT8 numCustomOptions; ///< Internal. For Lua custom value support.
|
UINT8 numCustomOptions; ///< Internal. For Lua custom value support.
|
||||||
|
|
|
||||||
|
|
@ -1760,6 +1760,8 @@ static int mapheaderinfo_get(lua_State *L)
|
||||||
lua_pushstring(L, header->musname);
|
lua_pushstring(L, header->musname);
|
||||||
else if (fastcmp(field,"mustrack"))
|
else if (fastcmp(field,"mustrack"))
|
||||||
lua_pushinteger(L, header->mustrack);
|
lua_pushinteger(L, header->mustrack);
|
||||||
|
else if (fastcmp(field,"muspostbossname"))
|
||||||
|
lua_pushstring(L, header->muspostbossname);
|
||||||
else if (fastcmp(field,"forcecharacter"))
|
else if (fastcmp(field,"forcecharacter"))
|
||||||
lua_pushstring(L, header->forcecharacter);
|
lua_pushstring(L, header->forcecharacter);
|
||||||
else if (fastcmp(field,"weather"))
|
else if (fastcmp(field,"weather"))
|
||||||
|
|
|
||||||
|
|
@ -3529,6 +3529,17 @@ void A_BossDeath(mobj_t *mo)
|
||||||
EV_DoElevator(&junk, elevateUp, false);
|
EV_DoElevator(&junk, elevateUp, false);
|
||||||
junk.tag = 682;
|
junk.tag = 682;
|
||||||
EV_DoElevator(&junk, elevateHighest, false);
|
EV_DoElevator(&junk, elevateHighest, false);
|
||||||
|
|
||||||
|
// change the music if specified
|
||||||
|
if (mapheaderinfo[gamemap-1]->muspostbossname && !strncmp(mapheaderinfo[gamemap-1]->musname, mapmusname, 7))
|
||||||
|
{
|
||||||
|
// Touching the egg trap button calls P_DoPlayerExit, which calls P_RestoreMusic.
|
||||||
|
// So just park ourselves in the mapmus variables.
|
||||||
|
strncpy(mapmusname, mapheaderinfo[gamemap-1]->muspostbossname, 7);
|
||||||
|
mapmusname[6] = 0;
|
||||||
|
mapmusflags = MUSIC_RELOADRESET;
|
||||||
|
S_ChangeMusicAdvanced(mapmusname, mapmusflags, true, 0, (1*MUSICRATE)+(MUSICRATE/2), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bossjustdie:
|
bossjustdie:
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
||||||
snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i));
|
snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i));
|
||||||
mapheaderinfo[num]->musname[6] = 0;
|
mapheaderinfo[num]->musname[6] = 0;
|
||||||
mapheaderinfo[num]->mustrack = 0;
|
mapheaderinfo[num]->mustrack = 0;
|
||||||
|
mapheaderinfo[num]->muspostbossname[6] = 0;
|
||||||
mapheaderinfo[num]->forcecharacter[0] = '\0';
|
mapheaderinfo[num]->forcecharacter[0] = '\0';
|
||||||
mapheaderinfo[num]->weather = 0;
|
mapheaderinfo[num]->weather = 0;
|
||||||
mapheaderinfo[num]->skynum = 1;
|
mapheaderinfo[num]->skynum = 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue