New feature: additional dialogue allows modders to play additional dialogue on man occasions, including reactions to other people speaking

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=tree&goto=351982&#msg_351982 and for a demonstration http://thepit.ja-galaxy-forum.com/index.php?t=tree&goto=351981&#msg_351981

Requires GameDir >= r2400

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8516 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2018-01-10 23:41:52 +00:00
parent fadb7710e6
commit dd3129ac11
18 changed files with 429 additions and 80 deletions
+156 -5
View File
@@ -1374,7 +1374,23 @@ void HandleDialogue( )
//ExecuteCharacterDialogue( QItem->ubCharacterNum, QItem->usQuoteNum, QItem->iFaceIndex, DIALOGUE_TACTICAL_UI, TRUE );
ExecuteSnitchCharacterDialogue( QItem->ubCharacterNum, QItem->usQuoteNum, QItem->iFaceIndex, QItem->bUIHandlerID, QItem->uiSpecialEventData2, QItem->uiSpecialEventData3, QItem->uiSpecialEventData4 );
}
// Flugente: additional dialogue
else if ( QItem->uiSpecialEventData & MULTIPURPOSE_SPECIAL_EVENT_ADDITIONAL_DIALOGUE )
{
// Flugente: only set up face if we can access correctly
if ( QItem->iFaceIndex >= 0 )
{
// Setup face pointer
gpCurrentTalkingFace = &gFacesData[QItem->iFaceIndex];
}
gubCurrentTalkingID = QItem->iFaceIndex;
extern BOOLEAN ExecuteAdditionalCharacterDialogue( UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3 );
ExecuteAdditionalCharacterDialogue( QItem->ubCharacterNum, QItem->iFaceIndex, QItem->usQuoteNum, QItem->uiSpecialEventData2, QItem->uiSpecialEventData3, QItem->uiSpecialEventData4 );
}
#ifdef JA2UB
//JA25 UB
if ( QItem->uiSpecialEventData & MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING )
@@ -1671,6 +1687,9 @@ BOOLEAN SnitchTacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNu
if (pSoldier->stats.bLife < CONSCIOUSNESS )
return( FALSE );
if ( pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_CRYO] )
return FALSE;
if (pSoldier->stats.bLife < OKLIFE && usQuoteNum != QUOTE_SERIOUSLY_WOUNDED )
return( FALSE );
@@ -1703,6 +1722,81 @@ BOOLEAN SnitchTacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNu
DIALOGUE_TACTICAL_UI, TRUE, FALSE ) );
}
// Flugente: additional dialogue
// 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
// This allows us to call a lot of very specific dialogue for individual mercs without the need to define what exactly should be said in the code -
// a modder can simply control in Lua what should happen
BOOLEAN AdditionalTacticalCharacterDialogue_CallsLua( SOLDIERTYPE *pSoldier, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3 )
{
// Haydent
if ( is_client )
return( FALSE ); //somewhere amongst all this it causes a puase of merc movement while making the quote which throws out the movement sync between clients... : hayden.
if ( pSoldier->ubProfile == NO_PROFILE )
return( FALSE );
#if (defined JA2UB)
//Ja25 no meanwhiles
#else
if ( AreInMeanwhile() )
return( FALSE );
#endif
if ( pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_CRYO] )
return FALSE;
if ( pSoldier->stats.bLife < OKLIFE )
return( FALSE );
if ( pSoldier->flags.uiStatusFlags & SOLDIER_GASSED )
return( FALSE );
if ( ( AM_A_ROBOT( pSoldier ) ) )
return( FALSE );
if ( pSoldier->bAssignment == ASSIGNMENT_POW )
return( FALSE );
if ( AM_AN_EPC( pSoldier ) && !( gMercProfiles[pSoldier->ubProfile].ubMiscFlags & PROFILE_MISC_FLAG_FORCENPCQUOTE ) )
return( FALSE );
// we actually use the snitch function here, and simply deviate later on due to marking this with MULTIPURPOSE_SPECIAL_EVENT_ADDITIONAL_DIALOGUE
return( SnitchCharacterDialogue( pSoldier->ubProfile, usEventNr, pSoldier->iFaceIndex,
DIALOGUE_SPECIAL_EVENT_MULTIPURPOSE, MULTIPURPOSE_SPECIAL_EVENT_ADDITIONAL_DIALOGUE,
aData1, aData2, aData3,
DIALOGUE_TACTICAL_UI, TRUE, FALSE ) );
}
// call event for all mercs in a sector
void AdditionalTacticalCharacterDialogue_AllInSector(INT16 aSectorX, INT16 aSectorY, INT8 aSectorZ, UINT8 ausIgnoreProfile,
UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3, INT32 aAroundGridno, INT32 aRadius )
{
SOLDIERTYPE* pSoldier;
int cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt, pSoldier++ )
{
if ( pSoldier->stats.bLife >= OKLIFE && pSoldier->bActive &&
pSoldier->ubProfile != ausIgnoreProfile &&
pSoldier->sSectorX == aSectorX && pSoldier->sSectorY == aSectorY && pSoldier->bSectorZ == aSectorZ &&
pSoldier->bAssignment != ASSIGNMENT_POW && pSoldier->bAssignment != IN_TRANSIT &&
(aAroundGridno == NOWHERE || PythSpacesAway( pSoldier->sGridNo, aAroundGridno ) <= aRadius ) &&
!pSoldier->flags.fBetweenSectors )
{
AdditionalTacticalCharacterDialogue_CallsLua( pSoldier, usEventNr, aData1, aData2, aData3 );
}
}
}
void AdditionalTacticalCharacterDialogue_AllInSectorRadiusCall( UINT8 ausIgnoreProfile,
UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3, INT32 aAroundGridno, INT32 aRadius )
{
return AdditionalTacticalCharacterDialogue_AllInSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, ausIgnoreProfile,
usEventNr, aData1, aData2, aData3, aAroundGridno, aRadius );
}
// This function takes a profile num, quote num, faceindex and a UI hander ID.
// What it does is queues up the dialog to be ultimately loaded/displayed
// FACEINDEX
@@ -1785,7 +1879,6 @@ BOOLEAN CharacterDialogueWithSpecialEventEx( UINT8 ubCharacterNum, UINT16 usQuot
return( TRUE );
}
BOOLEAN CharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, INT32 iFaceIndex, UINT8 bUIHandlerID, BOOLEAN fFromSoldier, BOOLEAN fDelayed )
{
DIALOGUE_Q_STRUCT *QItem;
@@ -1813,6 +1906,22 @@ BOOLEAN CharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, INT32 iFaceI
// Add to queue
ghDialogueQ = AddtoQueue( ghDialogueQ, &QItem );
// Flugente: additional dialogue
// in the dialogue screen, only the merc doing the talking may answer
if ( bUIHandlerID == DIALOGUE_NPC_UI )
{
if ( gusSelectedSoldier != NOBODY )
{
AdditionalTacticalCharacterDialogue_CallsLua( MercPtrs[gusSelectedSoldier], ADE_DIALOGUE_REACTION, ubCharacterNum, usQuoteNum );
}
}
// if teammembers talk, anyone may answer
else
{
// other teammembers might react to this line
AdditionalTacticalCharacterDialogue_AllInSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, ubCharacterNum, ADE_DIALOGUE_REACTION, ubCharacterNum, usQuoteNum );
}
return( TRUE );
}
@@ -2075,15 +2184,57 @@ BOOLEAN ExecuteSnitchCharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum,
gbUIHandlerID = DIALOGUE_TACTICAL_UI;
guiScreenIDUsedWhenUICreated = guiCurrentScreen;
return( TRUE );
}
return( TRUE );
}
// Flugente: additional dialogue
extern void LuaHandleAdditionalDialogue( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3 );
BOOLEAN ExecuteAdditionalCharacterDialogue( UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3 )
{
SOLDIERTYPE *pSoldier = FindSoldierByProfileID( ubProfile, TRUE );
if ( !pSoldier )
return FALSE;
// call Lua script on whether we can play something here, and get text and sound file
LuaHandleAdditionalDialogue( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ, ubProfile, iFaceIndex, usEventNr, aData1, aData2, aData3 );
return( TRUE );
}
void SetQuoteStr( STR16 aStr )
{
//Copy the original string over to the temp string
wcscpy( gzQuoteStr, aStr );
}
BOOLEAN LuaCallsToDoDialogueStuff( UINT8 ubProfile, INT32 iFaceIndex, const char* azSoundString )
{
SOLDIERTYPE *pSoldier = FindSoldierByProfileID( ubProfile, TRUE );
if ( !pSoldier )
return FALSE;
// in order to stop modders from crashing the game by calling this function a million times, we can only say one thing at a time
if ( IsFaceTalking( iFaceIndex ) )
return FALSE;
SetFaceTalking( iFaceIndex, (char*)azSoundString, gzQuoteStr, RATE_11025, 30, 1, MIDDLEPAN );
CreateTalkingUI( DIALOGUE_TACTICAL_UI, iFaceIndex, ubProfile, pSoldier, gzQuoteStr );
// Set global handleer ID value, used when face desides it's done...
gbUIHandlerID = DIALOGUE_TACTICAL_UI;
guiScreenIDUsedWhenUICreated = guiCurrentScreen;
return TRUE;
}
void CreateTalkingUI( INT8 bUIHandlerID, INT32 iFaceIndex, UINT8 ubCharacterNum, SOLDIERTYPE *pSoldier, STR16 zQuoteStr )
{
// Show text, if on
if ( gGameSettings.fOptions[ TOPTION_SUBTITLES ] || !gFacesData[ iFaceIndex ].fValidSpeech )
{
+33
View File
@@ -276,6 +276,7 @@ enum DialogQuoteIDs
#endif
#define MULTIPURPOSE_SPECIAL_EVENT_SNITCH_DIALOGUE 0x00000004
#define MULTIPURPOSE_SPECIAL_EVENT_ADDITIONAL_DIALOGUE 0x00000008
#ifdef JA2UB
enum{
@@ -341,6 +342,38 @@ BOOLEAN TacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNum );
BOOLEAN SnitchTacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNum, UINT8 ubEventType, UINT8 ubTargetProfile, UINT8 ubSecondaryTargetProfile );
// Flugente: additional dialogue
enum AdditionalDialogEvents
{
ADE_DISCOVER_ROOM = 0, // merc is the 1st one to explore this room
ADE_DIALOGUE_REACTION, // someone else used a line, and we might answer to that
ADE_OMERTA_ENTRY, // similar to an IMP, we can comment upon the initial Omerta landing
ADE_SECTOR_COMMENTARY, // similar to the rebel's quotes, this is called upon visiting a sector for the first time
ADE_MERCHANT_CHAT, // we greet a merchant (used with non-profile merchants, in order to be a bit more lively)
ADE_DIALOGUE_NPC_FRIENDLY, // in a conversation, we can say something when clicking on a button
ADE_DIALOGUE_NPC_DIRECT,
ADE_DIALOGUE_NPC_THREATEN,
ADE_DIALOGUE_NPC_RECRUIT,
ADE_DIALOGUE_NPC_REPEAT,
ADE_DIALOGUE_RPC_RECRUIT_SUCCESS, // we've successfully recruited an RPC, and might comment on that
ADE_SEX, // does exactly what you think it does
ADE_WEATHERCHANGE, // the weather has changed, and we can warn the player about that
ADE_SKILL_RESULT, // we used a skill, and comment on the result
ADE_GRENADEWARNING, // a delayed enemy grenade was dropped nearby
};
// 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
// This allows us to call a lot of very specific dialogue for individual mercs without the need to define what exactly should be said in the code -
// a modder can simply control in Lua what should happen
BOOLEAN AdditionalTacticalCharacterDialogue_CallsLua( SOLDIERTYPE *pSoldier, UINT16 usEventNr, UINT32 aData1 = 0, UINT32 aData2 = 0, UINT32 aData3 = 0 );
// call event for all mercs in a sector
void AdditionalTacticalCharacterDialogue_AllInSector( INT16 aSectorX, INT16 aSectorY, INT8 aSectorZ, UINT8 ausIgnoreProfile,
UINT16 usEventNr, UINT32 aData1 = 0, UINT32 aData2 = 0, UINT32 aData3 = 0, INT32 aAroundGridno = -1, INT32 aRadius = 0 );
void AdditionalTacticalCharacterDialogue_AllInSectorRadiusCall( UINT8 ausIgnoreProfile, UINT16 usEventNr,
UINT32 aData1 = 0, UINT32 aData2 = 0, UINT32 aData3 = 0, INT32 aAroundGridno = -1, INT32 aRadius = 0 );
// Flugente: replace text with other text
BOOLEAN ReplaceTextWithOtherText( CHAR16 *pFinishedString, CHAR16 compare[32], CHAR16 replace[32] );
+4 -1
View File
@@ -3148,7 +3148,10 @@ BOOLEAN SetFaceTalking( INT32 iFaceIndex, CHAR8 *zSoundFile, STR16 zTextString,
return( TRUE );
}
BOOLEAN IsFaceTalking( INT32 iFaceIndex )
{
return gFacesData[iFaceIndex].fTalking;
}
BOOLEAN SetFaceTalkingMultipleSounds( INT32 iFaceIndex, CHAR8 zSoundFiles[][64], UINT8 ubMaxSoundsCount,
STR16 zTextString, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
+10 -3
View File
@@ -52,6 +52,7 @@
#include "Quests.h"
#include "GameSettings.h"
#include "DynamicDialogue.h"// added by Flugente
#include "Dialogue Control.h" // added by Flugente
#endif
#include "connect.h"
@@ -689,13 +690,19 @@ void HandleMercArrivesQuotes( SOLDIERTYPE *pSoldier )
// If we are approaching with helicopter, don't say any ( yet )
if ( pSoldier->ubStrategicInsertionCode != INSERTION_CODE_CHOPPER )
{
// Player-generated characters issue a comment about arriving in Omerta.
if ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__PLAYER_CHARACTER)
// if we haven't met the rebels yet, characters issue some comments
if ( gubQuest[QUEST_DELIVER_LETTER] == QUESTINPROGRESS )
{
if ( gubQuest[ QUEST_DELIVER_LETTER ] == QUESTINPROGRESS )
// Player-generated characters issue a comment about arriving in Omerta.
if ( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__PLAYER_CHARACTER )
{
TacticalCharacterDialogue( pSoldier, QUOTE_PC_DROPPED_OMERTA );
}
// Flugente: additional dialogue
else
{
AdditionalTacticalCharacterDialogue_CallsLua( pSoldier, ADE_OMERTA_ENTRY );
}
}
// Check to see if anyone hates this merc and will now complain
+4
View File
@@ -2477,6 +2477,10 @@ void EnterShopKeeperInterfaceScreen_NonNPC( INT8 ubArmsDealerID, UINT8 aMercID )
gfSKIScreenExit = TRUE;
}
// Flugente: additional dialogue
if ( gusSelectedSoldier != NOBODY )
AdditionalTacticalCharacterDialogue_CallsLua( MercPtrs[gusSelectedSoldier], ADE_MERCHANT_CHAT );
LeaveTacticalScreen( SHOPKEEPER_SCREEN );
}
+21 -6
View File
@@ -14,7 +14,7 @@
#include "strategicmap.h"
#include "Map Screen Interface.h"
#include "Rotting Corpses.h"
#include "Dialogue Control.h"
extern void GetEquipmentTemplates( );
@@ -319,7 +319,10 @@ SkillSelection::Functions( UINT32 aVal )
UINT8 ubID = WhoIsThere2(sTraitsMenuTargetGridNo, 0 );
pSoldier->UseSkill(aVal, sTraitsMenuTargetGridNo, ubID);
BOOLEAN result = pSoldier->UseSkill(aVal, sTraitsMenuTargetGridNo, ubID);
// additional dialogue
AdditionalTacticalCharacterDialogue_CallsLua( pSoldier, ADE_SKILL_RESULT, aVal, result );
Cancel();
gTraitSelection.Cancel();
@@ -472,7 +475,10 @@ ArtilleryTeam::Functions( UINT32 aVal )
if ( pSoldier == NULL || !pSoldier->CanUseSkill(SKILLS_RADIO_ARTILLERY) )
return;
pSoldier->OrderArtilleryStrike(usSector, sTraitsMenuTargetGridNo, (UINT8)(aVal));
BOOLEAN result = pSoldier->OrderArtilleryStrike(usSector, sTraitsMenuTargetGridNo, (UINT8)(aVal));
// additional dialogue
AdditionalTacticalCharacterDialogue_CallsLua( pSoldier, ADE_SKILL_RESULT, SKILLS_RADIO_ARTILLERY, result );
Cancel();
gArtillerySector.Cancel();
@@ -663,7 +669,10 @@ ReinforcementNumber::Functions( UINT32 aVal )
if ( pSoldier == NULL || !pSoldier->CanUseSkill(SKILLS_RADIO_CALLREINFORCEMENTS) )
return;
pSoldier->RadioCallReinforcements(usSector, aVal);
BOOLEAN result = pSoldier->RadioCallReinforcements(usSector, aVal);
// additional dialogue
AdditionalTacticalCharacterDialogue_CallsLua( pSoldier, ADE_SKILL_RESULT, SKILLS_RADIO_CALLREINFORCEMENTS, result );
Cancel();
gReinforcementSector.Cancel();
@@ -742,7 +751,10 @@ SoldierSelection::Functions( UINT32 aVal )
if ( pSoldier == NULL )
return;
pSoldier->UseSkill(usSkill, sTraitsMenuTargetGridNo, aVal);
BOOLEAN result = pSoldier->UseSkill(usSkill, sTraitsMenuTargetGridNo, aVal);
// additional dialogue
AdditionalTacticalCharacterDialogue_CallsLua( pSoldier, ADE_SKILL_RESULT, usSkill, result );
Cancel();
gSkillSelection.Cancel();
@@ -821,7 +833,10 @@ DragSelection::Functions( UINT32 aVal )
if ( pSoldier )
{
pSoldier->UseSkill( usSkill, sTraitsMenuTargetGridNo, aVal );
BOOLEAN result = pSoldier->UseSkill( usSkill, sTraitsMenuTargetGridNo, aVal );
// additional dialogue
AdditionalTacticalCharacterDialogue_CallsLua( pSoldier, ADE_SKILL_RESULT, usSkill, result );
}
Cancel( );
+3
View File
@@ -2002,6 +2002,9 @@ BOOLEAN RecruitRPC( UINT8 ubCharNum )
HandlePlayingQuoteWhenHiringNpc( pNewSoldier->ubProfile );
#endif
// Flugente: additional dialogue
AdditionalTacticalCharacterDialogue_AllInSectorRadiusCall( ubCharNum, ADE_DIALOGUE_RPC_RECRUIT_SUCCESS, ubCharNum );
// Flugente: external scripts might have extra functionality on recruiting someone
LuaRecruitRPCAdditionalHandling( ubCharNum );
+39 -20
View File
@@ -27,6 +27,7 @@
#include "strategicmap.h"
#include "Random.h"
#include "Explosion Control.h"
#include "Dialogue Control.h" // added by Flugente
#endif
#include "Reinforcement.h"
@@ -47,7 +48,7 @@ void HandleRPCDescription( )
std::vector<UINT8> ubMercsInSector (CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS, 0);
// UINT8 ubMercsInSector[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ] = { 0 };
UINT8 ubNumMercs = 0;
UINT8 ubChosenMerc;
UINT8 ubChosenMerc = 0;
SOLDIERTYPE *pTeamSoldier;
INT32 cnt2;
BOOLEAN fSAMSite = FALSE;
@@ -91,8 +92,7 @@ void HandleRPCDescription( )
{
return;
}
gTacticalStatus.bGuideDescriptionCountDown--;
if ( gTacticalStatus.bGuideDescriptionCountDown == 0 )
@@ -102,36 +102,55 @@ void HandleRPCDescription( )
// OK, count how many rpc guys we have....
// set up soldier ptr as first element in mercptrs list
cnt2 = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
// run through list
for ( pTeamSoldier = MercPtrs[ cnt2 ]; cnt2 <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt2++,pTeamSoldier++ )
{
// Add guy if he's a candidate...
if ( RPC_RECRUITED( pTeamSoldier ) )
// run through list
for ( pTeamSoldier = MercPtrs[cnt2]; cnt2 <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt2, pTeamSoldier++ )
{
if ( pTeamSoldier->stats.bLife >= OKLIFE && pTeamSoldier->bActive &&
// Add guy if he's a candidate...
if ( RPC_RECRUITED( pTeamSoldier ) )
{
if ( pTeamSoldier->stats.bLife >= OKLIFE && pTeamSoldier->bActive &&
pTeamSoldier->sSectorX == gTacticalStatus.bGuideDescriptionSectorX && pTeamSoldier->sSectorY == gTacticalStatus.bGuideDescriptionSectorY &&
pTeamSoldier->bSectorZ == gbWorldSectorZ &&
!pTeamSoldier->flags.fBetweenSectors )
{
if ( pTeamSoldier->ubProfile == IRA ||
!pTeamSoldier->flags.fBetweenSectors )
{
if ( pTeamSoldier->ubProfile == IRA ||
pTeamSoldier->ubProfile == MIGUEL ||
pTeamSoldier->ubProfile == CARLOS ||
pTeamSoldier->ubProfile == DIMITRI )
{
ubMercsInSector[ ubNumMercs ] = (UINT8)cnt2;
ubNumMercs++;
{
ubMercsInSector[ubNumMercs] = (UINT8)cnt2;
++ubNumMercs;
}
}
}
}
// If we are > 0
if ( ubNumMercs > 0 )
{
ubChosenMerc = (UINT8)Random( ubNumMercs );
TacticalCharacterDialogueWithSpecialEvent( MercPtrs[ubMercsInSector[ubChosenMerc]], gTacticalStatus.ubGuideDescriptionToUse, DIALOGUE_SPECIAL_EVENT_USE_ALTERNATE_FILES, 0, 0 );
}
}
// If we are > 0
if ( ubNumMercs > 0 )
// Flugente: special value signifies lua-based quotes
if ( !ubNumMercs || gTacticalStatus.ubGuideDescriptionToUse == 100 )
{
ubChosenMerc = (UINT8)Random( ubNumMercs );
TacticalCharacterDialogueWithSpecialEvent( MercPtrs[ ubMercsInSector[ ubChosenMerc ] ], gTacticalStatus.ubGuideDescriptionToUse, DIALOGUE_SPECIAL_EVENT_USE_ALTERNATE_FILES, 0, 0 );
// run through list
cnt2 = gTacticalStatus.Team[gbPlayerNum].bFirstID;
for ( pTeamSoldier = MercPtrs[cnt2]; cnt2 <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt2, pTeamSoldier++ )
{
if ( pTeamSoldier->stats.bLife >= OKLIFE && pTeamSoldier->bActive &&
pTeamSoldier->sSectorX == gTacticalStatus.bGuideDescriptionSectorX && pTeamSoldier->sSectorY == gTacticalStatus.bGuideDescriptionSectorY &&
pTeamSoldier->bSectorZ == gbWorldSectorZ &&
!pTeamSoldier->flags.fBetweenSectors )
{
AdditionalTacticalCharacterDialogue_CallsLua( pTeamSoldier, ADE_SECTOR_COMMENTARY );
}
}
}
}
}
+2
View File
@@ -236,6 +236,8 @@ BOOLEAN SetFaceTalking( INT32 iFaceIndex, CHAR8 *zSoundFile, STR16 zTextString,
// This function will setup appropriate face data and begin the speech process. It can fail if the sound
//cannot be played for any reason.
BOOLEAN IsFaceTalking( INT32 iFaceIndex );
BOOLEAN SetFaceTalkingMultipleSounds( INT32 iFaceIndex, CHAR8 zSoundFiles[][64], UINT8 ubMaxSoundsCount, STR16 zTextString, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan );
// Set some face talking flags without need to play sound