mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 23:21:05 +00:00
More lenient checkpoints
Doesn't really belong in this branch but shut up! I'm lazy :p
This commit is contained in:
parent
a2767fe341
commit
888515331f
7 changed files with 20 additions and 4 deletions
|
@ -575,6 +575,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
|
|||
rsp->starposty = SHORT(players[i].starposty);
|
||||
rsp->starpostz = SHORT(players[i].starpostz);
|
||||
rsp->starpostnum = LONG(players[i].starpostnum);
|
||||
rsp->starpostcount = LONG(players[i].starpostcount);
|
||||
rsp->starposttime = (tic_t)LONG(players[i].starposttime);
|
||||
rsp->starpostangle = (angle_t)LONG(players[i].starpostangle);
|
||||
|
||||
|
@ -706,6 +707,7 @@ static void resynch_read_player(resynch_pak *rsp)
|
|||
players[i].starposty = SHORT(rsp->starposty);
|
||||
players[i].starpostz = SHORT(rsp->starpostz);
|
||||
players[i].starpostnum = LONG(rsp->starpostnum);
|
||||
players[i].starpostcount = LONG(rsp->starpostcount);
|
||||
players[i].starposttime = (tic_t)LONG(rsp->starposttime);
|
||||
players[i].starpostangle = (angle_t)LONG(rsp->starpostangle);
|
||||
|
||||
|
|
|
@ -219,6 +219,7 @@ typedef struct
|
|||
INT16 starposty;
|
||||
INT16 starpostz;
|
||||
INT32 starpostnum;
|
||||
INT32 starpostcount;
|
||||
tic_t starposttime;
|
||||
angle_t starpostangle;
|
||||
|
||||
|
|
|
@ -477,6 +477,7 @@ typedef struct player_s
|
|||
INT16 starposty;
|
||||
INT16 starpostz;
|
||||
INT32 starpostnum; // The number of the last starpost you hit
|
||||
INT32 starpostcount; // SRB2kart: how many did you hit?
|
||||
tic_t starposttime; // Your time when you hit the starpost
|
||||
angle_t starpostangle; // Angle that the starpost is facing - you respawn facing this way
|
||||
|
||||
|
|
|
@ -2142,6 +2142,7 @@ static inline void G_PlayerFinishLevel(INT32 player)
|
|||
p->starposty = 0;
|
||||
p->starpostz = 0;
|
||||
p->starpostnum = 0;
|
||||
p->starpostcount = 0;
|
||||
|
||||
if (rendermode == render_soft)
|
||||
V_SetPaletteLump(GetPalette()); // Reset the palette
|
||||
|
@ -2182,6 +2183,7 @@ void G_PlayerReborn(INT32 player)
|
|||
INT16 starposty;
|
||||
INT16 starpostz;
|
||||
INT32 starpostnum;
|
||||
INT32 starpostcount;
|
||||
INT32 starpostangle;
|
||||
fixed_t jumpfactor;
|
||||
INT32 exiting;
|
||||
|
@ -2239,6 +2241,7 @@ void G_PlayerReborn(INT32 player)
|
|||
starposty = players[player].starposty;
|
||||
starpostz = players[player].starpostz;
|
||||
starpostnum = players[player].starpostnum;
|
||||
starpostcount = players[player].starpostcount;
|
||||
starpostangle = players[player].starpostangle;
|
||||
jumpfactor = players[player].jumpfactor;
|
||||
thokitem = players[player].thokitem;
|
||||
|
@ -2296,6 +2299,7 @@ void G_PlayerReborn(INT32 player)
|
|||
p->starposty = starposty;
|
||||
p->starpostz = starpostz;
|
||||
p->starpostnum = starpostnum;
|
||||
p->starpostcount = starpostcount;
|
||||
p->starpostangle = starpostangle;
|
||||
p->jumpfactor = jumpfactor;
|
||||
p->exiting = exiting;
|
||||
|
@ -2665,6 +2669,7 @@ void G_DoReborn(INT32 playernum)
|
|||
player->starposty = 0;
|
||||
player->starpostz = 0;
|
||||
player->starpostnum = 0;
|
||||
player->starpostcount = 0;
|
||||
}
|
||||
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
|
||||
{
|
||||
|
@ -3714,6 +3719,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
|
|||
players[i].playerstate = PST_REBORN;
|
||||
players[i].starpostangle = players[i].starpostnum = players[i].starposttime = 0;
|
||||
players[i].starpostx = players[i].starposty = players[i].starpostz = 0;
|
||||
players[i].starpostcount = 0; // srb2kart
|
||||
|
||||
if (netgame || multiplayer)
|
||||
{
|
||||
|
|
|
@ -246,6 +246,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->starpostz);
|
||||
else if (fastcmp(field,"starpostnum"))
|
||||
lua_pushinteger(L, plr->starpostnum);
|
||||
else if (fastcmp(field,"starpostcount"))
|
||||
lua_pushinteger(L, plr->starpostcount);
|
||||
else if (fastcmp(field,"starposttime"))
|
||||
lua_pushinteger(L, plr->starposttime);
|
||||
else if (fastcmp(field,"starpostangle"))
|
||||
|
@ -513,6 +515,8 @@ static int player_set(lua_State *L)
|
|||
plr->starpostz = (INT16)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"starpostnum"))
|
||||
plr->starpostnum = (INT32)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"starpostcount"))
|
||||
plr->starpostcount = (INT32)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"starposttime"))
|
||||
plr->starposttime = (tic_t)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"starpostangle"))
|
||||
|
|
|
@ -1213,9 +1213,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
return;
|
||||
}
|
||||
//
|
||||
// In circuit, player must have touched all previous starposts
|
||||
// SRB2kart: make sure the player will have enough checkpoints to touch
|
||||
if (circuitmap
|
||||
&& special->health - player->starpostnum > 1)
|
||||
&& special->health >= (numstarposts/2 + player->starpostnum))
|
||||
{
|
||||
// blatant reuse of a variable that's normally unused in circuit
|
||||
if (!player->tossdelay)
|
||||
|
@ -1242,6 +1242,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
player->starpostz = special->z>>FRACBITS;
|
||||
player->starpostangle = special->angle;
|
||||
player->starpostnum = special->health;
|
||||
player->starpostcount++;
|
||||
P_ClearStarPost(special->health);
|
||||
|
||||
// Find all starposts in the level with this value.
|
||||
|
|
|
@ -4110,12 +4110,12 @@ DoneSection2:
|
|||
|
||||
case 10: // Finish Line
|
||||
// SRB2kart - 150117
|
||||
if (gametype == GT_RACE && (player->starpostnum == numstarposts || player->exiting))
|
||||
if (gametype == GT_RACE && (player->starpostcount >= numstarposts/2 || player->exiting))
|
||||
player->kartstuff[k_starpostwp] = player->kartstuff[k_waypoint] = 0;
|
||||
//
|
||||
if (gametype == GT_RACE && !player->exiting)
|
||||
{
|
||||
if (player->starpostnum == numstarposts) // Must have touched all the starposts
|
||||
if (player->starpostcount >= numstarposts/2) // srb2kart: must have touched *enough* starposts (was originally "(player->starpostnum == numstarposts)")
|
||||
{
|
||||
player->laps++;
|
||||
player->kartstuff[k_lapanimation] = 80;
|
||||
|
@ -4134,6 +4134,7 @@ DoneSection2:
|
|||
// SRB2kart 200117
|
||||
player->starpostangle = player->starpostnum = 0;
|
||||
player->starpostx = player->starposty = player->starpostz = 0;
|
||||
player->starpostcount = 0;
|
||||
//except the time!
|
||||
player->starposttime = player->realtime;
|
||||
|
||||
|
|
Loading…
Reference in a new issue