added insurance cost modifier to backgrounds

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6360 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-09-04 23:31:34 +00:00
parent 251d96ccb6
commit c78568cb2a
12 changed files with 20 additions and 0 deletions
+4
View File
@@ -25,6 +25,7 @@
#include "Strategic Status.h"
#include "Assignments.h"
#include "Map Screen Interface.h"
#include "Interface.h" // added by Flugente
#endif
#include <vector>
@@ -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)
{
+1
View File
@@ -183,6 +183,7 @@ enum {
// various
BG_BONUS_BREACHINGCHARGE,
BG_PERC_CTH_CREATURE,
BG_PERC_INSURANCE,
BG_MAX,
};
+6
View File
@@ -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;
+1
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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