mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Power-ups: delay voice clips by 10 tics
This commit is contained in:
parent
f7d396d150
commit
549865ce2d
2 changed files with 27 additions and 6 deletions
|
|
@ -66,33 +66,28 @@ void K_GivePowerUp(player_t* player, kartitems_t powerup, tic_t time)
|
||||||
switch (powerup)
|
switch (powerup)
|
||||||
{
|
{
|
||||||
case POWERUP_SMONITOR:
|
case POWERUP_SMONITOR:
|
||||||
S_StartSound(NULL, sfx_bpwrua);
|
|
||||||
K_AddMessageForPlayer(player, "Got S MONITOR!", true, false);
|
K_AddMessageForPlayer(player, "Got S MONITOR!", true, false);
|
||||||
K_DoInvincibility(player, player->invincibilitytimer + time);
|
K_DoInvincibility(player, player->invincibilitytimer + time);
|
||||||
player->powerup.superTimer += time;
|
player->powerup.superTimer += time;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case POWERUP_BARRIER:
|
case POWERUP_BARRIER:
|
||||||
S_StartSound(NULL, sfx_bpwrub);
|
|
||||||
K_AddMessageForPlayer(player, "Got MEGA BARRIER!", true, false);
|
K_AddMessageForPlayer(player, "Got MEGA BARRIER!", true, false);
|
||||||
player->powerup.barrierTimer += time;
|
player->powerup.barrierTimer += time;
|
||||||
Obj_SpawnMegaBarrier(player);
|
Obj_SpawnMegaBarrier(player);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case POWERUP_BUMPER:
|
case POWERUP_BUMPER:
|
||||||
S_StartSound(NULL, sfx_bpwruc);
|
|
||||||
K_AddMessageForPlayer(player, "Got BUMPER RESTOCK!", true, false);
|
K_AddMessageForPlayer(player, "Got BUMPER RESTOCK!", true, false);
|
||||||
K_GiveBumpersToPlayer(player, nullptr, 5);
|
K_GiveBumpersToPlayer(player, nullptr, 5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case POWERUP_BADGE:
|
case POWERUP_BADGE:
|
||||||
S_StartSound(NULL, sfx_bpwrud);
|
|
||||||
K_AddMessageForPlayer(player, "Got RHYTHM BADGE!", true, false);
|
K_AddMessageForPlayer(player, "Got RHYTHM BADGE!", true, false);
|
||||||
player->powerup.rhythmBadgeTimer += time;
|
player->powerup.rhythmBadgeTimer += time;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case POWERUP_SUPERFLICKY:
|
case POWERUP_SUPERFLICKY:
|
||||||
S_StartSound(NULL, sfx_bpwrue);
|
|
||||||
K_AddMessageForPlayer(player, "Got SUPER FLICKY!", true, false);
|
K_AddMessageForPlayer(player, "Got SUPER FLICKY!", true, false);
|
||||||
if (K_PowerUpRemaining(player, POWERUP_SUPERFLICKY))
|
if (K_PowerUpRemaining(player, POWERUP_SUPERFLICKY))
|
||||||
{
|
{
|
||||||
|
|
@ -105,7 +100,6 @@ void K_GivePowerUp(player_t* player, kartitems_t powerup, tic_t time)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case POWERUP_POINTS:
|
case POWERUP_POINTS:
|
||||||
S_StartSound(NULL, sfx_bpwruf);
|
|
||||||
K_AddMessageForPlayer(player, "Got 6 POINTS!", true, false);
|
K_AddMessageForPlayer(player, "Got 6 POINTS!", true, false);
|
||||||
K_GivePointsToPlayer(player, nullptr, 6);
|
K_GivePointsToPlayer(player, nullptr, 6);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,11 @@ struct Spinner : Mobj
|
||||||
{
|
{
|
||||||
fixed_t f = FRACUNIT - std::clamp(fuse, 0, duration()) * FRACUNIT / std::max(duration(), 1);
|
fixed_t f = FRACUNIT - std::clamp(fuse, 0, duration()) * FRACUNIT / std::max(duration(), 1);
|
||||||
|
|
||||||
|
if (fuse == duration() - 20)
|
||||||
|
{
|
||||||
|
S_StartSound(nullptr, sound());
|
||||||
|
}
|
||||||
|
|
||||||
angle += Easing_InQuad(f, ANGLE_11hh, ANGLE_45);
|
angle += Easing_InQuad(f, ANGLE_11hh, ANGLE_45);
|
||||||
renderflags = (renderflags & ~RF_TRANSMASK) | (Easing_Linear(f, 0, 9) << RF_TRANSSHIFT);
|
renderflags = (renderflags & ~RF_TRANSMASK) | (Easing_Linear(f, 0, 9) << RF_TRANSSHIFT);
|
||||||
spritescale({Easing_Linear(f, 4*FRACUNIT, FRACUNIT/4), Easing_Linear(f, FRACUNIT, 6*FRACUNIT)});
|
spritescale({Easing_Linear(f, 4*FRACUNIT, FRACUNIT/4), Easing_Linear(f, FRACUNIT, 6*FRACUNIT)});
|
||||||
|
|
@ -55,6 +60,28 @@ struct Spinner : Mobj
|
||||||
remove();
|
remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
sfxenum_t sound() const
|
||||||
|
{
|
||||||
|
switch (powerup())
|
||||||
|
{
|
||||||
|
case POWERUP_SMONITOR:
|
||||||
|
return sfx_bpwrua;
|
||||||
|
case POWERUP_BARRIER:
|
||||||
|
return sfx_bpwrub;
|
||||||
|
case POWERUP_BUMPER:
|
||||||
|
return sfx_bpwruc;
|
||||||
|
case POWERUP_BADGE:
|
||||||
|
return sfx_bpwrud;
|
||||||
|
case POWERUP_SUPERFLICKY:
|
||||||
|
return sfx_bpwrue;
|
||||||
|
case POWERUP_POINTS:
|
||||||
|
return sfx_bpwruf;
|
||||||
|
default:
|
||||||
|
return sfx_thok;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace
|
}; // namespace
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue