by Graf Zahl » Sat Nov 20, 2004 11:05 am
...and here is the result of my playing around with the player's death sounds. I just wanted to know whether it is possible to remove all the game mode checks from A_PlayerScream so all different death sounds can be defined in each game. It seems to work properly with all games.
Code: Select all
void A_PlayerScream (AActor *self)
{
int sound=0;
int chan = CHAN_VOICE;
if (self->player == NULL || self->player->morphTics != 0)
{
S_SoundID (self, CHAN_VOICE, self->DeathSound, 1, ATTN_NORM);
return;
}
// Handle the different player death screams
if ((((level.flags >> 15) | (dmflags)) &
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) &&
self->momz <= -39*FRACUNIT)
{
sound = S_FindSkinnedSound(self, "*splat");
chan = CHAN_BODY;
}
// try to find the appropriate death sound and use suitable replacements if necessary
if (!sound && self->special1<10)
{
sound = S_FindSkinnedSound(self, "*wimpydeath");
}
if (!sound && self->health<=-50)
{
if (self->health>-100)
{
sound = S_FindSkinnedSound(self, "*crazydeath");
}
if (!sound)
{
sound = S_FindSkinnedSound(self, "*xdeath");
if (!sound)
{
sound = S_FindSkinnedSound(self, "*gibbed");
chan = CHAN_BODY;
}
}
}
if (!sound) sound=S_FindSkinnedSound(self, "*death");
if (chan != CHAN_VOICE)
{
for (int i = 0; i < 8; ++i)
{
// Stop most playing sounds from this player.
// This is mainly to stop *land from messing up *splat.
if (i != CHAN_WEAPON && i != CHAN_VOICE)
{
S_StopSound (self, i);
}
}
}
S_SoundID (self, CHAN_VOICE, sound, 1, ATTN_NORM);
}
...and here is the result of my playing around with the player's death sounds. I just wanted to know whether it is possible to remove all the game mode checks from A_PlayerScream so all different death sounds can be defined in each game. It seems to work properly with all games.
[code]
void A_PlayerScream (AActor *self)
{
int sound=0;
int chan = CHAN_VOICE;
if (self->player == NULL || self->player->morphTics != 0)
{
S_SoundID (self, CHAN_VOICE, self->DeathSound, 1, ATTN_NORM);
return;
}
// Handle the different player death screams
if ((((level.flags >> 15) | (dmflags)) &
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) &&
self->momz <= -39*FRACUNIT)
{
sound = S_FindSkinnedSound(self, "*splat");
chan = CHAN_BODY;
}
// try to find the appropriate death sound and use suitable replacements if necessary
if (!sound && self->special1<10)
{
sound = S_FindSkinnedSound(self, "*wimpydeath");
}
if (!sound && self->health<=-50)
{
if (self->health>-100)
{
sound = S_FindSkinnedSound(self, "*crazydeath");
}
if (!sound)
{
sound = S_FindSkinnedSound(self, "*xdeath");
if (!sound)
{
sound = S_FindSkinnedSound(self, "*gibbed");
chan = CHAN_BODY;
}
}
}
if (!sound) sound=S_FindSkinnedSound(self, "*death");
if (chan != CHAN_VOICE)
{
for (int i = 0; i < 8; ++i)
{
// Stop most playing sounds from this player.
// This is mainly to stop *land from messing up *splat.
if (i != CHAN_WEAPON && i != CHAN_VOICE)
{
S_StopSound (self, i);
}
}
}
S_SoundID (self, CHAN_VOICE, sound, 1, ATTN_NORM);
}
[/code]