mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +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 "k_hud.h" // K_AddMessage
|
||||||
#include "p_mobj.h"
|
#include "p_mobj.h"
|
||||||
#include "s_sound.h"
|
#include "s_sound.h"
|
||||||
|
#include "p_tick.h"
|
||||||
|
|
||||||
tic_t K_PowerUpRemaining(const player_t* player, kartitems_t powerup)
|
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);
|
Obj_SpawnPowerUpAura(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
S_StartSound(NULL, sfx_gsha7);
|
||||||
player->flashing = 2*TICRATE;
|
player->flashing = 2*TICRATE;
|
||||||
|
|
||||||
|
g_darkness.start = leveltime;
|
||||||
|
g_darkness.end = leveltime + BATTLE_POWERUP_ANIM_TIME + DARKNESS_FADE_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, time);
|
K_DoInvincibility(player, 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))
|
||||||
{
|
{
|
||||||
|
|
@ -91,6 +101,7 @@ 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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define BATTLE_POWERUP_ANIM_TIME (40)
|
||||||
|
|
||||||
tic_t K_PowerUpRemaining(const player_t *player, kartitems_t powerup);
|
tic_t K_PowerUpRemaining(const player_t *player, kartitems_t powerup);
|
||||||
UINT32 K_AnyPowerUpRemaining(const player_t *player); // returns POWERUP_BIT mask
|
UINT32 K_AnyPowerUpRemaining(const player_t *player); // returns POWERUP_BIT mask
|
||||||
void K_GivePowerUp(player_t *player, kartitems_t powerup, tic_t timer);
|
void K_GivePowerUp(player_t *player, kartitems_t powerup, tic_t timer);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue