Half-Life: Make player death-flatline a sound shader

This commit is contained in:
Marco Cawthorne 2020-04-28 06:13:22 +02:00
parent 7c1921ae05
commit cf34e1d678
6 changed files with 9 additions and 7 deletions

View File

@ -24,7 +24,8 @@ void Game_Worldspawn(void)
{
precache_model("models/player.mdl");
precache_model("models/w_weaponbox.mdl");
precache_sound("fvox/flatline.wav");
Sound_Precache("player.die");
Sound_Precache("player.fall");
Player_Precache();
Weapons_Init();

View File

@ -25,9 +25,10 @@ Game_Worldspawn(void)
{
Sound_Precache("ammo.pickup");
Sound_Precache("ammo.respawn");
Sound_Precache("player.die");
Sound_Precache("player.fall");
precache_model("models/player.mdl");
precache_model("models/w_weaponbox.mdl");
precache_sound("fvox/flatline.wav");
Weapons_Init();
Player_Precache();
}

View File

@ -67,7 +67,7 @@ HLMultiplayerRules::PlayerDeath(player pl)
pl.think = PutClientInServer;
pl.nextthink = time + 4.0f;
sound(pl, CHAN_AUTO, "fvox/flatline.wav", 1.0, ATTN_NORM);
Sound_Play(pl, CHAN_AUTO, "player.die");
if (pl.health < -50) {
pl.health = 0;

View File

@ -22,7 +22,7 @@ HLSingleplayerRules::PlayerDeath(player pl)
pl.takedamage = DAMAGE_NO;
pl.flags &= ~FL_FLASHLIGHT;
pl.armor = pl.activeweapon = pl.g_items = 0;
sound(pl, CHAN_AUTO, "fvox/flatline.wav", 1.0, ATTN_NORM);
Sound_Play(pl, CHAN_AUTO, "player.die");
if (pl.health < -50) {
pl.health = 0;

View File

@ -17,7 +17,6 @@
void
Game_InitRules(void)
{
print("Game_InitRules!\n");
if (cvar("sv_playerslots") == 1 || cvar("coop") == 1) {
g_grMode = spawn(HLSingleplayerRules);
} else {
@ -30,9 +29,10 @@ Game_Worldspawn(void)
{
Sound_Precache("ammo.pickup");
Sound_Precache("ammo.respawn");
Sound_Precache("player.die");
Sound_Precache("player.fall");
precache_model("models/player.mdl");
precache_model("models/w_weaponbox.mdl");
precache_sound("fvox/flatline.wav");
Weapons_Init();
Player_Precache();
}

View File

@ -32,7 +32,7 @@ void GamePMove_Fall(player target, float impactspeed)
#ifdef SERVER
float fFallDamage = (impactspeed - 580) * (100 / (1024 - 580));
Damage_Apply(self, world, fFallDamage, 0, DMG_FALL);
sound(self, CHAN_AUTO, "player/pl_fallpain3.wav", 1.0, ATTN_NORM);
Sound_Play(self, CHAN_AUTO, "player.fall");
#endif
}
}