From c5cfc84a8cb2c824f887a0b8da36ab1b62a227c0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 28 Oct 2018 00:58:49 -0400 Subject: [PATCH 1/3] Fix up respawning so that it takes respawning with Shrink into account --- src/k_kart.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 76670f178..a72e1f1b2 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1362,8 +1362,8 @@ void K_RespawnChecker(player_t *player) fixed_t newx, newy, newz; newangle = FixedAngle(((360/8)*i)*FRACUNIT); - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 31*player->mo->scale); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 31*player->mo->scale); + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 31<mo->y + P_ReturnThrustY(player->mo, newangle, 31<mo->eflags & MFE_VERTICALFLIP) newz = player->mo->z + player->mo->height; else @@ -1383,11 +1383,19 @@ void K_RespawnChecker(player_t *player) } else if (player->kartstuff[k_respawn] == 1) { - if (!P_IsObjectOnGround(player->mo)) + if (player->kartstuff[k_growshrinktimer] < 0) + { + player->mo->scalespeed = mapheaderinfo[gamemap-1]->mobj_scale/TICRATE; + player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8; + if (cv_kartdebugshrink.value && !player->bot) + player->mo->destscale = 6*player->mo->destscale/8; + } + + if (!P_IsObjectOnGround(player->mo) && !mapreset) { player->powers[pw_flashing] = 2; - // Sal: That's stupid and prone to accidental usage. + // Sal: The old behavior was stupid and prone to accidental usage. // Let's rip off Mania instead, and turn this into a Drop Dash! if (cmd->buttons & BT_ACCELERATE) @@ -3879,7 +3887,12 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) fast->momz = 3*player->mo->momz/4; } - if (player->kartstuff[k_eggmanexplode]) // You're gonna diiiiie + if (player->playerstate == PST_DEAD || player->kartstuff[k_respawn] > 1) // Ensure these are set correctly here + { + player->mo->colorized = false; + player->mo->color = player->skincolor; + } + else if (player->kartstuff[k_eggmanexplode]) // You're gonna diiiiie { const INT32 flashtime = 4<<(player->kartstuff[k_eggmanexplode]/TICRATE); if (player->kartstuff[k_eggmanexplode] == 1 || (player->kartstuff[k_eggmanexplode] % (flashtime/2) != 0)) @@ -4008,11 +4021,13 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_invincibilitytimer]) player->kartstuff[k_invincibilitytimer]--; - if (player->kartstuff[k_growshrinktimer] > 0) - player->kartstuff[k_growshrinktimer]--; - - if (player->kartstuff[k_growshrinktimer] < 0) - player->kartstuff[k_growshrinktimer]++; + if (!player->kartstuff[k_respawn]) + { + if (player->kartstuff[k_growshrinktimer] > 0) + player->kartstuff[k_growshrinktimer]--; + if (player->kartstuff[k_growshrinktimer] < 0) + player->kartstuff[k_growshrinktimer]++; + } if (player->kartstuff[k_growshrinktimer] == 1 || player->kartstuff[k_growshrinktimer] == -1) { From 88831ae79f704f314336de0503cec0837c3ccab3 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 28 Oct 2018 01:02:30 -0400 Subject: [PATCH 2/3] Fix invincibility item cap It was supposed to be capped at 2 invincibility items at a time, not 3. (may consider scaling with number of players, just not for R1) --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index a72e1f1b2..c67a06bfa 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -666,7 +666,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) break; case KITEM_INVINCIBILITY: POWERITEMODDS(newodds); - if ((!cv_invincibility.value) || (pinvin > 2)) newodds = 0; + if ((!cv_invincibility.value) || (pinvin >= 2)) newodds = 0; break; case KITEM_BANANA: if (!cv_banana.value) newodds = 0; From 2f9fa0250d3a2431351a30200062632fe973ba9d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 28 Oct 2018 01:02:49 -0400 Subject: [PATCH 3/3] This didn't commit with for some reason... --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index c67a06bfa..fc46c347f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -700,7 +700,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) break; case KITEM_GROW: POWERITEMODDS(newodds); - if ((!cv_grow.value) || (pinvin > 2)) newodds = 0; + if ((!cv_grow.value) || (pinvin >= 2)) newodds = 0; break; case KITEM_SHRINK: POWERITEMODDS(newodds);