nukeykt / NBlood

Reverse-engineered ports of Build games using EDuke32 engine technology and development principles (NBlood/Rednukem/PCExhumed)
620 stars 78 forks source link

Blood: Fix enemy death sfx getting cut and fix cultist sfx not getting cut on death #854

Closed tmyqlfpir closed 1 month ago

tmyqlfpir commented 1 month ago

This PR fixes a common issue of channels being cut out upon an enemy's death, and resolves an original game bug of cultist alerts continuing to play on death.

When an enemy is killed by a hitscan weapon such as the shotgun or tommy gun, it'll spawn a spurt of blood that has a random chance of triggering a splattering sfx upon hitting the ground - and cutting off the still ongoing enemy death sfx. This PR will set the sound effect trigger to only play if the channel is available, instead of cutting off the voice.

For cultists, when they are killed at point blank range with the shotgun, it'll trigger the activate callout sfx, then the death sfx in the same tick. This PR resolves this by setting all cultists to use their own unique channel slot for callouts, so they are cut off upon dying or getting hurt.

Fixes #804

Hendricks266 commented 1 month ago

Looks great. Only comments: I would prefer if Blood: Tweak aiActivateDude() nChannel variable were squashed into Blood: Mute cultist alert calls on death, rather than implementing something one way and changing it later in the same patchset. Also, should the literal 16384 used for the definition of nChannel be some macro constant? I'm guessing MAXSPRITES.

tmyqlfpir commented 1 month ago

Sure, I'll do that, and comment about the unique magic number use for the nChannel variable.