Pain sounds, death sounds, silly bug fixes... ugh!
This commit is contained in:
parent
249eb2d94f
commit
3827446805
6 changed files with 41 additions and 8 deletions
|
@ -74,11 +74,11 @@ void Damage_Apply( entity eTarget, entity eAttacker, int iDamage, vector vHitPos
|
|||
|
||||
if ( trace_surface_id == BODY_HEAD ) {
|
||||
iDamage *= 4;
|
||||
} else if ( iDamage == BODY_STOMACH ) {
|
||||
} else if ( trace_surface_id == BODY_STOMACH ) {
|
||||
iDamage *= 0.9;
|
||||
} else if ( iDamage == BODY_LEGLEFT ) {
|
||||
} else if ( trace_surface_id == BODY_LEGLEFT ) {
|
||||
iDamage *= 0.9;
|
||||
} else if ( iDamage == BODY_LEGRIGHT ) {
|
||||
} else if ( trace_surface_id == BODY_LEGRIGHT ) {
|
||||
iDamage *= 0.9;
|
||||
}
|
||||
|
||||
|
@ -112,6 +112,13 @@ void Damage_Apply( entity eTarget, entity eAttacker, int iDamage, vector vHitPos
|
|||
if ( self.health <= 0 ) {
|
||||
self.health = 0;
|
||||
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 );
|
||||
}
|
||||
} else {
|
||||
self.vPain();
|
||||
}
|
||||
|
|
|
@ -84,6 +84,20 @@ void worldspawn( void ) {
|
|||
precache_sound( "player/pl_step3.wav" );
|
||||
precache_sound( "player/pl_step4.wav" );
|
||||
|
||||
precache_sound( "player/pl_pain2.wav" );
|
||||
precache_sound( "player/pl_pain4.wav" );
|
||||
precache_sound( "player/pl_pain5.wav" );
|
||||
precache_sound( "player/pl_pain6.wav" );
|
||||
precache_sound( "player/pl_pain7.wav" );
|
||||
|
||||
precache_sound( "player/die1.wav" );
|
||||
precache_sound( "player/die2.wav" );
|
||||
precache_sound( "player/die3.wav" );
|
||||
|
||||
precache_sound( "player/headshot1.wav" );
|
||||
precache_sound( "player/headshot2.wav" );
|
||||
precache_sound( "player/headshot3.wav" );
|
||||
|
||||
precache_sound( "items/9mmclip1.wav" );
|
||||
precache_sound( "items/tr_kevlar.wav" );
|
||||
precache_sound( "items/gunpickup2.wav" );
|
||||
|
|
|
@ -38,17 +38,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
return TRUE;
|
||||
}*/
|
||||
|
||||
string sPainSounds[5] = {
|
||||
"player/pl_pain2.wav",
|
||||
"player/pl_pain4.wav",
|
||||
"player/pl_pain5.wav",
|
||||
"player/pl_pain6.wav",
|
||||
"player/pl_pain7.wav"
|
||||
};
|
||||
|
||||
void Player_Pain( void ) {
|
||||
|
||||
sound( self, CHAN_VOICE, sPainSounds[ floor( random() * 5 ) ], 1, ATTN_IDLE );
|
||||
self.velocity = '0 0 0';
|
||||
}
|
||||
|
||||
void Player_Death( void ) {
|
||||
|
||||
// Drop a corpse
|
||||
entity eCorpse = spawn();
|
||||
setorigin( eCorpse, self.origin );
|
||||
setmodel( eCorpse, self.model );
|
||||
eCorpse.angles = self.angles;
|
||||
setsize( eCorpse, self.mins, self.maxs );
|
||||
eCorpse.angles = [ 0, self.angles_y, 0 ];
|
||||
eCorpse.movetype = MOVETYPE_BOUNCE;
|
||||
eCorpse.frame = 93; // TODO: Pick the right frame
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ void Spawn_RespawnClient( float fTeam ) {
|
|||
self.flags = FL_CLIENT;
|
||||
self.vPain = Player_Pain;
|
||||
self.vDeath = Player_Death;
|
||||
self.iBleeds = TRUE;
|
||||
|
||||
self.origin = eSpawn.origin;
|
||||
self.angles = eSpawn.angles;
|
||||
|
|
|
@ -31,7 +31,7 @@ void BaseMelee_Attack( void ) {
|
|||
|
||||
makevectors( self.v_angle );
|
||||
vSource = ( self.origin + self.view_ofs );
|
||||
traceline( vSource, vSource + ( v_forward * 64 ), FALSE, self );
|
||||
traceline( vSource, vSource + ( v_forward * 64 ), MOVE_HITMODEL, self );
|
||||
|
||||
if ( trace_fraction == 1.0 )
|
||||
return;
|
||||
|
@ -41,6 +41,8 @@ void BaseMelee_Attack( void ) {
|
|||
if ( trace_ent.takedamage ) {
|
||||
Damage_Apply( trace_ent, self, wptTable[ self.weapon ].iDamage, trace_endpos );
|
||||
return;
|
||||
} else {
|
||||
pointparticles( EFFECT_GUNSHOT, trace_endpos, trace_plane_normal, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ weaponinfo_t wptKNIFE = {
|
|||
64, // Bullet Range
|
||||
0.75, // Range Modifier
|
||||
TYPE_SEMI, // Firing Type
|
||||
0.3, // Attack-Delay
|
||||
0.7, // Attack-Delay
|
||||
1.0, // Reload-Delay
|
||||
iAmmo_9MM, // Caliber Pointer
|
||||
iMag_GLOCK18, // Clip Pointer
|
||||
|
|
Loading…
Reference in a new issue