From cd5441d87558efda69666ebb6fff942ea4493d1a Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 22 Jul 2018 19:06:48 +0000 Subject: [PATCH] Added additional dialogue call for death of a character (ADE_NPC_DEATH = 16) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8585 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Dialogue Control.h | 5 +++++ Tactical/Soldier Ani.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/Tactical/Dialogue Control.h b/Tactical/Dialogue Control.h index cee767d5..3aeeea16 100644 --- a/Tactical/Dialogue Control.h +++ b/Tactical/Dialogue Control.h @@ -361,6 +361,7 @@ enum AdditionalDialogEvents ADE_SKILL_RESULT, // we used a skill, and comment on the result ADE_GRENADEWARNING, // a delayed enemy grenade was dropped nearby ADE_CONSUMEITEM, // we applied an item to us + ADE_NPC_DEATH, // someone died }; // We call this function from several places. It uses the dialogue functions, but calls a Lua script to know whether something, and what, should be said @@ -375,6 +376,10 @@ void AdditionalTacticalCharacterDialogue_AllInSector( INT16 aSectorX, INT16 aSec void AdditionalTacticalCharacterDialogue_AllInSectorRadiusCall( UINT8 ausIgnoreProfile, UINT16 usEventNr, UINT32 aData1 = 0, UINT32 aData2 = 0, UINT32 aData3 = 0, INT32 aAroundGridno = -1, INT32 aRadius = 0 ); +void SetQuoteStr( STR16 aStr ); + +BOOLEAN LuaCallsToDoDialogueStuff( UINT8 ubProfile, INT32 iFaceIndex, const char* azSoundString ); + // Flugente: replace text with other text BOOLEAN ReplaceTextWithOtherText( CHAR16 *pFinishedString, CHAR16 compare[32], CHAR16 replace[32] ); diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index 1b85b748..1066fded 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -4096,6 +4096,13 @@ BOOLEAN HandleSoldierDeath( SOLDIERTYPE *pSoldier , BOOLEAN *pfMadeCorpse ) DeleteVIP( pSoldier->sSectorX, pSoldier->sSectorY ); } + // Flugente: additional dialogue + if ( pSoldier->ubProfile != NO_PROFILE ) + { + AdditionalTacticalCharacterDialogue_AllInSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ, pSoldier->ubProfile, ADE_NPC_DEATH, + pSoldier->ubProfile, pKillerSoldier ? pKillerSoldier->ubProfile : 0, pSoldier->ubBodyType ); + } + // Remove mad as target, one he has died! RemoveManAsTarget( pSoldier );