mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
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:
+39
-20
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user