diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2019-08-27 01:27:55 +0100 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2019-08-27 01:27:55 +0100 |
commit | 2a062e07ade9a2f76e90b3f2794b08189db75e89 (patch) | |
tree | 2c8c7a1b50dc3c15d5f256e28130440a6465a5e9 /src | |
parent | 1c970daca1c62539325df935b7afce0ecc08823b (diff) |
buildable death sound
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_buildable.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 43ac66a..b7bc386 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -503,6 +503,13 @@ static void nullDieFunction( gentity_t *self, gentity_t *inflictor, gentity_t *a { } +static void G_BuildableDeathSound( gentity_t *self ) +{ + gentity_t *snd = G_TempEntity( self->r.currentOrigin, EV_GENERAL_SOUND ); + snd->s.eventParm = G_SoundIndex( BG_FindTeamForBuildable( self->s.modelindex ) == PTE_HUMANS ? + "sound/buildables/human/destroyed" : "sound/buildables/alien/construct2" ); +} + /* ================ freeBuildable @@ -644,7 +651,9 @@ void ASpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int new->fate = ( attacker && attacker->client && attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) ? BF_TEAMKILLED : BF_DESTROYED; new->next = NULL; G_LogBuild( new ); - + + G_BuildableDeathSound( self ); + G_SetBuildableAnim( self, BANIM_DESTROY1, qtrue ); G_SetIdleBuildableAnim( self, BANIM_DESTROYED ); @@ -958,7 +967,9 @@ void ABarricade_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, new->fate = ( attacker && attacker->client && attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) ? BF_TEAMKILLED : BF_DESTROYED; new->next = NULL; G_LogBuild( new ); - + + G_BuildableDeathSound( self ); + G_SetBuildableAnim( self, BANIM_DESTROY1, qtrue ); G_SetIdleBuildableAnim( self, BANIM_DESTROYED ); @@ -1408,6 +1419,8 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int new->next = NULL; G_LogBuild( new ); + G_BuildableDeathSound( self ); + VectorCopy( self->s.origin2, dir ); //do a bit of radius damage @@ -2480,7 +2493,9 @@ void HSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int new->fate = ( attacker && attacker->client && attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) ? BF_TEAMKILLED : BF_DESTROYED; new->next = NULL; G_LogBuild( new ); - + + G_BuildableDeathSound( self ); + //pretty events and cleanup G_SetBuildableAnim( self, BANIM_DESTROY1, qtrue ); G_SetIdleBuildableAnim( self, BANIM_DESTROYED ); |