mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'quiet-ring-spam' into 'master'
Reduce ring sound volume as it's repeated See merge request KartKrew/Kart!1370
This commit is contained in:
commit
21d00050a6
7 changed files with 29 additions and 2 deletions
|
|
@ -654,6 +654,7 @@ struct player_t
|
|||
UINT8 sparkleanim; // (0 to 19) - Angle offset for ring sparkle animation
|
||||
UINT16 superring; // You were awarded rings, and have this many of them left to spawn on yourself.
|
||||
UINT8 nextringaward; // When should we spawn our next superring ring?
|
||||
UINT16 ringvolume; // When consuming lots of rings, lower the sound a little.
|
||||
|
||||
UINT8 curshield; // see kartshields_t
|
||||
UINT8 bubblecool; // Bubble Shield use cooldown
|
||||
|
|
|
|||
|
|
@ -2773,6 +2773,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
p->nocontrol = nocontrol;
|
||||
p->kickstartaccel = kickstartaccel;
|
||||
|
||||
p->ringvolume = 255;
|
||||
|
||||
p->botvars.rubberband = FRACUNIT;
|
||||
p->botvars.controller = UINT16_MAX;
|
||||
|
||||
|
|
|
|||
|
|
@ -8187,6 +8187,13 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->hyudorotimer)
|
||||
player->hyudorotimer--;
|
||||
|
||||
if (player->ringvolume < MINRINGVOLUME)
|
||||
player->ringvolume = MINRINGVOLUME;
|
||||
else if (MAXRINGVOLUME - player->ringvolume < RINGVOLUMEREGEN)
|
||||
player->ringvolume = MAXRINGVOLUME;
|
||||
else
|
||||
player->ringvolume += RINGVOLUMEREGEN;
|
||||
|
||||
if (player->sadtimer)
|
||||
player->sadtimer--;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,12 @@ Make sure this matches the actual number of states
|
|||
#define STUMBLE_STEEP_VAL ANG60
|
||||
#define STUMBLE_STEEP_VAL_AIR (ANG30 + ANG10)
|
||||
|
||||
#define MAXRINGVOLUME 255
|
||||
#define MINRINGVOLUME 100
|
||||
#define RINGVOLUMECOLLECTPENALTY 3
|
||||
#define RINGVOLUMEUSEPENALTY 15
|
||||
#define RINGVOLUMEREGEN 3
|
||||
|
||||
angle_t K_ReflectAngle(angle_t angle, angle_t against, fixed_t maxspeed, fixed_t yourspeed);
|
||||
|
||||
void K_RegisterKartStuff(void);
|
||||
|
|
|
|||
|
|
@ -355,6 +355,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->superring);
|
||||
else if (fastcmp(field,"nextringaward"))
|
||||
lua_pushinteger(L, plr->nextringaward);
|
||||
else if (fastcmp(field,"ringvolume"))
|
||||
lua_pushinteger(L, plr->ringvolume);
|
||||
else if (fastcmp(field,"curshield"))
|
||||
lua_pushinteger(L, plr->curshield);
|
||||
else if (fastcmp(field,"bubblecool"))
|
||||
|
|
@ -765,6 +767,8 @@ static int player_set(lua_State *L)
|
|||
plr->superring = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"nextringaward"))
|
||||
plr->nextringaward = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"ringvolume"))
|
||||
plr->ringvolume = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"curshield"))
|
||||
plr->curshield = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"bubblecool"))
|
||||
|
|
|
|||
|
|
@ -3821,7 +3821,10 @@ void A_AttractChase(mobj_t *actor)
|
|||
|
||||
// Base add is 3 tics for 9,9, adds 1 tic for each point closer to the 1,1 end
|
||||
actor->target->player->ringboost += K_GetKartRingPower(actor->target->player, true) + 3;
|
||||
S_ReducedVFXSound(actor->target, sfx_s1b5, NULL);
|
||||
|
||||
S_ReducedVFXSoundAtVolume(actor->target, sfx_s1b5, actor->target->player->ringvolume, NULL);
|
||||
|
||||
actor->target->player->ringvolume -= RINGVOLUMEUSEPENALTY;
|
||||
|
||||
sparkle = P_SpawnMobj(actor->target->x, actor->target->y, actor->target->z, MT_RINGSPARKS);
|
||||
P_SetTarget(&sparkle->target, actor->target);
|
||||
|
|
@ -3854,7 +3857,9 @@ void A_AttractChase(mobj_t *actor)
|
|||
if (actor->cvmem) // caching
|
||||
S_StartSound(actor->target, sfx_s1c5);
|
||||
else
|
||||
S_StartSound(actor->target, sfx_s227);
|
||||
S_StartSoundAtVolume(actor->target, sfx_s227, actor->target->player->ringvolume);
|
||||
|
||||
actor->target->player->ringvolume -= RINGVOLUMECOLLECTPENALTY;
|
||||
|
||||
actor->target->player->pickuprings--;
|
||||
P_RemoveMobj(actor);
|
||||
|
|
|
|||
|
|
@ -463,6 +463,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT8(save->p, players[i].sparkleanim);
|
||||
WRITEUINT16(save->p, players[i].superring);
|
||||
WRITEUINT8(save->p, players[i].nextringaward);
|
||||
WRITEUINT8(save->p, players[i].ringvolume);
|
||||
|
||||
WRITEUINT8(save->p, players[i].curshield);
|
||||
WRITEUINT8(save->p, players[i].bubblecool);
|
||||
|
|
@ -885,6 +886,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].sparkleanim = READUINT8(save->p);
|
||||
players[i].superring = READUINT16(save->p);
|
||||
players[i].nextringaward = READUINT8(save->p);
|
||||
players[i].ringvolume = READUINT8(save->p);
|
||||
|
||||
players[i].curshield = READUINT8(save->p);
|
||||
players[i].bubblecool = READUINT8(save->p);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue