mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-17 10:11:12 +00:00
Remove kart offroad variable and workings.
We can set a standard for friction sectors in maps and people can then do what they want with it. Also caused problems with Ice and FOFs above friction sectors.
This commit is contained in:
parent
92f33c1d60
commit
aff9a78d76
3 changed files with 0 additions and 54 deletions
|
@ -261,7 +261,6 @@ typedef enum
|
||||||
k_boostcharge, // Charge-up for boosting at the start of the race, or when Lakitu drops you
|
k_boostcharge, // Charge-up for boosting at the start of the race, or when Lakitu drops you
|
||||||
k_jmp, // In Mario Kart, letting go of the jump button stops the drift
|
k_jmp, // In Mario Kart, letting go of the jump button stops the drift
|
||||||
k_lakitu, // > 0 = Lakitu fishing, < 0 = Lakitu lap counter (was "player->airtime") // NOTE: Check for ->lakitu, replace with this
|
k_lakitu, // > 0 = Lakitu fishing, < 0 = Lakitu lap counter (was "player->airtime") // NOTE: Check for ->lakitu, replace with this
|
||||||
k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
|
|
||||||
|
|
||||||
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
|
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
|
||||||
k_itemclose, // Used to animate the item window closing (was "pw_psychic")
|
k_itemclose, // Used to animate the item window closing (was "pw_psychic")
|
||||||
|
|
|
@ -2190,7 +2190,6 @@ void G_PlayerReborn(INT32 player)
|
||||||
INT32 playerahead;
|
INT32 playerahead;
|
||||||
INT32 starpostwp;
|
INT32 starpostwp;
|
||||||
INT32 lakitu;
|
INT32 lakitu;
|
||||||
INT32 offroad;
|
|
||||||
|
|
||||||
score = players[player].score;
|
score = players[player].score;
|
||||||
lives = players[player].lives;
|
lives = players[player].lives;
|
||||||
|
@ -2247,7 +2246,6 @@ void G_PlayerReborn(INT32 player)
|
||||||
playerahead = players[player].kartstuff[k_playerahead];
|
playerahead = players[player].kartstuff[k_playerahead];
|
||||||
starpostwp = players[player].kartstuff[k_starpostwp];
|
starpostwp = players[player].kartstuff[k_starpostwp];
|
||||||
lakitu = players[player].kartstuff[k_lakitu];
|
lakitu = players[player].kartstuff[k_lakitu];
|
||||||
offroad = players[player].kartstuff[k_offroad];
|
|
||||||
|
|
||||||
p = &players[player];
|
p = &players[player];
|
||||||
memset(p, 0, sizeof (*p));
|
memset(p, 0, sizeof (*p));
|
||||||
|
@ -2305,7 +2303,6 @@ void G_PlayerReborn(INT32 player)
|
||||||
p->kartstuff[k_playerahead] = playerahead;
|
p->kartstuff[k_playerahead] = playerahead;
|
||||||
p->kartstuff[k_starpostwp] = starpostwp;
|
p->kartstuff[k_starpostwp] = starpostwp;
|
||||||
p->kartstuff[k_lakitu] = lakitu;
|
p->kartstuff[k_lakitu] = lakitu;
|
||||||
p->kartstuff[k_offroad] = offroad;
|
|
||||||
|
|
||||||
// Don't do anything immediately
|
// Don't do anything immediately
|
||||||
p->pflags |= PF_USEDOWN;
|
p->pflags |= PF_USEDOWN;
|
||||||
|
|
50
src/k_kart.c
50
src/k_kart.c
|
@ -872,49 +872,6 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
||||||
S_StartSound(NULL, sfx_mkitmF);
|
S_StartSound(NULL, sfx_mkitmF);
|
||||||
}
|
}
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
//{ SRB2kart p_user.c Stuff
|
|
||||||
|
|
||||||
/** \brief Updates the Player's offroad value once per frame
|
|
||||||
|
|
||||||
\param player player object passed from K_KartPlayerThink
|
|
||||||
|
|
||||||
\return void
|
|
||||||
*/
|
|
||||||
static void K_UpdateOffroad(player_t *player)
|
|
||||||
{
|
|
||||||
fixed_t kartweight = player->kartweight;
|
|
||||||
fixed_t offroad;
|
|
||||||
sector_t *nextsector = R_PointInSubsector(
|
|
||||||
player->mo->x + player->mo->momx*2, player->mo->y + player->mo->momy*2)->sector;
|
|
||||||
|
|
||||||
// If you are offroad, a timer starts. Depending on your weight value, the timer increments differently.
|
|
||||||
if ((nextsector->special & 256) && nextsector->special != 768 && nextsector->special != 1024 && nextsector->special != 4864)
|
|
||||||
{
|
|
||||||
if (P_IsObjectOnGround(player->mo) && player->kartstuff[k_offroad] == 0)
|
|
||||||
player->kartstuff[k_offroad] = 16;
|
|
||||||
if (player->kartstuff[k_offroad] > 0)
|
|
||||||
{
|
|
||||||
if (kartweight < 1) { kartweight = 1; } if (kartweight > 9) { kartweight = 9; } // Safety Net
|
|
||||||
|
|
||||||
// 1872 is the magic number - 35 frames adds up to approximately 65536. 1872/4 = 468/3 = 156
|
|
||||||
// A higher kart weight means you can stay offroad for longer without losing speed
|
|
||||||
offroad = (1872 + 5*156 - kartweight*156);
|
|
||||||
|
|
||||||
if (player->kartstuff[k_growshrinktimer] > 1) // megashroom slows down half as fast
|
|
||||||
offroad /= 2;
|
|
||||||
|
|
||||||
player->kartstuff[k_offroad] += offroad;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player->kartstuff[k_offroad] > FRACUNIT)
|
|
||||||
player->kartstuff[k_offroad] = FRACUNIT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
player->kartstuff[k_offroad] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c
|
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c
|
||||||
|
|
||||||
\param player player object passed from P_PlayerThink
|
\param player player object passed from P_PlayerThink
|
||||||
|
@ -924,8 +881,6 @@ static void K_UpdateOffroad(player_t *player)
|
||||||
*/
|
*/
|
||||||
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
K_UpdateOffroad(player);
|
|
||||||
|
|
||||||
// This spawns the drift sparks when k_driftcharge hits 26 + player->kartspeed. Its own AI handles life/death and color
|
// This spawns the drift sparks when k_driftcharge hits 26 + player->kartspeed. Its own AI handles life/death and color
|
||||||
if ((player->kartstuff[k_drift] >= 1 || player->kartstuff[k_drift] <= -1)
|
if ((player->kartstuff[k_drift] >= 1 || player->kartstuff[k_drift] <= -1)
|
||||||
&& player->kartstuff[k_driftcharge] == (26 + player->kartspeed))
|
&& player->kartstuff[k_driftcharge] == (26 + player->kartspeed))
|
||||||
|
@ -1056,11 +1011,6 @@ static fixed_t K_GetKartBoostPower(player_t *player, boolean speedonly)
|
||||||
fixed_t boostvalue = 0;
|
fixed_t boostvalue = 0;
|
||||||
fixed_t numboosts = 0;
|
fixed_t numboosts = 0;
|
||||||
|
|
||||||
// Offroad is separate, it's difficult to factor it in with a variable value anyway.
|
|
||||||
if (!(player->kartstuff[k_startimer] || player->kartstuff[k_bootaketimer] || player->kartstuff[k_mushroomtimer])
|
|
||||||
&& player->kartstuff[k_offroad] >= 0 && speedonly)
|
|
||||||
boostpower = FixedDiv(boostpower, player->kartstuff[k_offroad] + FRACUNIT);
|
|
||||||
|
|
||||||
if (player->kartstuff[k_growshrinktimer] < -1 && speedonly)
|
if (player->kartstuff[k_growshrinktimer] < -1 && speedonly)
|
||||||
{ // Shrink
|
{ // Shrink
|
||||||
boostvalue += 16; // This is basically speed x2 due to friction and being smaller. Really translates to about 80%.
|
boostvalue += 16; // This is basically speed x2 due to friction and being smaller. Really translates to about 80%.
|
||||||
|
|
Loading…
Reference in a new issue