Bounce pad sector type

Uses Ice/Sludge sector effect (new friction doesn't need it)
This commit is contained in:
TehRealSalt 2017-11-07 02:36:27 -05:00
parent 7fcca8f2d1
commit 01afd52ad0
4 changed files with 34 additions and 5 deletions

View file

@ -2444,6 +2444,26 @@ static void K_DoLightning(player_t *player, boolean bluelightning)
player->kartstuff[k_sounds] = 50; 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 // 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 // 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) static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer)
@ -3232,10 +3252,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
// Feather // Feather
else if (ATTACK_IS_DOWN && !HOLDING_ITEM && player->kartstuff[k_feather] & 1 && NO_BOO) 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); K_PlayTauntSound(player->mo);
K_DoBouncePad(player, 16<<FRACBITS);
player->mo->momz = FixedMul(15<<FRACBITS, player->mo->scale);
player->pflags |= PF_ATTACKDOWN; player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_feather] |= 2; player->kartstuff[k_feather] |= 2;

View file

@ -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_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_SpawnDriftTrail(player_t *player);
void K_DoMushroom(player_t *player, boolean doPFlag, boolean startboost); 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); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue);
void K_MomentumToFacing(player_t *player); void K_MomentumToFacing(player_t *player);
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower); fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower);

View file

@ -9266,7 +9266,7 @@ void P_RespawnBattleSpecials(void)
return; return;
// Didn't collect enough boxes // Didn't collect enough boxes
if (numgotboxes < (9*nummapboxes/10)) if (numgotboxes < (4*nummapboxes/5))
return; return;
// wait a teeeensy bit after collecting everything // wait a teeeensy bit after collecting everything

View file

@ -3728,7 +3728,17 @@ DoneSection2:
// Process Section 3 // Process Section 3
switch (special) 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<<FRACBITS);
break;
case 2: // Wind/Current case 2: // Wind/Current
case 3: // Unused (was "Ice/Sludge and Wind/Current") case 3: // Unused (was "Ice/Sludge and Wind/Current")
case 4: // Conveyor Belt case 4: // Conveyor Belt