mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-18 03:22:35 +00:00
Fix tripwire sound riding garden top
This commit is contained in:
parent
80c02ca6db
commit
5bd70c13bd
3 changed files with 16 additions and 9 deletions
14
src/k_kart.c
14
src/k_kart.c
|
|
@ -9042,6 +9042,7 @@ static void K_UpdateTripwire(player_t *player)
|
|||
boolean goodSpeed = (player->speed >= speedThreshold);
|
||||
boolean boostExists = (player->tripwireLeniency > 0); // can't be checked later because of subtractions...
|
||||
tripwirepass_t triplevel = K_TripwirePassConditions(player);
|
||||
boolean mightplaysound = false;
|
||||
|
||||
if (triplevel != TRIPWIRE_NONE)
|
||||
{
|
||||
|
|
@ -9050,12 +9051,7 @@ static void K_UpdateTripwire(player_t *player)
|
|||
mobj_t *front = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_TRIPWIREBOOST);
|
||||
mobj_t *back = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_TRIPWIREBOOST);
|
||||
|
||||
if (P_IsDisplayPlayer(player))
|
||||
{
|
||||
S_StartSound(player->mo, sfx_s3k40);
|
||||
S_StopSoundByID(player->mo, sfx_gshaf);
|
||||
}
|
||||
|
||||
mightplaysound = true;
|
||||
|
||||
P_SetTarget(&front->target, player->mo);
|
||||
P_SetTarget(&back->target, player->mo);
|
||||
|
|
@ -9074,6 +9070,12 @@ static void K_UpdateTripwire(player_t *player)
|
|||
|
||||
if (triplevel != TRIPWIRE_CONSUME)
|
||||
player->tripwireLeniency = max(player->tripwireLeniency, TRIPWIRETIME);
|
||||
|
||||
if (P_IsDisplayPlayer(player) && player->tripwireLeniency && mightplaysound)
|
||||
{
|
||||
S_StartSound(player->mo, TRIPWIRE_OK_SOUND);
|
||||
S_StopSoundByID(player->mo, TRIPWIRE_NG_SOUND);
|
||||
}
|
||||
}
|
||||
|
||||
// TRIPWIRE_CONSUME is only applied in very specific cases (currently, riding Garden Top)
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ Make sure this matches the actual number of states
|
|||
|
||||
#define EARLY_ITEM_FLICKER (NUMTRANSMAPS)
|
||||
|
||||
#define TRIPWIRE_OK_SOUND (sfx_s3k40)
|
||||
#define TRIPWIRE_NG_SOUND (sfx_gshaf)
|
||||
|
||||
// 2023-08-26 +ang20 to Sal's OG values to make them friendlier - Tyron
|
||||
#define STUMBLE_STEEP_VAL (ANG60 + ANG20)
|
||||
#define STUMBLE_STEEP_VAL_AIR (ANG30 + ANG10 + ANG20)
|
||||
|
|
|
|||
|
|
@ -7864,10 +7864,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
if (!mobj->target || !mobj->target->health
|
||||
|| !mobj->target->player || !mobj->target->player->tripwireLeniency)
|
||||
{
|
||||
if (mobj->target && mobj->target->player && P_IsDisplayPlayer(mobj->target->player))
|
||||
if (mobj->target && mobj->target->player
|
||||
&& P_IsDisplayPlayer(mobj->target->player)
|
||||
&& !(mobj->target->player->curshield == KSHIELD_TOP))
|
||||
{
|
||||
S_StopSoundByID(mobj->target, sfx_s3k40);
|
||||
S_StartSound(mobj->target, sfx_gshaf);
|
||||
S_StopSoundByID(mobj->target, TRIPWIRE_OK_SOUND);
|
||||
S_StartSound(mobj->target, TRIPWIRE_NG_SOUND);
|
||||
}
|
||||
|
||||
P_RemoveMobj(mobj);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue