mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add level header options for setting special stage time and spheres requirements
This commit is contained in:
parent
c39fd8053a
commit
9abfcacc3c
5 changed files with 14 additions and 2 deletions
|
|
@ -1863,6 +1863,10 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
}
|
}
|
||||||
else if (fastcmp(word, "STARTRINGS"))
|
else if (fastcmp(word, "STARTRINGS"))
|
||||||
mapheaderinfo[num-1]->startrings = (UINT16)i;
|
mapheaderinfo[num-1]->startrings = (UINT16)i;
|
||||||
|
else if (fastcmp(word, "SPECIALSTAGETIME"))
|
||||||
|
mapheaderinfo[num-1]->sstimer = i;
|
||||||
|
else if (fastcmp(word, "SPECIALSTAGESPHERES"))
|
||||||
|
mapheaderinfo[num-1]->ssspheres = i;
|
||||||
else
|
else
|
||||||
deh_warning("Level header %d: unknown word '%s'", num, word);
|
deh_warning("Level header %d: unknown word '%s'", num, word);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -319,6 +319,8 @@ typedef struct
|
||||||
|
|
||||||
char selectheading[22]; ///< Level select heading. Allows for controllable grouping.
|
char selectheading[22]; ///< Level select heading. Allows for controllable grouping.
|
||||||
UINT16 startrings; ///< Number of rings players start with.
|
UINT16 startrings; ///< Number of rings players start with.
|
||||||
|
INT32 sstimer; ///< Timer for special stages.
|
||||||
|
UINT32 ssspheres; ///< Sphere requirement in special stages.
|
||||||
|
|
||||||
// Title card.
|
// Title card.
|
||||||
char ltzzpatch[8]; ///< Zig zag patch.
|
char ltzzpatch[8]; ///< Zig zag patch.
|
||||||
|
|
|
||||||
|
|
@ -2082,6 +2082,10 @@ static int mapheaderinfo_get(lua_State *L)
|
||||||
lua_pushinteger(L, header->menuflags);
|
lua_pushinteger(L, header->menuflags);
|
||||||
else if (fastcmp(field,"startrings"))
|
else if (fastcmp(field,"startrings"))
|
||||||
lua_pushinteger(L, header->startrings);
|
lua_pushinteger(L, header->startrings);
|
||||||
|
else if (fastcmp(field, "sstimer"))
|
||||||
|
lua_pushinteger(L, header->sstimer);
|
||||||
|
else if (fastcmp(field, "ssspheres"))
|
||||||
|
lua_pushinteger(L, header->ssspheres);
|
||||||
// TODO add support for reading numGradedMares and grades
|
// TODO add support for reading numGradedMares and grades
|
||||||
else {
|
else {
|
||||||
// Read custom vars now
|
// Read custom vars now
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,8 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
||||||
mapheaderinfo[num]->typeoflevel = 0;
|
mapheaderinfo[num]->typeoflevel = 0;
|
||||||
mapheaderinfo[num]->nextlevel = (INT16)(i + 1);
|
mapheaderinfo[num]->nextlevel = (INT16)(i + 1);
|
||||||
mapheaderinfo[num]->startrings = 0;
|
mapheaderinfo[num]->startrings = 0;
|
||||||
|
mapheaderinfo[num]->sstimer = 90;
|
||||||
|
mapheaderinfo[num]->ssspheres = 1;
|
||||||
mapheaderinfo[num]->keywords[0] = '\0';
|
mapheaderinfo[num]->keywords[0] = '\0';
|
||||||
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;
|
||||||
|
|
|
||||||
|
|
@ -6249,8 +6249,8 @@ void P_InitSpecials(void)
|
||||||
gravity = FRACUNIT/2;
|
gravity = FRACUNIT/2;
|
||||||
|
|
||||||
// Defaults in case levels don't have them set.
|
// Defaults in case levels don't have them set.
|
||||||
sstimer = 90*TICRATE + 6;
|
sstimer = mapheaderinfo[gamemap-1]->sstimer*TICRATE + 6;
|
||||||
ssspheres = 1;
|
ssspheres = mapheaderinfo[gamemap-1]->ssspheres;
|
||||||
|
|
||||||
CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false;
|
CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue