diff --git a/src/k_kart.c b/src/k_kart.c index 8081065a..fa084fb7 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2444,6 +2444,26 @@ static void K_DoLightning(player_t *player, boolean bluelightning) player->kartstuff[k_sounds] = 50; } +void K_DoBouncePad(player_t *player, fixed_t vertispeed) +{ + if (player->spectator || !player->mo) + return; + + if (player->mo->eflags & MFE_SPRUNG) + return; + +#ifdef ESLOPE + player->mo->standingslope = NULL; +#endif + player->mo->eflags |= MFE_SPRUNG; + + if (player->mo->eflags & MFE_VERTICALFLIP) + vertispeed *= -1; + + player->mo->momz = FixedMul(vertispeed, player->mo->scale); + S_StartSound(player->mo, sfx_boing); +} + // countersteer is how strong the controls are telling us we are turning // turndir is the direction the controls are telling us to turn, -1 if turning right and 1 if turning left static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer) @@ -3232,10 +3252,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Feather else if (ATTACK_IS_DOWN && !HOLDING_ITEM && player->kartstuff[k_feather] & 1 && NO_BOO) { - S_StartSound(player->mo, sfx_boing); // Boing! K_PlayTauntSound(player->mo); - - player->mo->momz = FixedMul(15<mo->scale); + K_DoBouncePad(player, 16<pflags |= PF_ATTACKDOWN; player->kartstuff[k_feather] |= 2; diff --git a/src/k_kart.h b/src/k_kart.h index f7be4204..36c8c0b9 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -26,6 +26,7 @@ void K_StealBalloon(player_t *player, player_t *victim); void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source); void K_SpawnDriftTrail(player_t *player); void K_DoMushroom(player_t *player, boolean doPFlag, boolean startboost); +void K_DoBouncePad(player_t *player, fixed_t vertispeed); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); void K_MomentumToFacing(player_t *player); fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower); diff --git a/src/p_mobj.c b/src/p_mobj.c index c7f6f54c..7c5fca01 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9266,7 +9266,7 @@ void P_RespawnBattleSpecials(void) return; // Didn't collect enough boxes - if (numgotboxes < (9*nummapboxes/10)) + if (numgotboxes < (4*nummapboxes/5)) return; // wait a teeeensy bit after collecting everything diff --git a/src/p_spec.c b/src/p_spec.c index 8830e007..bc25ac79 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3728,7 +3728,17 @@ DoneSection2: // Process Section 3 switch (special) { - case 1: // Unused (was "Ice/Sludge") + case 1: // SRB2kart: bounce pad + if (!P_IsObjectOnGround(player->mo)) + break; + + if (player->speed < K_GetKartSpeed(player, true)/16 && !(player->mo->eflags & MFE_SPRUNG)) // Push forward to prevent getting stuck + P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player, true)/16, player->mo->scale)); + + K_DoBouncePad(player, 12<