mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-28 10:42:34 +00:00
Associate sounds with powerups and set g_darkness
This commit is contained in:
parent
f3a715eae1
commit
5181c7a6c2
2 changed files with 13 additions and 0 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#include "k_hud.h" // K_AddMessage
|
||||
#include "p_mobj.h"
|
||||
#include "s_sound.h"
|
||||
#include "p_tick.h"
|
||||
|
||||
tic_t K_PowerUpRemaining(const player_t* player, kartitems_t powerup)
|
||||
{
|
||||
|
|
@ -52,33 +53,42 @@ void K_GivePowerUp(player_t* player, kartitems_t powerup, tic_t time)
|
|||
Obj_SpawnPowerUpAura(player);
|
||||
}
|
||||
|
||||
S_StartSound(NULL, sfx_gsha7);
|
||||
player->flashing = 2*TICRATE;
|
||||
|
||||
g_darkness.start = leveltime;
|
||||
g_darkness.end = leveltime + BATTLE_POWERUP_ANIM_TIME + DARKNESS_FADE_TIME;
|
||||
|
||||
switch (powerup)
|
||||
{
|
||||
case POWERUP_SMONITOR:
|
||||
S_StartSound(NULL, sfx_bpwrua);
|
||||
K_AddMessageForPlayer(player, "Got S MONITOR!", true, false);
|
||||
K_DoInvincibility(player, time);
|
||||
player->powerup.superTimer += time;
|
||||
break;
|
||||
|
||||
case POWERUP_BARRIER:
|
||||
S_StartSound(NULL, sfx_bpwrub);
|
||||
K_AddMessageForPlayer(player, "Got MEGA BARRIER!", true, false);
|
||||
player->powerup.barrierTimer += time;
|
||||
Obj_SpawnMegaBarrier(player);
|
||||
break;
|
||||
|
||||
case POWERUP_BUMPER:
|
||||
S_StartSound(NULL, sfx_bpwruc);
|
||||
K_AddMessageForPlayer(player, "Got BUMPER RESTOCK!", true, false);
|
||||
K_GiveBumpersToPlayer(player, nullptr, 5);
|
||||
break;
|
||||
|
||||
case POWERUP_BADGE:
|
||||
S_StartSound(NULL, sfx_bpwrud);
|
||||
K_AddMessageForPlayer(player, "Got RHYTHM BADGE!", true, false);
|
||||
player->powerup.rhythmBadgeTimer += time;
|
||||
break;
|
||||
|
||||
case POWERUP_SUPERFLICKY:
|
||||
S_StartSound(NULL, sfx_bpwrue);
|
||||
K_AddMessageForPlayer(player, "Got SUPER FLICKY!", true, false);
|
||||
if (K_PowerUpRemaining(player, POWERUP_SUPERFLICKY))
|
||||
{
|
||||
|
|
@ -91,6 +101,7 @@ void K_GivePowerUp(player_t* player, kartitems_t powerup, tic_t time)
|
|||
break;
|
||||
|
||||
case POWERUP_POINTS:
|
||||
S_StartSound(NULL, sfx_bpwruf);
|
||||
K_AddMessageForPlayer(player, "Got 6 POINTS!", true, false);
|
||||
K_GivePointsToPlayer(player, nullptr, 6);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BATTLE_POWERUP_ANIM_TIME (40)
|
||||
|
||||
tic_t K_PowerUpRemaining(const player_t *player, kartitems_t powerup);
|
||||
UINT32 K_AnyPowerUpRemaining(const player_t *player); // returns POWERUP_BIT mask
|
||||
void K_GivePowerUp(player_t *player, kartitems_t powerup, tic_t timer);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue