Skip to content

Commit

Permalink
Blood: Mute cultist alert calls on death
Browse files Browse the repository at this point in the history
  • Loading branch information
tmyqlfpir committed Oct 21, 2024
1 parent 23dd7f3 commit 79aeb5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions source/blood/src/actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3137,6 +3137,8 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType,
case kDudeCultistShotgun:
case kDudeCultistTesla:
case kDudeCultistTNT:
if (!VanillaMode()) // kill all cultist idle alerts on death
sfxKill3DSound(pSprite, 16384+pSprite->index, -1);
sfxPlay3DSound(pSprite, 1018+Random(2), -1, 0);
if (nSeq == 3)
seqSpawn(dudeInfo[nType].seqStartID+nSeq, 3, nXSprite, nDudeToGibClient2);
Expand Down
21 changes: 12 additions & 9 deletions source/blood/src/ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,9 @@ void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
case kMediumNormal:
aiNewState(pSprite, pXSprite, &cultistSearch);
if (Chance(0x8000)) {
if (pSprite->type == kDudeCultistTommy) aiPlay3DSound(pSprite, 4008+Random(5), AI_SFX_PRIORITY_1, -1);
else aiPlay3DSound(pSprite, 1008+Random(5), AI_SFX_PRIORITY_1, -1);
const int nChannel = !VanillaMode() ? 16384+pSprite->index : -1;
if (pSprite->type == kDudeCultistTommy) aiPlay3DSound(pSprite, 4008+Random(5), AI_SFX_PRIORITY_1, nChannel);
else aiPlay3DSound(pSprite, 1008+Random(5), AI_SFX_PRIORITY_1, nChannel);
}
break;
case kMediumWater:
Expand All @@ -390,8 +391,9 @@ void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
}
} else {
if (Chance(0x8000)) {
if (pSprite->type == kDudeCultistTommy) aiPlay3DSound(pSprite, 4003+Random(4), AI_SFX_PRIORITY_1, -1);
else aiPlay3DSound(pSprite, 1003+Random(4), AI_SFX_PRIORITY_1, -1);
const int nChannel = !VanillaMode() ? 16384+pSprite->index : -1;
if (pSprite->type == kDudeCultistTommy) aiPlay3DSound(pSprite, 4003+Random(4), AI_SFX_PRIORITY_1, nChannel);
else aiPlay3DSound(pSprite, 1003+Random(4), AI_SFX_PRIORITY_1, nChannel);
}
switch (pXSprite->medium) {
case kMediumNormal:
Expand All @@ -412,6 +414,7 @@ void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
return;
#endif
case kDudeCultistTommyProne: {
const int nChannel = !VanillaMode() ? 16384+pSprite->index : -1;
DUDEEXTRA_STATS *pDudeExtraE = &gDudeExtra[pSprite->extra].stats;
pDudeExtraE->active = 1;
pSprite->type = kDudeCultistTommy;
Expand All @@ -420,7 +423,7 @@ void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
case 0:
aiNewState(pSprite, pXSprite, &cultistSearch);
if (Chance(0x8000))
aiPlay3DSound(pSprite, 4008+Random(5), AI_SFX_PRIORITY_1, -1);
aiPlay3DSound(pSprite, 4008+Random(5), AI_SFX_PRIORITY_1, nChannel);
break;
case kMediumWater:
case kMediumGoo:
Expand All @@ -429,8 +432,7 @@ void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
}
} else {
if (Chance(0x8000))
aiPlay3DSound(pSprite, 4008+Random(5), AI_SFX_PRIORITY_1, -1);

aiPlay3DSound(pSprite, 4008+Random(5), AI_SFX_PRIORITY_1, nChannel);
switch (pXSprite->medium) {
case kMediumNormal:
aiNewState(pSprite, pXSprite, &cultistProneChase);
Expand All @@ -445,6 +447,7 @@ void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
}
case kDudeCultistShotgunProne:
{
const int nChannel = !VanillaMode() ? 16384+pSprite->index : -1;
DUDEEXTRA_STATS *pDudeExtraE = &gDudeExtra[pSprite->extra].stats;
pDudeExtraE->active = 1;
pSprite->type = kDudeCultistShotgun;
Expand All @@ -455,7 +458,7 @@ void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
case kMediumNormal:
aiNewState(pSprite, pXSprite, &cultistSearch);
if (Chance(0x8000))
aiPlay3DSound(pSprite, 1008+Random(5), AI_SFX_PRIORITY_1, -1);
aiPlay3DSound(pSprite, 1008+Random(5), AI_SFX_PRIORITY_1, nChannel);
break;
case kMediumWater:
case kMediumGoo:
Expand All @@ -466,7 +469,7 @@ void aiActivateDude(spritetype *pSprite, XSPRITE *pXSprite)
else
{
if (Chance(0x8000))
aiPlay3DSound(pSprite, 1003+Random(4), AI_SFX_PRIORITY_1, -1);
aiPlay3DSound(pSprite, 1003+Random(4), AI_SFX_PRIORITY_1, nChannel);
switch (pXSprite->medium)
{
case kMediumNormal:
Expand Down

0 comments on commit 79aeb5a

Please sign in to comment.