mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
Merge branch 'push-more-lua' into awful-mix
This commit is contained in:
commit
43e5718851
11 changed files with 35 additions and 35 deletions
|
@ -9931,10 +9931,10 @@ static inline int lib_getenum(lua_State *L)
|
||||||
lua_pushinteger(L, cv_numlaps.value);
|
lua_pushinteger(L, cv_numlaps.value);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (fastcmp(word,"racecountdown")) {
|
} else if (fastcmp(word,"racecountdown")) {
|
||||||
lua_pushinteger(L, countdown);
|
lua_pushinteger(L, racecountdown);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (fastcmp(word,"exitcountdown")) {
|
} else if (fastcmp(word,"exitcountdown")) {
|
||||||
lua_pushinteger(L, countdown2); // This name is pretty dumb. Hence why we'll prefer more descriptive names at least in Lua...
|
lua_pushinteger(L, exitcountdown); // This name is pretty dumb. Hence why we'll prefer more descriptive names at least in Lua...
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -448,7 +448,7 @@ extern UINT8 maxXtraLife; // Max extra lives from rings
|
||||||
extern mobj_t *hunt1, *hunt2, *hunt3; // Emerald hunt locations
|
extern mobj_t *hunt1, *hunt2, *hunt3; // Emerald hunt locations
|
||||||
|
|
||||||
// For racing
|
// For racing
|
||||||
extern UINT32 countdown, countdown2;
|
extern tic_t racecountdown, exitcountdown;
|
||||||
|
|
||||||
extern fixed_t gravity;
|
extern fixed_t gravity;
|
||||||
extern fixed_t mapobjectscale;
|
extern fixed_t mapobjectscale;
|
||||||
|
|
|
@ -234,7 +234,7 @@ mobj_t *hunt1;
|
||||||
mobj_t *hunt2;
|
mobj_t *hunt2;
|
||||||
mobj_t *hunt3;
|
mobj_t *hunt3;
|
||||||
|
|
||||||
UINT32 countdown, countdown2; // for racing
|
tic_t racecountdown, exitcountdown; // for racing
|
||||||
|
|
||||||
fixed_t gravity;
|
fixed_t gravity;
|
||||||
fixed_t mapobjectscale;
|
fixed_t mapobjectscale;
|
||||||
|
@ -4592,7 +4592,7 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
|
||||||
{
|
{
|
||||||
// Clear a bunch of variables
|
// Clear a bunch of variables
|
||||||
tokenlist = token = sstimer = redscore = bluescore = lastmap = 0;
|
tokenlist = token = sstimer = redscore = bluescore = lastmap = 0;
|
||||||
countdown = countdown2 = mapreset = 0;
|
racecountdown = exitcountdown = mapreset = 0;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8911,9 +8911,9 @@ void K_drawKartHUD(void)
|
||||||
if (leveltime >= starttime-(3*TICRATE)
|
if (leveltime >= starttime-(3*TICRATE)
|
||||||
&& leveltime < starttime+TICRATE)
|
&& leveltime < starttime+TICRATE)
|
||||||
K_drawKartStartCountdown();
|
K_drawKartStartCountdown();
|
||||||
else if (countdown && (!splitscreen || !stplyr->exiting))
|
else if (racecountdown && (!splitscreen || !stplyr->exiting))
|
||||||
{
|
{
|
||||||
char *countstr = va("%d", countdown/TICRATE);
|
char *countstr = va("%d", racecountdown/TICRATE);
|
||||||
|
|
||||||
if (splitscreen > 1)
|
if (splitscreen > 1)
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/4, LAPS_Y+1, K_calcSplitFlags(0), countstr);
|
V_DrawCenteredString(BASEVIDWIDTH/4, LAPS_Y+1, K_calcSplitFlags(0), countstr);
|
||||||
|
|
|
@ -2645,7 +2645,7 @@ static int lib_kGetItemPatch(lua_State *L)
|
||||||
static int lib_kSetRaceCountdown(lua_State *L)
|
static int lib_kSetRaceCountdown(lua_State *L)
|
||||||
{
|
{
|
||||||
tic_t c = (tic_t)luaL_checkinteger(L, 1);
|
tic_t c = (tic_t)luaL_checkinteger(L, 1);
|
||||||
countdown = c;
|
racecountdown = c;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2654,7 +2654,7 @@ static int lib_kSetExitCountdown(lua_State *L)
|
||||||
{
|
{
|
||||||
tic_t c = (tic_t)luaL_checkinteger(L, 1);
|
tic_t c = (tic_t)luaL_checkinteger(L, 1);
|
||||||
NOHUD
|
NOHUD
|
||||||
countdown2 = c;
|
exitcountdown = c;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2036,7 +2036,7 @@ boolean P_CheckRacers(void)
|
||||||
|
|
||||||
if (i == MAXPLAYERS) // finished
|
if (i == MAXPLAYERS) // finished
|
||||||
{
|
{
|
||||||
countdown = countdown2 = 0;
|
racecountdown = exitcountdown = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2063,13 +2063,13 @@ boolean P_CheckRacers(void)
|
||||||
if (j == MAXPLAYERS) // finish anyways, force a time over
|
if (j == MAXPLAYERS) // finish anyways, force a time over
|
||||||
{
|
{
|
||||||
P_DoTimeOver(&players[i]);
|
P_DoTimeOver(&players[i]);
|
||||||
countdown = countdown2 = 0;
|
racecountdown = exitcountdown = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!countdown) // Check to see if the winners have finished, to set countdown.
|
if (!racecountdown) // Check to see if the winners have finished, to set countdown.
|
||||||
{
|
{
|
||||||
UINT8 numingame = 0, numexiting = 0;
|
UINT8 numingame = 0, numexiting = 0;
|
||||||
UINT8 winningpos = 1;
|
UINT8 winningpos = 1;
|
||||||
|
@ -2088,7 +2088,7 @@ boolean P_CheckRacers(void)
|
||||||
winningpos++;
|
winningpos++;
|
||||||
|
|
||||||
if (numexiting >= winningpos)
|
if (numexiting >= winningpos)
|
||||||
countdown = (((netgame || multiplayer) ? cv_countdowntime.value : 30)*TICRATE) + 1; // 30 seconds to finish, get going!
|
racecountdown = (((netgame || multiplayer) ? cv_countdowntime.value : 30)*TICRATE) + 1; // 30 seconds to finish, get going!
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -3264,8 +3264,8 @@ static void P_NetArchiveMisc(void)
|
||||||
WRITEINT16(save_p, scrambletotal);
|
WRITEINT16(save_p, scrambletotal);
|
||||||
WRITEINT16(save_p, scramblecount);
|
WRITEINT16(save_p, scramblecount);
|
||||||
|
|
||||||
WRITEUINT32(save_p, countdown);
|
WRITEUINT32(save_p, racecountdown);
|
||||||
WRITEUINT32(save_p, countdown2);
|
WRITEUINT32(save_p, exitcountdown);
|
||||||
|
|
||||||
WRITEFIXED(save_p, gravity);
|
WRITEFIXED(save_p, gravity);
|
||||||
WRITEFIXED(save_p, mapobjectscale);
|
WRITEFIXED(save_p, mapobjectscale);
|
||||||
|
@ -3373,8 +3373,8 @@ static inline boolean P_NetUnArchiveMisc(void)
|
||||||
scrambletotal = READINT16(save_p);
|
scrambletotal = READINT16(save_p);
|
||||||
scramblecount = READINT16(save_p);
|
scramblecount = READINT16(save_p);
|
||||||
|
|
||||||
countdown = READUINT32(save_p);
|
racecountdown = READUINT32(save_p);
|
||||||
countdown2 = READUINT32(save_p);
|
exitcountdown = READUINT32(save_p);
|
||||||
|
|
||||||
gravity = READFIXED(save_p);
|
gravity = READFIXED(save_p);
|
||||||
mapobjectscale = READFIXED(save_p);
|
mapobjectscale = READFIXED(save_p);
|
||||||
|
|
|
@ -2387,7 +2387,7 @@ static void P_LevelInitStuff(void)
|
||||||
players[i].lives = 1; // SRB2Kart
|
players[i].lives = 1; // SRB2Kart
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
players[i].realtime = countdown = countdown2 = 0;
|
players[i].realtime = racecountdown = exitcountdown = 0;
|
||||||
curlap = bestlap = 0; // SRB2Kart
|
curlap = bestlap = 0; // SRB2Kart
|
||||||
|
|
||||||
players[i].gotcontinue = false;
|
players[i].gotcontinue = false;
|
||||||
|
|
12
src/p_tick.c
12
src/p_tick.c
|
@ -720,15 +720,15 @@ void P_Ticker(boolean run)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (countdown > 1)
|
if (racecountdown > 1)
|
||||||
countdown--;
|
racecountdown--;
|
||||||
|
|
||||||
if (countdown2)
|
if (exitcountdown > 1)
|
||||||
countdown2--;
|
exitcountdown--;
|
||||||
|
|
||||||
if (indirectitemcooldown)
|
if (indirectitemcooldown > 1)
|
||||||
indirectitemcooldown--;
|
indirectitemcooldown--;
|
||||||
if (hyubgone)
|
if (hyubgone > 1)
|
||||||
hyubgone--;
|
hyubgone--;
|
||||||
|
|
||||||
if (G_BattleGametype())
|
if (G_BattleGametype())
|
||||||
|
|
18
src/p_user.c
18
src/p_user.c
|
@ -1727,8 +1727,8 @@ void P_DoPlayerExit(player_t *player)
|
||||||
P_EndingMusic(player);
|
P_EndingMusic(player);
|
||||||
|
|
||||||
// SRB2kart 120217
|
// SRB2kart 120217
|
||||||
//if (!countdown2)
|
//if (!exitcountdown)
|
||||||
//countdown2 = countdown + 8*TICRATE;
|
//exitcountdown = racecountdown + 8*TICRATE;
|
||||||
|
|
||||||
if (P_CheckRacers())
|
if (P_CheckRacers())
|
||||||
player->exiting = raceexittime+1;
|
player->exiting = raceexittime+1;
|
||||||
|
@ -7088,7 +7088,7 @@ static void P_DeathThink(player_t *player)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep time rolling
|
// Keep time rolling
|
||||||
if (!(countdown2 && !countdown) && !(player->exiting || mapreset) && !(player->pflags & PF_TIMEOVER))
|
if (!(exitcountdown && !racecountdown) && !(player->exiting || mapreset) && !(player->pflags & PF_TIMEOVER))
|
||||||
{
|
{
|
||||||
if (leveltime >= starttime)
|
if (leveltime >= starttime)
|
||||||
{
|
{
|
||||||
|
@ -8288,8 +8288,8 @@ void P_DoTimeOver(player_t *player)
|
||||||
|
|
||||||
P_EndingMusic(player);
|
P_EndingMusic(player);
|
||||||
|
|
||||||
if (!countdown2)
|
if (!exitcountdown)
|
||||||
countdown2 = 5*TICRATE;
|
exitcountdown = 5*TICRATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -8432,7 +8432,7 @@ void P_PlayerThink(player_t *player)
|
||||||
// begin the drown music for countdown!
|
// begin the drown music for countdown!
|
||||||
|
|
||||||
// SRB2Kart: despite how perfect this is, it's disabled FOR A REASON
|
// SRB2Kart: despite how perfect this is, it's disabled FOR A REASON
|
||||||
/*if (countdown == 11*TICRATE - 1)
|
/*if (racecountdown == 11*TICRATE - 1)
|
||||||
{
|
{
|
||||||
if (P_IsLocalPlayer(player))
|
if (P_IsLocalPlayer(player))
|
||||||
S_ChangeMusicInternal("drown", false);
|
S_ChangeMusicInternal("drown", false);
|
||||||
|
@ -8440,7 +8440,7 @@ void P_PlayerThink(player_t *player)
|
||||||
|
|
||||||
// If you've hit the countdown and you haven't made
|
// If you've hit the countdown and you haven't made
|
||||||
// it to the exit, you're a goner!
|
// it to the exit, you're a goner!
|
||||||
else if (countdown == 1 && !player->exiting && !player->spectator && player->lives > 0)
|
else if (racecountdown == 1 && !player->exiting && !player->spectator && player->lives > 0)
|
||||||
{
|
{
|
||||||
P_DoTimeOver(player);
|
P_DoTimeOver(player);
|
||||||
|
|
||||||
|
@ -8454,10 +8454,10 @@ void P_PlayerThink(player_t *player)
|
||||||
if (player->exiting > 1 && (player->exiting < raceexittime+2 || !G_RaceGametype())) // SRB2kart - "&& player->exiting > 1"
|
if (player->exiting > 1 && (player->exiting < raceexittime+2 || !G_RaceGametype())) // SRB2kart - "&& player->exiting > 1"
|
||||||
player->exiting--;
|
player->exiting--;
|
||||||
|
|
||||||
if (player->exiting && countdown2)
|
if (player->exiting && exitcountdown)
|
||||||
player->exiting = 99; // SRB2kart
|
player->exiting = 99; // SRB2kart
|
||||||
|
|
||||||
if (player->exiting == 2 || countdown2 == 2)
|
if (player->exiting == 2 || exitcountdown == 2)
|
||||||
{
|
{
|
||||||
if (cv_playersforexit.value) // Count to be sure everyone's exited
|
if (cv_playersforexit.value) // Count to be sure everyone's exited
|
||||||
{
|
{
|
||||||
|
|
|
@ -1834,7 +1834,7 @@ static void ST_overlayDrawer(void)
|
||||||
{
|
{
|
||||||
patch_t *p;
|
patch_t *p;
|
||||||
|
|
||||||
if (countdown == 1)
|
if (racecountdown == 1)
|
||||||
p = timeover;
|
p = timeover;
|
||||||
else
|
else
|
||||||
p = sboover;
|
p = sboover;
|
||||||
|
@ -1954,7 +1954,7 @@ static void ST_overlayDrawer(void)
|
||||||
|
|
||||||
if (!hu_showscores && netgame && !mapreset)
|
if (!hu_showscores && netgame && !mapreset)
|
||||||
{
|
{
|
||||||
/*if (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)
|
/*if (G_GametypeUsesLives() && stplyr->lives <= 0 && racecountdown != 1)
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press Viewpoint Key to watch a player."));
|
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press Viewpoint Key to watch a player."));
|
||||||
else if (gametype == GT_HIDEANDSEEK &&
|
else if (gametype == GT_HIDEANDSEEK &&
|
||||||
(!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE))
|
(!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE))
|
||||||
|
|
Loading…
Reference in a new issue