mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
New Feature: dynamic dialogue is played when dynamic opinions are active. Mercs can comment on each others actions, and this can influence their opinions further. IMP character answers can even be chosen by the player.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7297 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+58
-3
@@ -114,6 +114,7 @@
|
||||
#include "Items.h"
|
||||
#include "Encyclopedia_new.h"
|
||||
#include "CampaignStats.h" // added by Flugente
|
||||
#include "DynamicDialogue.h" // added by Flugente
|
||||
#endif
|
||||
|
||||
#include "BobbyR.h"
|
||||
@@ -1539,9 +1540,35 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
||||
|
||||
if ( guiCurrentSaveGameVersion >= DYNAMIC_OPINIONS )
|
||||
{
|
||||
if ( !FileRead( hFile, &this->usDynamicOpinionFlagmask, sizeof(usDynamicOpinionFlagmask), &uiNumBytesRead ) )
|
||||
if ( guiCurrentSaveGameVersion >= DYNAMIC_DIALOGUE )
|
||||
{
|
||||
return(FALSE);
|
||||
if ( !FileRead( hFile, &this->usDynamicOpinionFlagmask, sizeof(usDynamicOpinionFlagmask), &uiNumBytesRead ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
if ( !FileRead( hFile, &this->sDynamicOpinionLongTerm, sizeof(sDynamicOpinionLongTerm), &uiNumBytesRead ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT32 tmp[NUM_PROFILES][3];
|
||||
if ( !FileRead( hFile, &tmp, sizeof(tmp), &uiNumBytesRead ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
for ( UINT16 profile = 0; profile < NUM_PROFILES; ++profile )
|
||||
{
|
||||
for ( UINT8 i = 0; i < 3; ++i )
|
||||
{
|
||||
this->usDynamicOpinionFlagmask[profile][i] = tmp[profile][i];
|
||||
}
|
||||
|
||||
sDynamicOpinionLongTerm[profile] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1644,6 +1671,11 @@ BOOLEAN MERCPROFILESTRUCT::Save(HWFILE hFile)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
if ( !FileWrite( hFile, &this->sDynamicOpinionLongTerm, sizeof(sDynamicOpinionLongTerm), &uiNumBytesWritten ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -4185,7 +4217,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
||||
|
||||
}
|
||||
|
||||
if( !SaveNewEmailDataToSaveGameFile( hFile ) )
|
||||
if( !SaveNewEmailDataToSaveGameFile( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing save data");
|
||||
goto FAILED_TO_SAVE;
|
||||
@@ -4234,6 +4266,13 @@ if( !SaveNewEmailDataToSaveGameFile( hFile ) )
|
||||
goto FAILED_TO_SAVE;
|
||||
}
|
||||
|
||||
// Flugente: dynamic dialogue
|
||||
if ( !SaveDynamicDialogue( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing Dynamic Dialogue" );
|
||||
goto FAILED_TO_SAVE;
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
SaveGameFilePosition( FileGetPos( hFile ), "Campaign Stats" );
|
||||
#endif
|
||||
@@ -5867,6 +5906,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
}
|
||||
else
|
||||
EncyclopediaInitItemsVisibility();
|
||||
|
||||
if( guiCurrentSaveGameVersion >= CAMPAIGNSTATS )
|
||||
{
|
||||
uiRelEndPerc += 1;
|
||||
@@ -5890,6 +5930,21 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
}
|
||||
}
|
||||
|
||||
if ( guiCurrentSaveGameVersion >= DYNAMIC_DIALOGUE )
|
||||
{
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load Dynamic Dialogue..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
if ( !LoadDynamicDialogue( hFile ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Dynamic Dialogue Load failed" ) );
|
||||
FileClose( hFile );
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//Close the saved game file
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user