mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
Add lastmarelap and lastmarebonuslap player variables
This commit is contained in:
parent
d58445fdf3
commit
18b5b70822
5 changed files with 23 additions and 2 deletions
|
@ -468,6 +468,8 @@ typedef struct player_s
|
||||||
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
|
||||||
UINT8 lastmare; // previous mare
|
UINT8 lastmare; // previous mare
|
||||||
|
UINT8 lastmarelap; // previous mare lap
|
||||||
|
UINT8 lastmarebonuslap; // previous mare bonus lap
|
||||||
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
|
||||||
UINT8 textvar; // which line of NiGHTS text to show -- let's not use cheap hacks
|
UINT8 textvar; // which line of NiGHTS text to show -- let's not use cheap hacks
|
||||||
|
|
|
@ -310,6 +310,10 @@ static int player_get(lua_State *L)
|
||||||
lua_pushinteger(L, plr->lastmarescore);
|
lua_pushinteger(L, plr->lastmarescore);
|
||||||
else if (fastcmp(field,"lastmare"))
|
else if (fastcmp(field,"lastmare"))
|
||||||
lua_pushinteger(L, plr->lastmare);
|
lua_pushinteger(L, plr->lastmare);
|
||||||
|
else if (fastcmp(field,"lastmarelap"))
|
||||||
|
lua_pushinteger(L, plr->lastmarelap);
|
||||||
|
else if (fastcmp(field,"lastmarebonuslap"))
|
||||||
|
lua_pushinteger(L, plr->lastmarebonuslap);
|
||||||
else if (fastcmp(field,"maxlink"))
|
else if (fastcmp(field,"maxlink"))
|
||||||
lua_pushinteger(L, plr->maxlink);
|
lua_pushinteger(L, plr->maxlink);
|
||||||
else if (fastcmp(field,"texttimer"))
|
else if (fastcmp(field,"texttimer"))
|
||||||
|
@ -594,6 +598,10 @@ static int player_set(lua_State *L)
|
||||||
plr->lastmarescore = (UINT32)luaL_checkinteger(L, 3);
|
plr->lastmarescore = (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,"lastmarelap"))
|
||||||
|
plr->lastmarelap = (UINT8)luaL_checkinteger(L, 3);
|
||||||
|
else if (fastcmp(field,"lastmarebonuslap"))
|
||||||
|
plr->lastmarebonuslap = (UINT8)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"maxlink"))
|
else if (fastcmp(field,"maxlink"))
|
||||||
plr->maxlink = (INT32)luaL_checkinteger(L, 3);
|
plr->maxlink = (INT32)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"texttimer"))
|
else if (fastcmp(field,"texttimer"))
|
||||||
|
|
|
@ -209,6 +209,8 @@ static void P_NetArchivePlayers(void)
|
||||||
WRITEUINT32(save_p, players[i].marescore);
|
WRITEUINT32(save_p, players[i].marescore);
|
||||||
WRITEUINT32(save_p, players[i].lastmarescore);
|
WRITEUINT32(save_p, players[i].lastmarescore);
|
||||||
WRITEUINT8(save_p, players[i].lastmare);
|
WRITEUINT8(save_p, players[i].lastmare);
|
||||||
|
WRITEUINT8(save_p, players[i].lastmarelap);
|
||||||
|
WRITEUINT8(save_p, players[i].lastmarebonuslap);
|
||||||
WRITEINT32(save_p, players[i].maxlink);
|
WRITEINT32(save_p, players[i].maxlink);
|
||||||
WRITEUINT8(save_p, players[i].texttimer);
|
WRITEUINT8(save_p, players[i].texttimer);
|
||||||
WRITEUINT8(save_p, players[i].textvar);
|
WRITEUINT8(save_p, players[i].textvar);
|
||||||
|
@ -400,6 +402,8 @@ static void P_NetUnArchivePlayers(void)
|
||||||
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].lastmare = READUINT8(save_p);
|
players[i].lastmare = READUINT8(save_p);
|
||||||
|
players[i].lastmarelap = READUINT8(save_p);
|
||||||
|
players[i].lastmarebonuslap = 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);
|
||||||
players[i].textvar = READUINT8(save_p);
|
players[i].textvar = READUINT8(save_p);
|
||||||
|
|
|
@ -2381,6 +2381,7 @@ static void P_LevelInitStuff(void)
|
||||||
players[i].maxlink = players[i].startedtime =\
|
players[i].maxlink = players[i].startedtime =\
|
||||||
players[i].finishedtime = players[i].finishedspheres =\
|
players[i].finishedtime = players[i].finishedspheres =\
|
||||||
players[i].finishedrings = players[i].lastmare =\
|
players[i].finishedrings = players[i].lastmare =\
|
||||||
|
players[i].lastmarelap = players[i].lastmarebonuslap =\
|
||||||
players[i].marebegunat = players[i].textvar =\
|
players[i].marebegunat = players[i].textvar =\
|
||||||
players[i].texttimer = players[i].linkcount =\
|
players[i].texttimer = players[i].linkcount =\
|
||||||
players[i].linktimer = players[i].flyangle =\
|
players[i].linktimer = players[i].flyangle =\
|
||||||
|
|
10
src/p_user.c
10
src/p_user.c
|
@ -637,7 +637,7 @@ static void P_DeNightserizePlayer(player_t *player)
|
||||||
// NiGHTS Time!
|
// NiGHTS Time!
|
||||||
void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
{
|
{
|
||||||
INT32 oldmare;
|
UINT8 oldmare, oldmarelap, oldmarebonuslap;
|
||||||
|
|
||||||
// Bots can't be NiGHTSerized, silly!1 :P
|
// Bots can't be NiGHTSerized, silly!1 :P
|
||||||
if (player->bot)
|
if (player->bot)
|
||||||
|
@ -684,6 +684,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
}
|
}
|
||||||
|
|
||||||
oldmare = player->mare;
|
oldmare = player->mare;
|
||||||
|
oldmarelap = player->marelap;
|
||||||
|
oldmarebonuslap = player->marebonuslap;
|
||||||
|
|
||||||
if (!P_TransferToNextMare(player))
|
if (!P_TransferToNextMare(player))
|
||||||
{
|
{
|
||||||
|
@ -711,6 +713,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
players[i].texttimer = (3 * TICRATE) - 10;
|
players[i].texttimer = (3 * TICRATE) - 10;
|
||||||
players[i].textvar = 4; // Score and grades
|
players[i].textvar = 4; // Score and grades
|
||||||
players[i].lastmare = players[i].mare;
|
players[i].lastmare = players[i].mare;
|
||||||
|
players[i].lastmarelap = players[i].marelap;
|
||||||
|
players[i].lastmarebonuslap = players[i].marebonuslap;
|
||||||
if (G_IsSpecialStage(gamemap))
|
if (G_IsSpecialStage(gamemap))
|
||||||
{
|
{
|
||||||
players[i].finishedspheres = (INT16)total_spheres;
|
players[i].finishedspheres = (INT16)total_spheres;
|
||||||
|
@ -742,7 +746,9 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
// Spheres bonus
|
// Spheres bonus
|
||||||
P_AddPlayerScore(player, (player->spheres) * 50);
|
P_AddPlayerScore(player, (player->spheres) * 50);
|
||||||
|
|
||||||
player->lastmare = (UINT8)oldmare;
|
player->lastmare = oldmare;
|
||||||
|
player->lastmarelap = oldmarelap;
|
||||||
|
player->lastmarebonuslap = oldmarebonuslap;
|
||||||
player->texttimer = 4*TICRATE;
|
player->texttimer = 4*TICRATE;
|
||||||
player->textvar = 4; // Score and grades
|
player->textvar = 4; // Score and grades
|
||||||
player->finishedspheres = (INT16)(player->spheres);
|
player->finishedspheres = (INT16)(player->spheres);
|
||||||
|
|
Loading…
Reference in a new issue