From 1c107bd8778b835576fd8bf85a45e707bc76ab7f Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 29 Nov 2017 07:29:40 +0000 Subject: [PATCH] CON: Add EVENT_RECOGSOUND. Set RETURN to -1 to disable the sound played when an enemy awaken. You have to use a command to play a sound, because the bosses use globalsound. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6517 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/actors.cpp | 3 +++ source/duke3d/src/events_defs.h | 1 + source/duke3d/src/game.cpp | 1 + source/duke3d/src/gamedef.cpp | 1 + 4 files changed, 6 insertions(+) diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index 03c06eba2..68ddfb29f 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -8123,6 +8123,9 @@ void A_PlayAlertSound(int spriteNum) { if (sprite[spriteNum].extra > 0) { + if ((VM_OnEventWithReturn(EVENT_RECOGSOUND, spriteNum, myconnectindex, 0)) != 0) + return; + switch (DYNAMICTILEMAP(PN(spriteNum))) { case LIZTROOPONTOILET__STATIC: diff --git a/source/duke3d/src/events_defs.h b/source/duke3d/src/events_defs.h index 73724c592..e268dae36 100644 --- a/source/duke3d/src/events_defs.h +++ b/source/duke3d/src/events_defs.h @@ -131,6 +131,7 @@ enum GameEvent_t { EVENT_DISPLAYROOMSEND, EVENT_DISPLAYEND, EVENT_OPENMENUSOUND, + EVENT_RECOGSOUND, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 6793459fe..9f8e3ed03 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -1557,6 +1557,7 @@ int A_Spawn(int spriteNum, int tileNum) if (sprite[spriteNum].picnum == RESPAWN) pActor->tempang = sprite[newSprite].pal = sprite[spriteNum].pal; + A_PlayAlertSound(newSprite); changespritestat(newSprite, STAT_ACTOR); } else diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 5cbf8a1e9..4e5297486 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -727,6 +727,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_DISPLAYROOMSEND", "EVENT_DISPLAYEND", "EVENT_OPENMENUSOUND", + "EVENT_RECOGSOUND", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif