Browse Source

Add snow step sound

opforfixed
Roman Chistokhodov 5 years ago
parent
commit
4fe0da6355
  1. 8
      cl_dll/ev_hldm.cpp
  2. 5
      dlls/client.cpp
  3. 1
      dlls/gearbox/ctf_gamerules.cpp
  4. 8
      dlls/sound.cpp
  5. 24
      pm_shared/pm_shared.c

8
cl_dll/ev_hldm.cpp

@ -238,6 +238,14 @@ float EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *v @@ -238,6 +238,14 @@ float EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *v
fattn = 1.0;
cnt = 2;
break;
case CHAR_TEX_SNOW:
fvol = 0.9;
fvolbar = 0.1;
rgsz[0] = "player/pl_snow1.wav";
rgsz[1] = "player/pl_snow2.wav";
rgsz[2] = "player/pl_snow3.wav";
cnt = 3;
break;
}
// play material hit sound

5
dlls/client.cpp

@ -892,6 +892,11 @@ void ClientPrecache( void ) @@ -892,6 +892,11 @@ void ClientPrecache( void )
PRECACHE_SOUND( "player/pl_wade3.wav" );
PRECACHE_SOUND( "player/pl_wade4.wav" );
PRECACHE_SOUND( "player/pl_snow1.wav" ); // walk on snow
PRECACHE_SOUND( "player/pl_snow2.wav" );
PRECACHE_SOUND( "player/pl_snow3.wav" );
PRECACHE_SOUND( "player/pl_snow4.wav" );
PRECACHE_SOUND( "debris/wood1.wav" ); // hit wood texture
PRECACHE_SOUND( "debris/wood2.wav" );
PRECACHE_SOUND( "debris/wood3.wav" );

1
dlls/gearbox/ctf_gamerules.cpp

@ -598,6 +598,7 @@ void CCTFMultiplay::ChangePlayerTeam(CBasePlayer *pPlayer, int iTeam) @@ -598,6 +598,7 @@ void CCTFMultiplay::ChangePlayerTeam(CBasePlayer *pPlayer, int iTeam)
WRITE_BYTE(ENTINDEX(pPlayer->edict()));
WRITE_SHORT(pPlayer->pev->frags);
WRITE_SHORT(pPlayer->m_iDeaths);
WRITE_SHORT(0);
WRITE_SHORT(pPlayer->pev->team);
MESSAGE_END();

8
dlls/sound.cpp

@ -1652,6 +1652,14 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in @@ -1652,6 +1652,14 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in
fattn = 1.0;
cnt = 2;
break;
case CHAR_TEX_SNOW:
fvol = 0.9;
fvolbar = 0.1;
rgsz[0] = "player/pl_snow1.wav";
rgsz[1] = "player/pl_snow2.wav";
rgsz[2] = "player/pl_snow3.wav";
cnt = 3;
break;
}
// did we hit a breakable?

24
pm_shared/pm_shared.c

@ -72,6 +72,7 @@ playermove_t *pmove = NULL; @@ -72,6 +72,7 @@ playermove_t *pmove = NULL;
#define CHAR_TEX_COMPUTER 'P'
#define CHAR_TEX_GLASS 'Y'
#define CHAR_TEX_FLESH 'F'
#define CHAR_TEX_SNOW 'O'
#define STEP_CONCRETE 0 // default step sound
#define STEP_METAL 1 // metal floor
@ -82,6 +83,7 @@ playermove_t *pmove = NULL; @@ -82,6 +83,7 @@ playermove_t *pmove = NULL;
#define STEP_SLOSH 6 // shallow liquid puddle
#define STEP_WADE 7 // wading in liquid
#define STEP_LADDER 8 // climbing ladder
#define STEP_SNOW 9
#define PLAYER_FATAL_FALL_SPEED 1024// approx 60 feet
#define PLAYER_MAX_SAFE_FALL_SPEED 580// approx 20 feet
@ -486,6 +488,25 @@ void PM_PlayStepSound( int step, float fvol ) @@ -486,6 +488,25 @@ void PM_PlayStepSound( int step, float fvol )
break;
}
break;
case STEP_SNOW:
switch( irand )
{
// right foot
case 0:
pmove->PM_PlaySound( CHAN_BODY, "player/pl_snow1.wav", fvol, ATTN_NORM, 0, PITCH_NORM );
break;
case 1:
pmove->PM_PlaySound( CHAN_BODY, "player/pl_snow3.wav", fvol, ATTN_NORM, 0, PITCH_NORM );
break;
// left foot
case 2:
pmove->PM_PlaySound( CHAN_BODY, "player/pl_snow2.wav", fvol, ATTN_NORM, 0, PITCH_NORM );
break;
case 3:
pmove->PM_PlaySound( CHAN_BODY, "player/pl_snow4.wav", fvol, ATTN_NORM, 0, PITCH_NORM );
break;
}
break;
}
}
@ -508,6 +529,8 @@ int PM_MapTextureTypeStepType( char chTextureType ) @@ -508,6 +529,8 @@ int PM_MapTextureTypeStepType( char chTextureType )
return STEP_TILE;
case CHAR_TEX_SLOSH:
return STEP_SLOSH;
case CHAR_TEX_SNOW:
return STEP_SNOW;
}
}
@ -647,6 +670,7 @@ void PM_UpdateStepSound( void ) @@ -647,6 +670,7 @@ void PM_UpdateStepSound( void )
pmove->flTimeStepSound = fWalking ? 400 : 300;
break;
case CHAR_TEX_DIRT:
case CHAR_TEX_SNOW:
fvol = fWalking ? 0.25 : 0.55;
pmove->flTimeStepSound = fWalking ? 400 : 300;
break;

Loading…
Cancel
Save