diff --git a/GameSettings.cpp b/GameSettings.cpp index baa87e57..4dc0df52 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1826,7 +1826,7 @@ void LoadGameExternalOptions() gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_ADMIN] = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INTERROGATION_POINTS_ADMIN", 80, 30, 1000); gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_REGULAR] = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INTERROGATION_POINTS_REGULAR", 100, gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_ADMIN], 1000); gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_ELITE] = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INTERROGATION_POINTS_ELITE", 100, gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_REGULAR], 1000); - gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_OFFICER] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_POINTS_OFFICER", 100, gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_ELITE], 1000 ); + gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_OFFICER] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_POINTS_OFFICER", 100, gGameExternalOptions.ubPrisonerInterrogationPoints[PRISONER_ELITE], 1000 ); gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_ADMIN] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_ENEMY_GENERAL_CHANCE_ADMIN", 0, 0, 100 ); gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_REGULAR] = iniReader.ReadInteger( "Strategic Gameplay Settings", "PRISONER_INTERROGATION_ENEMY_GENERAL_CHANCE_REGULAR", 1, gGameExternalOptions.ubPrisonerInterrogationEnemyGeneralInfoChance[PRISONER_ADMIN], 100 ); @@ -1860,6 +1860,9 @@ void LoadGameExternalOptions() gGameExternalOptions.sMoraleModRacism = iniReader.ReadInteger("Morale Settings","MORALE_MOD_RACISM", 3, 0, 5); gGameExternalOptions.sMoraleModSexism = iniReader.ReadInteger("Morale Settings","MORALE_MOD_SEXISM", 1, 0, 5); gGameExternalOptions.sMoraleModXenophobicBackGround = iniReader.ReadInteger("Morale Settings","MORALE_MOD_BACKGROUND_XENOPHOBIC", 5, 0, 15); + + gGameExternalOptions.fDynamicOpinions = iniReader.ReadBoolean("Morale Settings","DYNAMIC_OPINIONS", TRUE ); + gGameExternalOptions.fDynamicWageFactor = iniReader.ReadFloat("Morale Settings","WAGE_ACCEPTANCE_FACTOR", 1.5f, 0.1f, 10.0f ); //################# Laptop Settings ################## @@ -3591,6 +3594,28 @@ void LoadMoraleSettings() gMoraleSettings.bModifiers[MORALE_MODIFIER_OT_COWARD_BAD_EVENT] = iniReader.ReadInteger("Morale Modifiers Settings","MORALE_MODIFIER_OT_COWARD_BAD_EVENT", -2, -100, 100); gMoraleSettings.bModifiers[MORALE_MODIFIER_MALICIOUS_HOURLY_DECAY] = iniReader.ReadInteger("Morale Modifiers Settings","MORALE_MODIFIER_MALICIOUS_HOURLY_DECAY", -1, -100, 100); + + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_FRIENDLYFIRE] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_FRIENDLYFIRE", -10, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_SNITCHSOLDMEOUT] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_SNITCHSOLDMEOUT", -3, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_SNITCHINTERFERENCE] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_FRIENDLYFIRE", -5, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_FRIENDSWITHHATED] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_FRIENDSWITHHATED", -4, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_CONTRACTEXTENSION] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_CONTRACTEXTENSION", -2, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_ORDEREDRETREAT] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_ORDEREDRETREAT", -6, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_CIVKILLER] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_CIVKILLER", -8, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_SLOWSUSDOWN] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_SLOWSUSDOWN", -2, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_NOSHARINGFOOD] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_NOSHARINGFOOD", -1, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_ANNOYINGDISABILITY] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_ANNOYINGDISABILITY", -2, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_ADDICT] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_ADDICT", -6, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_THIEF] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_THIEF", -5, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_WORSTCOMMANDEREVER] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_WORSTCOMMANDEREVER", -7, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_RICHGUY] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_RICHGUY", -1, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_BETTERGEAR] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_BETTERGEAR", -2, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_YOUMOUNTEDAGUNONMYBREASTS] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_YOUMOUNTEDAGUNONMYBREASTS",-3, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_BANDAGED] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_BANDAGED", 1, 0, 50 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_DRINKBUDDIES_GOOD] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_DRINKBUDDIES_GOOD", 1, 0, 50 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_DRINKBUDDIES_SUPER] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_DRINKBUDDIES_SUPER", 4, 0, 50 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_DRINKBUDDIES_BAD] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_DRINKBUDDIES_BAD", - 1, -50, 0 ); + gMoraleSettings.bDynamicOpinionModifiers[OPINIONEVENT_DRINKBUDDIES_WORSE] = iniReader.ReadInteger( "Dynamic Opinion Modifiers Settings", "OPINIONEVENT_DRINKBUDDIES_WORSE", -4, -50, 0 ); } void LoadReputationSettings() diff --git a/GameSettings.h b/GameSettings.h index 0ffdf41f..697bbf58 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -1376,6 +1376,10 @@ typedef struct INT8 sMoraleModSexism; INT8 sMoraleModXenophobicBackGround; + // Flugente: dynamic opinions + BOOLEAN fDynamicOpinions; + FLOAT fDynamicWageFactor; + // Flugente: enemy roles BOOLEAN fEnemyRoles; UINT8 usTurnsToUncover; @@ -1542,6 +1546,34 @@ typedef struct } HELICOPTER_SETTINGS; +// Flugente: dynamic opinions +enum +{ + OPINIONEVENT_FRIENDLYFIRE, + OPINIONEVENT_SNITCHSOLDMEOUT, + OPINIONEVENT_SNITCHINTERFERENCE, + OPINIONEVENT_FRIENDSWITHHATED, + OPINIONEVENT_CONTRACTEXTENSION, + OPINIONEVENT_ORDEREDRETREAT, + OPINIONEVENT_CIVKILLER, + OPINIONEVENT_SLOWSUSDOWN, + OPINIONEVENT_NOSHARINGFOOD, + OPINIONEVENT_ANNOYINGDISABILITY, + OPINIONEVENT_ADDICT, + OPINIONEVENT_THIEF, + OPINIONEVENT_WORSTCOMMANDEREVER, + OPINIONEVENT_RICHGUY, + OPINIONEVENT_BETTERGEAR, + OPINIONEVENT_YOUMOUNTEDAGUNONMYBREASTS, + OPINIONEVENT_BANDAGED, + OPINIONEVENT_DRINKBUDDIES_GOOD, + OPINIONEVENT_DRINKBUDDIES_SUPER, + OPINIONEVENT_DRINKBUDDIES_BAD, + OPINIONEVENT_DRINKBUDDIES_WORSE, + + OPINIONEVENT_MAX +}; + typedef struct { UINT8 ubDefaultMorale; @@ -1549,6 +1581,7 @@ typedef struct INT8 bValues[64]; INT8 bModifiers[32]; INT16 sDrugAndAlcoholModifiers[2]; + INT8 bDynamicOpinionModifiers[OPINIONEVENT_MAX]; } MORALE_SETTINGS; typedef struct diff --git a/GameVersion.cpp b/GameVersion.cpp index abb523bf..756471ed 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -15,9 +15,9 @@ #ifdef JA2EDITOR #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7214 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7240 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7214 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7240 (Development Build)" }; #endif // ------------------------------ @@ -27,11 +27,11 @@ //DEBUG BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7214 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7240 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7214 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7240 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7214 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7240 (Development Build)" }; #endif #elif defined CRIPPLED_VERSION @@ -46,16 +46,16 @@ //RELEASE BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7214 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7240 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7214 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7240 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Release v1.13.7214 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.7240 (Development Build)" }; #endif #endif -CHAR8 czVersionNumber[16] = { "Build 14.05.18" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 14.05.29" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/GameVersion.h b/GameVersion.h index b21ed0d4..0e48ac77 100644 --- a/GameVersion.h +++ b/GameVersion.h @@ -21,6 +21,7 @@ extern CHAR16 zTrackingNumber[16]; // Keeps track of the saved game version. Increment the saved game version whenever // you will invalidate the saved game file +#define DYNAMIC_OPINIONS 156 // Flugente: mercs can form opinions on other people depending on their behaviour #define INCREASED_REFUEL_SITES 155 // Flugente: increased the number of helicopter refuel sites #define ENEMY_VIPS 154 // Flugente: enemy generals are placed randomly in the map #define MORE_LOCKS_AND_KEYS 153 // anv: externalized locks and keys to xml @@ -74,7 +75,7 @@ extern CHAR16 zTrackingNumber[16]; #define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes #define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system -#define SAVE_GAME_VERSION INCREASED_REFUEL_SITES +#define SAVE_GAME_VERSION DYNAMIC_OPINIONS //#define RUSSIANGOLD #ifdef __cplusplus diff --git a/Laptop/CampaignHistoryMain.cpp b/Laptop/CampaignHistoryMain.cpp index f1539929..5ac5ff3e 100644 --- a/Laptop/CampaignHistoryMain.cpp +++ b/Laptop/CampaignHistoryMain.cpp @@ -223,11 +223,11 @@ void DisplayCampaignHistoryDefaults() usPosY += CAMPAIGN_HISTORY_LINK_STEP_Y; //Display the red bar under the link at the bottom. and the text - DisplaySmallRedLineWithShadow( usPosX, usPosY-2, LAPTOP_SCREEN_UL_X+CAMPAIGN_HISTORY_LINK_TEXT_WIDTH, usPosY-2); + DisplaySmallColouredLineWithShadow( usPosX, usPosY - 2, LAPTOP_SCREEN_UL_X + CAMPAIGN_HISTORY_LINK_TEXT_WIDTH, usPosY - 2 ); } // closing line that separates header from individual page - DisplaySmallRedLineWithShadow( usPosX, usPosY-2, LAPTOP_SCREEN_LR_X, usPosY-2); + DisplaySmallColouredLineWithShadow( usPosX, usPosY - 2, LAPTOP_SCREEN_LR_X, usPosY - 2 ); usPosX = LAPTOP_SCREEN_LR_X - 50; usPosY = CAMPAIGN_HISTORY_LINK_START_Y; diff --git a/Laptop/CampaignHistory_Summary.cpp b/Laptop/CampaignHistory_Summary.cpp index 14dcc8d7..da3bd064 100644 --- a/Laptop/CampaignHistory_Summary.cpp +++ b/Laptop/CampaignHistory_Summary.cpp @@ -768,18 +768,22 @@ void RenderCampaignHistory_MostImportant() if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X; } - if ( incident.usIncidentFlags & INCIDENT_SPYACTION_ENEMY ) + // only report on spies if they were uncovered + if ( incident.usIncidentFlags & INCIDENT_SPYACTION_UNCOVERED ) { - swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_SPY_ENEMY] ); - usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - usPosX, 2, CAMPHIS_FONT_SMALL, CAMPAIGN_HISTORY_FONT_COLOR_REGULAR,sText, FONT_MCOLOR_BLACK, FALSE, 0); - if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X; - } + if ( incident.usIncidentFlags & INCIDENT_SPYACTION_ENEMY ) + { + swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_SPY_ENEMY] ); + usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - usPosX, 2, CAMPHIS_FONT_SMALL, CAMPAIGN_HISTORY_FONT_COLOR_REGULAR,sText, FONT_MCOLOR_BLACK, FALSE, 0); + if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X; + } - if ( incident.usIncidentFlags & INCIDENT_SPYACTION_PLAYERSIDE ) - { - swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_SPY_PLAYER] ); - usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - usPosX, 2, CAMPHIS_FONT_SMALL, CAMPAIGN_HISTORY_FONT_COLOR_REGULAR,sText, FONT_MCOLOR_BLACK, FALSE, 0); - if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X; + if ( incident.usIncidentFlags & INCIDENT_SPYACTION_PLAYERSIDE ) + { + swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_SPY_PLAYER] ); + usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - usPosX, 2, CAMPHIS_FONT_SMALL, CAMPAIGN_HISTORY_FONT_COLOR_REGULAR,sText, FONT_MCOLOR_BLACK, FALSE, 0); + if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X; + } } { diff --git a/Laptop/CampaignStats.cpp b/Laptop/CampaignStats.cpp index b357a028..932fead6 100644 --- a/Laptop/CampaignStats.cpp +++ b/Laptop/CampaignStats.cpp @@ -707,7 +707,7 @@ void FinishIncident(INT16 sX, INT16 sY, INT8 sZ) if ( i == CAMPAIGNHISTORY_SD_MAX ) { - // totally boring. Don't add this, just clean it an exit + // totally boring. Don't add this, just clean it and exit gCurrentIncident.clear(); return; @@ -715,6 +715,9 @@ void FinishIncident(INT16 sX, INT16 sY, INT8 sZ) } } + // dynamic opinions: if the playerside had a lot of losses, the mercs will blame one of their own + HandleDynamicOpinionBattleLosses(); + // due to odd coding, we do not know when an incident starts // (checking for entering combat isn't enough, as we do that multiple times per battle) // we thus set the relevant data when finishing an incident diff --git a/Laptop/DropDown.cpp b/Laptop/DropDown.cpp index cc5f7f6d..af2dca43 100644 --- a/Laptop/DropDown.cpp +++ b/Laptop/DropDown.cpp @@ -356,7 +356,7 @@ DropDownBase::DrawTopEntry() SetFontShadow(NO_SHADOW); - DrawTextToScreen( mEntryVector[mSelectedEntry].second, musStartX+CITY_NAME_OFFSET, (UINT16)(musStartY+7), 0, DEF_DROPDOWN_FONT, FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );; + DrawTextToScreen( mEntryVector[mSelectedEntry].second, musStartX+CITY_NAME_OFFSET, (UINT16)(musStartY+7), 0, DEF_DROPDOWN_FONT, FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); SetFontShadow(DEFAULT_SHADOW); } @@ -508,6 +508,8 @@ DropDownBase::SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion DrawTopEntry(); DrawSelectedCity(); DrawGoldRectangle(); + + SetRefresh( ); } } @@ -605,6 +607,26 @@ DropDownBase::SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT } } +/* +* If aKey exists among our keys, set it as the current one +*/ +void +DropDownBase::SetSelectedEntryKey( INT16 aKey ) +{ + UINT8 cnt = 0; + std::vector >::iterator itend = mEntryVector.end(); + for ( std::vector >::iterator it = mEntryVector.begin(); it != itend; ++it ) + { + if ( (*it).first == aKey ) + { + mSelectedEntry = cnt; + return; + } + + ++cnt; + } +} + void DropDownBase::OpenDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) { diff --git a/Laptop/DropDown.h b/Laptop/DropDown.h index 429aaeeb..4ac3e369 100644 --- a/Laptop/DropDown.h +++ b/Laptop/DropDown.h @@ -18,6 +18,26 @@ void Display2Line2ShadowHorizontal( UINT16 usStartX, UINT16 usStartY, UINT16 End // the maximum number of entries that can be shown at once. Increase requires recompilation! #define DROPDOWN_REGIONS 8 +// different dropdowns can interfere with each other +enum definedDropDowns +{ + DROPDOWNNR_APPEARANCE = 0, + DROPDOWNNR_APPEARANCECARE, + DROPDOWNNR_REFINEMENT, + DROPDOWNNR_REFINEMENTCARE, + DROPDOWNNR_NATIONALITY, + DROPDOWNNR_HATEDNATIONALITY, + DROPDOWNNR_HATEDNATIONALITYCARE, + DROPDOWNNR_RACIST, + DROPDOWNNR_RACE, + DROPDOWNNR_SEXIST, + DROPDOWNNR_RACISTFEATURE, + + DROPDOWNNR_MERCCOMPARE1, + DROPDOWNNR_MERCCOMPARE2, + DROPDOWNNR_MERCCOMPARE_SQUADSELECTION, +}; + /* * As we cannot directly add our callbacks (we need a static callback due to the way MSYS_DefineRegion(...) works, which utterly fails if we have multiple instance of a class), * we use a very odd looking workaround. @@ -118,6 +138,11 @@ public: */ INT16 GetSelectedEntryKey() { return mEntryVector[mSelectedEntry].first; } + /* + * If aKey exists among our keys, set it as the current one + */ + void SetSelectedEntryKey( INT16 aKey ); + /* * Get width of entire DropDownBase */ diff --git a/Laptop/IMP Background.cpp b/Laptop/IMP Background.cpp index 3686190f..4d822dc2 100644 --- a/Laptop/IMP Background.cpp +++ b/Laptop/IMP Background.cpp @@ -494,7 +494,12 @@ void AssignBackgroundHelpText( UINT16 ubNumber, MOUSE_REGION* pMouseregion ) for ( UINT8 i = 0; i < BG_MAX; ++i) { - if ( zBackground[ ubNumber ].value[i] ) + if ( BG_DISLIKEBG == i ) + { + swprintf( atStr, szBackgroundText_Value[i] ); + wcscat( apStr, atStr ); + } + else if ( zBackground[ ubNumber ].value[i] ) { swprintf(atStr, szBackgroundText_Value[ i ], zBackground[ ubNumber ].value[i] > 0 ? L"+" : L"", zBackground[ ubNumber ].value[i] ); wcscat( apStr, atStr ); diff --git a/Laptop/IMP Prejudice.cpp b/Laptop/IMP Prejudice.cpp index 36ecdb66..6c7cc83f 100644 --- a/Laptop/IMP Prejudice.cpp +++ b/Laptop/IMP Prejudice.cpp @@ -78,21 +78,6 @@ BOOLEAN CameBackToPrejudicePageButNotFinished(); //******************************************************************* #define DROPDOWN_MARKUP_Y 50 -enum definedDropDowns -{ - DROPDOWNNR_APPEARANCE = 0, - DROPDOWNNR_APPEARANCECARE, - DROPDOWNNR_REFINEMENT, - DROPDOWNNR_REFINEMENTCARE, - DROPDOWNNR_NATIONALITY, - DROPDOWNNR_HATEDNATIONALITY, - DROPDOWNNR_HATEDNATIONALITYCARE, - DROPDOWNNR_RACIST, - DROPDOWNNR_RACE, - DROPDOWNNR_SEXIST, - DROPDOWNNR_RACISTFEATURE, -}; - template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } template<> void DropDownTemplate::SetRefresh() { gfIMPPrejudice_Redraw = TRUE; } diff --git a/Laptop/Laptop_VS2005.vcproj b/Laptop/Laptop_VS2005.vcproj index 51d3cebd..83d85fe4 100644 --- a/Laptop/Laptop_VS2005.vcproj +++ b/Laptop/Laptop_VS2005.vcproj @@ -622,6 +622,10 @@ RelativePath=".\LaptopSave.h" > + + @@ -928,6 +932,10 @@ RelativePath=".\laptop.cpp" > + + diff --git a/Laptop/Laptop_VS2008.vcproj b/Laptop/Laptop_VS2008.vcproj index a847e09e..c8f1c237 100644 --- a/Laptop/Laptop_VS2008.vcproj +++ b/Laptop/Laptop_VS2008.vcproj @@ -614,6 +614,10 @@ RelativePath="LaptopSave.h" > + + @@ -914,6 +918,10 @@ RelativePath="laptop.cpp" > + + diff --git a/Laptop/Laptop_VS2010.vcxproj b/Laptop/Laptop_VS2010.vcxproj index f2d71418..f5759a7a 100644 --- a/Laptop/Laptop_VS2010.vcxproj +++ b/Laptop/Laptop_VS2010.vcxproj @@ -94,6 +94,7 @@ + @@ -172,6 +173,7 @@ + diff --git a/Laptop/Laptop_VS2013.vcxproj b/Laptop/Laptop_VS2013.vcxproj index e883d3f7..d705dd9e 100644 --- a/Laptop/Laptop_VS2013.vcxproj +++ b/Laptop/Laptop_VS2013.vcxproj @@ -94,6 +94,7 @@ + @@ -172,6 +173,7 @@ + diff --git a/Laptop/Laptop_VS2013.vcxproj.filters b/Laptop/Laptop_VS2013.vcxproj.filters index ee3bd972..ef5d2d43 100644 --- a/Laptop/Laptop_VS2013.vcxproj.filters +++ b/Laptop/Laptop_VS2013.vcxproj.filters @@ -249,6 +249,9 @@ Header Files + + Header Files + @@ -509,5 +512,8 @@ Source Files + + Source Files + \ No newline at end of file diff --git a/Laptop/finances.cpp b/Laptop/finances.cpp index 6bd9f5e1..092b9b4b 100644 --- a/Laptop/finances.cpp +++ b/Laptop/finances.cpp @@ -196,6 +196,8 @@ UINT32 AddTransactionToPlayersBook (UINT8 ubCode, UINT8 ubSecondCode, UINT32 uiD GetBalanceFromDisk( ); // process the actual data + // Flugente: dynamic opinion + HandleDynamicOpinionOnContractExtension( ubCode, ubSecondCode ); // // If this transaction is for the hiring/extending of a mercs contract diff --git a/Laptop/insurance Comments.cpp b/Laptop/insurance Comments.cpp index 96d7120b..2ba410d0 100644 --- a/Laptop/insurance Comments.cpp +++ b/Laptop/insurance Comments.cpp @@ -142,7 +142,7 @@ void RenderInsuranceComments() swprintf( sText, L"%s", pMessageStrings[ MSG_HOMEPAGE ] ); DisplayWrappedString( usPosX, INS_CMNT_LINK_Y+13, INS_CMNT_LINK_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); //Display the red bar under the link at the bottom - DisplaySmallRedLineWithShadow( usPosX, INS_CMNT_LINK_Y+INS_CMNT_LINK_HEIGHT, (UINT16)(usPosX+INS_CMNT_LINK_WIDTH), INS_CMNT_LINK_Y+INS_CMNT_LINK_HEIGHT); + DisplaySmallColouredLineWithShadow( usPosX, INS_CMNT_LINK_Y + INS_CMNT_LINK_HEIGHT, (UINT16)(usPosX + INS_CMNT_LINK_WIDTH), INS_CMNT_LINK_Y + INS_CMNT_LINK_HEIGHT ); usPosX += INS_CMNT_LINK_OFFSET_X; @@ -150,14 +150,14 @@ void RenderInsuranceComments() GetInsuranceText( INS_SNGL_HOW_DOES_INS_WORK, sText ); DisplayWrappedString( usPosX, INS_CMNT_LINK_Y+6, INS_CMNT_LINK_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); //Display the red bar under the link at the bottom - DisplaySmallRedLineWithShadow( usPosX, INS_CMNT_LINK_Y+INS_CMNT_LINK_HEIGHT, (UINT16)(usPosX+INS_CMNT_LINK_WIDTH), INS_CMNT_LINK_Y+INS_CMNT_LINK_HEIGHT); + DisplaySmallColouredLineWithShadow( usPosX, INS_CMNT_LINK_Y + INS_CMNT_LINK_HEIGHT, (UINT16)(usPosX + INS_CMNT_LINK_WIDTH), INS_CMNT_LINK_Y + INS_CMNT_LINK_HEIGHT ); usPosX += INS_CMNT_LINK_OFFSET_X; //Display the fourth link text GetInsuranceText( INS_SNGL_TO_ENTER_REVIEW, sText ); DisplayWrappedString( usPosX, INS_CMNT_LINK_Y-1, INS_CMNT_LINK_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); //Display the red bar under the link at the bottom - DisplaySmallRedLineWithShadow( usPosX, INS_CMNT_LINK_Y+INS_CMNT_LINK_HEIGHT, (UINT16)(usPosX+INS_CMNT_LINK_WIDTH), INS_CMNT_LINK_Y+INS_CMNT_LINK_HEIGHT); + DisplaySmallColouredLineWithShadow( usPosX, INS_CMNT_LINK_Y + INS_CMNT_LINK_HEIGHT, (UINT16)(usPosX + INS_CMNT_LINK_WIDTH), INS_CMNT_LINK_Y + INS_CMNT_LINK_HEIGHT ); SetFontShadow(DEFAULT_SHADOW); MarkButtonsDirty( ); @@ -204,7 +204,7 @@ BOOLEAN DisplayComment( UINT8 ubCommentorsName, UINT8 ubComment, UINT16 usPosY ) sNumPixels = DisplayWrappedString( INS_CMNT_FIRST_BULLET_X+INSURANCE_BULLET_TEXT_OFFSET_X, (UINT16)(usPosY), INS_CMNT_COMMENT_TEXT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); //Display the red bar under the link at the bottom - DisplaySmallRedLineWithShadow( INS_CMNT_FIRST_BULLET_X+INSURANCE_BULLET_TEXT_OFFSET_X, (UINT16)(usPosY+sNumPixels), INS_CMNT_FIRST_BULLET_X+INS_CMNT_REDLINE_WIDTH, (UINT16)(usPosY+sNumPixels)); + DisplaySmallColouredLineWithShadow( INS_CMNT_FIRST_BULLET_X + INSURANCE_BULLET_TEXT_OFFSET_X, (UINT16)(usPosY + sNumPixels), INS_CMNT_FIRST_BULLET_X + INS_CMNT_REDLINE_WIDTH, (UINT16)(usPosY + sNumPixels) ); sNumPixels += 4; diff --git a/Laptop/insurance Contract.cpp b/Laptop/insurance Contract.cpp index 16228187..82516bbd 100644 --- a/Laptop/insurance Contract.cpp +++ b/Laptop/insurance Contract.cpp @@ -355,14 +355,14 @@ void RenderInsuranceContract() usPosX = INS_CTRCT_BOTTOM_LINK_RED_BAR_X; //Display the red bar under the link at the bottom. and the text - DisplaySmallRedLineWithShadow( usPosX, INS_CTRCT_BOTTON_LINK_RED_BAR_Y, (UINT16)(usPosX+INS_CTRCT_BOTTOM_LINK_RED_WIDTH), INS_CTRCT_BOTTON_LINK_RED_BAR_Y); + DisplaySmallColouredLineWithShadow( usPosX, INS_CTRCT_BOTTON_LINK_RED_BAR_Y, (UINT16)(usPosX + INS_CTRCT_BOTTOM_LINK_RED_WIDTH), INS_CTRCT_BOTTON_LINK_RED_BAR_Y ); swprintf( sText, L"%s", pMessageStrings[ MSG_HOMEPAGE ] ); DisplayWrappedString( usPosX, INS_CTRCT_BOTTON_LINK_Y+18, INS_CTRCT_BOTTOM_LINK_RED_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); usPosX += INS_CTRCT_BOTTOM_LINK_RED_BAR_OFFSET; //Display the red bar under the link at the bottom. and the text - DisplaySmallRedLineWithShadow( usPosX, INS_CTRCT_BOTTON_LINK_RED_BAR_Y, (UINT16)(usPosX+INS_CTRCT_BOTTOM_LINK_RED_WIDTH), INS_CTRCT_BOTTON_LINK_RED_BAR_Y); + DisplaySmallColouredLineWithShadow( usPosX, INS_CTRCT_BOTTON_LINK_RED_BAR_Y, (UINT16)(usPosX + INS_CTRCT_BOTTOM_LINK_RED_WIDTH), INS_CTRCT_BOTTON_LINK_RED_BAR_Y ); GetInsuranceText( INS_SNGL_HOW_DOES_INS_WORK, sText ); DisplayWrappedString( usPosX, INS_CTRCT_BOTTON_LINK_Y+12, INS_CTRCT_BOTTOM_LINK_RED_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); @@ -390,7 +390,7 @@ void RenderInsuranceContract() DisplayWrappedString( INS_CTRCT_FIRST_BULLET_TEXT_X+INSURANCE_BULLET_TEXT_OFFSET_X, INS_CTRCT_SECOND_BULLET_TEXT_Y, INS_CTRCT_INTSRUCTION_TEXT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); //Display the red bar under the instruction text - DisplaySmallRedLineWithShadow( INS_CTRCT_FIRST_BULLET_TEXT_X, INS_CTRCT_RED_BAR_UNDER_INSTRUCTION_TEXT_Y, INS_CTRCT_FIRST_BULLET_TEXT_X+INS_CTRCT_INTSRUCTION_TEXT_WIDTH, INS_CTRCT_RED_BAR_UNDER_INSTRUCTION_TEXT_Y); + DisplaySmallColouredLineWithShadow( INS_CTRCT_FIRST_BULLET_TEXT_X, INS_CTRCT_RED_BAR_UNDER_INSTRUCTION_TEXT_Y, INS_CTRCT_FIRST_BULLET_TEXT_X + INS_CTRCT_INTSRUCTION_TEXT_WIDTH, INS_CTRCT_RED_BAR_UNDER_INSTRUCTION_TEXT_Y ); sNextMercID = gsCurrentInsuranceMercIndex; diff --git a/Laptop/insurance Info.cpp b/Laptop/insurance Info.cpp index 68691031..d281760c 100644 --- a/Laptop/insurance Info.cpp +++ b/Laptop/insurance Info.cpp @@ -193,7 +193,7 @@ void RenderInsuranceInfo() //Display the red bar under the link at the bottom - DisplaySmallRedLineWithShadow( INS_INFO_SUBTITLE_X, INS_INFO_SUBTITLE_LINE_Y, INS_INFO_SUBTITLE_X+INS_INFO_SUBTITLE_LINE_WIDTH, INS_INFO_SUBTITLE_LINE_Y); + DisplaySmallColouredLineWithShadow( INS_INFO_SUBTITLE_X, INS_INFO_SUBTITLE_LINE_Y, INS_INFO_SUBTITLE_X + INS_INFO_SUBTITLE_LINE_WIDTH, INS_INFO_SUBTITLE_LINE_Y ); switch( gubCurrentInsInfoSubPage ) { @@ -221,13 +221,13 @@ void RenderInsuranceInfo() usPosX = INS_INFO_LINK_START_X; //Display the red bar under the link at the bottom. and the text - DisplaySmallRedLineWithShadow( usPosX, INS_INFO_LINK_TO_CONTRACT_Y, (UINT16)(usPosX+INS_INFO_LINK_TO_CONTRACT_WIDTH), INS_INFO_LINK_TO_CONTRACT_Y); + DisplaySmallColouredLineWithShadow( usPosX, INS_INFO_LINK_TO_CONTRACT_Y, (UINT16)(usPosX + INS_INFO_LINK_TO_CONTRACT_WIDTH), INS_INFO_LINK_TO_CONTRACT_Y ); swprintf( sText, L"%s", pMessageStrings[ MSG_HOMEPAGE ] ); DisplayWrappedString( usPosX, INS_INFO_LINK_TO_CONTRACT_TEXT_Y+14, INS_INFO_LINK_TO_CONTRACT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); usPosX += INS_INFO_LINK_START_OFFSET + INS_INFO_LINK_TO_CONTRACT_WIDTH; //Display the red bar under the link at the bottom. and the text - DisplaySmallRedLineWithShadow( usPosX, INS_INFO_LINK_TO_CONTRACT_Y, (UINT16)(usPosX+INS_INFO_LINK_TO_CONTRACT_WIDTH), INS_INFO_LINK_TO_CONTRACT_Y); + DisplaySmallColouredLineWithShadow( usPosX, INS_INFO_LINK_TO_CONTRACT_Y, (UINT16)(usPosX + INS_INFO_LINK_TO_CONTRACT_WIDTH), INS_INFO_LINK_TO_CONTRACT_Y ); GetInsuranceText( INS_SNGL_TO_ENTER_REVIEW, sText ); DisplayWrappedString( usPosX, INS_INFO_LINK_TO_CONTRACT_TEXT_Y, INS_INFO_LINK_TO_CONTRACT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); @@ -538,7 +538,7 @@ void DisplayInfoTocPage() GetInsuranceText( INS_SNGL_WE_CAN_OFFER_U, sText ); DrawTextToScreen( sText, INS_INFO_TOC_SUBTITLE_X, usNewLineOffset, 640-INS_INFO_INFO_TOC_TITLE_X, INS_FONT_BIG, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); usPosY = usNewLineOffset + 12; - DisplaySmallRedLineWithShadow( INS_INFO_SUBTITLE_X, usPosY, (UINT16)(INS_INFO_SUBTITLE_X+INS_INFO_SUBTITLE_LINE_WIDTH), usPosY ); + DisplaySmallColouredLineWithShadow( INS_INFO_SUBTITLE_X, usPosY, (UINT16)(INS_INFO_SUBTITLE_X + INS_INFO_SUBTITLE_LINE_WIDTH), usPosY ); usNewLineOffset += INS_INFO_SPACE_BN_PARAGRAPHS; usNewLineOffset += INS_INFO_SPACE_BN_PARAGRAPHS; diff --git a/Laptop/insurance.cpp b/Laptop/insurance.cpp index 9d0f9e94..04a3e7cd 100644 --- a/Laptop/insurance.cpp +++ b/Laptop/insurance.cpp @@ -190,21 +190,21 @@ void RenderInsurance() //Display the red bar under the link at the bottom. and the text - DisplaySmallRedLineWithShadow( INSURANCE_BOTTOM_LINK_RED_BAR_X, INSURANCE_BOTTOM_LINK_RED_BAR_Y, INSURANCE_BOTTOM_LINK_RED_BAR_X+INSURANCE_BOTTOM_LINK_RED_BAR_WIDTH, INSURANCE_BOTTOM_LINK_RED_BAR_Y); + DisplaySmallColouredLineWithShadow( INSURANCE_BOTTOM_LINK_RED_BAR_X, INSURANCE_BOTTOM_LINK_RED_BAR_Y, INSURANCE_BOTTOM_LINK_RED_BAR_X + INSURANCE_BOTTOM_LINK_RED_BAR_WIDTH, INSURANCE_BOTTOM_LINK_RED_BAR_Y ); GetInsuranceText( INS_SNGL_COMMENTSFROM_CLIENTS, sText ); DisplayWrappedString( INSURANCE_LINK_TEXT_1_X, INSURANCE_LINK_TEXT_1_Y, INSURANCE_LINK_TEXT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); //Display the red bar under the link at the bottom - DisplaySmallRedLineWithShadow( INSURANCE_BOTTOM_LINK_RED_BAR_X_2, INSURANCE_BOTTOM_LINK_RED_BAR_Y, INSURANCE_BOTTOM_LINK_RED_BAR_X_2+INSURANCE_BOTTOM_LINK_RED_BAR_WIDTH, INSURANCE_BOTTOM_LINK_RED_BAR_Y); + DisplaySmallColouredLineWithShadow( INSURANCE_BOTTOM_LINK_RED_BAR_X_2, INSURANCE_BOTTOM_LINK_RED_BAR_Y, INSURANCE_BOTTOM_LINK_RED_BAR_X_2 + INSURANCE_BOTTOM_LINK_RED_BAR_WIDTH, INSURANCE_BOTTOM_LINK_RED_BAR_Y ); GetInsuranceText( INS_SNGL_HOW_DOES_INS_WORK, sText ); DisplayWrappedString( INSURANCE_LINK_TEXT_2_X, INSURANCE_LINK_TEXT_2_Y+7, INSURANCE_LINK_TEXT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); //Display the red bar under the link at the bottom - DisplaySmallRedLineWithShadow( INSURANCE_BOTTOM_LINK_RED_BAR_X_3, INSURANCE_BOTTOM_LINK_RED_BAR_Y, INSURANCE_BOTTOM_LINK_RED_BAR_X_3+INSURANCE_BOTTOM_LINK_RED_BAR_WIDTH, INSURANCE_BOTTOM_LINK_RED_BAR_Y); + DisplaySmallColouredLineWithShadow( INSURANCE_BOTTOM_LINK_RED_BAR_X_3, INSURANCE_BOTTOM_LINK_RED_BAR_Y, INSURANCE_BOTTOM_LINK_RED_BAR_X_3 + INSURANCE_BOTTOM_LINK_RED_BAR_WIDTH, INSURANCE_BOTTOM_LINK_RED_BAR_Y ); GetInsuranceText( INS_SNGL_TO_ENTER_REVIEW, sText ); DisplayWrappedString( INSURANCE_LINK_TEXT_3_X, INSURANCE_LINK_TEXT_3_Y+7, INSURANCE_LINK_TEXT_WIDTH, 2, INS_FONT_MED, INS_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); @@ -318,7 +318,7 @@ void RemoveInsuranceDefaults() } -void DisplaySmallRedLineWithShadow( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 EndY) +void DisplaySmallColouredLineWithShadow( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 EndY, UINT32 colour ) { UINT32 uiDestPitchBYTES; UINT8 *pDestBuf; @@ -328,7 +328,7 @@ void DisplaySmallRedLineWithShadow( UINT16 usStartX, UINT16 usStartY, UINT16 End SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); // draw the red line - LineDraw(FALSE, usStartX, usStartY, EndX, EndY, Get16BPPColor( FROMRGB( 255, 0, 0 ) ), pDestBuf); + LineDraw( FALSE, usStartX, usStartY, EndX, EndY, Get16BPPColor( colour ), pDestBuf ); // draw the black shadow line LineDraw(FALSE, usStartX+1, usStartY+1, EndX+1, EndY+1, Get16BPPColor( FROMRGB( 0, 0, 0 ) ), pDestBuf); diff --git a/Laptop/insurance.h b/Laptop/insurance.h index 35af5e98..c11e3583 100644 --- a/Laptop/insurance.h +++ b/Laptop/insurance.h @@ -32,7 +32,7 @@ void RenderInsurance(); BOOLEAN InitInsuranceDefaults(); void DisplayInsuranceDefaults(); void RemoveInsuranceDefaults(); -void DisplaySmallRedLineWithShadow( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 EndY); +void DisplaySmallColouredLineWithShadow( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 EndY, UINT32 colour = FROMRGB( 255, 0, 0 ) ); void GetInsuranceText( UINT8 ubNumber, STR16 pString ); diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index b0e89f01..6f0ebfe3 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -87,6 +87,7 @@ #include "Encyclopedia_Data_new.h" #include "CampaignHistoryMain.h" // added by Flugente #include "CampaignHistory_Summary.h" // added by Flugente + #include "MercCompare.h" // added by Flugente #endif #include "connect.h" @@ -1048,14 +1049,17 @@ INT32 EnterLaptop() //JA25 UB SetBookMark(MERC_BOOKMARK); #endif - if ( gGameExternalOptions.gEncyclopedia == TRUE && !is_networked ) + if ( gGameExternalOptions.gEncyclopedia && !is_networked ) SetBookMark(ENCYCLOPEDIA_BOOKMARK); - if ( gGameExternalOptions.gBriefingRoom == TRUE && !is_networked ) + if ( gGameExternalOptions.gBriefingRoom && !is_networked ) SetBookMark(BRIEFING_ROOM_BOOKMARK); if ( gGameExternalOptions.fCampaignHistoryWebSite && !is_networked ) SetBookMark(CAMPAIGNHISTORY_BOOKMARK); + + if ( !is_networked ) + SetBookMark( MERCCOMPARE_BOOKMARK ); LoadLoadPending( ); @@ -1443,18 +1447,30 @@ void RenderLaptop() case LAPTOP_MODE_CAMPAIGNHISTORY_ABOUTTUS: RenderCampaignHistory(); break; + + case LAPTOP_MODE_MERCCOMPARE_MATRIX: + RenderMercCompareMatrix( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_ANALYZE: + RenderMercCompareAnalyze( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_CUSTOMERS: + RenderMercCompareCustomers(); + break; + + case LAPTOP_MODE_MERCCOMPARE_MAIN: + RenderMercCompareMain(); + break; } - - if( guiCurrentLaptopMode >= LAPTOP_MODE_WWW ) { // render program bar for www program RenderWWWProgramTitleBar( ); } - - if(fLoadPendingFlag) { guiCurrentLaptopMode = uiTempMode; @@ -1860,6 +1876,22 @@ void EnterNewLaptopMode() EnterCampaignHistory(); break; + case LAPTOP_MODE_MERCCOMPARE_MATRIX: + EnterMercCompareMatrix( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_ANALYZE: + EnterMercCompareAnalyze( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_CUSTOMERS: + EnterMercCompareCustomers(); + break; + + case LAPTOP_MODE_MERCCOMPARE_MAIN: + EnterMercCompareMain( ); + break; + case LAPTOP_MODE_BOBBYR_SHIPMENTS: EnterBobbyRShipments(); break; @@ -2097,6 +2129,22 @@ void HandleLapTopHandles() case LAPTOP_MODE_CAMPAIGNHISTORY_ABOUTTUS: HandleCampaignHistory(); break; + + case LAPTOP_MODE_MERCCOMPARE_MATRIX: + HandleMercCompareMatrix( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_ANALYZE: + HandleMercCompareAnalyze( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_CUSTOMERS: + HandleMercCompareCustomers(); + break; + + case LAPTOP_MODE_MERCCOMPARE_MAIN: + HandleMercCompareMain(); + break; } } @@ -2652,6 +2700,22 @@ UINT32 ExitLaptopMode(UINT32 uiMode) case LAPTOP_MODE_CAMPAIGNHISTORY_ABOUTTUS: ExitCampaignHistory(); break; + + case LAPTOP_MODE_MERCCOMPARE_MATRIX: + ExitMercCompareMatrix( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_ANALYZE: + ExitMercCompareAnalyze( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_CUSTOMERS: + ExitMercCompareCustomers( ); + break; + + case LAPTOP_MODE_MERCCOMPARE_MAIN: + ExitMercCompareMain(); + break; } if( ( uiMode != LAPTOP_MODE_NONE )&&( uiMode < LAPTOP_MODE_WWW ) ) @@ -4250,6 +4314,35 @@ if( (gubQuest[ QUEST_FIX_LAPTOP ] != QUESTINPROGRESS) || (gGameUBOptions.LaptopQ } break; + case MERCCOMPARE_BOOKMARK: + { + // if the option is off, we instead link to a 'broken' website + if ( !gGameExternalOptions.fCampaignHistoryWebSite ) + { + guiCurrentWWWMode=LAPTOP_MODE_BROKEN_LINK; + guiCurrentLaptopMode=LAPTOP_MODE_BROKEN_LINK; + + return GoToWebPage(LAPTOP_MODE_BROKEN_LINK); + } + + guiCurrentWWWMode = LAPTOP_MODE_MERCCOMPARE_MAIN; + guiCurrentLaptopMode = LAPTOP_MODE_MERCCOMPARE_MAIN; + + // do we have to have a World Wide Wait + if ( LaptopSaveInfo.fVisitedBookmarkAlready[MERCCOMPARE_BOOKMARK] == FALSE ) + { + // reset flag and set load pending flag + LaptopSaveInfo.fVisitedBookmarkAlready[MERCCOMPARE_BOOKMARK] = TRUE; + fLoadPendingFlag = TRUE; + } + else + { + // fast reload + fLoadPendingFlag = TRUE; + fFastLoadFlag = TRUE; + } + } + break; } #ifdef JA2UB diff --git a/Laptop/laptop.h b/Laptop/laptop.h index dde25a41..cdf8a716 100644 --- a/Laptop/laptop.h +++ b/Laptop/laptop.h @@ -145,6 +145,12 @@ enum LAPTOP_MODE_CAMPAIGNHISTORY_LATESTNEWS, LAPTOP_MODE_CAMPAIGNHISTORY_ABOUTTUS, + // Flugente: MercCompare + LAPTOP_MODE_MERCCOMPARE_MAIN, + LAPTOP_MODE_MERCCOMPARE_MATRIX, + LAPTOP_MODE_MERCCOMPARE_ANALYZE, + LAPTOP_MODE_MERCCOMPARE_CUSTOMERS, + LAPTOP_MODE_BOBBYR_SHIPMENTS, //ENCYCLOPEDIA @@ -219,6 +225,7 @@ enum{ ENCYCLOPEDIA_BOOKMARK, //Encyclopedia BRIEFING_ROOM_BOOKMARK, CAMPAIGNHISTORY_BOOKMARK, // added by Flugente + MERCCOMPARE_BOOKMARK, // added by Flugente TEXT_NUM_LAPTOP_BOOKMARKS }; diff --git a/Laptop/merccompare.cpp b/Laptop/merccompare.cpp new file mode 100644 index 00000000..1bc212f4 --- /dev/null +++ b/Laptop/merccompare.cpp @@ -0,0 +1,1207 @@ +/** +* @file +* @author Flugente (bears-pit.com) +*/ + +#ifdef PRECOMPILEDHEADERS +#include "Laptop All.h" +#else +#include "laptop.h" +#include "insurance.h" +#include "insurance Contract.h" +#include "WCheck.h" +#include "Utilities.h" +#include "WordWrap.h" +#include "Cursors.h" +#include "Line.h" +#include "Insurance Text.h" +#include "Encrypted File.h" +#include "Text.h" +#include "Multi Language Graphic Utils.h" +#include "merccompare.h" +#include "random.h" +#include "Interface.h" +#include "Soldier Add.h" +#include "Soldier Profile.h" +#include "DropDown.h" +#include "Overhead.h" +#include "Map Screen Interface.h" +#endif + + +#define MERCOMP_FONT_COLOR 2 +#define CAMPHIS_FONT_COLOR_RED FONT_MCOLOR_RED +#define CAMPHIS_FONT_BIG FONT14ARIAL +#define CAMPHIS_FONT_MED FONT12ARIAL +#define CAMPHIS_FONT_SMALL FONT10ARIAL + +#define CAMPHIS_FONT_BTN_COLOR FONT_MCOLOR_WHITE +#define CAMPHIS_FONT_BTN_SHADOW_COLOR 2 + +#define MERCOMP_FONT_SHADOW FONT_MCOLOR_WHITE + +#define CAMPAIGN_HISTORY_BULLET_TEXT_OFFSET_X 21 + +#define CAMPAIGN_HISTORY_LINK_START_X LAPTOP_SCREEN_UL_X +#define CAMPAIGN_HISTORY_LINK_START_Y LAPTOP_SCREEN_WEB_UL_Y + 5 +#define CAMPAIGN_HISTORY_LINK_TEXT_WIDTH 107 +#define CAMPAIGN_HISTORY_LINK_STEP_Y 14 + +#define CAMPAIGN_HISTORY_BACKGROUND_WIDTH 125 +#define CAMPAIGN_HISTORY_BACKGROUND_HEIGHT 100 + +#define CAMPAIGN_HISTORY_BIG_TITLE_X 115 + LAPTOP_SCREEN_UL_X +#define CAMPAIGN_HISTORY_BIG_TITLE_Y 10 + LAPTOP_SCREEN_WEB_UL_Y + +#define CAMPAIGN_HISTORY_RED_BAR_X LAPTOP_SCREEN_UL_X +#define CAMPAIGN_HISTORY_RED_BAR_Y LAPTOP_SCREEN_WEB_UL_Y + +#define CAMPAIGN_HISTORY_TOP_RED_BAR_X LAPTOP_SCREEN_UL_X + 66 +#define CAMPAIGN_HISTORY_TOP_RED_BAR_Y 109 + LAPTOP_SCREEN_WEB_UL_Y +#define CAMPAIGN_HISTORY_TOP_RED_BAR_Y1 31 + LAPTOP_SCREEN_WEB_UL_Y + +#define CAMPAIGN_HISTORY_BOTTOM_RED_BAR_Y 345 + LAPTOP_SCREEN_WEB_UL_Y + +#define CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_X 77 + LAPTOP_SCREEN_UL_X +#define CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_Y 392 + LAPTOP_SCREEN_WEB_UL_Y +#define CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_WIDTH 107 +#define CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_OFFSET 148 +#define CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_X_2 CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_X + CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_OFFSET +#define CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_X_3 CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_X_2 + CAMPAIGN_HISTORY_BOTTOM_LINK_RED_BAR_OFFSET + +#define CAMPAIGN_HISTORY_SUBTITLE_X CAMPAIGN_HISTORY_BIG_TITLE_X +#define CAMPAIGN_HISTORY_SUBTITLE_Y CAMPAIGN_HISTORY_BIG_TITLE_Y + 20 + +#define CAMPAIGN_HISTORY_BULLET_TEXT_1_Y 188 + LAPTOP_SCREEN_WEB_UL_Y +#define CAMPAIGN_HISTORY_BULLET_TEXT_2_Y 215 + LAPTOP_SCREEN_WEB_UL_Y +#define CAMPAIGN_HISTORY_BULLET_TEXT_3_Y 242 + LAPTOP_SCREEN_WEB_UL_Y + +#define CAMPAIGN_HISTORY_BOTTOM_SLOGAN_X CAMPAIGN_HISTORY_SUBTITLE_X +#define CAMPAIGN_HISTORY_BOTTOM_SLOGAN_Y 285 + LAPTOP_SCREEN_WEB_UL_Y +#define CAMPAIGN_HISTORY_BOTTOM_SLOGAN_WIDTH 370 + +#define CAMPAIGN_HISTORY_SMALL_TITLE_X 64 + LAPTOP_SCREEN_UL_X +#define CAMPAIGN_HISTORY_SMALL_TITLE_Y 5 + LAPTOP_SCREEN_WEB_UL_Y + +#define CAMPAIGN_HISTORY_SMALL_TITLE_WIDTH 434 - 170 +#define CAMPAIGN_HISTORY_SMALL_TITLE_HEIGHT 40 - 10 + +#define MERCCOMPARE_NUM_LINKS 4 +#define MCA_START_CONTENT_Y (LAPTOP_SCREEN_WEB_UL_Y + MERCCOMPARE_NUM_LINKS * 17) + + +extern UINT32 guiInsuranceBackGround; +extern UINT32 guiInsuranceSmallTitleImage; +extern UINT32 guiInsuranceBigRedLineImage; +UINT32 guiMercCompareBulletImage; +UINT32 guiMercCompareLogoImage; + +//link to the various pages +MOUSE_REGION gMercCompareLinkRegion[MERCCOMPARE_NUM_LINKS]; +void SelectMercCompareRegionCallBack( MOUSE_REGION * pRegion, INT32 iReason ); + + +void GameInitMercCompare( ) +{ + +} + +BOOLEAN EnterMercCompareMain( ) +{ + InitMercCompareDefaults( ); + + RenderMercCompareMain( ); + + return(TRUE); +} + +void ExitMercCompareMain( ) +{ + RemoveMercCompareDefaults( ); +} + +void HandleMercCompareMain( ) +{ + +} + +void RenderMercCompareMain( ) +{ + CHAR16 sText[800]; + swprintf( sText, L"" ); + UINT16 usPosX, usPosY; + HVOBJECT hPixHandle; + + //Get the bullet + GetVideoObject( &hPixHandle, guiMercCompareBulletImage ); + + DisplayMercCompareDefaults( ); + + SetFontShadow( MERCOMP_FONT_SHADOW ); + + usPosX = LAPTOP_SCREEN_UL_X; + usPosY = MCA_START_CONTENT_Y; + + swprintf( sText, szMercCompareWebSite[TEXT_MERCCOMPARE_INTRO1] ); + usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + for ( int i = TEXT_MERCCOMPARE_BULLET1; i < TEXT_MERCCOMPARE_BULLET4; ++i ) + { + // display bullet + BltVideoObject( FRAME_BUFFER, hPixHandle, 0, usPosX, usPosY, VO_BLT_SRCTRANSPARENCY, NULL ); + + swprintf( sText, szMercCompareWebSite[i] ); + DrawTextToScreen( sText, usPosX + 25, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, 0 ); + + usPosY += 15; + } + + usPosY += 15; + + swprintf( sText, szMercCompareWebSite[TEXT_MERCCOMPARE_INTRO2] ); + usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + SetFontShadow( DEFAULT_SHADOW ); + + MarkButtonsDirty( ); + RenderWWWProgramTitleBar( ); + InvalidateRegion( LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y ); +} + + +BOOLEAN InitMercCompareDefaults( ) +{ + VOBJECT_DESC VObjectDesc; + + // load the Insurance bullet graphic and add it + VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE; + FilenameForBPP( "LAPTOP\\bullet.sti", VObjectDesc.ImageFile ); + CHECKF( AddVideoObject( &VObjectDesc, &guiMercCompareBulletImage ) ); + + // load the Flower Account Box graphic and add it + VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE; + FilenameForBPP( "LAPTOP\\BackGroundTile.sti", VObjectDesc.ImageFile ); + CHECKF( AddVideoObject( &VObjectDesc, &guiInsuranceBackGround ) ); + + // load the red bar on the side of the page and add it + VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE; + FilenameForBPP( "LAPTOP\\LargeBar.sti", VObjectDesc.ImageFile ); + CHECKF( AddVideoObject( &VObjectDesc, &guiInsuranceBigRedLineImage ) ); + + VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE; + FilenameForBPP( "LAPTOP\\PressLogos.sti", VObjectDesc.ImageFile ); + CHECKF( AddVideoObject( &VObjectDesc, &guiMercCompareLogoImage ) ); + + UINT16 usPosX = CAMPAIGN_HISTORY_LINK_START_X; + UINT16 usPosY = CAMPAIGN_HISTORY_LINK_START_Y; + for ( int i = 0; i= TEXT_MERCCOMPARE_MAX ) + wcscpy( pString, L"???" ); + + wcscpy( pString, szMercCompareWebSite[ubNumber] ); +} + + +void SelectMercCompareRegionCallBack( MOUSE_REGION * pRegion, INT32 iReason ) +{ + if ( iReason & MSYS_CALLBACK_REASON_INIT ) + { + } + else if ( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP ) + { + UINT32 uiLink = MSYS_GetRegionUserData( pRegion, 0 ); + + if ( uiLink == 0 ) + guiCurrentLaptopMode = LAPTOP_MODE_MERCCOMPARE_MAIN; + else if ( uiLink == 1 ) + guiCurrentLaptopMode = LAPTOP_MODE_MERCCOMPARE_MATRIX; + else if ( uiLink == 2 ) + guiCurrentLaptopMode = LAPTOP_MODE_MERCCOMPARE_ANALYZE; + else if ( uiLink == 3 ) + guiCurrentLaptopMode = LAPTOP_MODE_MERCCOMPARE_CUSTOMERS; + } + else if ( iReason & MSYS_CALLBACK_REASON_RBUTTON_UP ) + { + } +} + + +////////////////////////// MERC COMPARE CUSTOMERS //////////////////////////////// + +void GameInitMercCompareCustomers( ) +{ + +} + +BOOLEAN EnterMercCompareCustomers( ) +{ + InitMercCompareDefaults( ); + + RenderMercCompareCustomers( ); + + return(TRUE); +} + +void ExitMercCompareCustomers( ) +{ + RemoveMercCompareDefaults( ); +} + +void HandleMercCompareCustomers( ) +{ + +} + +void RenderMercCompareCustomers( ) +{ + CHAR16 sText[800]; + swprintf( sText, L"" ); + UINT16 usPosX, usPosY; + HVOBJECT hPixHandle; + + //Get the bullet + GetVideoObject( &hPixHandle, guiMercCompareBulletImage ); + + DisplayMercCompareDefaults( ); + + SetFontShadow( MERCOMP_FONT_SHADOW ); + + usPosX = LAPTOP_SCREEN_UL_X; + usPosY = MCA_START_CONTENT_Y; + + swprintf( sText, szMercCompareWebSite[TEXT_MERCCOMPARE_QUOTEINTRO] ); + usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + // choose 3 random customer quotes out of the pool of all quotes + std::set quoteset; + //while ( quoteset.size( ) < min( 3, TEXT_MERCCOMPARE_CUSTOMERSTATEMENTS ) ) + //quoteset.insert( Random( TEXT_MERCCOMPARE_CUSTOMERSTATEMENTS ) ); + + // showoff hack + quoteset.insert( 0 ); + quoteset.insert( 1 ); + quoteset.insert( 2 ); + + std::set::iterator itend = quoteset.end(); + for ( std::set::iterator it = quoteset.begin(); it != itend; ++it ) + { + // display bullet + BltVideoObject( FRAME_BUFFER, hPixHandle, 0, usPosX, usPosY, VO_BLT_SRCTRANSPARENCY, NULL ); + + swprintf( sText, szMercCompareWebSite[TEXT_MERCCOMPARE_QUOTE1 + 2 * (*it)] ); + usPosY += DisplayWrappedString( usPosX + 25, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X - 25, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + usPosY += 10; + + swprintf( sText, szMercCompareWebSite[TEXT_MERCCOMPARE_QUOTE1 + 2 * (*it) + 1] ); + usPosY += DisplayWrappedString( usPosX + 180, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X - 25, 2, FONT12ROMAN, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + usPosY += 30; + } + + SetFontShadow( DEFAULT_SHADOW ); + + MarkButtonsDirty( ); + RenderWWWProgramTitleBar( ); + InvalidateRegion( LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y ); +} +////////////////////////// MERC COMPARE CUSTOMERS //////////////////////////////// + +////////////////////////// MERC COMPARE ANALYZE //////////////////////////////// +UINT8 gMercCompareProfile1 = NO_PROFILE; +UINT8 gMercCompareProfile2 = NO_PROFILE; +BOOLEAN fMercCompareRedraw = FALSE; + +#define MCA_DROPDOWN_X (LAPTOP_SCREEN_UL_X + 60) +#define MCA_SIDEOFFSET ((LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X) /2) +#define MCA_NUMBEROFFSET ((LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X) *4/9) + +// two dropdowns, which we'll use to toggle between our mercs +template<> void DropDownTemplate::SetRefresh( ) { fMercCompareRedraw = TRUE; } +template<> void DropDownTemplate::SetRefresh( ) { fMercCompareRedraw = TRUE; } + +void GameInitMercCompareAnalyze() +{ + +} + +BOOLEAN EnterMercCompareAnalyze() +{ + InitMercCompareDefaults( ); + + // We fill two dropdowns with all mercs on our team + std::vector > mercvector; + + SOLDIERTYPE* pSoldier = NULL; + UINT16 id = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 lastid = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pSoldier = MercPtrs[id]; id <= lastid; ++id, pSoldier++ ) + { + if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE ) + mercvector.push_back( std::make_pair( pSoldier->ubProfile, gMercProfiles[pSoldier->ubProfile].zNickname ) ); + } + + DropDownTemplate::getInstance( ).SetEntries( mercvector ); + DropDownTemplate::getInstance( ).SetHelpText( szMercCompareWebSite[TEXT_MERCCOMPARE_DROPDOWNTEXT] ); + DropDownTemplate::getInstance( ).Create( MCA_DROPDOWN_X, MCA_START_CONTENT_Y ); + + DropDownTemplate::getInstance( ).SetEntries( mercvector ); + DropDownTemplate::getInstance( ).SetHelpText( szMercCompareWebSite[TEXT_MERCCOMPARE_DROPDOWNTEXT] ); + DropDownTemplate::getInstance( ).Create( MCA_DROPDOWN_X + MCA_SIDEOFFSET, MCA_START_CONTENT_Y ); + + // if a profile wa already set, use it + if ( gMercCompareProfile1 != NO_PROFILE ) + DropDownTemplate::getInstance( ).SetSelectedEntryKey( gMercCompareProfile1 ); + + if ( gMercCompareProfile2 != NO_PROFILE ) + DropDownTemplate::getInstance( ).SetSelectedEntryKey( gMercCompareProfile2 ); + + RenderMercCompareAnalyze( ); + + return(TRUE); +} + +void ExitMercCompareAnalyze() +{ + RemoveMercCompareDefaults( ); + + DropDownTemplate::getInstance( ).Destroy( ); + DropDownTemplate::getInstance( ).Destroy( ); +} + +void HandleMercCompareAnalyze() +{ + if ( fMercCompareRedraw ) + { + RenderMercCompareAnalyze( ); + fMercCompareRedraw = FALSE; + } +} + +void RenderMercCompareAnalyze() +{ + CHAR16 sText[800]; + swprintf( sText, L"" ); + UINT16 usPosX, usPosY; + HVOBJECT hPixHandle; + + //Get the bullet + GetVideoObject( &hPixHandle, guiMercCompareBulletImage ); + + DisplayMercCompareDefaults( ); + + SetFontShadow( MERCOMP_FONT_SHADOW ); + + usPosX = LAPTOP_SCREEN_UL_X; + usPosY = MCA_START_CONTENT_Y; + + gMercCompareProfile1 = (UINT8)DropDownTemplate::getInstance( ).GetSelectedEntryKey( ); + gMercCompareProfile2 = (UINT8)DropDownTemplate::getInstance( ).GetSelectedEntryKey( ); + + DisplayMercData( gMercCompareProfile1, gMercCompareProfile2 ); + + DropDownTemplate::getInstance( ).Display( ); + DropDownTemplate::getInstance( ).Display( ); + + SetFontShadow( DEFAULT_SHADOW ); + + MarkButtonsDirty( ); + RenderWWWProgramTitleBar( ); + InvalidateRegion( LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y ); +} +////////////////////////// MERC COMPARE ANALYZE //////////////////////////////// + + +BOOLEAN DisplayMercData( UINT8 usProfileA, UINT8 usProfileB ) +{ + VOBJECT_DESC VObjectDesc; + HVOBJECT hPixHandle; + UINT16 usPosX, usPosY, usPosY2; + UINT32 uiInsMercFaceImage; + INT32 iCostOfContract = 0; + char sTemp[100]; + CHAR16 sText[800]; + BOOLEAN fDisplayMercContractStateTextColorInRed = FALSE; + + // we need a valid ID here + if ( !OKToCheckOpinion( usProfileA ) || !OKToCheckOpinion( usProfileB ) ) + return FALSE; + + MERCPROFILESTRUCT* pProfileA = &(gMercProfiles[usProfileA]); + MERCPROFILESTRUCT* pProfileB = &(gMercProfiles[usProfileB]); + + if ( !pProfileA || !pProfileB ) + return FALSE; + + INT16 idA = GetSoldierIDFromMercID( usProfileA ); + INT16 idB = GetSoldierIDFromMercID( usProfileB ); + + if ( idA < 0 || idB < 0 ) + return FALSE; + + SOLDIERTYPE* pSoldierA = MercPtrs[idA]; + SOLDIERTYPE* pSoldierB = MercPtrs[idB]; + + if ( !pSoldierA || !pSoldierB ) + return FALSE; + + usPosX = LAPTOP_SCREEN_UL_X; + usPosY = MCA_START_CONTENT_Y; + + // load the mercs face graphic and add it + VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE; + + // face 1 + // IMP faces are stored elsewhere + if ( gProfilesIMP[usProfileA].ProfilId == usProfileA ) + { + sprintf( sTemp, "IMPFACES\\%02d.sti", gMercProfiles[usProfileA].ubFaceIndex ); + FilenameForBPP( sTemp, VObjectDesc.ImageFile ); + CHECKF( AddVideoObject( &VObjectDesc, &uiInsMercFaceImage ) ); + } + else + { + sprintf( sTemp, "FACES\\%02d.sti", usProfileA ); + FilenameForBPP( sTemp, VObjectDesc.ImageFile ); + CHECKF( AddVideoObject( &VObjectDesc, &uiInsMercFaceImage ) ); + } + + //Get the merc's face + GetVideoObject( &hPixHandle, uiInsMercFaceImage ); + + //if the merc is dead, shade the face red + if ( IsMercDead( usProfileA ) ) + { + //if the merc is dead + //shade the face red, (to signify that he is dead) + hPixHandle->pShades[0] = Create16BPPPaletteShaded( hPixHandle->pPaletteEntry, DEAD_MERC_COLOR_RED, DEAD_MERC_COLOR_GREEN, DEAD_MERC_COLOR_BLUE, TRUE ); + + //set the red pallete to the face + SetObjectHandleShade( uiInsMercFaceImage, 0 ); + } + + //Get and display the mercs face + BltVideoObject( FRAME_BUFFER, hPixHandle, 0, usPosX + 5, usPosY + 4, VO_BLT_SRCTRANSPARENCY, NULL ); + + usPosX += MCA_SIDEOFFSET; + + // face 2 + // IMP faces are stored elsewhere + if ( gProfilesIMP[usProfileB].ProfilId == usProfileB ) + { + sprintf( sTemp, "IMPFACES\\%02d.sti", gMercProfiles[usProfileB].ubFaceIndex ); + FilenameForBPP( sTemp, VObjectDesc.ImageFile ); + CHECKF( AddVideoObject( &VObjectDesc, &uiInsMercFaceImage ) ); + } + else + { + sprintf( sTemp, "FACES\\%02d.sti", usProfileB ); + FilenameForBPP( sTemp, VObjectDesc.ImageFile ); + CHECKF( AddVideoObject( &VObjectDesc, &uiInsMercFaceImage ) ); + } + + //Get the merc's face + GetVideoObject( &hPixHandle, uiInsMercFaceImage ); + + //if the merc is dead, shade the face red + if ( IsMercDead( usProfileB ) ) + { + //if the merc is dead + //shade the face red, (to signify that he is dead) + hPixHandle->pShades[0] = Create16BPPPaletteShaded( hPixHandle->pPaletteEntry, DEAD_MERC_COLOR_RED, DEAD_MERC_COLOR_GREEN, DEAD_MERC_COLOR_BLUE, TRUE ); + + //set the red pallete to the face + SetObjectHandleShade( uiInsMercFaceImage, 0 ); + } + + //Get and display the mercs face + BltVideoObject( FRAME_BUFFER, hPixHandle, 0, usPosX + 5, usPosY + 4, VO_BLT_SRCTRANSPARENCY, NULL ); + + // the face images isn't needed anymore so delete it + DeleteVideoObjectFromIndex( uiInsMercFaceImage ); + + usPosX -= MCA_SIDEOFFSET; + usPosY += 50; + + SetFontShadow( MERCOMP_FONT_SHADOW ); + + // base opinions + swprintf( sText, L"Base opinion:" ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + INT8 val = pProfileA->bMercOpinion[usProfileB]; + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + val = pProfileB->bMercOpinion[usProfileA]; + swprintf( sText, L"%d", val ); + usPosY += DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + // refinement + BOOLEAN fRefinementfoundA = FALSE; + // if we don't care, doesn't matter + if ( pProfileA->bRefinementCareLevel == CARELEVEL_NONE ) + { + // nothing to do... + } + // if we care somewhat, malus on slob/snob + else if ( pProfileA->bRefinementCareLevel == CARELEVEL_SOME ) + { + if ( pProfileA->bRefinement * pProfileB->bRefinement == 2 ) + { + val = -gGameExternalOptions.sMoraleModRefinement; + fRefinementfoundA = TRUE; + } + } + // if we care extremely, reward for similarity, malus otherwise + else //if( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) + { + if ( pProfileA->bRefinement * pProfileB->bRefinement == 2 ) + val = -2 * gGameExternalOptions.sMoraleModRefinement; + else if ( pProfileA->bRefinement * pProfileB->bRefinement == 0 ) + val = -gGameExternalOptions.sMoraleModRefinement; + else + val = gGameExternalOptions.sMoraleModRefinement; + + fRefinementfoundA = TRUE; + } + + if ( fRefinementfoundA ) + { + swprintf( sText, (val < 0) ? L"Dislikes %s %s" : L"Likes %s %s", szRefinementTextTypes[pProfileB->bRefinement], szCareLevelText[pProfileA->bRefinementCareLevel] ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + BOOLEAN fRefinementfoundB = FALSE; + // if we don't care, doesn't matter + if ( pProfileB->bRefinementCareLevel == CARELEVEL_NONE ) + { + // nothing to do... + } + // if we care somewhat, malus on slob/snob + else if ( pProfileB->bRefinementCareLevel == CARELEVEL_SOME ) + { + if ( pProfileA->bRefinement * pProfileB->bRefinement == 2 ) + { + val = -gGameExternalOptions.sMoraleModRefinement; + fRefinementfoundB = TRUE; + } + } + // if we care extremely, reward for similarity, malus otherwise + else //if( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) + { + if ( pProfileA->bRefinement * pProfileB->bRefinement == 2 ) + val = -2 * gGameExternalOptions.sMoraleModRefinement; + else if ( pProfileA->bRefinement * pProfileB->bRefinement == 0 ) + val = -gGameExternalOptions.sMoraleModRefinement; + else + val = gGameExternalOptions.sMoraleModRefinement; + + fRefinementfoundB = TRUE; + } + + if ( fRefinementfoundB ) + { + swprintf( sText, (val < 0) ? L"Dislikes %s %s" : L"Likes %s %s", szRefinementTextTypes[pProfileA->bRefinement], szCareLevelText[pProfileB->bRefinementCareLevel] ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + if ( fRefinementfoundA || fRefinementfoundB ) + usPosY += 12; + + // some people hate other nationalities (do not mix up with racism, which uses bRace) + if ( (pProfileA->bHatedNationality > -1 && pProfileB->bNationality == pProfileA->bHatedNationality) || (pProfileB->bHatedNationality > -1 && pProfileA->bNationality == pProfileB->bHatedNationality) ) + { + if ( pProfileA->bHatedNationality > -1 && pProfileB->bNationality == pProfileA->bHatedNationality ) + { + if ( pProfileA->bHatedNationalityCareLevel == CARELEVEL_SOME ) + val = -gGameExternalOptions.sMoraleModHatedNationality; + else if ( pProfileA->bHatedNationalityCareLevel == CARELEVEL_EXTREME ) + val = -gGameExternalOptions.sMoraleModHatedNationality * 2; + else + val = 0; + + swprintf( sText, pProfileA->bRacist == RACIST_VERY ? L"Strongly hates %s" : L"Hates %s", szNationalityTextAdjective[pProfileA->bHatedNationality] ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + if ( pProfileB->bHatedNationality > -1 && pProfileA->bNationality == pProfileB->bHatedNationality ) + { + if ( pProfileB->bHatedNationalityCareLevel == CARELEVEL_SOME ) + val = -gGameExternalOptions.sMoraleModHatedNationality; + else if ( pProfileB->bHatedNationalityCareLevel == CARELEVEL_EXTREME ) + val = -gGameExternalOptions.sMoraleModHatedNationality * 2; + else + val = 0; + + swprintf( sText, pProfileB->bRacist == RACIST_VERY ? L"Strongly hates %s" : L"Hates %s", szNationalityTextAdjective[pProfileB->bHatedNationality] ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + usPosY += 12; + } + + // racism + if ( (pProfileA->bRacist || pProfileB->bRacist) && pProfileA->bRace != pProfileB->bRace ) + { + if ( pProfileA->bRacist ) + { + if ( pProfileA->bRacist == RACIST_SOME ) + val = -gGameExternalOptions.sMoraleModRacism; + else if ( pProfileA->bRacist == RACIST_VERY ) + val = -gGameExternalOptions.sMoraleModRacism * 2; + else + val = 0; + + swprintf( sText, pProfileA->bRacist == RACIST_VERY ? L"Deep racism against %s" : L"Racism against %s", szRaceText[pProfileB->bRace] ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + if ( pProfileB->bRacist ) + { + if ( pProfileB->bRacist == RACIST_SOME ) + val = -gGameExternalOptions.sMoraleModRacism; + else if ( pProfileB->bRacist == RACIST_VERY ) + val = -gGameExternalOptions.sMoraleModRacism * 2; + else + val = 0; + + swprintf( sText, pProfileB->bRacist == RACIST_VERY ? L"Deep racism against %s" : L"Racism against %s", szRaceText[pProfileA->bRace] ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + usPosY += 12; + } + + // appearance + BOOLEAN fAppearanceDone = FALSE; + switch ( pProfileB->bAppearance ) + { + case APPEARANCE_UGLY: val = -gGameExternalOptions.sMoraleModAppearance * 2; break; + case APPEARANCE_HOMELY: val = -gGameExternalOptions.sMoraleModAppearance; break; + case APPEARANCE_ATTRACTIVE: val = gGameExternalOptions.sMoraleModAppearance; break; + case APPEARANCE_BABE: val = gGameExternalOptions.sMoraleModAppearance * 2; break; + default: val = 0; break; + } + + if ( pProfileA->bAppearanceCareLevel == CARELEVEL_EXTREME ) val *= 2; + else if ( pProfileA->bAppearanceCareLevel == CARELEVEL_NONE ) val = 0; + + if ( val != 0 ) + { + swprintf( sText, (pProfileA->bAppearanceCareLevel == CARELEVEL_EXTREME) ? L"Cares deeply about looks" : L"Cares about looks" ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + fAppearanceDone = TRUE; + } + + switch ( pProfileA->bAppearance ) + { + case APPEARANCE_UGLY: val = -gGameExternalOptions.sMoraleModAppearance * 2; break; + case APPEARANCE_HOMELY: val = -gGameExternalOptions.sMoraleModAppearance; break; + case APPEARANCE_ATTRACTIVE: val = gGameExternalOptions.sMoraleModAppearance; break; + case APPEARANCE_BABE: val = gGameExternalOptions.sMoraleModAppearance * 2; break; + default: val = 0; break; + } + + if ( pProfileB->bAppearanceCareLevel == CARELEVEL_EXTREME ) val *= 2; + else if ( pProfileB->bAppearanceCareLevel == CARELEVEL_NONE ) val = 0; + + if ( val != 0 ) + { + swprintf( sText, (pProfileB->bAppearanceCareLevel == CARELEVEL_EXTREME) ? L"Cares deeply about looks" : L"Cares about looks" ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + fAppearanceDone = TRUE; + } + + if ( fAppearanceDone ) + usPosY += 12; + + // sexism + BOOLEAN fSexismDone = FALSE; + if ( (pProfileA->bSexist || pProfileB->bSexist) && pProfileA->bSex != pProfileB->bSex ) + { + if ( pProfileA->bSexist ) + { + switch ( pProfileB->bAppearance ) + { + case APPEARANCE_UGLY: val = -gGameExternalOptions.sMoraleModSexism * 2; break; + case APPEARANCE_HOMELY: val = -gGameExternalOptions.sMoraleModSexism; break; + case APPEARANCE_ATTRACTIVE: val = gGameExternalOptions.sMoraleModSexism; break; + case APPEARANCE_BABE: val = gGameExternalOptions.sMoraleModSexism * 2; break; + default: val = 0; break; + } + + if ( pProfileA->bSexist == VERY_SEXIST ) val *= 2; + + if ( val != 0 ) + { + swprintf( sText, (pProfileA->bSexist == VERY_SEXIST) ? L"Very sexist" : L"Sexist" ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + fSexismDone = TRUE; + } + } + + if ( pProfileB->bSexist ) + { + switch ( pProfileA->bAppearance ) + { + case APPEARANCE_UGLY: val = -gGameExternalOptions.sMoraleModSexism * 2; break; + case APPEARANCE_HOMELY: val = -gGameExternalOptions.sMoraleModSexism; break; + case APPEARANCE_ATTRACTIVE: val = gGameExternalOptions.sMoraleModSexism; break; + case APPEARANCE_BABE: val = gGameExternalOptions.sMoraleModSexism * 2; break; + default: val = 0; break; + } + + if ( pProfileB->bSexist == VERY_SEXIST ) val *= 2; + + if ( val != 0 ) + { + swprintf( sText, (pProfileB->bSexist == VERY_SEXIST) ? L"Very sexist" : L"Sexist" ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + fSexismDone = TRUE; + } + } + + if ( fSexismDone ) + usPosY += 12; + } + + // backgrounds + if ( GetBackgroundValue( usProfileA, BG_DISLIKEBG ) && GetBackgroundValue( usProfileA, BG_DISLIKEBG ) == -GetBackgroundValue( usProfileB, BG_DISLIKEBG ) ) + { + val = -2; + + swprintf( sText, L"Dislikes other background" ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + swprintf( sText, L"Dislikes other background" ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + usPosY += DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + // after this, the lines are no longer synchronous - we just list each property on its own side + usPosY2 = usPosY; + + if ( pProfileA->usBackground != pProfileB->usBackground ) + { + if ( HasBackgroundFlag( usProfileA, BACKGROUND_XENOPHOBIC ) ) + { + val = -gGameExternalOptions.sMoraleModXenophobicBackGround; + swprintf( sText, L"Dislikes other backgrounds" ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + usPosY += DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + if ( HasBackgroundFlag( usProfileB, BACKGROUND_XENOPHOBIC ) ) + { + val = -gGameExternalOptions.sMoraleModXenophobicBackGround; + swprintf( sText, L"Dislikes other backgrounds" ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY2, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + usPosY2 += DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY2, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + } + + // dynamic opinions + if ( gGameExternalOptions.fDynamicOpinions ) + { + for ( UINT8 opinionevent = OPINIONEVENT_FRIENDLYFIRE; opinionevent < OPINIONEVENT_MAX; ++opinionevent ) + { + val = GetDynamicOpinion( usProfileA, usProfileB, opinionevent ); + + if ( val ) + { + swprintf( sText, szMercCompareEventText[opinionevent], gMercProfiles[usProfileB].zNickname ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + usPosY += DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + + val = GetDynamicOpinion( usProfileB, usProfileA, opinionevent ); + + if ( val ) + { + swprintf( sText, szMercCompareEventText[opinionevent], gMercProfiles[usProfileA].zNickname ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET, usPosY2, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + swprintf( sText, L"%d", val ); + usPosY2 += DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY2, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + } + } + } + + // draw the final verdict + val = SoldierRelation( pSoldierA, pSoldierB ); + + swprintf( sText, L"____" ); + DisplayWrappedString( usPosX + MCA_NUMBEROFFSET - 10, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + usPosY += 12; + swprintf( sText, L"%d", val ); + usPosY += DisplayWrappedString( usPosX + MCA_NUMBEROFFSET, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + val = SoldierRelation( pSoldierB, pSoldierA ); + + swprintf( sText, L"____" ); + DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET - 10, usPosY2, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + usPosY2 += 12; + swprintf( sText, L"%d", val ); + usPosY2 += DisplayWrappedString( usPosX + MCA_SIDEOFFSET + MCA_NUMBEROFFSET, usPosY2, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + return TRUE; +} + +////////////////////////// MERC COMPARE MATRIX //////////////////////////////// +UINT8 gSquadToShow = SQUAD_1; +BOOLEAN fMercCompareMatrixRedraw = FALSE; + +//link to the various pages +MOUSE_REGION gMercCompareMatrixLinkRegion[100]; +BOOLEAN gMercCompareMatrixLinkDefined[100] = { FALSE }; +void SelectMercCompareMatrixRegionCallBack( MOUSE_REGION * pRegion, INT32 iReason ); + +// two dropdowns, which we'll use to toggle between our mercs +template<> void DropDownTemplate::SetRefresh( ) { + fMercCompareMatrixRedraw = TRUE; +} + +void GameInitMercCompareMatrix( ) +{ + +} + +BOOLEAN EnterMercCompareMatrix( ) +{ + InitMercCompareDefaults( ); + + // We fill two dropdowns with all mercs on our team + std::vector > dropdownvector; + + // create a map of all current squads with at least 2 members + std::map squadmap; + + SOLDIERTYPE* pSoldier = NULL; + UINT16 id = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 lastid = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pSoldier = MercPtrs[id]; id <= lastid; ++id, pSoldier++ ) + { + if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bAssignment < ON_DUTY ) + { + if ( squadmap.find( pSoldier->bAssignment ) == squadmap.end() ) + squadmap[pSoldier->bAssignment] = 1; + else + ++squadmap[pSoldier->bAssignment]; + } + } + + std::map::iterator itend = squadmap.end(); + for ( std::map::iterator it = squadmap.begin(); it != itend; ++it ) + { + if ( (*it).second > 1 ) + { + if ( gGameExternalOptions.fUseXMLSquadNames ) + dropdownvector.push_back( std::make_pair( (*it).first, SquadNames[(*it).first].squadname ) ); + else + dropdownvector.push_back( std::make_pair( (*it).first, pSquadMenuStrings[(*it).first] ) ); + } + } + + if ( !dropdownvector.empty() ) + { + DropDownTemplate::getInstance( ).SetEntries( dropdownvector ); + DropDownTemplate::getInstance( ).SetHelpText( szMercCompareWebSite[TEXT_MERCCOMPARE_DROPDOWNTEXT_MATRIX] ); + DropDownTemplate::getInstance( ).Create( LAPTOP_SCREEN_UL_X, MCA_START_CONTENT_Y ); + } + + RenderMercCompareMatrix( ); + + return(TRUE); +} + +void ExitMercCompareMatrix( ) +{ + RemoveMercCompareDefaults( ); + + DropDownTemplate::getInstance( ).Destroy( ); + + for ( int i = 0; i < 100; ++i ) + { + if ( gMercCompareMatrixLinkDefined[i] ) + { + MSYS_RemoveRegion( &gMercCompareMatrixLinkRegion[i] ); + gMercCompareMatrixLinkDefined[i] = FALSE; + } + } +} + +void HandleMercCompareMatrix( ) +{ + if ( fMercCompareMatrixRedraw ) + { + RenderMercCompareMatrix( ); + fMercCompareMatrixRedraw = FALSE; + } +} + +void RenderMercCompareMatrix( ) +{ + CHAR16 sText[800]; + swprintf( sText, L"" ); + UINT16 usPosX, usPosY; + + DisplayMercCompareDefaults( ); + + SetFontShadow( MERCOMP_FONT_SHADOW ); + + usPosX = LAPTOP_SCREEN_UL_X; + usPosY = MCA_START_CONTENT_Y; + + for ( int i = 0; i < 100; ++i ) + { + if ( gMercCompareMatrixLinkDefined[i] ) + { + MSYS_RemoveRegion( &gMercCompareMatrixLinkRegion[i] ); + gMercCompareMatrixLinkDefined[i] = FALSE; + } + } + + gSquadToShow = ( UINT8 )DropDownTemplate::getInstance( ).GetSelectedEntryKey( ); + DropDownTemplate::getInstance( ).Display( ); + + SetFontShadow( MERCOMP_FONT_SHADOW ); + + usPosX = LAPTOP_SCREEN_UL_X; + usPosY = MCA_START_CONTENT_Y + 30; + + // display a table with all squadmembers + std::vector squadvector; + SOLDIERTYPE* pSoldier = NULL; + UINT16 id = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 lastid = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pSoldier = MercPtrs[id]; id <= lastid; ++id, pSoldier++ ) + { + if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bAssignment == gSquadToShow ) + { + // remember squamember + squadvector.push_back( pSoldier->ubProfile ); + } + } + + UINT16 spacepermerc = (LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X) / (squadvector.size() + 1); + spacepermerc = min( spacepermerc , 60); + + // now loop over the squadmembers and fill out the table + std::vector::iterator itend = squadvector.end( ); + for ( std::vector::iterator it = squadvector.begin(); it != itend; ++it ) + { + usPosX += spacepermerc; + + // write the names of all squamembers on top of the table + swprintf( sText, gMercProfiles[(*it)].zNickname ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + DisplaySmallColouredLineWithShadow( usPosX - 10, usPosY - 6, usPosX - 10, usPosY + 17 * (squadvector.size( ) + 1) - 5, FROMRGB( 0, 255, 0 ) ); + } + + DisplaySmallColouredLineWithShadow( usPosX - 10, usPosY - 6, usPosX - 10, usPosY + 17 * (squadvector.size( ) + 1) - 5, FROMRGB( 0, 255, 0 ) ); + + usPosX = LAPTOP_SCREEN_UL_X; + + DisplaySmallColouredLineWithShadow( usPosX, usPosY - 5, usPosX + spacepermerc * (squadvector.size( ) + 1), usPosY - 5, FROMRGB( 0, 255, 0 ) ); + + UINT16 currentmouseregion = 0; + + for ( std::vector::iterator it = squadvector.begin(); it != itend; ++it ) + { + INT16 idA = GetSoldierIDFromMercID( (*it) ); + + if ( idA < 0 ) + continue; + + SOLDIERTYPE* pSoldierA = MercPtrs[idA]; + + if ( !pSoldierA ) + continue; + + usPosY += 17; + usPosX = LAPTOP_SCREEN_UL_X; + + DisplaySmallColouredLineWithShadow( usPosX, usPosY - 5, usPosX + spacepermerc * (squadvector.size( ) + 1), usPosY - 5, FROMRGB( 0, 255, 0 ) ); + + // write name on the left side + swprintf( sText, gMercProfiles[pSoldierA->ubProfile].zNickname ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + usPosX += spacepermerc; + + for ( std::vector::iterator it2 = squadvector.begin( ); it2 != itend; ++it2 ) + { + INT16 idB = GetSoldierIDFromMercID( (*it2) ); + + if ( idB < 0 ) + continue; + + if ( idA == idB ) + { + usPosX += spacepermerc; + continue; + } + + SOLDIERTYPE* pSoldierB = MercPtrs[idB]; + + if ( !pSoldierB ) + continue; + + if ( !gMercCompareMatrixLinkDefined[currentmouseregion] ) + { + MSYS_DefineRegion( &gMercCompareMatrixLinkRegion[currentmouseregion], usPosX - 5, usPosY, usPosX + spacepermerc - 5, usPosY + 17, MSYS_PRIORITY_HIGH, + CURSOR_WWW, MSYS_NO_CALLBACK, SelectMercCompareMatrixRegionCallBack ); + MSYS_AddRegion( &gMercCompareMatrixLinkRegion[currentmouseregion] ); + + // both profilenumbers are combined to a single value which cn later be reinterpreted. + // Note: this will fail if the profile IDs are bigger than UINT16 (currently UINT8) + MSYS_SetRegionUserData( &gMercCompareMatrixLinkRegion[currentmouseregion], 0, ((pSoldierA->ubProfile << 8) | pSoldierB->ubProfile) ); + gMercCompareMatrixLinkDefined[currentmouseregion] = TRUE; + ++currentmouseregion; + } + + // write down both relations + INT8 val = SoldierRelation( pSoldierA, pSoldierB ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + usPosX += 15; + + swprintf( sText, L"/" ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + usPosX += 5; + + val = SoldierRelation( pSoldierB, pSoldierA ); + swprintf( sText, L"%d", val ); + DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X, 2, CAMPHIS_FONT_MED, (val > 0) ? FONT_MCOLOR_LTGREEN : (val < 0) ? FONT_MCOLOR_LTRED : MERCOMP_FONT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, 0 ); + + usPosX += spacepermerc - 20; + } + } + + usPosY += 17; + usPosX = LAPTOP_SCREEN_UL_X; + + DisplaySmallColouredLineWithShadow( usPosX, usPosY - 5, usPosX + spacepermerc * (squadvector.size( ) + 1), usPosY - 5, FROMRGB( 0, 255, 0 ) ); + + SetFontShadow( DEFAULT_SHADOW ); + + MarkButtonsDirty( ); + RenderWWWProgramTitleBar( ); + InvalidateRegion( LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y ); +} + +void SelectMercCompareMatrixRegionCallBack( MOUSE_REGION * pRegion, INT32 iReason ) +{ + if ( iReason & MSYS_CALLBACK_REASON_INIT ) + { + } + else if ( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP ) + { + INT32 uiLink = MSYS_GetRegionUserData( pRegion, 0 ); + + gMercCompareProfile1 = uiLink >> 8; + gMercCompareProfile2 = uiLink & ~0xFFFFFF00; + + guiCurrentLaptopMode = LAPTOP_MODE_MERCCOMPARE_ANALYZE; + } + else if ( iReason & MSYS_CALLBACK_REASON_RBUTTON_UP ) + { + } +} +////////////////////////// MERC COMPARE MATRIX //////////////////////////////// \ No newline at end of file diff --git a/Laptop/merccompare.h b/Laptop/merccompare.h new file mode 100644 index 00000000..753e9efa --- /dev/null +++ b/Laptop/merccompare.h @@ -0,0 +1,43 @@ +#ifndef __MERCCOMPARE_H +#define __MERCCOMPARE_H + +/** +* @file +* @author Flugente (bears-pit.com) +*/ + +// main page (explains what this is all about) +BOOLEAN EnterMercCompareMain( ); +void ExitMercCompareMain( ); +void HandleMercCompareMain( ); +void RenderMercCompareMain( ); + +BOOLEAN InitMercCompareDefaults( ); +void DisplayMercCompareDefaults( ); +void RemoveMercCompareDefaults( ); +void GetMercCompareText( UINT8 ubNumber, STR16 pString ); + +// displays a few quotes of customers +void GameInitMercCompareCustomers( ); +BOOLEAN EnterMercCompareCustomers( ); +void ExitMercCompareCustomers( ); +void HandleMercCompareCustomers( ); +void RenderMercCompareCustomers( ); + +// comparison of characters +void GameInitMercCompareAnalyze( ); +BOOLEAN EnterMercCompareAnalyze( ); +void ExitMercCompareAnalyze( ); +void HandleMercCompareAnalyze( ); +void RenderMercCompareAnalyze( ); + +BOOLEAN DisplayMercData( UINT8 usProfileA, UINT8 usProfileB ); + +// squad opinion overview +void GameInitMercCompareMatrix( ); +BOOLEAN EnterMercCompareMatrix( ); +void ExitMercCompareMatrix( ); +void HandleMercCompareMatrix( ); +void RenderMercCompareMatrix( ); + +#endif //__MERCCOMPARE_H diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index b766f6fb..3a0fc06a 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -1509,21 +1509,22 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for // Flugente: backgrounds if(guiCurrentSaveGameVersion >= BACKGROUNDS) { - if(guiCurrentSaveGameVersion >= BACKGROUNDS_FIX_UINT8) + if(guiCurrentSaveGameVersion >= BACKGROUNDS_FIX_UINT8) + { + if ( !FileRead( hFile, &this->usBackground, sizeof(UINT16), &uiNumBytesRead ) ) { - if ( !FileRead( hFile, &this->usBackground, sizeof(UINT16), &uiNumBytesRead ) ) - { - return(FALSE); - } + return(FALSE); } - else - { + } + else + { if ( !FileRead( hFile, &this->usBackground, sizeof(UINT8), &uiNumBytesRead ) ) { return(FALSE); } } } + if(guiCurrentSaveGameVersion >= SNITCH_TRAIT_EXTENDED) { //if ( !FileRead( hFile, &this->ubExposedInSector, sizeof(ubExposedInSector), &uiNumBytesRead ) ) @@ -1535,6 +1536,14 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for return(FALSE); } } + + if ( guiCurrentSaveGameVersion >= DYNAMIC_OPINIONS ) + { + if ( !FileRead( hFile, &this->usDynamicOpinionFlagmask, sizeof(usDynamicOpinionFlagmask), &uiNumBytesRead ) ) + { + return(FALSE); + } + } } if ( this->uiProfileChecksum != this->GetChecksum() ) @@ -1630,6 +1639,11 @@ BOOLEAN MERCPROFILESTRUCT::Save(HWFILE hFile) { return(FALSE); } + + if ( !FileWrite( hFile, &this->usDynamicOpinionFlagmask, sizeof(usDynamicOpinionFlagmask), &uiNumBytesWritten ) ) + { + return(FALSE); + } return TRUE; } diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 48cc43f1..00dfe257 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -2917,7 +2917,7 @@ UINT32 CalculateSnitchGuardValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts ) return 0; // only undercover snitches count - if ( !pSoldier->bAssignment == FACILITY_PRISON_SNITCH ) + if ( pSoldier->bAssignment != FACILITY_PRISON_SNITCH ) return 0; usValue = 15 * EffectiveExpLevel( pSoldier ) + EffectiveLeadership( pSoldier ) / 2 + 2 * EffectiveWisdom( pSoldier ); @@ -5178,6 +5178,9 @@ void FatigueCharacter( SOLDIERTYPE *pSoldier ) { iBreathLoss = (INT32)(bMaxBreathLoss * iPercentEncumbrance / 100); bMaxBreathLoss = (float)min( 127, iBreathLoss ); + + // Flugente: dynamic opinions: other mercs might get annoyed, because we are slowing down the team + HandleDynamicOpinionSlowdown( pSoldier ); } } diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index e7fb6fd7..678b9d70 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -4646,7 +4646,12 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget ) else if ( pTarget->pSoldier->bTeam == CIV_TEAM && !pTarget->pSoldier->aiData.bNeutral && pTarget->pSoldier->bSide != gbPlayerNum ) gMercProfiles[ pAttacker->pSoldier->ubProfile ].records.usKillsHostiles++; else + { gMercProfiles[ pAttacker->pSoldier->ubProfile ].records.usKillsOthers++; + + // Flugente: dynamic opinions + HandleDynamicOpinionCivKill( pAttacker->pSoldier ); + } break; } ///////////////////////////////////////////////////////////////////////////////////// diff --git a/Strategic/Hourly Update.cpp b/Strategic/Hourly Update.cpp index 1cf96903..ed2600f5 100644 --- a/Strategic/Hourly Update.cpp +++ b/Strategic/Hourly Update.cpp @@ -414,13 +414,13 @@ void HourlyLarryUpdate() if ( usTemptation > 0 ) { - // anv: snitches stop mercs from getting wasted + BOOLEAN fSnitchStoppedBehaviour = FALSE; for( INT32 cnt2 = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt2 ) { - pOtherSoldier = MercPtrs[ cnt ]; + pOtherSoldier = MercPtrs[ cnt2 ]; // note - snitches stop others, but can get wasted themselves (if they have drug use specifically set in background...) - if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && pOtherSoldier->bInSector && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile ) + if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile ) { if ( ProfileHasSkillTrait( pOtherSoldier->ubProfile, SNITCH_NT ) && !( pSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF ) ) { @@ -443,12 +443,20 @@ void HourlyLarryUpdate() // merc is not amused by being prevented HandleMoraleEvent( pSoldier, MORALE_PREVENTED_MISBEHAVIOUR, pSoldier->sSectorX, pSoldier->sSectorX, pSoldier->bSectorZ ); // also here would be a place for dynamic relationship decrease between them + // Flugente: then lets do that, shall we? + AddOpinionEvent( pSoldier->ubProfile, pOtherSoldier->ubProfile, OPINIONEVENT_SNITCHINTERFERENCE ); + + fSnitchStoppedBehaviour = TRUE; continue; } } } } } + + if ( fSnitchStoppedBehaviour ) + continue; + if ( pSoldier->ubProfile == LARRY_DRUNK ) { // NB store all drunkenness info in LARRY_NORMAL profile (to use same values) @@ -466,6 +474,9 @@ void HourlyLarryUpdate() continue; } + // Flugente: dynamic opinion + HandleDynamicOpinionAddict( pSoldier ); + if ( fBar ) { // take $ from player's account @@ -545,11 +556,12 @@ void HourlyStealUpdate() if ( Chance(50) ) { // anv: snitches prevent scrounging in the same sector + BOOLEAN fSnitchStoppedBehaviour = FALSE; for( INT32 cnt2 = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt2 <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt2 ) { - pOtherSoldier = MercPtrs[ cnt ]; + pOtherSoldier = MercPtrs[ cnt2 ]; // note - snitches stop others, but can scrounge themselves (if they have scrounging specifically set in background...) - if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && pOtherSoldier->bInSector && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile ) + if( pOtherSoldier && !pOtherSoldier->flags.fBetweenSectors && pOtherSoldier->bActive && !pOtherSoldier->flags.fMercAsleep && pSoldier->ubProfile != pOtherSoldier->ubProfile ) { if ( ProfileHasSkillTrait( pOtherSoldier->ubProfile, SNITCH_NT ) && !( pSoldier->usSoldierFlagMask2 & SOLDIER_PREVENT_MISBEHAVIOUR_OFF ) ) { @@ -572,12 +584,21 @@ void HourlyStealUpdate() // merc is not amused by being prevented HandleMoraleEvent( pSoldier, MORALE_PREVENTED_MISBEHAVIOUR, pSoldier->sSectorX, pSoldier->sSectorX, pSoldier->bSectorZ ); // also here would be a place for dynamic relationship decrease between them + // Flugente: then lets do that, shall we? + AddOpinionEvent( pSoldier->ubProfile, pOtherSoldier->ubProfile, OPINIONEVENT_SNITCHINTERFERENCE ); + + fSnitchStoppedBehaviour = TRUE; + continue; } } } } } + + if ( fSnitchStoppedBehaviour ) + continue; + // we loop over this sector's inventory and look for something shiny. We will pick it up if we hae enough space in our inventory // open sector inv UINT32 uiTotalNumberOfRealItems = 0; @@ -648,8 +669,13 @@ void HourlyStealUpdate() } if ( pTargetObj ) + { AutoPlaceObject( pSoldier, pTargetObj, TRUE ); + // Flugente: dynamic opinion + HandleDynamicOpinionThief( pSoldier ); + } + // save the changed inventory // open sector inv if( ( gWorldSectorX == pSoldier->sSectorX )&&( gWorldSectorY == pSoldier->sSectorY ) && (gbWorldSectorZ == pSoldier->bSectorZ ) ) diff --git a/Strategic/Strategic Merc Handler.cpp b/Strategic/Strategic Merc Handler.cpp index 66b4c706..ff547463 100644 --- a/Strategic/Strategic Merc Handler.cpp +++ b/Strategic/Strategic Merc Handler.cpp @@ -610,6 +610,9 @@ void MercDailyUpdate() // anv: time for snitches to report HandleSnitchCheck(); + + // Flugente: dynmaic opinion rollover + HandleDynamicOpinions(); } /* diff --git a/Strategic/Strategic Town Loyalty.cpp b/Strategic/Strategic Town Loyalty.cpp index 5b1495ee..e8263e75 100644 --- a/Strategic/Strategic Town Loyalty.cpp +++ b/Strategic/Strategic Town Loyalty.cpp @@ -2061,6 +2061,9 @@ void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX, { HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ ); } + + // Flugente: dynamic opinion: mercs retreated. Someone has to be blamed for this shameful defeat! + HandleDynamicOpinionRetreat(); } diff --git a/Tactical/Drugs And Alcohol.cpp b/Tactical/Drugs And Alcohol.cpp index f75f59db..a1172cbd 100644 --- a/Tactical/Drugs And Alcohol.cpp +++ b/Tactical/Drugs And Alcohol.cpp @@ -234,9 +234,12 @@ BOOLEAN ApplyDrugs( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject ) } } - if ( (ubDrugType & DRUG_ALCOHOL) != 0 ) + if ( (ubDrugType & DRUG_ALCOHOL) ) { ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_DRANK_SOME ], pSoldier->GetName(), ShortItemNames[ usItem ] ); + + // Flugente: dynamic opinions + HandleDynamicOpinionTeamDrinking( pSoldier ); } else { diff --git a/Tactical/Food.cpp b/Tactical/Food.cpp index e9c74ea3..14e3ef2e 100644 --- a/Tactical/Food.cpp +++ b/Tactical/Food.cpp @@ -616,6 +616,9 @@ void HourlyFoodAutoDigestion( SOLDIERTYPE *pSoldier ) EatFromInventory( pSoldier, FALSE ); } + + // dynamic opinions: if we're still really hungry an someone in this sector has food, we get a lwoer opinion of him, as he obviously doesn't share + HandleDynamicOpinionFoodSharing( pSoldier ); } } @@ -1061,3 +1064,38 @@ void SoldierAutoFillCanteens(SOLDIERTYPE *pSoldier) } } } + +BOOLEAN HasFoodInInventory( SOLDIERTYPE *pSoldier, BOOLEAN fCheckFood, BOOLEAN fCheckDrink ) +{ + if ( !pSoldier ) + return FALSE; + + if ( !fCheckFood && !fCheckDrink ) + return TRUE; + + // search for food in our inventory + INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly + for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ... + { + // ... if Item exists and is food ... + if ( pSoldier->inv[bLoop].exists( ) && Item[pSoldier->inv[bLoop].usItem].foodtype > 0 ) + { + if ( fCheckFood && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bFoodPoints ) + return TRUE; + + if ( fCheckDrink && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints ) + { + if ( Item[pSoldier->inv[bLoop].usItem].canteen ) + { + // empty canteens retain 1% status, so check ether something is in them + if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 ) + return TRUE; + } + else + return TRUE; + } + } + } + + return FALSE; +} \ No newline at end of file diff --git a/Tactical/Food.h b/Tactical/Food.h index 8b51b8df..f4bb345d 100644 --- a/Tactical/Food.h +++ b/Tactical/Food.h @@ -96,4 +96,6 @@ OBJECTTYPE* GetUsableWaterDrumInSector( void ); // soldier refills canteen while auto-consuming. Only clean sector water souces are consumed, an sector inventory is not touched (sector is likely not loaded) void SoldierAutoFillCanteens(SOLDIERTYPE *pSoldier); +BOOLEAN HasFoodInInventory( SOLDIERTYPE *pSoldier, BOOLEAN fCheckFood, BOOLEAN fCheckDrink ); + #endif diff --git a/Tactical/Interface.cpp b/Tactical/Interface.cpp index cfaa96f6..d002487a 100644 --- a/Tactical/Interface.cpp +++ b/Tactical/Interface.cpp @@ -6890,4 +6890,26 @@ void NCTHShowMounted( SOLDIERTYPE* pSoldier, UINT16* ptrBuf, UINT32 uiPitch, INT } } } +} + +// Flugente: check a profile for a background flag without using SOLDIERTYPE +BOOLEAN HasBackgroundFlag( UINT8 usProfile, UINT64 aFlag ) +{ + if ( gGameOptions.fBackGround && usProfile != NO_PROFILE ) + { + if ( zBackground[gMercProfiles[usProfile].usBackground].uiFlags & aFlag ) + return TRUE; + } + + return FALSE; +} + +INT16 GetBackgroundValue( UINT8 usProfile, UINT16 aNr ) +{ + if ( gGameOptions.fBackGround && usProfile != NO_PROFILE ) + { + return zBackground[gMercProfiles[usProfile].usBackground].value[aNr]; + } + + return 0; } \ No newline at end of file diff --git a/Tactical/Interface.h b/Tactical/Interface.h index e4225f03..963d599c 100644 --- a/Tactical/Interface.h +++ b/Tactical/Interface.h @@ -187,6 +187,8 @@ enum { BG_PERC_INSURANCE, BG_PERC_SPOTTER, + BG_DISLIKEBG, // dislike any other background that has the negative of this value set + BG_MAX, }; @@ -556,4 +558,8 @@ void NCTHDrawScopeModeIcon( SOLDIERTYPE *pSoldier, INT16 sNewX, INT16 sNewY ); void NCTHShowAimLevels( SOLDIERTYPE* pSoldier, INT16 curX, INT16 curY ); void NCTHShowMounted( SOLDIERTYPE* pSoldier, UINT16* ptrBuf, UINT32 uiPitch, INT16 sLeft, INT16 sTop, INT16 sRight, INT16 sBottom, INT16 sStartScreenX, INT16 sStartScreenY, INT16 zOffset ); +// Flugente: check a profile for a background flag without using SOLDIERTYPE +BOOLEAN HasBackgroundFlag( UINT8 usProfile, UINT64 aFlag ); +INT16 GetBackgroundValue( UINT8 usProfile, UINT16 aNr ); + #endif \ No newline at end of file diff --git a/Tactical/Merc Hiring.cpp b/Tactical/Merc Hiring.cpp index 98bb09db..79894e74 100644 --- a/Tactical/Merc Hiring.cpp +++ b/Tactical/Merc Hiring.cpp @@ -417,6 +417,9 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc) //remove the merc from the Personnel screens departed list ( if they have never been hired before, its ok to call it ) RemoveNewlyHiredMercFromPersonnelDepartedList( pSoldier->ubProfile ); + // Flugente: dynamic opinions + CheckForFriendsofHated( pSoldier ); + gfAtLeastOneMercWasHired = TRUE; return( MERC_HIRE_OK ); } diff --git a/Tactical/Morale.cpp b/Tactical/Morale.cpp index de551af5..92ae8ab3 100644 --- a/Tactical/Morale.cpp +++ b/Tactical/Morale.cpp @@ -27,6 +27,10 @@ #include "GameSettings.h" #include "Isometric Utils.h" #include "Food.h" + #include "Interface.h" // added by Flugente + #include "finances.h" // added by Flugente for EXTENDED_CONTRACT_BY_1_DAY + #include "Soldier Add.h" // added by Flugente for MERC_TYPE__AIM_MERC + #include "CampaignStats.h" // added by Flugente for gCurrentIncident #endif #include "connect.h" @@ -289,6 +293,9 @@ void DecayTacticalMoraleModifiers( void ) pSoldier->usQuoteSaidFlags |= SOLDIER_QUOTE_SAID_PERSONALITY; } HandleMoraleEvent( pSoldier, MORALE_NERVOUS_ALONE, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( pSoldier ); } } } @@ -970,6 +977,7 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I case MORALE_BAD_EQUIPMENT: case MORALE_OWED_MONEY: case MORALE_PLAYER_INACTIVE_DAYS: + case MORALE_PREVENTED_MISBEHAVIOUR: Assert( pSoldier ); HandleMoraleEventForSoldier( pSoldier, bMoraleEvent ); break; @@ -1437,6 +1445,9 @@ void HandleSnitchesReports( std::vector& aVec ) // clear info event2.ubEventType = NUM_SNITCH_EVENTS; + + // Flugente: dynamic opinions + AddOpinionEvent( event2.ubTargetProfile, pSnitch->ubProfile, OPINIONEVENT_SNITCHSOLDMEOUT ); } } @@ -1736,52 +1747,28 @@ INT8 SoldierRelation( SOLDIERTYPE* pSoldierA, SOLDIERTYPE* pSoldierB) // some people care about how distuingished other people are. Malus if on different ends of the spectrum, a small bonus if on the same and its really important to the person // also give a malus if the other person is a slob or snob and we are average but care extremely (we don't like people who behave differently) - switch ( gMercProfiles[ pSoldierB->ubProfile ].bRefinement ) + // if we don't care, doesn't matter + if ( pProfile->bRefinementCareLevel == CARELEVEL_NONE ) { - case REFINEMENT_SLOB: - { - if ( pProfile->bRefinement == REFINEMENT_AVERAGE ) - { - if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) - bOpinion -= gGameExternalOptions.sMoraleModRefinement; - } - if ( pProfile->bRefinement == REFINEMENT_SLOB ) - { - if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) - bOpinion += gGameExternalOptions.sMoraleModRefinement; - } - else if ( pProfile->bRefinement == REFINEMENT_SNOB ) - { - if ( pProfile->bRefinementCareLevel == CARELEVEL_SOME ) - bOpinion -= gGameExternalOptions.sMoraleModRefinement; - else if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) - bOpinion -= gGameExternalOptions.sMoraleModRefinement * 2; - } - } - break; - case REFINEMENT_SNOB: - { - if ( pProfile->bRefinement == REFINEMENT_AVERAGE ) - { - if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) - bOpinion -= gGameExternalOptions.sMoraleModRefinement; - } - if ( pProfile->bRefinement == REFINEMENT_SNOB ) - { - if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) - bOpinion += gGameExternalOptions.sMoraleModRefinement; - } - else if ( pProfile->bRefinement == REFINEMENT_SLOB ) - { - if ( pProfile->bRefinementCareLevel == CARELEVEL_SOME ) - bOpinion -= gGameExternalOptions.sMoraleModRefinement; - else if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) - bOpinion -= gGameExternalOptions.sMoraleModRefinement * 2; - } - } - break; + // nothing to do... } - + // if we care somewhat, malus on slob/snob + else if ( pProfile->bRefinementCareLevel == CARELEVEL_SOME ) + { + if ( pProfile->bRefinement * gMercProfiles[pSoldierB->ubProfile].bRefinement == 2 ) + bOpinion -= gGameExternalOptions.sMoraleModRefinement; + } + // if we care extremely, reward for similarity, malus otherwise + else //if( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME ) + { + if ( pProfile->bRefinement * gMercProfiles[pSoldierB->ubProfile].bRefinement == 2 ) + bOpinion -= 2 * gGameExternalOptions.sMoraleModRefinement; + else if ( pProfile->bRefinement * gMercProfiles[pSoldierB->ubProfile].bRefinement == 0 ) + bOpinion -= gGameExternalOptions.sMoraleModRefinement; + else + bOpinion += gGameExternalOptions.sMoraleModRefinement; + } + // some people hate other nationalities (do not mix up with racism, which uses bRace) if ( pProfile->bHatedNationality > -1 && gMercProfiles[ pSoldierB->ubProfile ].bNationality == pProfile->bHatedNationality ) { @@ -1801,8 +1788,792 @@ INT8 SoldierRelation( SOLDIERTYPE* pSoldierA, SOLDIERTYPE* pSoldierB) } // Flugente: backgrounds + if ( pSoldierA->GetBackgroundValue( BG_DISLIKEBG ) && pSoldierA->GetBackgroundValue( BG_DISLIKEBG ) == -pSoldierB->GetBackgroundValue( BG_DISLIKEBG ) ) + { + bOpinion -= 2; + } + if ( pSoldierA->HasBackgroundFlag( BACKGROUND_XENOPHOBIC ) && pSoldierB->ubProfile != NO_PROFILE && gMercProfiles[pSoldierA->ubProfile].usBackground != gMercProfiles[pSoldierB->ubProfile].usBackground ) bOpinion -= gGameExternalOptions.sMoraleModXenophobicBackGround; + // Flugente: dynamic opinions + if ( gGameExternalOptions.fDynamicOpinions ) + { + for ( UINT8 opinionevent = OPINIONEVENT_FRIENDLYFIRE; opinionevent < OPINIONEVENT_MAX; ++opinionevent ) + { + bOpinion += GetDynamicOpinion( pSoldierA->ubProfile, pSoldierB->ubProfile, opinionevent ); + } + } + + // reasonable values + bOpinion = min( BUDDY_OPINION, bOpinion ); + bOpinion = max( HATED_OPINION, bOpinion ); + return bOpinion; +} + +// Flugente: dynamic opinions +void AddOpinionEvent( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent ) +{ + if ( usProfileA == NO_PROFILE || usProfileA == NO_PROFILE ) + return; + + if ( usEvent >= OPINIONEVENT_MAX ) + return; + + // we add a flag signifiying that an event happened today + switch ( usEvent ) + { + case OPINIONEVENT_FRIENDLYFIRE: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] |= OPINIONFLAG_STAGE1_FRIENDLYFIRE; break; + case OPINIONEVENT_SNITCHSOLDMEOUT: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] |= OPINIONFLAG_STAGE1_SNITCHSOLDMEOUT; break; + case OPINIONEVENT_SNITCHINTERFERENCE: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] |= OPINIONFLAG_STAGE1_INTERFERENCE; break; + case OPINIONEVENT_FRIENDSWITHHATED: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] |= OPINIONFLAG_STAGE1_FRIENDSWITHHATED; break; + case OPINIONEVENT_CONTRACTEXTENSION: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] |= OPINIONFLAG_STAGE1_CONTRACTEXTENSION; break; + case OPINIONEVENT_ORDEREDRETREAT: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] |= OPINIONFLAG_STAGE1_ORDEREDRETREAT; break; + case OPINIONEVENT_CIVKILLER: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] |= OPINIONFLAG_STAGE1_CIVKILLER; break; + case OPINIONEVENT_SLOWSUSDOWN: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] |= OPINIONFLAG_STAGE1_SLOWSUSDOWN; break; + + case OPINIONEVENT_NOSHARINGFOOD: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] |= OPINIONFLAG_STAGE1_NOSHARINGFOOD; break; + case OPINIONEVENT_ANNOYINGDISABILITY: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] |= OPINIONFLAG_STAGE1_ANNOYINGDISABILITY; break; + case OPINIONEVENT_ADDICT: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] |= OPINIONFLAG_STAGE1_ADDICT; break; + case OPINIONEVENT_THIEF: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] |= OPINIONFLAG_STAGE1_THIEF; break; + case OPINIONEVENT_WORSTCOMMANDEREVER: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] |= OPINIONFLAG_STAGE1_WORSTCOMMANDEREVER; break; + case OPINIONEVENT_RICHGUY: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] |= OPINIONFLAG_STAGE1_RICHGUY; break; + case OPINIONEVENT_BETTERGEAR: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] |= OPINIONFLAG_STAGE1_BETTERGEAR; break; + case OPINIONEVENT_YOUMOUNTEDAGUNONMYBREASTS: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] |= OPINIONFLAG_STAGE1_YOUMOUNTEDAGUNONMYBREASTS; break; + + case OPINIONEVENT_BANDAGED: gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] |= OPINIONFLAG_STAGE1_BANDAGED; break; + + // drinking flags are a bit different - drinking can apply the GOOD or BAD flag, and they cancel each other out. + // GOOD on GOOD causes SUPER, which cannot be removed (and stops this for today) + // BAD on BAD causes WORSE, which cannot be removed (and stops this for today) + case OPINIONEVENT_DRINKBUDDIES_GOOD: + // if we do not already have the SUPER flag... + if ( !(gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & (OPINIONFLAG_STAGE1_DRINKBUDDIES_SUPER | OPINIONFLAG_STAGE1_DRINKBUDDIES_WORSE)) ) + { + // if we already have GOOD, get SUPER + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_DRINKBUDDIES_GOOD ) + { + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] |= OPINIONFLAG_STAGE1_DRINKBUDDIES_SUPER; + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] &= ~OPINIONFLAG_STAGE1_DRINKBUDDIES_GOOD; + } + // if we have BAD, cancel it out + else if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_DRINKBUDDIES_BAD ) + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] &= ~OPINIONFLAG_STAGE1_DRINKBUDDIES_BAD; + // if we have nothing, get GOOD + else + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] |= OPINIONFLAG_STAGE1_DRINKBUDDIES_GOOD; + } + break; + + case OPINIONEVENT_DRINKBUDDIES_BAD: + // if we do not already have the SUPER flag... + if ( !(gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & (OPINIONFLAG_STAGE1_DRINKBUDDIES_SUPER | OPINIONFLAG_STAGE1_DRINKBUDDIES_WORSE)) ) + { + // if we already have BAD, get WORSE + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_DRINKBUDDIES_BAD ) + { + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] |= OPINIONFLAG_STAGE1_DRINKBUDDIES_WORSE; + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] &= ~OPINIONFLAG_STAGE1_DRINKBUDDIES_BAD; + } + // if we have GOOD, cancel it out + else if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_DRINKBUDDIES_GOOD ) + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] &= ~OPINIONFLAG_STAGE1_DRINKBUDDIES_GOOD; + // if we have nothing, get BAD + else + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] |= OPINIONFLAG_STAGE1_DRINKBUDDIES_BAD; + } + break; + + default: break; + } +} + +// get usProfileA's opinion of usProfileB concerning usEvent +INT8 GetDynamicOpinion( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent ) +{ + INT32 opinion = 0; + + if ( usProfileA == NO_PROFILE || usProfileA == NO_PROFILE ) + return opinion; + + if ( usEvent >= OPINIONEVENT_MAX ) + return opinion; + + // count how many relevant flags are set + UINT8 numflags = 0; + switch ( usEvent ) + { + case OPINIONEVENT_FRIENDLYFIRE: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE1_FRIENDLYFIRE) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE2_FRIENDLYFIRE ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE3_FRIENDLYFIRE ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE4_FRIENDLYFIRE ) ++numflags; + break; + + case OPINIONEVENT_SNITCHSOLDMEOUT: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE1_SNITCHSOLDMEOUT ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE2_SNITCHSOLDMEOUT ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE3_SNITCHSOLDMEOUT ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE4_SNITCHSOLDMEOUT ) ++numflags; + break; + + case OPINIONEVENT_SNITCHINTERFERENCE: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE1_INTERFERENCE ) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE2_INTERFERENCE) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE3_INTERFERENCE ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE4_INTERFERENCE ) ++numflags; + break; + + case OPINIONEVENT_FRIENDSWITHHATED: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE1_FRIENDSWITHHATED ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE2_FRIENDSWITHHATED ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE3_FRIENDSWITHHATED ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE4_FRIENDSWITHHATED ) ++numflags; + break; + + case OPINIONEVENT_CONTRACTEXTENSION: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE1_CONTRACTEXTENSION ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE2_CONTRACTEXTENSION ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE3_CONTRACTEXTENSION ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE4_CONTRACTEXTENSION ) ++numflags; + break; + + case OPINIONEVENT_ORDEREDRETREAT: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE1_ORDEREDRETREAT ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE2_ORDEREDRETREAT ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE3_ORDEREDRETREAT ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE4_ORDEREDRETREAT ) ++numflags; + break; + + case OPINIONEVENT_CIVKILLER: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE1_CIVKILLER ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE2_CIVKILLER ) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE3_CIVKILLER) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE4_CIVKILLER) ++numflags; + break; + + case OPINIONEVENT_SLOWSUSDOWN: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE1_SLOWSUSDOWN) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE2_SLOWSUSDOWN) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE3_SLOWSUSDOWN) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][0] & OPINIONFLAG_STAGE4_SLOWSUSDOWN) ++numflags; + break; + + case OPINIONEVENT_NOSHARINGFOOD: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE1_NOSHARINGFOOD) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE2_NOSHARINGFOOD) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE3_NOSHARINGFOOD) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE4_NOSHARINGFOOD) ++numflags; + break; + + case OPINIONEVENT_ANNOYINGDISABILITY: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE1_ANNOYINGDISABILITY) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE2_ANNOYINGDISABILITY) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE3_ANNOYINGDISABILITY) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE4_ANNOYINGDISABILITY) ++numflags; + break; + + case OPINIONEVENT_ADDICT: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE1_ADDICT) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE2_ADDICT) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE3_ADDICT) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE4_ADDICT) ++numflags; + break; + + case OPINIONEVENT_THIEF: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE1_THIEF) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE2_THIEF) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE3_THIEF) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE4_THIEF) ++numflags; + break; + + case OPINIONEVENT_WORSTCOMMANDEREVER: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE1_WORSTCOMMANDEREVER) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE2_WORSTCOMMANDEREVER) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE3_WORSTCOMMANDEREVER) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE4_WORSTCOMMANDEREVER) ++numflags; + break; + + case OPINIONEVENT_RICHGUY: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE1_RICHGUY) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE2_RICHGUY) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE3_RICHGUY) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE4_RICHGUY) ++numflags; + break; + + case OPINIONEVENT_BETTERGEAR: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE1_BETTERGEAR) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE2_BETTERGEAR) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE3_BETTERGEAR) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE4_BETTERGEAR) ++numflags; + break; + + case OPINIONEVENT_YOUMOUNTEDAGUNONMYBREASTS: + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE1_YOUMOUNTEDAGUNONMYBREASTS) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE2_YOUMOUNTEDAGUNONMYBREASTS) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE3_YOUMOUNTEDAGUNONMYBREASTS) ++numflags; + if (gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][1] & OPINIONFLAG_STAGE4_YOUMOUNTEDAGUNONMYBREASTS) ++numflags; + break; + + case OPINIONEVENT_BANDAGED: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_BANDAGED ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE2_BANDAGED ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE3_BANDAGED ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE4_BANDAGED ) ++numflags; + break; + + case OPINIONEVENT_DRINKBUDDIES_GOOD: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_DRINKBUDDIES_GOOD ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE2_DRINKBUDDIES_GOOD ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE3_DRINKBUDDIES_GOOD ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE4_DRINKBUDDIES_GOOD ) ++numflags; + break; + + case OPINIONEVENT_DRINKBUDDIES_SUPER: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_DRINKBUDDIES_SUPER ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE2_DRINKBUDDIES_SUPER ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE3_DRINKBUDDIES_SUPER ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE4_DRINKBUDDIES_SUPER ) ++numflags; + break; + + case OPINIONEVENT_DRINKBUDDIES_BAD: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_DRINKBUDDIES_BAD ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE2_DRINKBUDDIES_BAD ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE3_DRINKBUDDIES_BAD ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE4_DRINKBUDDIES_BAD ) ++numflags; + break; + + case OPINIONEVENT_DRINKBUDDIES_WORSE: + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE1_DRINKBUDDIES_WORSE ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE2_DRINKBUDDIES_WORSE ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE3_DRINKBUDDIES_WORSE ) ++numflags; + if ( gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][2] & OPINIONFLAG_STAGE4_DRINKBUDDIES_WORSE ) ++numflags; + break; + + default: + break; + } + + // event opinion is number of times this happened times opinion modifer + opinion = numflags * gMoraleSettings.bDynamicOpinionModifiers[usEvent]; + + // cut it down to INT8 + return (INT8)opinion; +} + +// daily rollover of opinions +void HandleDynamicOpinions( ) +{ + for ( UINT8 usProfile = 0; usProfile < NUM_PROFILES; ++usProfile ) + { + // each profile has its opinions on everyone else renewed + RolloverDynamicOpinions( usProfile ); + } + + SOLDIERTYPE* pSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pSoldier++ ) + { + if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && + !(pSoldier->bAssignment == IN_TRANSIT || + pSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + // or each profile, check wether everyone else is a friend of someone else we hate + CheckForFriendsofHated( pSoldier ); + + // get annoyed on mercs that receive a lot more money than we do + HandleDynamicOpinionWageJealousy( pSoldier ); + } + } +} + +// a day has passed, 'age' opinions +void RolloverDynamicOpinions( UINT8 usProfileA ) +{ + for ( UINT8 usProfileB = 0; usProfileB < NUM_PROFILES; ++usProfileB ) + { + for ( UINT8 i = 0; i < OPINION_FLAGMASKS_NUMBER; ++i ) + { + // events that are at stage 4 are forgotten + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][i] &= ~OPINIONFLAG_STAGE4_ALL; + + // all other events move up one stage + gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][i] = gMercProfiles[usProfileA].usDynamicOpinionFlagmask[usProfileB][i] << 1; + } + } +} + +// check wether other people are friends with someone else we hate. All persons must be in Arulco +void CheckForFriendsofHated( SOLDIERTYPE* pSoldier ) +{ + INT8 bMercID, bOtherID, bThirdID; + INT8 bOpinion = -1; + INT8 bSecondOpinion = -1; + INT8 bLastTeamID; + SOLDIERTYPE* pOtherSoldier; + SOLDIERTYPE* pThirdSoldier; + + bMercID = pSoldier->ubID; + bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + + // loop through all other mercs + bOtherID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + for ( pOtherSoldier = MercPtrs[bOtherID]; bOtherID <= bLastTeamID; ++bOtherID, pOtherSoldier++ ) + { + // skip past ourselves and all inactive mercs + if ( bOtherID != bMercID && pOtherSoldier->bActive && pOtherSoldier->ubProfile != NO_PROFILE && + !(pOtherSoldier->bAssignment == IN_TRANSIT || + pOtherSoldier->bAssignment == ASSIGNMENT_DEAD ) ) + { + bOpinion = SoldierRelation( pSoldier, pOtherSoldier ); + + // we cannot simply check for HATED_OPINION here - this very feature makes opinions not so easy anymore. Simply check for a range + if ( bOpinion < -20 ) + { + // there is someone in our team that we hate. We dislike his friends somewhat, purely because they like our foe + // loop through all other mercs + bThirdID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + for ( pThirdSoldier = MercPtrs[bThirdID]; bThirdID <= bLastTeamID; ++bThirdID, pThirdSoldier++ ) + { + // skip past ourselves and all inactive mercs + if ( bThirdID != bMercID && bThirdID != bOtherID && pThirdSoldier->bActive && pThirdSoldier->ubProfile != NO_PROFILE && + !(pThirdSoldier->bAssignment == IN_TRANSIT || + pThirdSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + bSecondOpinion = SoldierRelation( pThirdSoldier, pOtherSoldier ); + + if ( bSecondOpinion > 20 ) + { + // this guy is friends with someone we hate! We dislike him a bit for that + AddOpinionEvent( pSoldier->ubProfile, pThirdSoldier->ubProfile, OPINIONEVENT_FRIENDSWITHHATED ); + } + } + } + } + } + } +} + +void HandleDynamicOpinionOnContractExtension( UINT8 ubCode, UINT8 usProfile ) +{ + if ( usProfile == NO_PROFILE ) + return; + + if ( ubCode == EXTENDED_CONTRACT_BY_1_DAY || ubCode == EXTENDED_CONTRACT_BY_1_WEEK || ubCode == EXTENDED_CONTRACT_BY_2_WEEKS ) + { + INT16 id = GetSoldierIDFromMercID( usProfile ); + if ( id > -1 ) + { + SOLDIERTYPE* pSoldierWhoGotPaid = MercPtrs[id]; + + // only for AIM mercs + if ( pSoldierWhoGotPaid->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC ) + return; + + // determine the remaining length of his contract BEFORE it go renewed + INT32 oldcontract = pSoldierWhoGotPaid->iEndofContractTime; + if ( ubCode == EXTENDED_CONTRACT_BY_1_DAY ) + oldcontract -= 1440; + else if ( ubCode == EXTENDED_CONTRACT_BY_1_WEEK ) + oldcontract -= 7 * 1440; + else if ( ubCode == EXTENDED_CONTRACT_BY_2_WEEKS ) + oldcontract -= 14 * 1440; + + // someones contract got extended. Other mercs who have less time on their contract will be annoyed by this, as they feel they shoul be paid first + SOLDIERTYPE* pSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pSoldier++ ) + { + if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->ubProfile != usProfile && + !(pSoldier->bAssignment == IN_TRANSIT || + pSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + // only for AIM mercs + if ( pSoldier->ubProfile == NO_PROFILE || pSoldier->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC ) + continue; + + if ( pSoldier->iEndofContractTime < oldcontract ) + { + // this guy got paid at a point where we had less time than he did! Favouritism! + AddOpinionEvent( pSoldier->ubProfile, usProfile, OPINIONEVENT_CONTRACTEXTENSION ); + } + } + } + } + } +} + +void HandleDynamicOpinionCivKill( SOLDIERTYPE* pSoldier ) +{ + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + if ( (gMercProfiles[pTeamSoldier->ubProfile].ubMiscFlags3 & PROFILE_MISC_FLAG3_GOODGUY) ) + { + AddOpinionEvent( pTeamSoldier->ubProfile, pSoldier->ubProfile, OPINIONEVENT_CIVKILLER ); + } + } + } +} + +void HandleDynamicOpinionSlowdown( SOLDIERTYPE* pSoldier ) +{ + if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE ) + return; + + INT32 iPercentEncumbranceOffended = CalculateCarriedWeight( pSoldier ); + if ( iPercentEncumbranceOffended > 100 ) + { + // everyone else on the same squad gets annoyed, if they aren't overencumbered themselves, or at least not as much as the offender + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && pTeamSoldier->bAssignment == pSoldier->bAssignment && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + INT32 iPercentEncumbrance = CalculateCarriedWeight( pTeamSoldier ); + + if ( iPercentEncumbrance < 100 || iPercentEncumbrance < 0.7 * iPercentEncumbranceOffended ) + { + AddOpinionEvent( pTeamSoldier->ubProfile, pSoldier->ubProfile, OPINIONEVENT_SLOWSUSDOWN ); + } + } + } + } +} + +void HandleDynamicOpinionWageJealousy( SOLDIERTYPE* pSoldier ) +{ + if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE ) + return; + + if ( !pSoldier->iTotalContractLength || (pSoldier->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC && pSoldier->ubWhatKindOfMercAmI != MERC_TYPE__MERC && pSoldier->ubWhatKindOfMercAmI != MERC_TYPE__NPC_WITH_UNEXTENDABLE_CONTRACT) ) + return; + + // determine our mean daily wage + UINT32 meanwage = gMercProfiles[pSoldier->ubProfile].uiTotalCostToDate / pSoldier->iTotalContractLength; + + UINT8 explevel = pSoldier->stats.bExpLevel; + + // hu? + if ( !explevel ) + return; + + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + if ( !pTeamSoldier->iTotalContractLength || (pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC && pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__MERC && pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__NPC_WITH_UNEXTENDABLE_CONTRACT) ) + continue; + + // their wage + UINT32 theirmeanwage = gMercProfiles[pTeamSoldier->ubProfile].uiTotalCostToDate / pTeamSoldier->iTotalContractLength; + + // adjust this for experience levels + FLOAT explevelfactor = gGameExternalOptions.fDynamicWageFactor * pTeamSoldier->stats.bExpLevel / explevel; + + if ( theirmeanwage > explevelfactor * meanwage ) + { + AddOpinionEvent( pSoldier->ubProfile, pTeamSoldier->ubProfile, OPINIONEVENT_RICHGUY ); + } + } + } +} + +void HandleDynamicOpinionDisability( SOLDIERTYPE* pSoldier ) +{ + if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE ) + return; + + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector gets annoyed + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && + pTeamSoldier->sSectorX == pSoldier->sSectorX && pTeamSoldier->sSectorY == pSoldier->sSectorY && pTeamSoldier->bSectorZ == pSoldier->bSectorZ && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + AddOpinionEvent( pTeamSoldier->ubProfile, pSoldier->ubProfile, OPINIONEVENT_ANNOYINGDISABILITY ); + } + } +} + +void HandleDynamicOpinionAddict( SOLDIERTYPE* pSoldier ) +{ + if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE ) + return; + + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + AddOpinionEvent( pTeamSoldier->ubProfile, pSoldier->ubProfile, OPINIONEVENT_ADDICT ); + } + } +} + +void HandleDynamicOpinionThief( SOLDIERTYPE* pSoldier ) +{ + if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE ) + return; + + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector gets annoyed + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && + pTeamSoldier->sSectorX == pSoldier->sSectorX && pTeamSoldier->sSectorY == pSoldier->sSectorY && pTeamSoldier->bSectorZ == pSoldier->bSectorZ && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + AddOpinionEvent( pTeamSoldier->ubProfile, pSoldier->ubProfile, OPINIONEVENT_THIEF ); + } + } +} + +void HandleDynamicOpinionFoodSharing( SOLDIERTYPE* pSoldier ) +{ + if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE ) + return; + + BOOLEAN fCheckFood = (pSoldier->bFoodLevel < FoodMoraleMods[FOOD_MERC_START_SHOW_HUNGER_SYMBOL].bThreshold); + BOOLEAN fCheckDrink = (pSoldier->bDrinkLevel < FoodMoraleMods[FOOD_MERC_START_SHOW_HUNGER_SYMBOL].bThreshold); + + // no hunger - no problem + if ( !fCheckFood && !fCheckDrink ) + return; + + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector gets annoyed + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && + pTeamSoldier->sSectorX == pSoldier->sSectorX && pTeamSoldier->sSectorY == pSoldier->sSectorY && pTeamSoldier->bSectorZ == pSoldier->bSectorZ && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + if ( HasFoodInInventory( pTeamSoldier, fCheckFood, fCheckDrink ) ) + { + AddOpinionEvent( pSoldier->ubProfile, pTeamSoldier->ubProfile, OPINIONEVENT_NOSHARINGFOOD ); + } + } + } +} + +void HandleDynamicOpinionGear( SOLDIERTYPE* pSoldier ) +{ + // only in combat squads + if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE || pSoldier->bAssignment >= ON_DUTY ) + return; + + UINT8 highestcoolness = HighestInventoryCoolness( pSoldier ); + + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector gets annoyed + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && + pTeamSoldier->sSectorX == pSoldier->sSectorX && pTeamSoldier->sSectorY == pSoldier->sSectorY && pTeamSoldier->bSectorZ == pSoldier->bSectorZ && + pTeamSoldier->bAssignment < ON_DUTY && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + if ( HighestInventoryCoolness( pTeamSoldier ) > highestcoolness + 2 ) + { + AddOpinionEvent( pSoldier->ubProfile, pTeamSoldier->ubProfile, OPINIONEVENT_BETTERGEAR ); + } + } + } +} + +void HandleDynamicOpinionBattleLosses() +{ + UINT32 badstuff = 0; + + for ( UINT16 i = 0; i < CAMPAIGNHISTORY_SD_CIV; ++i ) + { + badstuff += 5 * gCurrentIncident.usKills[i]; + badstuff += gCurrentIncident.usWounds[i]; + badstuff += 4 * gCurrentIncident.usPrisoners[i]; + } + + if ( badstuff > 100 ) + { + // this was a disaster (Ignoring of how high the enemies losses were to create drama :-) )! Someone needs to be blamed! + SOLDIERTYPE* pScapeGoat = NULL; + FLOAT bestdommanderrating = 0.0f; + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector gets annoyed + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && + pTeamSoldier->sSectorX == SECTORX( gCurrentIncident.usSector ) && pTeamSoldier->sSectorY == SECTORY( gCurrentIncident.usSector ) && pTeamSoldier->bSectorZ == gCurrentIncident.usLevel && + pTeamSoldier->bAssignment < ON_DUTY && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + FLOAT commanderrating = pTeamSoldier->stats.bExpLevel + NUM_SKILL_TRAITS( pTeamSoldier, SQUADLEADER_NT ); + + if ( commanderrating > bestdommanderrating ) + { + bestdommanderrating = commanderrating; + + pScapeGoat = pTeamSoldier; + } + } + } + + // we've found someone competent. Let's all blame him for this disaster! + if ( bestdommanderrating > 0.0f ) + { + bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector gets annoyed + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && + pTeamSoldier->ubProfile != pScapeGoat->ubProfile && + pTeamSoldier->sSectorX == SECTORX( gCurrentIncident.usSector ) && pTeamSoldier->sSectorY == SECTORY( gCurrentIncident.usSector ) && pTeamSoldier->bSectorZ == gCurrentIncident.usLevel && + pTeamSoldier->bAssignment < ON_DUTY && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + AddOpinionEvent( pTeamSoldier->ubProfile, pScapeGoat->ubProfile, OPINIONEVENT_WORSTCOMMANDEREVER ); + } + } + } + } +} + +void HandleDynamicOpinionRetreat() +{ + // this was a disaster (Ignoring of how high the enemies losses were to create drama :-) )! Someone needs to be blamed! + SOLDIERTYPE* pScapeGoat = NULL; + FLOAT bestdommanderrating = 0.0f; + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector gets annoyed + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && + pTeamSoldier->sSectorX == gWorldSectorX && pTeamSoldier->sSectorY == gWorldSectorY && (pTeamSoldier->bSectorZ == gbWorldSectorZ) && + pTeamSoldier->bAssignment < ON_DUTY && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + FLOAT commanderrating = pTeamSoldier->stats.bExpLevel + NUM_SKILL_TRAITS( pTeamSoldier, SQUADLEADER_NT ); + + if ( commanderrating > bestdommanderrating ) + { + bestdommanderrating = commanderrating; + + pScapeGoat = pTeamSoldier; + } + } + } + + // we've found someone competent. Let's all blame him for this disaster! + if ( bestdommanderrating > 0.0f ) + { + bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector gets annoyed + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && + pTeamSoldier->ubProfile != pScapeGoat->ubProfile && + pTeamSoldier->sSectorX == gWorldSectorX && pTeamSoldier->sSectorY == gWorldSectorY && (pTeamSoldier->bSectorZ == gbWorldSectorZ) && + pTeamSoldier->bAssignment < ON_DUTY && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + AddOpinionEvent( pTeamSoldier->ubProfile, pScapeGoat->ubProfile, OPINIONEVENT_ORDEREDRETREAT ); + } + } + } +} + +void HandleDynamicOpinionTeamDrinking( SOLDIERTYPE* pSoldier ) +{ + // need to be drunk for this + if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE || !MercUnderTheInfluence( pSoldier, DRUG_TYPE_ALCOHOL ) ) + return; + + SOLDIERTYPE* pTeamSoldier = NULL; + UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID; + UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID; + for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ ) + { + // everybody other merc in the same sector can get updated if they are drugged too + if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile && + pTeamSoldier->sSectorX == pSoldier->sSectorX && pTeamSoldier->sSectorY == pSoldier->sSectorY && pTeamSoldier->bSectorZ == pSoldier->bSectorZ && + MercUnderTheInfluence( pTeamSoldier, DRUG_TYPE_ALCOHOL ) && + !(pTeamSoldier->bAssignment == IN_TRANSIT || + pTeamSoldier->bAssignment == ASSIGNMENT_DEAD) ) + { + // both mercs drink together, they opinion either improve or worsen + if ( Chance( 67 ) ) + AddOpinionEvent( pTeamSoldier->ubProfile, pSoldier->ubProfile, OPINIONEVENT_DRINKBUDDIES_GOOD ); + else + AddOpinionEvent( pTeamSoldier->ubProfile, pSoldier->ubProfile, OPINIONEVENT_DRINKBUDDIES_BAD ); + + if ( Chance( 67 ) ) + AddOpinionEvent( pSoldier->ubProfile, pTeamSoldier->ubProfile, OPINIONEVENT_DRINKBUDDIES_GOOD ); + else + AddOpinionEvent( pSoldier->ubProfile, pTeamSoldier->ubProfile, OPINIONEVENT_DRINKBUDDIES_BAD ); + } + } +} + +UINT8 HighestInventoryCoolness( SOLDIERTYPE* pSoldier ) +{ + UINT8 coolness = 0; + + if ( !pSoldier ) + return coolness; + + // search for food in our inventory + INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly + for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ... + { + // ... if Item exists and is food ... + if ( pSoldier->inv[bLoop].exists( ) ) + { + coolness = max( coolness, Item[pSoldier->inv[bLoop].usItem].ubCoolness ); + } + } + + return coolness; } \ No newline at end of file diff --git a/Tactical/Morale.h b/Tactical/Morale.h index ad60fc75..e8f66b6a 100644 --- a/Tactical/Morale.h +++ b/Tactical/Morale.h @@ -148,6 +148,136 @@ typedef struct SnitchEvent UINT8 ubSecondaryTargetProfile; } SnitchEvent; +// -------- added by Flugente: flags for opinions -------- +// easier than adding 32 differently named variables. DO NOT CHANGE THEM, UNLESS YOU KNOW WHAT YOU ARE DOING!!! +// if someone influences our opinion, STAGE1 gets set. Every day, stages move up one step, until we 'forget' them +// these flags describe what the other guy did to us.... +// flagmask 1 +#define OPINIONFLAG_STAGE1_FRIENDLYFIRE 0x00000001 //1 // fired on us +#define OPINIONFLAG_STAGE2_FRIENDLYFIRE 0x00000002 //2 +#define OPINIONFLAG_STAGE3_FRIENDLYFIRE 0x00000004 //4 +#define OPINIONFLAG_STAGE4_FRIENDLYFIRE 0x00000008 //8 + +#define OPINIONFLAG_STAGE1_SNITCHSOLDMEOUT 0x00000010 //16 // has been snitching to the player about us +#define OPINIONFLAG_STAGE2_SNITCHSOLDMEOUT 0x00000020 //32 +#define OPINIONFLAG_STAGE3_SNITCHSOLDMEOUT 0x00000040 //64 +#define OPINIONFLAG_STAGE4_SNITCHSOLDMEOUT 0x00000080 //128 + +#define OPINIONFLAG_STAGE1_INTERFERENCE 0x00000100 //256 // is interfering with us (stopped us from taking drugs or stealing) +#define OPINIONFLAG_STAGE2_INTERFERENCE 0x00000200 //512 +#define OPINIONFLAG_STAGE3_INTERFERENCE 0x00000400 //1024 +#define OPINIONFLAG_STAGE4_INTERFERENCE 0x00000800 //2048 + +#define OPINIONFLAG_STAGE1_FRIENDSWITHHATED 0x00001000 //4096 // is friends with someone we hate +#define OPINIONFLAG_STAGE2_FRIENDSWITHHATED 0x00002000 //8192 +#define OPINIONFLAG_STAGE3_FRIENDSWITHHATED 0x00004000 //16384 +#define OPINIONFLAG_STAGE4_FRIENDSWITHHATED 0x00008000 //32768 + +#define OPINIONFLAG_STAGE1_CONTRACTEXTENSION 0x00010000 //65536 // got his contract extended before we did, even though we had less time left +#define OPINIONFLAG_STAGE2_CONTRACTEXTENSION 0x00020000 //131072 +#define OPINIONFLAG_STAGE3_CONTRACTEXTENSION 0x00040000 //262144 +#define OPINIONFLAG_STAGE4_CONTRACTEXTENSION 0x00080000 //524288 + +#define OPINIONFLAG_STAGE1_ORDEREDRETREAT 0x00100000 //1048576 // was commander (most senior merc around) and ordered retreat +#define OPINIONFLAG_STAGE2_ORDEREDRETREAT 0x00200000 //2097152 +#define OPINIONFLAG_STAGE3_ORDEREDRETREAT 0x00400000 //4194304 +#define OPINIONFLAG_STAGE4_ORDEREDRETREAT 0x00800000 //8388608 + +#define OPINIONFLAG_STAGE1_CIVKILLER 0x01000000 //16777216 // killed an unarmed civilian +#define OPINIONFLAG_STAGE2_CIVKILLER 0x02000000 //33554432 +#define OPINIONFLAG_STAGE3_CIVKILLER 0x04000000 //67108864 +#define OPINIONFLAG_STAGE4_CIVKILLER 0x08000000 //134217728 + +#define OPINIONFLAG_STAGE1_SLOWSUSDOWN 0x10000000 //268435456 // is overloaded and thus slows us down +#define OPINIONFLAG_STAGE2_SLOWSUSDOWN 0x20000000 //536870912 +#define OPINIONFLAG_STAGE3_SLOWSUSDOWN 0x40000000 //1073741824 +#define OPINIONFLAG_STAGE4_SLOWSUSDOWN 0x80000000 //2147483648 + +// flagmask 2 +#define OPINIONFLAG_STAGE1_NOSHARINGFOOD 0x00000001 //1 // had water/food when we needed it. So he did not share! +#define OPINIONFLAG_STAGE2_NOSHARINGFOOD 0x00000002 //2 +#define OPINIONFLAG_STAGE3_NOSHARINGFOOD 0x00000004 //4 +#define OPINIONFLAG_STAGE4_NOSHARINGFOOD 0x00000008 //8 + +#define OPINIONFLAG_STAGE1_ANNOYINGDISABILITY 0x00000010 //16 // disability kicked in at a bad time, putting the team at risk (forgeful, nervous, psycho...) +#define OPINIONFLAG_STAGE2_ANNOYINGDISABILITY 0x00000020 //32 +#define OPINIONFLAG_STAGE3_ANNOYINGDISABILITY 0x00000040 //64 +#define OPINIONFLAG_STAGE4_ANNOYINGDISABILITY 0x00000080 //128 + +#define OPINIONFLAG_STAGE1_ADDICT 0x00000100 //256 // is taking drugs +#define OPINIONFLAG_STAGE2_ADDICT 0x00000200 //512 +#define OPINIONFLAG_STAGE3_ADDICT 0x00000400 //1024 +#define OPINIONFLAG_STAGE4_ADDICT 0x00000800 //2048 + +#define OPINIONFLAG_STAGE1_THIEF 0x00001000 //4096 // is stealing items +#define OPINIONFLAG_STAGE2_THIEF 0x00002000 //8192 +#define OPINIONFLAG_STAGE3_THIEF 0x00004000 //16384 +#define OPINIONFLAG_STAGE4_THIEF 0x00008000 //32768 + +#define OPINIONFLAG_STAGE1_WORSTCOMMANDEREVER 0x00010000 //65536 // was commander (most senior merc around) when a lot of our people (including militia) died +#define OPINIONFLAG_STAGE2_WORSTCOMMANDEREVER 0x00020000 //131072 +#define OPINIONFLAG_STAGE3_WORSTCOMMANDEREVER 0x00040000 //262144 +#define OPINIONFLAG_STAGE4_WORSTCOMMANDEREVER 0x00080000 //524288 + +#define OPINIONFLAG_STAGE1_RICHGUY 0x00100000 //1048576 // gets paid a lot more than we do +#define OPINIONFLAG_STAGE2_RICHGUY 0x00200000 //2097152 +#define OPINIONFLAG_STAGE3_RICHGUY 0x00400000 //4194304 +#define OPINIONFLAG_STAGE4_RICHGUY 0x00800000 //8388608 + +#define OPINIONFLAG_STAGE1_BETTERGEAR 0x01000000 //16777216 // has a lot better gear than we do +#define OPINIONFLAG_STAGE2_BETTERGEAR 0x02000000 //33554432 +#define OPINIONFLAG_STAGE3_BETTERGEAR 0x04000000 //67108864 +#define OPINIONFLAG_STAGE4_BETTERGEAR 0x08000000 //134217728 + +#define OPINIONFLAG_STAGE1_YOUMOUNTEDAGUNONMYBREASTS 0x10000000 //268435456 // used our body to rest his gun on +#define OPINIONFLAG_STAGE2_YOUMOUNTEDAGUNONMYBREASTS 0x20000000 //536870912 +#define OPINIONFLAG_STAGE3_YOUMOUNTEDAGUNONMYBREASTS 0x40000000 //1073741824 +#define OPINIONFLAG_STAGE4_YOUMOUNTEDAGUNONMYBREASTS 0x80000000 //2147483648 + +// flagmask 3 +#define OPINIONFLAG_STAGE1_BANDAGED 0x00000001 //1 // bandaged our wounds +#define OPINIONFLAG_STAGE2_BANDAGED 0x00000002 //2 +#define OPINIONFLAG_STAGE3_BANDAGED 0x00000004 //4 +#define OPINIONFLAG_STAGE4_BANDAGED 0x00000008 //8 + +#define OPINIONFLAG_STAGE1_DRINKBUDDIES_GOOD 0x00000010 //16 // had a drink with him, he's okay. +#define OPINIONFLAG_STAGE2_DRINKBUDDIES_GOOD 0x00000020 //32 +#define OPINIONFLAG_STAGE3_DRINKBUDDIES_GOOD 0x00000040 //64 +#define OPINIONFLAG_STAGE4_DRINKBUDDIES_GOOD 0x00000080 //128 + +#define OPINIONFLAG_STAGE1_DRINKBUDDIES_SUPER 0x00000100 //256 // had a drink with him, he's super okay +#define OPINIONFLAG_STAGE2_DRINKBUDDIES_SUPER 0x00000200 //512 +#define OPINIONFLAG_STAGE3_DRINKBUDDIES_SUPER 0x00000400 //1024 +#define OPINIONFLAG_STAGE4_DRINKBUDDIES_SUPER 0x00000800 //2048 + +#define OPINIONFLAG_STAGE1_DRINKBUDDIES_BAD 0x00001000 //4096 // had a drink with him, don't like him +#define OPINIONFLAG_STAGE2_DRINKBUDDIES_BAD 0x00002000 //8192 +#define OPINIONFLAG_STAGE3_DRINKBUDDIES_BAD 0x00004000 //16384 +#define OPINIONFLAG_STAGE4_DRINKBUDDIES_BAD 0x00008000 //32768 + +#define OPINIONFLAG_STAGE1_DRINKBUDDIES_WORSE 0x00010000 //65536 // had a drink with him, and I REALLY don't like him now +#define OPINIONFLAG_STAGE2_DRINKBUDDIES_WORSE 0x00020000 //131072 +#define OPINIONFLAG_STAGE3_DRINKBUDDIES_WORSE 0x00040000 //262144 +#define OPINIONFLAG_STAGE4_DRINKBUDDIES_WORSE 0x00080000 //524288 + +/*#define OPINIONFLAG_STAGE1_RICHGUY 0x00100000 //1048576 // gets paid a lot more than we do +#define OPINIONFLAG_STAGE2_RICHGUY 0x00200000 //2097152 +#define OPINIONFLAG_STAGE3_RICHGUY 0x00400000 //4194304 +#define OPINIONFLAG_STAGE4_RICHGUY 0x00800000 //8388608 + +#define OPINIONFLAG_STAGE1_BETTERGEAR 0x01000000 //16777216 // has a lot better gear than we do +#define OPINIONFLAG_STAGE2_BETTERGEAR 0x02000000 //33554432 +#define OPINIONFLAG_STAGE3_BETTERGEAR 0x04000000 //67108864 +#define OPINIONFLAG_STAGE4_BETTERGEAR 0x08000000 //134217728 + +#define OPINIONFLAG_STAGE1_YOUMOUNTEDAGUNONMYBREASTS 0x10000000 //268435456 // used our body to rest his gun on +#define OPINIONFLAG_STAGE2_YOUMOUNTEDAGUNONMYBREASTS 0x20000000 //536870912 +#define OPINIONFLAG_STAGE3_YOUMOUNTEDAGUNONMYBREASTS 0x40000000 //1073741824 +#define OPINIONFLAG_STAGE4_YOUMOUNTEDAGUNONMYBREASTS 0x80000000 //2147483648*/ + +#define OPINIONFLAG_STAGE4_ALL 0x88888888 // flags of all final stages, used when rolling over +// ---------------------------------------------------------------- + extern void HandleMoraleEvent( SOLDIERTYPE * pSoldier, INT8 bMoraleEvent, INT16 sMapX, INT16 sMapY, INT8 bMapZ ); extern void RefreshSoldierMorale( SOLDIERTYPE * pSoldier ); extern INT8 GetMoraleModifier( SOLDIERTYPE * pSoldier ); @@ -163,4 +293,35 @@ void DecayTacticalMoraleModifiers( void ); // Flugente: calculate A's opinion of B INT8 SoldierRelation( SOLDIERTYPE* pSoldierA, SOLDIERTYPE* pSoldierB); +// Flugente: dynamic opinions +// modify usProfileA's opinion of usProfileB because of usEvent +void AddOpinionEvent( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent ); + +// get usProfileA's opinion of usProfileB concerning usEvent +INT8 GetDynamicOpinion( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent ); + +// daily rollover of opinions +void HandleDynamicOpinions(); + +// a day has passed, 'age' opinions +void RolloverDynamicOpinions( UINT8 usProfileA ); + +// check wether other people are friends with someone else we hate. All persons must be in Arulco +void CheckForFriendsofHated( SOLDIERTYPE* pSoldier ); + +void HandleDynamicOpinionOnContractExtension( UINT8 ubCode, UINT8 usProfile ); +void HandleDynamicOpinionCivKill( SOLDIERTYPE* pSoldier ); +void HandleDynamicOpinionSlowdown( SOLDIERTYPE* pSoldier ); +void HandleDynamicOpinionWageJealousy( SOLDIERTYPE* pSoldier ); +void HandleDynamicOpinionDisability( SOLDIERTYPE* pSoldier ); +void HandleDynamicOpinionAddict( SOLDIERTYPE* pSoldier ); +void HandleDynamicOpinionThief( SOLDIERTYPE* pSoldier ); +void HandleDynamicOpinionFoodSharing( SOLDIERTYPE* pSoldier ); +void HandleDynamicOpinionGear( SOLDIERTYPE* pSoldier ); +void HandleDynamicOpinionBattleLosses(); +void HandleDynamicOpinionRetreat(); +void HandleDynamicOpinionTeamDrinking( SOLDIERTYPE* pSoldier ); + +UINT8 HighestInventoryCoolness( SOLDIERTYPE* pSoldier ); + #endif \ No newline at end of file diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index bafbdd79..1887c4de 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -2488,6 +2488,9 @@ BOOLEAN HandleGotoNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving, BOOLE fDontContinue = TRUE; UnSetUIBusy( pSoldier->ubID ); + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( pSoldier ); } } @@ -3227,6 +3230,9 @@ void InternalSelectSoldier( UINT16 usSoldierID, BOOLEAN fAcknowledge, BOOLEAN fF { TacticalCharacterDialogue( pSoldier, QUOTE_PERSONALITY_TRAIT ); pSoldier->usQuoteSaidFlags |= SOLDIER_QUOTE_SAID_PERSONALITY; + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( pSoldier ); } break; default: @@ -3237,6 +3243,9 @@ void InternalSelectSoldier( UINT16 usSoldierID, BOOLEAN fAcknowledge, BOOLEAN fF { TacticalCharacterDialogue( pSoldier, QUOTE_PERSONALITY_TRAIT ); pSoldier->usQuoteSaidFlags |= SOLDIER_QUOTE_SAID_PERSONALITY; + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( pSoldier ); } } break; diff --git a/Tactical/SkillCheck.cpp b/Tactical/SkillCheck.cpp index 0dbbb2f4..5de8c418 100644 --- a/Tactical/SkillCheck.cpp +++ b/Tactical/SkillCheck.cpp @@ -783,6 +783,9 @@ INT32 SkillCheck( SOLDIERTYPE * pSoldier, INT8 bReason, INT8 bChanceMod ) if ( MercIsHot( pSoldier ) && pSoldier->ubWhatKindOfMercAmI != MERC_TYPE__PLAYER_CHARACTER) // SANDRO - added this { TacticalCharacterDialogue( pSoldier, QUOTE_PERSONALITY_TRAIT ); + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( pSoldier ); } // do we realize that we just can't do this? if ( (100 - (pSoldier->ubSkillCheckAttempts - 2) * 20) < EffectiveWisdom( pSoldier ) ) diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index 7dd96fbe..373bc77e 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -3934,7 +3934,12 @@ BOOLEAN HandleSoldierDeath( SOLDIERTYPE *pSoldier , BOOLEAN *pfMadeCorpse ) else if ( pSoldier->bTeam == CIV_TEAM && !pSoldier->aiData.bNeutral && pSoldier->bSide != gbPlayerNum ) gMercProfiles[ MercPtrs[ ubAttacker ]->ubProfile ].records.usKillsHostiles++; else + { gMercProfiles[ MercPtrs[ ubAttacker ]->ubProfile ].records.usKillsOthers++; + + // Flugente: dynamic opinions + HandleDynamicOpinionCivKill( MercPtrs[ubAttacker] ); + } break; } //gMercProfiles[ MercPtrs[ pSoldier->ubAttackerID ]->ubProfile ].usKills++; diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 07cdfefd..bee1c029 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -7691,6 +7691,9 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou { TacticalCharacterDialogue( this, QUOTE_PERSONALITY_TRAIT ); this->usQuoteSaidFlags |= SOLDIER_QUOTE_SAID_PERSONALITY; + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( this ); } } } @@ -7704,6 +7707,9 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou { TacticalCharacterDialogue( this, QUOTE_PERSONALITY_TRAIT ); this->usQuoteSaidFlags |= SOLDIER_QUOTE_SAID_PERSONALITY; + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( this ); } } } @@ -7718,8 +7724,10 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou { TacticalCharacterDialogue( this, QUOTE_PERSONALITY_TRAIT ); this->usQuoteSaidFlags |= SOLDIER_QUOTE_SAID_PERSONALITY; - } + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( this ); + } } } @@ -7735,6 +7743,9 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou { TacticalCharacterDialogue( this, QUOTE_PERSONALITY_TRAIT ); this->usQuoteSaidFlags |= SOLDIER_QUOTE_SAID_PERSONALITY; + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( this ); } } } @@ -9626,6 +9637,12 @@ UINT8 SOLDIERTYPE::SoldierTakeDamage( INT8 bHeight, INT16 sLifeDeduct, INT16 sPo // reduce poison damage by poison resistance sPoisonAdd = (INT16)(sPoisonAdd * (100 - this->GetPoisonResistance())/100); + // Flugente: dynamic opinions + if ( ubAttacker != NOBODY && MercPtrs[ubAttacker] ) + { + AddOpinionEvent( this->ubProfile, MercPtrs[ubAttacker]->ubProfile, OPINIONEVENT_FRIENDLYFIRE ); + } + // CJC Jan 21 99: add check to see if we are hurting an enemy in an enemy-controlled // sector; if so, this is a sign of player activity switch ( this->bTeam ) @@ -12682,6 +12699,9 @@ UINT32 SOLDIERTYPE::SoldierDressWound( SOLDIERTYPE *pVictim, INT16 sKitPts, INT1 return(0); } + // Flugente: dynamic opinions + AddOpinionEvent( pVictim->ubProfile, this->ubProfile, OPINIONEVENT_BANDAGED ); + bInitialBleeding = pVictim->bBleeding; // in case he has multiple kits in hand, limit influence of kit status to 100%! @@ -13707,6 +13727,9 @@ BOOLEAN SOLDIERTYPE::CheckForBreathCollapse( void ) if ( MercIsHot( this ) && this->ubWhatKindOfMercAmI != MERC_TYPE__PLAYER_CHARACTER ) { TacticalCharacterDialogue( this, QUOTE_PERSONALITY_TRAIT ); + + // Flugente: dynamic opinions + HandleDynamicOpinionDisability( this ); } else { @@ -14225,7 +14248,7 @@ BOOLEAN SOLDIERTYPE::IsWeaponMounted( void ) // for some reason I find EXTREMELY FRUSTRATING, we might get a heigth of 2 on a totally empty tile... so we check if we could occupy the tile if ( !IsLocationSittable( nextGridNoinSight, 0 ) ) { - // resting our gun on people would be rude - only allow if nobody is there + // resting our gun on people is allowed sometimes UINT usPersonID = WhoIsThere2( nextGridNoinSight, this->pathing.bLevel ); if( usPersonID == NOBODY ) applybipod = TRUE; @@ -14233,13 +14256,18 @@ BOOLEAN SOLDIERTYPE::IsWeaponMounted( void ) { SOLDIERTYPE* pSoldier = MercPtrs[ usPersonID ]; - // if the other person is an ally an prone + // if the other person is an ally and prone if ( this->bSide == pSoldier->bSide && gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE ) { // if we are facing the other guy in a 90 degree angle, we can mount our gun on his back // Once merc's relationship allows angering mercs through actions of others, add a penalty here - if ( this->ubDirection == gTwoCCDirection[ pSoldier->ubDirection ] || this->ubDirection == gTwoCDirection[ pSoldier->ubDirection ] ) + if ( this->ubDirection == gTwoCCDirection[pSoldier->ubDirection] || this->ubDirection == gTwoCDirection[pSoldier->ubDirection] ) + { applybipod = TRUE; + + // Flugente: dynamic opinions + AddOpinionEvent( MercPtrs[usPersonID]->ubProfile, this->ubProfile, OPINIONEVENT_YOUMOUNTEDAGUNONMYBREASTS ); + } } } } @@ -14285,9 +14313,25 @@ BOOLEAN SOLDIERTYPE::IsWeaponMounted( void ) { // for some reason I find EXTREMELY FRUSTRATING, we might get a heigth of 2 on a totally empty tile... so we check if we could occupy the tile if ( !IsLocationSittable( nextGridNoinSight, 0 ) ) - // resting our gun on people would be rude - only allow if nobody is there - if( WhoIsThere2( nextGridNoinSight, 0 ) == NOBODY ) - applybipod = TRUE; + { + // resting our gun on people is allowed sometimes + UINT usPersonID = WhoIsThere2( nextGridNoinSight, this->pathing.bLevel ); + if ( usPersonID == NOBODY ) + applybipod = TRUE; + else + { + SOLDIERTYPE* pSoldier = MercPtrs[usPersonID]; + + // if the other person is an ally and prone + if ( this->bSide == pSoldier->bSide && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_CROUCH ) + { + applybipod = TRUE; + + // Flugente: dynamic opinions + AddOpinionEvent( MercPtrs[usPersonID]->ubProfile, this->ubProfile, OPINIONEVENT_YOUMOUNTEDAGUNONMYBREASTS ); + } + } + } } } diff --git a/Tactical/XML_Background.cpp b/Tactical/XML_Background.cpp index 09ec68e8..91457e96 100644 --- a/Tactical/XML_Background.cpp +++ b/Tactical/XML_Background.cpp @@ -125,6 +125,7 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha strcmp(name, "cth_vs_creatures") == 0 || strcmp(name, "insurance") == 0 || strcmp(name, "spotter") == 0 || + strcmp(name, "dislikebackground" ) == 0 || strcmp(name, "druguse") == 0 || strcmp(name, "xenophobic") == 0 || strcmp(name, "corruptionspread") == 0 || @@ -519,6 +520,11 @@ backgroundEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; pData->curBackground.value[BG_PERC_SPOTTER] = min(30, max(-30, (INT16) atol(pData->szCharData) )); } + else if ( strcmp( name, "dislikebackground" ) == 0 ) + { + pData->curElement = ELEMENT; + pData->curBackground.value[BG_DISLIKEBG] = (INT16)atol( pData->szCharData ); + } else if(strcmp(name, "druguse") == 0) { pData->curElement = ELEMENT; diff --git a/Tactical/soldier profile type.h b/Tactical/soldier profile type.h index f8408682..db82be47 100644 --- a/Tactical/soldier profile type.h +++ b/Tactical/soldier profile type.h @@ -307,6 +307,9 @@ typedef enum NUM_RACIST } RacistLevels; +// Flugente: dynamic opinons: number of profile flagmasks +#define OPINION_FLAGMASKS_NUMBER 3 + ////////////////////////////////////////////////////////////////////// typedef enum @@ -952,6 +955,9 @@ public: // anv: simplified ubExposedInSector, hours until snitch can go undercover after exposition UINT8 ubSnitchExposedCooldown; + // Flugente: flagmasks for dynamic opinions on each and every other person. Yes, this is significant in size + UINT32 usDynamicOpinionFlagmask[NUM_PROFILES][OPINION_FLAGMASKS_NUMBER]; + }; // MERCPROFILESTRUCT; // WANNE - BMP: DONE! diff --git a/Utils/Text.h b/Utils/Text.h index e7ea30e8..0e1fa746 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -2570,7 +2570,9 @@ extern STR16 szPersonalityHelpText[]; extern STR16 szRaceText[]; extern STR16 szAppearanceText[]; extern STR16 szRefinementText[]; +extern STR16 szRefinementTextTypes[]; extern STR16 szNationalityText[]; +extern STR16 szNationalityTextAdjective[]; extern STR16 szNationalityText_Special[]; extern STR16 szCareLevelText[]; extern STR16 szRacistText[]; @@ -2733,6 +2735,42 @@ enum extern STR16 szCampaignHistoryWebpageString[]; +// Flugente: merc compare website +#define TEXT_MERCCOMPARE_CUSTOMERSTATEMENTS 6 // number of customer quotes, each with an additional short character name + +enum +{ + // main page + TEXT_MERCCOMPARE_WEBSITENAME, + TEXT_MERCCOMPARE_SLOGAN, + + TEXT_MERCCOMPARE_SUBSITE1, + TEXT_MERCCOMPARE_SUBSITE2, + TEXT_MERCCOMPARE_SUBSITE3, + TEXT_MERCCOMPARE_SUBSITE4, + + TEXT_MERCCOMPARE_INTRO1, + TEXT_MERCCOMPARE_BULLET1, + TEXT_MERCCOMPARE_BULLET2, + TEXT_MERCCOMPARE_BULLET3, + TEXT_MERCCOMPARE_BULLET4, + TEXT_MERCCOMPARE_INTRO2, + + // customer quotes + TEXT_MERCCOMPARE_QUOTEINTRO, + TEXT_MERCCOMPARE_QUOTE1, + TEXT_MERCCOMPARE_QUOTE1NAME, + + // analyze + TEXT_MERCCOMPARE_DROPDOWNTEXT = TEXT_MERCCOMPARE_QUOTE1 + 2 * TEXT_MERCCOMPARE_CUSTOMERSTATEMENTS, + TEXT_MERCCOMPARE_DROPDOWNTEXT_MATRIX, + + TEXT_MERCCOMPARE_MAX, +}; + +extern STR16 szMercCompareWebSite[]; +extern STR16 szMercCompareEventText[]; + extern STR16 szTacticalInventoryDialogString[]; extern STR16 szTacticalCoverDialogString[]; extern STR16 szTacticalCoverDialogPrintString[]; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index c95c0fd1..87bfff86 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -4307,6 +4307,7 @@ STR16 pBookMarkStrings[] = L"百科全书", L"简报室", L"战役历史", + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4419,6 +4420,10 @@ STR16 pWebPagesTitles[] = L"%s新闻发布会 - 战役报告", L"%s新闻发布会 - 最新消息", L"%s新闻发布会 - 关于我们", + L"Mercs Love or Dislike You - Home", // TODO.Translate + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Bobby Ray - 最近的运货", L"百科全书", L"百科全书 - 数据", @@ -6206,6 +6211,7 @@ STR16 gzLaptopHelpText[] = L"百科全书", L"简报室", L"战役历史", + L"Mercenaries Love or Dislike You", // TODO.Translate }; @@ -8103,7 +8109,7 @@ STR16 szInventoryArmTextStr[]= STR16 szBackgroundText_Flags[]= { L" 会消耗掉背包中的药品\n", //L" might consume drugs in inventory\n", - L" 蔑视其他背景的角色\n", //L" disregard for other backgrounds\n", + L" disregard for all other backgrounds\n", // TODO.Translate L" 在地下分区角色等级+1\n", //L" +1 level in underground sectors\n", L" 会盗窃物品\n", //L" might steal items\n", @@ -8185,6 +8191,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%%射击生物准确率(CTH)\n", //L" %s%d%% cth with firearms against creatures\n", L" %s%d%%医疗保证金\n", //L" %s%d%% insurance cost\n", L" %s%d%%发现狙击手的成功率\n", + + L" dislikes some other backgrounds", // TODO.Translate }; STR16 szBackgroundTitleText[] = @@ -8253,6 +8261,13 @@ STR16 szRefinementText[]= L"讲究", //L"manners of a snob", }; +STR16 szRefinementTextTypes[] = // TODO.Translate +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"美国人", // 0 @@ -8303,6 +8318,57 @@ STR16 szNationalityText[]= L"葡萄牙人", }; +STR16 szNationalityTextAdjective[] = // TODO.Translate +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8513,6 +8579,74 @@ STR16 szCampaignHistoryWebpageString[]= L"天", }; +STR16 szMercCompareWebSite[] = // TODO.Translate +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"操作背包", diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index aba50435..7ab97d98 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -4309,6 +4309,7 @@ STR16 pBookMarkStrings[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", // TODO.Translate + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4421,6 +4422,10 @@ STR16 pWebPagesTitles[] = L"%s Press Council - Battle Reports", L"%s Press Council - Latest News", L"%s Press Council - About us", + L"Mercs Love or Dislike You - Home", // TODO.Translate + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Bobby Ray's - Recentelijke Zendingen", L"Encyclopedia", L"Encyclopedia - Data", @@ -6217,6 +6222,7 @@ STR16 gzLaptopHelpText[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", // TODO.Translate + L"Mercenaries Love or Dislike You", // TODO.Translate }; @@ -8117,7 +8123,7 @@ STR16 szInventoryArmTextStr[]= // TODO.Translate STR16 szBackgroundText_Flags[]= { L" might consume drugs in inventory\n", - L" disregard for other backgrounds\n", + L" disregard for all other backgrounds\n", L" +1 level in underground sectors\n", L" might steal items\n", @@ -8200,6 +8206,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%% cth with firearms against creatures\n", L" %s%d%% insurance cost\n", L" %s%d%% effectiveness as spotter for fellow snipers\n", // TODO.Translate + + L" dislikes some other backgrounds", // TODO.Translate }; STR16 szBackgroundTitleText[] = // TODO.Translate @@ -8268,6 +8276,13 @@ STR16 szRefinementText[]= L"manners of a snob", }; +STR16 szRefinementTextTypes[] = // TODO.Translate +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"American", // 0 @@ -8318,6 +8333,56 @@ STR16 szNationalityText[]= L"Portoguese", }; +STR16 szNationalityTextAdjective[] = // TODO.Translate +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8528,6 +8593,74 @@ STR16 szCampaignHistoryWebpageString[]= L"Day", }; +STR16 szMercCompareWebSite[] = // TODO.Translate +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"Inventory Manipulations", diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 6c30eef2..ff01918c 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -4306,6 +4306,7 @@ STR16 pBookMarkStrings[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4418,6 +4419,10 @@ STR16 pWebPagesTitles[] = L"%s Press Council - Battle Reports", L"%s Press Council - Latest News", L"%s Press Council - About us", + L"Mercs Love or Dislike You - Home", + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Bobby Ray's - Recent Shipments", L"Encyclopedia", L"Encyclopedia - Data", @@ -6205,6 +6210,7 @@ STR16 gzLaptopHelpText[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", + L"Mercenaries Love or Dislike You", }; @@ -8101,7 +8107,7 @@ STR16 szInventoryArmTextStr[]= STR16 szBackgroundText_Flags[]= { L" might consume drugs in inventory\n", - L" disregard for other backgrounds\n", + L" disregard for all other backgrounds\n", L" +1 level in underground sectors\n", L" might steal items\n", @@ -8183,6 +8189,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%% cth with firearms against creatures\n", L" %s%d%% insurance cost\n", L" %s%d%% effectiveness as spotter for fellow snipers\n", + + L" dislikes some other backgrounds", }; STR16 szBackgroundTitleText[] = @@ -8252,6 +8260,13 @@ STR16 szRefinementText[]= L"manners of a snob", }; +STR16 szRefinementTextTypes[] = +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"American", // 0 @@ -8302,6 +8317,56 @@ STR16 szNationalityText[]= L"Portoguese", }; +STR16 szNationalityTextAdjective[] = +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8512,6 +8577,74 @@ STR16 szCampaignHistoryWebpageString[]= L"Day", }; +STR16 szMercCompareWebSite[] = +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"Inventory Manipulations", diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index d2b1c326..4ad159b9 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -4317,6 +4317,7 @@ STR16 pBookMarkStrings[] = L"Encyclopédie", L"Briefing", L"Comptes rendus", + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4429,6 +4430,10 @@ STR16 pWebPagesTitles[] = L"%s, conseil de presse : Rapports", // TODO.Translate //A voir fini (to see finished) L"%s, conseil de presse : Dernières Nouvelles", // TODO.Translate //A voir fini (to see finished) L"%s, conseil de presse : À propos de nous", // TODO.Translate //A voir fini (to see finished) + L"Mercs Love or Dislike You - Home", // TODO.Translate + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Bobby Ray : Dernières commandes", L"Encyclopédie", L"Encyclopédie : Données", @@ -6217,6 +6222,7 @@ STR16 gzLaptopHelpText[] = L"Encyclopédie", L"Salle de briefing", L"Comptes rendus", + L"Mercenaries Love or Dislike You", // TODO.Translate }; @@ -8102,7 +8108,7 @@ STR16 szInventoryArmTextStr[]= STR16 szBackgroundText_Flags[]= { L" peut consommer des drogues se trouvant dans son inventaire\n", - L" ne tient pas compte des autres passifs\n", + L" disregard for all other backgrounds\n", // TODO.Translate L" +1 Niveau dans les souterrains\n", L" peut voler des objets\n", @@ -8185,6 +8191,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%% de CDT avec des armes à feu contre les créatures\n", L" %s%d%% du coût de l'assurance\n", L" %s%d%% d'efficacité comme guetteur pour vos tireurs d'élite\n", + + L" dislikes some other backgrounds", // TODO.Translate }; STR16 szBackgroundTitleText[] = @@ -8253,6 +8261,13 @@ STR16 szRefinementText[]= L"manières de snob", }; +STR16 szRefinementTextTypes[] = // TODO.Translate +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"Américain", // 0 @@ -8303,6 +8318,56 @@ STR16 szNationalityText[]= L"Portugais", }; +STR16 szNationalityTextAdjective[] = // TODO.Translate +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8513,6 +8578,74 @@ STR16 szCampaignHistoryWebpageString[]= L"Jour", }; +STR16 szMercCompareWebSite[] = // TODO.Translate +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"Manipulations de l'inventaire", diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 9e396bcb..afaf102c 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -4260,6 +4260,7 @@ STR16 pBookMarkStrings[] = L"Enzyklopädie", L"Besprechung", L"Geschichte", + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4364,6 +4365,10 @@ STR16 pWebPagesTitles[] = L"%s Presse Rat - Kampfberichte", L"%s Presse Rat - Aktuellste Neuigkeiten", L"%s Presse Rat - Über uns", + L"Mercs Love or Dislike You - Home", // TODO.Translate + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Bobby Rays - Letzte Lieferungen", L"Enzyklopädie", L"Enzyklopädie - Daten", @@ -6049,6 +6054,7 @@ STR16 gzLaptopHelpText[] = L"Enzyklopädie", L"Einsatzbesprechung", L"Geschichte", + L"Mercenaries Love or Dislike You", // TODO.Translate }; STR16 gzHelpScreenText[] = @@ -7931,7 +7937,7 @@ STR16 szInventoryArmTextStr[]= STR16 szBackgroundText_Flags[]= { L" might consume drugs in inventory\n", - L" disregard for other backgrounds\n", + L" disregard for all other backgrounds\n", L" +1 level in underground sectors\n", L" might steal items\n", @@ -8014,6 +8020,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%% cth with firearms against creatures\n", L" %s%d%% insurance cost\n", L" %s%d%% effectiveness as spotter for fellow snipers\n", // TODO.Translate + + L" dislikes some other backgrounds", // TODO.Translate }; STR16 szBackgroundTitleText[] = // TODO.Translate @@ -8082,6 +8090,13 @@ STR16 szRefinementText[]= L"manners of a snob", }; +STR16 szRefinementTextTypes[] = // TODO.Translate +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"American", // 0 @@ -8132,6 +8147,56 @@ STR16 szNationalityText[]= L"Portoguese", }; +STR16 szNationalityTextAdjective[] = // TODO.Translate +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8342,6 +8407,74 @@ STR16 szCampaignHistoryWebpageString[]= L"Day", }; +STR16 szMercCompareWebSite[] = // TODO.Translate +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"Inventory Manipulations", diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 9bc65dff..d177235e 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -4297,6 +4297,7 @@ STR16 pBookMarkStrings[] = L"Assicurazione", L"Annulla", L"Campaign History", // TODO.Translate + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4409,6 +4410,10 @@ STR16 pWebPagesTitles[] = L"%s Press Council - Battle Reports", L"%s Press Council - Latest News", L"%s Press Council - About us", + L"Mercs Love or Dislike You - Home", // TODO.Translate + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Bobby Ray - Spedizioni recenti", L"Encyclopedia", L"Encyclopedia - Data", @@ -6202,6 +6207,7 @@ STR16 gzLaptopHelpText[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", // TODO.Translate + L"Mercenaries Love or Dislike You", // TODO.Translate }; @@ -8109,7 +8115,7 @@ STR16 szInventoryArmTextStr[]= // TODO.Translate STR16 szBackgroundText_Flags[]= { L" might consume drugs in inventory\n", - L" disregard for other backgrounds\n", + L" disregard for all other backgrounds\n", L" +1 level in underground sectors\n", L" might steal items\n", @@ -8192,6 +8198,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%% cth with firearms against creatures\n", L" %s%d%% insurance cost\n", L" %s%d%% effectiveness as spotter for fellow snipers\n", // TODO.Translate + + L" dislikes some other backgrounds", // TODO.Translate }; STR16 szBackgroundTitleText[] = // TODO.Translate @@ -8260,6 +8268,13 @@ STR16 szRefinementText[]= L"manners of a snob", }; +STR16 szRefinementTextTypes[] = // TODO.Translate +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"American", // 0 @@ -8310,6 +8325,56 @@ STR16 szNationalityText[]= L"Portoguese", }; +STR16 szNationalityTextAdjective[] = // TODO.Translate +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8520,6 +8585,74 @@ STR16 szCampaignHistoryWebpageString[]= L"Day", }; +STR16 szMercCompareWebSite[] = // TODO.Translate +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"Inventory Manipulations", diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 69155ff8..29abd335 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -4316,6 +4316,7 @@ STR16 pBookMarkStrings[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", // TODO.Translate + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4428,6 +4429,10 @@ STR16 pWebPagesTitles[] = L"%s Press Council - Battle Reports", L"%s Press Council - Latest News", L"%s Press Council - About us", + L"Mercs Love or Dislike You - Home", // TODO.Translate + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Bobby Ray's - Ostatnie dostawy", L"Encyclopedia", L"Encyclopedia - Dane", @@ -6220,6 +6225,7 @@ STR16 gzLaptopHelpText[] = L"Encyklopedia", L"Briefing Room", L"Campaign History", // TODO.Translate + L"Mercenaries Love or Dislike You", // TODO.Translate }; @@ -8126,7 +8132,7 @@ STR16 szInventoryArmTextStr[]= // TODO.Translate STR16 szBackgroundText_Flags[]= { L" might consume drugs in inventory\n", - L" disregard for other backgrounds\n", + L" disregard for all other backgrounds\n", L" +1 level in underground sectors\n", L" might steal items\n", @@ -8209,6 +8215,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%% cth with firearms against creatures\n", L" %s%d%% insurance cost\n", L" %s%d%% effectiveness as spotter for fellow snipers\n", // TODO.Translate + + L" dislikes some other backgrounds", // TODO.Translate }; STR16 szBackgroundTitleText[] = // TODO.Translate @@ -8277,6 +8285,13 @@ STR16 szRefinementText[]= L"manners of a snob", }; +STR16 szRefinementTextTypes[] = // TODO.Translate +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"American", // 0 @@ -8327,6 +8342,56 @@ STR16 szNationalityText[]= L"Portoguese", }; +STR16 szNationalityTextAdjective[] = // TODO.Translate +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8537,6 +8602,74 @@ STR16 szCampaignHistoryWebpageString[]= L"Day", }; +STR16 szMercCompareWebSite[] = // TODO.Translate +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"Inventory Manipulations", diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 55acba46..edee367d 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -4307,6 +4307,7 @@ STR16 pBookMarkStrings[] = L"Энциклопедия", L"Briefing Room", L"Campaign History", // TODO.Translate + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4419,6 +4420,10 @@ STR16 pWebPagesTitles[] = L"%s Press Council - Battle Reports", L"%s Press Council - Latest News", L"%s Press Council - About us", + L"Mercs Love or Dislike You - Home", // TODO.Translate + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Бобби Рэй - последние поступления", L"Энциклопедия", L"Энциклопедия - данные", @@ -6207,6 +6212,7 @@ STR16 gzLaptopHelpText[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", // TODO.Translate + L"Mercenaries Love or Dislike You", // TODO.Translate }; @@ -8106,7 +8112,7 @@ STR16 szInventoryArmTextStr[]= // TODO.Translate STR16 szBackgroundText_Flags[]= { L" might consume drugs in inventory\n", - L" disregard for other backgrounds\n", + L" disregard for all other backgrounds\n", L" +1 level in underground sectors\n", L" might steal items\n", @@ -8189,6 +8195,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%% cth with firearms against creatures\n", L" %s%d%% insurance cost\n", L" %s%d%% effectiveness as spotter for fellow snipers\n", // TODO.Translate + + L" dislikes some other backgrounds", // TODO.Translate }; STR16 szBackgroundTitleText[] = // TODO.Translate @@ -8257,6 +8265,13 @@ STR16 szRefinementText[]= L"manners of a snob", }; +STR16 szRefinementTextTypes[] = // TODO.Translate +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"American", // 0 @@ -8307,6 +8322,56 @@ STR16 szNationalityText[]= L"Portoguese", }; +STR16 szNationalityTextAdjective[] = // TODO.Translate +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8517,6 +8582,74 @@ STR16 szCampaignHistoryWebpageString[]= L"Day", }; +STR16 szMercCompareWebSite[] = // TODO.Translate +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"Inventory Manipulations", diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index e2564302..c0694fac 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -4312,6 +4312,7 @@ STR16 pBookMarkStrings[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", + L"MeLoDY", }; STR16 pBookmarkTitle[] = @@ -4424,6 +4425,10 @@ STR16 pWebPagesTitles[] = L"%s Press Council - Battle Reports", L"%s Press Council - Latest News", L"%s Press Council - About us", + L"Mercs Love or Dislike You - Home", // TODO.Translate + L"Mercs Love or Dislike You - Analyze a team", + L"Mercs Love or Dislike You - Pairwise comparison", + L"Mercs Love or Dislike You - About us", L"Bobby Ray's - Recent Shipments", L"Encyclopedia", L"Encyclopedia - Data", @@ -6216,6 +6221,7 @@ STR16 gzLaptopHelpText[] = L"Encyclopedia", L"Briefing Room", L"Campaign History", + L"Mercenaries Love or Dislike You", // TODO.Translate }; @@ -8117,7 +8123,7 @@ STR16 szInventoryArmTextStr[]= // TODO.Translate STR16 szBackgroundText_Flags[]= { L" might consume drugs in inventory\n", - L" disregard for other backgrounds\n", + L" disregard for all other backgrounds\n", L" +1 level in underground sectors\n", L" might steal items\n", @@ -8200,6 +8206,8 @@ STR16 szBackgroundText_Value[]= L" %s%d%% cth with firearms against creatures\n", L" %s%d%% insurance cost\n", L" %s%d%% effectiveness as spotter for fellow snipers\n", // TODO.Translate + + L" dislikes some other backgrounds", // TODO.Translate }; STR16 szBackgroundTitleText[] = // TODO.Translate @@ -8268,6 +8276,13 @@ STR16 szRefinementText[]= L"manners of a snob", }; +STR16 szRefinementTextTypes[] = // TODO.Translate +{ + L"normal people", + L"slobs", + L"snobs", +}; + STR16 szNationalityText[]= { L"American", // 0 @@ -8318,6 +8333,56 @@ STR16 szNationalityText[]= L"Portoguese", }; +STR16 szNationalityTextAdjective[] = // TODO.Translate +{ + L"americans", // 0 + L"arabs", + L"australians", + L"britains", + L"canadians", + L"cubans", // 5 + L"danes", + L"frenchmen", + L"russians", + L"nigerians", + L"swiss", // 10 + L"jamaicans", + L"poles", + L"chinese", + L"irishmen", + L"south africans", // 15 + L"hungarians", + L"scotsmen", + L"arulcans", + L"germans", + L"africans", // 20 + L"italians", + L"dutchmen", + L"romanians", + L"metavirans", + + // newly added from here on + L"greek", // 25 + L"estonians", + L"venezuelans", + L"japanese", + L"turks", + L"indians", // 30 + L"mexicans", + L"norwegians", + L"spaniards", + L"brasilians", + L"finns", // 35 + L"iranians", + L"israelis", + L"bulgarians", + L"swedes", + L"iraqis", // 40 + L"syrians", + L"belgians", + L"portoguese", +}; + // special text used if we do not hate any nation (value of -1) STR16 szNationalityText_Special[]= { @@ -8528,6 +8593,74 @@ STR16 szCampaignHistoryWebpageString[]= L"Day", }; +STR16 szMercCompareWebSite[] = // TODO.Translate +{ + // main page + L"Mercs Love or Dislike You", + L"Your #1 teambuilding experts on the web", + + L"About us", + L"Analyse a team", + L"Pairwise comparison", + L"Customer voices", + + L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:", + L"Your team struggles with itself.", + L"Your employees waste time working against each other.", + L"Your workforce experiences a high fluctuation rate.", + L"You constantly receive low marks on workplace satisfaction ratings.", + L"If you can say 'yes' to one or more of these statements, then you might have a problem in your business. Your employees likely won't work at peak perfection. Thanks to our patented, easy-to-understand MeLoDY system, you can bring productivity back up in no time, and a happy smile on the faces all your staff!", + + // customer quotes + L"A few citations from our satisfied customers:", + L"My last relationship was terrible. I blamed myself... but now I know better. All men deserve a violent death! Thanks, MeLoDY, for enlightening me!", + L"-Louisa G., Novelist-", + L"I never got along with my brothers to start with, and recently its gotten worse. You've shown me that our trust problem with father is to blame. Thank you for that! I have to make a bold statement to open his eyes to the facts.", + L"-Konrad C., Corrective law enforcement-", + L"I've always been a loner, so joining a team was hard for me. Your insight showed me how to become part of a team. You've been a big help!", + L"-Grant W., Snake charmer-", + L"In my line of work, you need to trust every member of your team 100%. That's why we went to the experts - we went to MeLoDY.", + L"-Halle L., SPK-", + L"I'll be the first to admit our crew was a rather illustrious assortion of characters, and we ran into some scuffles. But we learned to respect each other, and now complement each other perfectly.", + L"-Michael C., NASA-", + L"I fully recommend this site!", + L"-Kasper H., H&C logistic incorporated-", + + // analyze + L"Choose your employee", + L"Choose your squad", +}; + +STR16 szMercCompareEventText[]= +{ + L"%s shot at me!", + L"%s is scheming behind my back", + L"%s interfered in my business", + L"%s is friends with my enemy", + + L"%s got a contract before I did", + L"%s ordered a shameful retreat", + L"%s massacred the innocent", + L"%s slows us down", + + L"%s doesn't share food", + L"%s jeopardizes the mission", + L"%s is a drug addict", + L"%s is thieving scum", + + L"%s is an incompetent commander", + L"%s is overpaid", + L"%s gets all the good stuff", + L"%s mounted a gun on me", + + L"%s treated my wounds", + L"Had a good drink %s", + L"%s is fun to get wasted with", + L"%s is annoying when drunk", + + L"%s is an idiot when drunk", +}; + STR16 szTacticalInventoryDialogString[]= { L"Inventory Manipulations",