Precaches and stuff

This commit is contained in:
Marco Cawthorne 2017-01-03 19:46:19 +01:00
parent 3827446805
commit 07b147331c
2 changed files with 43 additions and 6 deletions

View file

@ -77,9 +77,9 @@ void Damage_Apply( entity eTarget, entity eAttacker, int iDamage, vector vHitPos
} else if ( trace_surface_id == BODY_STOMACH ) {
iDamage *= 0.9;
} else if ( trace_surface_id == BODY_LEGLEFT ) {
iDamage *= 0.9;
iDamage *= 0.4;
} else if ( trace_surface_id == BODY_LEGRIGHT ) {
iDamage *= 0.9;
iDamage *= 0.4;
}
bprint( sprintf( "[DEBUG] Hit Bodypart: %s\n", Damage_GetHitLocation( trace_surface_id ) ) );
@ -114,10 +114,13 @@ void Damage_Apply( entity eTarget, entity eAttacker, int iDamage, vector vHitPos
self.vDeath();
// Make a cooky death sound
if ( trace_surface_id == BODY_HEAD ) {
sound( self, CHAN_VOICE, sprintf( "player/headshot%d.wav", floor( ( random() * 3 ) + 1 ) ), 1, ATTN_NORM );
} else {
sound( self, CHAN_VOICE, sprintf( "player/die%d.wav", floor( ( random() * 3 ) + 1 ) ), 1, ATTN_NORM );
if ( self.classname == "player" ) {
if ( trace_surface_id == BODY_HEAD ) {
sound( self, CHAN_VOICE, sprintf( "player/headshot%d.wav", floor( ( random() * 3 ) + 1 ) ), 1, ATTN_NORM );
} else {
sound( self, CHAN_VOICE, sprintf( "player/die%d.wav", floor( ( random() * 3 ) + 1 ) ), 1, ATTN_NORM );
}
}
} else {
self.vPain();

View file

@ -262,6 +262,40 @@ void worldspawn( void ) {
precache_sound( "weapons/xm1014-1.wav" );
precache_sound( "weapons/zoom.wav" );
precache_sound( "debris/glass1.wav" );
precache_sound( "debris/glass2.wav" );
precache_sound( "debris/glass3.wav" );
precache_sound( "debris/wood1.wav" );
precache_sound( "debris/wood2.wav" );
precache_sound( "debris/wood3.wav" );
precache_sound( "debris/metal1.wav" );
precache_sound( "debris/metal2.wav" );
precache_sound( "debris/metal3.wav" );
precache_sound( "debris/flesh1.wav" );
precache_sound( "debris/flesh2.wav" );
precache_sound( "debris/flesh3.wav" );
precache_sound( "debris/flesh4.wav" );
precache_sound( "debris/flesh5.wav" );
precache_sound( "debris/flesh6.wav" );
precache_sound( "debris/flesh7.wav" );
precache_sound( "debris/concrete1.wav" );
precache_sound( "debris/concrete2.wav" );
precache_sound( "debris/concrete3.wav" );
precache_sound( "debris/bustglass1.wav" );
precache_sound( "debris/bustglass2.wav" );
precache_sound( "debris/bustwood1.wav" );
precache_sound( "debris/bustwood2.wav" );
precache_sound( "debris/bustmetal1.wav" );
precache_sound( "debris/bustmetal2.wav" );
precache_sound( "debris/bustflesh1.wav" );
precache_sound( "debris/bustflesh2.wav" );
precache_sound( "debris/bustconcrete1.wav" );
precache_sound( "debris/bustconcrete2.wav" );
precache_sound( "debris/bustconcrete3.wav" );
precache_sound( "debris/bustceiling1.wav" );
precache_sound( "debris/bustceiling2.wav" );
precache_sound( "debris/bustceiling3.wav" );
lightstyle( 0, "m" );
lightstyle( 1, "mmnmmommommnonmmonqnmmo" );
lightstyle( 2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba" );