diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_event.c | 20 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 4 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 15 | ||||
-rw-r--r-- | src/cgame/cg_view.c | 2 | ||||
-rw-r--r-- | src/game/bg_misc.c | 50 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 5 | ||||
-rw-r--r-- | src/game/bg_public.h | 5 |
7 files changed, 59 insertions, 42 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 4833346d..0df4ea5c 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -369,16 +369,20 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) // case EV_FOOTSTEP: DEBUGNAME( "EV_FOOTSTEP" ); - if( cg_footsteps.integer ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) { - trap_S_StartSound( NULL, es->number, CHAN_BODY, - cgs.media.footsteps[ ci->footsteps ][ rand( ) & 3 ] ); + if( ci->footsteps == FOOTSTEP_CUSTOM ) + trap_S_StartSound( NULL, es->number, CHAN_BODY, + ci->customFootsteps[ rand( ) & 3 ] ); + else + trap_S_StartSound( NULL, es->number, CHAN_BODY, + cgs.media.footsteps[ ci->footsteps ][ rand( ) & 3 ] ); } break; case EV_FOOTSTEP_METAL: DEBUGNAME( "EV_FOOTSTEP_METAL" ); - if( cg_footsteps.integer ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_METAL ][ rand( ) & 3 ] ); @@ -387,7 +391,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_FOOTSTEP_SQUELCH: DEBUGNAME( "EV_FOOTSTEP_SQUELCH" ); - if( cg_footsteps.integer ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_FLESH ][ rand( ) & 3 ] ); @@ -396,7 +400,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_FOOTSPLASH: DEBUGNAME( "EV_FOOTSPLASH" ); - if( cg_footsteps.integer ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] ); @@ -405,7 +409,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_FOOTWADE: DEBUGNAME( "EV_FOOTWADE" ); - if( cg_footsteps.integer ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] ); @@ -414,7 +418,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_SWIM: DEBUGNAME( "EV_SWIM" ); - if( cg_footsteps.integer ) + if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE ) { trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 2dd28bf2..8a660c4a 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -103,6 +103,8 @@ typedef enum FOOTSTEP_ENERGY, FOOTSTEP_METAL, FOOTSTEP_SPLASH, + FOOTSTEP_CUSTOM, + FOOTSTEP_NONE, FOOTSTEP_TOTAL } footstep_t; @@ -650,6 +652,8 @@ typedef struct animation_t animations[ MAX_PLAYER_TOTALANIMATIONS ]; sfxHandle_t sounds[ MAX_CUSTOM_SOUNDS ]; + + sfxHandle_t customFootsteps[ 4 ]; } clientInfo_t; diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index 5357b589..037a71a2 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -147,6 +147,21 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci ) ci->footsteps = FOOTSTEP_MECH; else if( !Q_stricmp( token, "energy" ) ) ci->footsteps = FOOTSTEP_ENERGY; + else if( !Q_stricmp( token, "none" ) ) + ci->footsteps = FOOTSTEP_NONE; + else if( !Q_stricmp( token, "custom" ) ) + { + ci->footsteps = FOOTSTEP_CUSTOM; + + for( i = 0; i < 4; i++ ) + { + token = COM_Parse( &text_p ); + if( !token ) + break; + + ci->customFootsteps[ i ] = trap_S_RegisterSound( token, qfalse ); + } + } else CG_Printf( "Bad footsteps parm in %s: %s\n", filename, token ); diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index 70e4f900..863dc776 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -623,7 +623,7 @@ static void CG_OffsetFirstPersonView( void ) } // add bob height - bob = cg.bobfracsin * cg.xyspeed * cg_bobup.value; + bob = cg.bobfracsin * cg.xyspeed * bob2; if( bob > 6 ) bob = 6; diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 8876af15..3eb2ca01 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1446,13 +1446,12 @@ classAttributes_t bg_classList[ ] = ABUILDER_HEALTH, //int health; 0.2f, //float fallDamage; ABUILDER_REGEN, //int regenRate; - SCA_TAKESFALLDAMAGE|SCA_FOVWARPS| - SCA_NOFOOTSTEPS, //int abilities; + SCA_TAKESFALLDAMAGE|SCA_FOVWARPS|SCA_ALIENSENSE,//int abilities; WP_ABUILD, //weapon_t startWeapon 95.0f, //float buildDist; 80, //int fov; 0.001f, //float bob; - 1.0f, //float bobCycle; + 2.0f, //float bobCycle; 350, //int steptime; ABUILDER_SPEED, //float speed; 10.0f, //float acceleration; @@ -1483,13 +1482,12 @@ classAttributes_t bg_classList[ ] = ABUILDER_UPG_HEALTH, //int health; 0.0f, //float fallDamage; ABUILDER_UPG_REGEN, //int regenRate; - SCA_FOVWARPS|SCA_WALLCLIMBER| - SCA_NOFOOTSTEPS, //int abilities; + SCA_FOVWARPS|SCA_WALLCLIMBER|SCA_ALIENSENSE, //int abilities; WP_ABUILD2, //weapon_t startWeapon 95.0f, //float buildDist; 110, //int fov; 0.001f, //float bob; - 1.0f, //float bobCycle; + 2.0f, //float bobCycle; 200, //int steptime; ABUILDER_UPG_SPEED, //float speed; 10.0f, //float acceleration; @@ -1521,12 +1519,12 @@ classAttributes_t bg_classList[ ] = 0.0f, //float fallDamage; SOLDIER_REGEN, //int regenRate; SCA_WALLCLIMBER|SCA_NOWEAPONDRIFT| - SCA_FOVWARPS|SCA_ALIENSENSE|SCA_NOFOOTSTEPS, //int abilities; - WP_SOLDIER, //weapon_t startWeapon + SCA_FOVWARPS|SCA_ALIENSENSE, //int abilities; + WP_SOLDIER, //weapon_t startWeapon 0.0f, //float buildDist; 140, //int fov; 0.0f, //float bob; - 1.0f, //float bobCycle; + 2.5f, //float bobCycle; 25, //int steptime; SOLDIER_SPEED, //float speed; 10.0f, //float acceleration; @@ -1558,13 +1556,12 @@ classAttributes_t bg_classList[ ] = 0.0f, //float fallDamage; HYDRA_REGEN, //int regenRate; SCA_NOWEAPONDRIFT| - SCA_FOVWARPS|SCA_WALLCLIMBER|SCA_ALIENSENSE| - SCA_NOFOOTSTEPS, //int abilities; + SCA_FOVWARPS|SCA_WALLCLIMBER|SCA_ALIENSENSE, //int abilities; WP_HYDRA, //weapon_t startWeapon 0.0f, //float buildDist; 120, //int fov; 0.001f, //float bob; - 1.0f, //float bobCycle; + 1.8f, //float bobCycle; 25, //int steptime; HYDRA_SPEED, //float speed; 10.0f, //float acceleration; @@ -1596,13 +1593,12 @@ classAttributes_t bg_classList[ ] = 0.0f, //float fallDamage; HYDRA_UPG_REGEN, //int regenRate; SCA_NOWEAPONDRIFT|SCA_FOVWARPS| - SCA_WALLCLIMBER|SCA_ALIENSENSE| - SCA_NOFOOTSTEPS, //int abilities; + SCA_WALLCLIMBER|SCA_ALIENSENSE, //int abilities; WP_HYDRA_UPG, //weapon_t startWeapon 0.0f, //float buildDist; 120, //int fov; 0.001f, //float bob; - 1.0f, //float bobCycle; + 1.8f, //float bobCycle; 25, //int steptime; HYDRA_UPG_SPEED, //float speed; 10.0f, //float acceleration; @@ -1634,12 +1630,12 @@ classAttributes_t bg_classList[ ] = 0.0f, //float fallDamage; CHIMERA_REGEN, //int regenRate; SCA_NOWEAPONDRIFT|SCA_WALLJUMPER| - SCA_FOVWARPS|SCA_ALIENSENSE|SCA_NOFOOTSTEPS, //int abilities; + SCA_FOVWARPS|SCA_ALIENSENSE, //int abilities; WP_CHIMERA, //weapon_t startWeapon 0.0f, //float buildDist; 90, //int fov; - 0.0f, //float bob; - 1.0f, //float bobCycle; + 0.001f, //float bob; + 1.5f, //float bobCycle; 60, //int steptime; CHIMERA_SPEED, //float speed; 10.0f, //float acceleration; @@ -1671,12 +1667,12 @@ classAttributes_t bg_classList[ ] = 0.0f, //float fallDamage; CHIMERA_UPG_REGEN, //int regenRate; SCA_NOWEAPONDRIFT|SCA_WALLJUMPER| - SCA_FOVWARPS|SCA_ALIENSENSE|SCA_NOFOOTSTEPS, //int abilities; + SCA_FOVWARPS|SCA_ALIENSENSE, //int abilities; WP_CHIMERA_UPG, //weapon_t startWeapon 0.0f, //float buildDist; 90, //int fov; - 0.0f, //float bob; - 1.0f, //float bobCycle; + 0.001f, //float bob; + 1.5f, //float bobCycle; 60, //int steptime; CHIMERA_UPG_SPEED, //float speed; 10.0f, //float acceleration; @@ -1708,12 +1704,12 @@ classAttributes_t bg_classList[ ] = 0.0f, //float fallDamage; DRAGOON_REGEN, //int regenRate; SCA_NOWEAPONDRIFT| - SCA_FOVWARPS|SCA_ALIENSENSE|SCA_NOFOOTSTEPS, //int abilities; + SCA_FOVWARPS|SCA_ALIENSENSE, //int abilities; WP_DRAGOON, //weapon_t startWeapon 0.0f, //float buildDist; 110, //int fov; 0.0005f, //float bob; - 1.0f, //float bobCycle; + 1.3f, //float bobCycle; 25, //int steptime; DRAGOON_SPEED, //float speed; 10.0f, //float acceleration; @@ -1745,12 +1741,12 @@ classAttributes_t bg_classList[ ] = 0.0f, //float fallDamage; DRAGOON_UPG_REGEN, //int regenRate; SCA_NOWEAPONDRIFT| - SCA_FOVWARPS|SCA_ALIENSENSE|SCA_NOFOOTSTEPS, //int abilities; + SCA_FOVWARPS|SCA_ALIENSENSE, //int abilities; WP_DRAGOON_UPG, //weapon_t startWeapon 0.0f, //float buildDist; 110, //int fov; 0.0005f, //float bob; - 1.0f, //float bobCycle; + 1.3f, //float bobCycle; 25, //int steptime; DRAGOON_UPG_SPEED, //float speed; 10.0f, //float acceleration; @@ -1782,12 +1778,12 @@ classAttributes_t bg_classList[ ] = 0.0f, //float fallDamage; BMOFO_REGEN, //int regenRate; SCA_NOWEAPONDRIFT| - SCA_FOVWARPS|SCA_ALIENSENSE|SCA_NOFOOTSTEPS, //int abilities; + SCA_FOVWARPS|SCA_ALIENSENSE, //int abilities; WP_BIGMOFO, //weapon_t startWeapon 0.0f, //float buildDist; 90, //int fov; 0.001f, //float bob; - 1.0f, //float bobCycle; + 1.1f, //float bobCycle; 60, //int steptime; BMOFO_SPEED, //float speed; 5.0f, //float acceleration; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 2031db3e..d7007733 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -1584,7 +1584,7 @@ static void PM_CrashLand( void ) if( pm->ps->stats[STAT_HEALTH] > 0 ) PM_AddEvent( EV_FALL_MEDIUM ); } - else if( !BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_NOFOOTSTEPS ) ) + else { if( delta > 7 ) PM_AddEvent( EV_FALL_SHORT ); @@ -2489,8 +2489,7 @@ static void PM_Footsteps( void ) if( pm->waterlevel == 0 ) { // on ground will only play sounds if running - if( footstep && !pm->noFootsteps && - !BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_NOFOOTSTEPS ) ) + if( footstep && !pm->noFootsteps ) PM_AddEvent( PM_FootstepForSurface( ) ); } else if( pm->waterlevel == 1 ) diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 019f9bb7..95892add 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -219,9 +219,8 @@ typedef enum #define SCA_NOWEAPONDRIFT 0x00000008 #define SCA_FOVWARPS 0x00000010 #define SCA_ALIENSENSE 0x00000020 -#define SCA_NOFOOTSTEPS 0x00000040 -#define SCA_CANUSELADDERS 0x00000080 -#define SCA_WALLJUMPER 0x00000100 +#define SCA_CANUSELADDERS 0x00000040 +#define SCA_WALLJUMPER 0x00000080 #define SS_WALLCLIMBING 0x00000001 #define SS_WALLCLIMBINGCEILING 0x00000002 |