mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
totalmarescore player variable for NiGHTS scoring
This commit is contained in:
parent
1952653f5b
commit
baa5d41dca
5 changed files with 11 additions and 2 deletions
|
|
@ -465,6 +465,7 @@ typedef struct player_s
|
||||||
INT16 finishedrings; // The rings/stars you had left upon finishing the mare
|
INT16 finishedrings; // The rings/stars you had left upon finishing the mare
|
||||||
UINT32 marescore; // score for this nights stage
|
UINT32 marescore; // score for this nights stage
|
||||||
UINT32 lastmarescore; // score for the last mare
|
UINT32 lastmarescore; // score for the last mare
|
||||||
|
UINT32 totalmarescore; // score for all mares
|
||||||
UINT8 lastmare; // previous mare
|
UINT8 lastmare; // previous mare
|
||||||
INT32 maxlink; // maximum link obtained
|
INT32 maxlink; // maximum link obtained
|
||||||
UINT8 texttimer; // nights_texttime should not be local
|
UINT8 texttimer; // nights_texttime should not be local
|
||||||
|
|
|
||||||
|
|
@ -304,6 +304,8 @@ static int player_get(lua_State *L)
|
||||||
lua_pushinteger(L, plr->marescore);
|
lua_pushinteger(L, plr->marescore);
|
||||||
else if (fastcmp(field,"lastmarescore"))
|
else if (fastcmp(field,"lastmarescore"))
|
||||||
lua_pushinteger(L, plr->lastmarescore);
|
lua_pushinteger(L, plr->lastmarescore);
|
||||||
|
else if (fastcmp(field,"totalmarescore"))
|
||||||
|
lua_pushinteger(L, plr->totalmarescore);
|
||||||
else if (fastcmp(field,"lastmare"))
|
else if (fastcmp(field,"lastmare"))
|
||||||
lua_pushinteger(L, plr->lastmare);
|
lua_pushinteger(L, plr->lastmare);
|
||||||
else if (fastcmp(field,"maxlink"))
|
else if (fastcmp(field,"maxlink"))
|
||||||
|
|
@ -584,6 +586,8 @@ static int player_set(lua_State *L)
|
||||||
plr->marescore = (UINT32)luaL_checkinteger(L, 3);
|
plr->marescore = (UINT32)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"lastmarescore"))
|
else if (fastcmp(field,"lastmarescore"))
|
||||||
plr->lastmarescore = (UINT32)luaL_checkinteger(L, 3);
|
plr->lastmarescore = (UINT32)luaL_checkinteger(L, 3);
|
||||||
|
else if (fastcmp(field,"totalmarescore"))
|
||||||
|
plr->totalmarescore = (UINT32)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"lastmare"))
|
else if (fastcmp(field,"lastmare"))
|
||||||
plr->lastmare = (UINT8)luaL_checkinteger(L, 3);
|
plr->lastmare = (UINT8)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"maxlink"))
|
else if (fastcmp(field,"maxlink"))
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,7 @@ static void P_NetArchivePlayers(void)
|
||||||
WRITEINT16(save_p, players[i].finishedrings);
|
WRITEINT16(save_p, players[i].finishedrings);
|
||||||
WRITEUINT32(save_p, players[i].marescore);
|
WRITEUINT32(save_p, players[i].marescore);
|
||||||
WRITEUINT32(save_p, players[i].lastmarescore);
|
WRITEUINT32(save_p, players[i].lastmarescore);
|
||||||
|
WRITEUINT32(save_p, players[i].totalmarescore);
|
||||||
WRITEUINT8(save_p, players[i].lastmare);
|
WRITEUINT8(save_p, players[i].lastmare);
|
||||||
WRITEINT32(save_p, players[i].maxlink);
|
WRITEINT32(save_p, players[i].maxlink);
|
||||||
WRITEUINT8(save_p, players[i].texttimer);
|
WRITEUINT8(save_p, players[i].texttimer);
|
||||||
|
|
@ -395,6 +396,7 @@ static void P_NetUnArchivePlayers(void)
|
||||||
players[i].finishedrings = READINT16(save_p);
|
players[i].finishedrings = READINT16(save_p);
|
||||||
players[i].marescore = READUINT32(save_p);
|
players[i].marescore = READUINT32(save_p);
|
||||||
players[i].lastmarescore = READUINT32(save_p);
|
players[i].lastmarescore = READUINT32(save_p);
|
||||||
|
players[i].totalmarescore = READUINT32(save_p);
|
||||||
players[i].lastmare = READUINT8(save_p);
|
players[i].lastmare = READUINT8(save_p);
|
||||||
players[i].maxlink = READINT32(save_p);
|
players[i].maxlink = READINT32(save_p);
|
||||||
players[i].texttimer = READUINT8(save_p);
|
players[i].texttimer = READUINT8(save_p);
|
||||||
|
|
|
||||||
|
|
@ -2385,8 +2385,8 @@ static void P_LevelInitStuff(void)
|
||||||
players[i].texttimer = players[i].linkcount =\
|
players[i].texttimer = players[i].linkcount =\
|
||||||
players[i].linktimer = players[i].flyangle =\
|
players[i].linktimer = players[i].flyangle =\
|
||||||
players[i].anotherflyangle = players[i].nightstime =\
|
players[i].anotherflyangle = players[i].nightstime =\
|
||||||
players[i].mare = players[i].realtime =\
|
players[i].mare = players[i].totalmarescore =\
|
||||||
players[i].exiting = 0;
|
players[i].realtime = players[i].exiting = 0;
|
||||||
|
|
||||||
// i guess this could be part of the above but i feel mildly uncomfortable implicitly casting
|
// i guess this could be part of the above but i feel mildly uncomfortable implicitly casting
|
||||||
players[i].gotcontinue = false;
|
players[i].gotcontinue = false;
|
||||||
|
|
|
||||||
|
|
@ -725,6 +725,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);
|
G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);
|
||||||
|
|
||||||
// transfer scores anyway
|
// transfer scores anyway
|
||||||
|
players[i].totalmarescore += players[i].marescore;
|
||||||
players[i].lastmarescore = players[i].marescore;
|
players[i].lastmarescore = players[i].marescore;
|
||||||
players[i].marescore = 0;
|
players[i].marescore = 0;
|
||||||
|
|
||||||
|
|
@ -748,6 +749,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));
|
G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));
|
||||||
|
|
||||||
// Starting a new mare, transfer scores
|
// Starting a new mare, transfer scores
|
||||||
|
player->totalmarescore += players[i].marescore;
|
||||||
player->lastmarescore = player->marescore;
|
player->lastmarescore = player->marescore;
|
||||||
player->marescore = 0;
|
player->marescore = 0;
|
||||||
player->marebegunat = leveltime;
|
player->marebegunat = leveltime;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue