From 596b08ca704cf281f69ba1660bc37fe18ebbe844 Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 21 Oct 2013 17:57:39 +0000 Subject: [PATCH] - renamed AC_SUPPRESSOR to AC_MUZZLE - mercs with average refinement get a morale penalty if they care extremely about refinement and the other merc is a slob or snob - added code for soldier-specific interrupt modifier - added belgian and portoguese nationalities - Fix: race, sexism etc. xml data didn't correctly overwrite PROF.DAT data git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6519 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/BobbyRGuns.cpp | 2 +- Tactical/Item Types.h | 2 +- Tactical/Morale.cpp | 11 +++++++++++ Tactical/Soldier Control.cpp | 7 +++++++ Tactical/Soldier Control.h | 1 + Tactical/Soldier Profile.cpp | 11 +++++++++++ Tactical/TeamTurns.cpp | 5 ++++- Tactical/soldier profile type.h | 2 ++ Utils/_ChineseText.cpp | 2 ++ Utils/_DutchText.cpp | 2 ++ Utils/_EnglishText.cpp | 2 ++ Utils/_FrenchText.cpp | 2 ++ Utils/_GermanText.cpp | 2 ++ Utils/_ItalianText.cpp | 2 ++ Utils/_PolishText.cpp | 2 ++ Utils/_RussianText.cpp | 2 ++ Utils/_TaiwaneseText.cpp | 2 ++ 17 files changed, 56 insertions(+), 3 deletions(-) diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp index 58d281b4..8e3f298a 100644 --- a/Laptop/BobbyRGuns.cpp +++ b/Laptop/BobbyRGuns.cpp @@ -171,7 +171,7 @@ BobbyRayPurchaseStruct BobbyRayPurchases[ 100 ]; //Madd: new BR filters #define BR_MISC_FILTER_OPTICS (AC_SCOPE | AC_SIGHT | AC_IRONSIGHT) #define BR_MISC_FILTER_SIDE_BOTTOM (AC_LASER | AC_FOREGRIP | AC_BIPOD) -#define BR_MISC_FILTER_MUZZLE (AC_SUPPRESSOR | AC_EXTENDER) +#define BR_MISC_FILTER_MUZZLE (AC_MUZZLE | AC_EXTENDER) #define BR_MISC_FILTER_STOCK AC_STOCK #define BR_MISC_FILTER_INTERNAL (AC_MAGWELL | AC_INTERNAL | AC_EXTERNAL) #define BR_MISC_FILTER_STD_ATTACHMENTS (BR_MISC_FILTER_OPTICS | BR_MISC_FILTER_SIDE_BOTTOM | BR_MISC_FILTER_MUZZLE | BR_MISC_FILTER_STOCK | BR_MISC_FILTER_INTERNAL) diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index ebeb1950..2e246953 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -644,7 +644,7 @@ extern OBJECTTYPE gTempObject; // redesigned by Flugente on 12-04-10 // Chrisl: Define attachment classes #define AC_BIPOD 0x00000001 //1 -#define AC_SUPPRESSOR 0x00000002 //2 +#define AC_MUZZLE 0x00000002 //2 #define AC_LASER 0x00000004 //4 #define AC_SIGHT 0x00000008 //8 #define AC_SCOPE 0x00000010 //16 diff --git a/Tactical/Morale.cpp b/Tactical/Morale.cpp index 148e02fd..a746cac1 100644 --- a/Tactical/Morale.cpp +++ b/Tactical/Morale.cpp @@ -1172,10 +1172,16 @@ void HourlyMoraleUpdate( void ) } // 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[ pOtherSoldier->ubProfile ].bRefinement ) { 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 ) @@ -1192,6 +1198,11 @@ void HourlyMoraleUpdate( void ) 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 ) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index ceb29eb9..9af3944f 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -16873,6 +16873,13 @@ UINT8 SOLDIERTYPE::GetMoraleThreshold() return min(threshold, max(0, threshold - moraledamage)); } +INT16 SOLDIERTYPE::GetInterruptModifier( UINT8 usDistance ) +{ + INT16 bonus = 0; + + return bonus; +} + void SOLDIERTYPE::SoldierPropertyUpkeep() { // these flags are only used for the first turn, and thus always removed diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index 8b66b1cb..76ba9cce 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -1603,6 +1603,7 @@ public: INT16 GetAPBonus(); INT8 GetFearResistanceBonus(); // fear resistance lowers shock and morale damage from horror UINT8 GetMoraleThreshold(); + INT16 GetInterruptModifier( UINT8 usDistance ); void SoldierPropertyUpkeep(); // update functions for various properties (updating counters, resetting flags etc.) diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index 2a7910ae..b2c1c336 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -2587,6 +2587,17 @@ void OverwriteMercProfileWithXMLData( UINT32 uiLoop ) gMercProfiles[ uiLoop ].bLearnToHate = tempProfiles[ uiLoop ].bLearnToHate ; gMercProfiles[ uiLoop ].bLearnToHateTime = tempProfiles[ uiLoop ].bLearnToHateTime ; + gMercProfiles[ uiLoop ].bRace = tempProfiles[ uiLoop ].bRace; + gMercProfiles[ uiLoop ].bNationality = tempProfiles[ uiLoop ].bNationality; + gMercProfiles[ uiLoop ].bAppearance = tempProfiles[ uiLoop ].bAppearance; + gMercProfiles[ uiLoop ].bAppearanceCareLevel = tempProfiles[ uiLoop ].bAppearanceCareLevel; + gMercProfiles[ uiLoop ].bRefinement = tempProfiles[ uiLoop ].bRefinement; + gMercProfiles[ uiLoop ].bRefinementCareLevel = tempProfiles[ uiLoop ].bRefinementCareLevel; + gMercProfiles[ uiLoop ].bHatedNationality = tempProfiles[ uiLoop ].bHatedNationality; + gMercProfiles[ uiLoop ].bHatedNationalityCareLevel = tempProfiles[ uiLoop ].bHatedNationalityCareLevel; + gMercProfiles[ uiLoop ].bRacist = tempProfiles[ uiLoop ].bRacist; + gMercProfiles[ uiLoop ].bSexist = tempProfiles[ uiLoop ].bSexist; + gMercProfiles[ uiLoop ].sSalary = tempProfiles[ uiLoop ].sSalary ; gMercProfiles[ uiLoop ].uiWeeklySalary = tempProfiles[ uiLoop ].uiWeeklySalary ; gMercProfiles[ uiLoop ].uiBiWeeklySalary = tempProfiles[ uiLoop ].uiBiWeeklySalary ; diff --git a/Tactical/TeamTurns.cpp b/Tactical/TeamTurns.cpp index e7863cc0..556da7d7 100644 --- a/Tactical/TeamTurns.cpp +++ b/Tactical/TeamTurns.cpp @@ -1943,7 +1943,10 @@ INT8 CalcInterruptDuelPts( SOLDIERTYPE * pSoldier, UINT8 ubOpponentID, BOOLEAN f else if ( pSoldier->drugs.bDrugSideEffect[ DRUG_TYPE_PERCEPTION ] ) { iPoints -= 1; - } + } + + // Flugente: interrupt modifier from special stats + iPoints += pSoldier->GetInterruptModifier( ubDistance ); // if he's a computer soldier diff --git a/Tactical/soldier profile type.h b/Tactical/soldier profile type.h index 8fe5b49f..17013326 100644 --- a/Tactical/soldier profile type.h +++ b/Tactical/soldier profile type.h @@ -273,6 +273,8 @@ typedef enum SWEDISH, IRAQI, // 40 SYRIAN, + BELGIAN, + PORTOGUESE, NUM_NATIONALITIES } Nationalities; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index bc2c5b21..2b258bae 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -7788,6 +7788,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1) diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 21412f2c..cd3b0ea0 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -7805,6 +7805,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1) diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 85a82a99..0f046df2 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -7788,6 +7788,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1) diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index f959d8b7..c9c4361c 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -7790,6 +7790,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1) diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 44b6fc80..7b8efaa5 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -7614,6 +7614,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1) diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 7641e81d..96da8bed 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -7792,6 +7792,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1) diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 9f0ba84d..22982a98 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -7816,6 +7816,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1) diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 75dbd2dd..8da4f4a7 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -7790,6 +7790,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1) diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index 94650e9d..b95fe893 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -7807,6 +7807,8 @@ STR16 szNationalityText[]= L"swedish", L"iraqi", // 40 L"syrian", + L"belgian", + L"portoguese", }; // special text used if we do not hate any nation (value of -1)