diff --git a/Laptop/insurance Contract.cpp b/Laptop/insurance Contract.cpp index d9057c18..16228187 100644 --- a/Laptop/insurance Contract.cpp +++ b/Laptop/insurance Contract.cpp @@ -25,6 +25,7 @@ #include "Strategic Status.h" #include "Assignments.h" #include "Map Screen Interface.h" + #include "Interface.h" // added by Flugente #endif #include @@ -1188,6 +1189,9 @@ INT32 CalculateInsuranceContractCost( INT32 iLength, UINT8 ubMercID ) // calculate the overall insurability risk factor for this merc by combining all the subfactors flRiskFactor = flSkillFactor * flFitnessFactor * flExpFactor * flSurvivalFactor; + // Flugente: backgrounds + flRiskFactor = flRiskFactor * (100 + pSoldier->GetBackgroundValue(BG_PERC_INSURANCE)) / 100; + // restrict the overall factor to within reasonable limits if (flRiskFactor < MIN_INSURANCE_RATIO) { diff --git a/Tactical/Interface.h b/Tactical/Interface.h index 20de5a63..031ba869 100644 --- a/Tactical/Interface.h +++ b/Tactical/Interface.h @@ -183,6 +183,7 @@ enum { // various BG_BONUS_BREACHINGCHARGE, BG_PERC_CTH_CREATURE, + BG_PERC_INSURANCE, BG_MAX, }; diff --git a/Tactical/XML_Background.cpp b/Tactical/XML_Background.cpp index b53ced2c..65c44ac9 100644 --- a/Tactical/XML_Background.cpp +++ b/Tactical/XML_Background.cpp @@ -118,6 +118,7 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha strcmp(name, "approach_recruit") == 0 || strcmp(name, "breachingcharge") == 0 || strcmp(name, "cth_vs_creatures") == 0 || + strcmp(name, "insurance") == 0 || strcmp(name, "druguse") == 0 || strcmp(name, "xenophobic") == 0 || strcmp(name, "corruptionspread") == 0 || @@ -488,6 +489,11 @@ backgroundEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; pData->curBackground.value[BG_PERC_CTH_CREATURE] = min(20, max(-20, (INT16) atol(pData->szCharData) )); } + else if(strcmp(name, "insurance") == 0) + { + pData->curElement = ELEMENT; + pData->curBackground.value[BG_PERC_INSURANCE] = min(200, max(-50, (INT16) atol(pData->szCharData) )); + } else if(strcmp(name, "druguse") == 0) { pData->curElement = ELEMENT; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 24351106..911a73f8 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -7686,6 +7686,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //CHINESE diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 70273bee..27f34c3b 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -7685,6 +7685,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //DUTCH diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 3e0277da..8e14d075 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -7669,6 +7669,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //ENGLISH diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index da369dad..14252e97 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -7669,6 +7669,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //FRENCH diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index c3839b5c..2e1e1aff 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -7494,6 +7494,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //GERMAN diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index b07b1437..982979e1 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -7672,6 +7672,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //ITALIAN diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index c4ad4d94..5a2349e7 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -7691,6 +7691,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //POLISH diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 52f2df4a..a711d42e 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -7671,6 +7671,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //RUSSIAN diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index 3e1f6c59..ad365419 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -7689,6 +7689,7 @@ STR16 szBackgroundText_Value[]= L" %s%d%% chance of success with door breaching charges\n", L" %s%d%% cth with firearms against creatures\n", + L" %s%d%% insurance cost\n", }; #endif //TAIWANESE