mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
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:
@@ -25,6 +25,7 @@
|
|||||||
#include "Strategic Status.h"
|
#include "Strategic Status.h"
|
||||||
#include "Assignments.h"
|
#include "Assignments.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "Map Screen Interface.h"
|
||||||
|
#include "Interface.h" // added by Flugente
|
||||||
#endif
|
#endif
|
||||||
#include <vector>
|
#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
|
// calculate the overall insurability risk factor for this merc by combining all the subfactors
|
||||||
flRiskFactor = flSkillFactor * flFitnessFactor * flExpFactor * flSurvivalFactor;
|
flRiskFactor = flSkillFactor * flFitnessFactor * flExpFactor * flSurvivalFactor;
|
||||||
|
|
||||||
|
// Flugente: backgrounds
|
||||||
|
flRiskFactor = flRiskFactor * (100 + pSoldier->GetBackgroundValue(BG_PERC_INSURANCE)) / 100;
|
||||||
|
|
||||||
// restrict the overall factor to within reasonable limits
|
// restrict the overall factor to within reasonable limits
|
||||||
if (flRiskFactor < MIN_INSURANCE_RATIO)
|
if (flRiskFactor < MIN_INSURANCE_RATIO)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ enum {
|
|||||||
// various
|
// various
|
||||||
BG_BONUS_BREACHINGCHARGE,
|
BG_BONUS_BREACHINGCHARGE,
|
||||||
BG_PERC_CTH_CREATURE,
|
BG_PERC_CTH_CREATURE,
|
||||||
|
BG_PERC_INSURANCE,
|
||||||
|
|
||||||
BG_MAX,
|
BG_MAX,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha
|
|||||||
strcmp(name, "approach_recruit") == 0 ||
|
strcmp(name, "approach_recruit") == 0 ||
|
||||||
strcmp(name, "breachingcharge") == 0 ||
|
strcmp(name, "breachingcharge") == 0 ||
|
||||||
strcmp(name, "cth_vs_creatures") == 0 ||
|
strcmp(name, "cth_vs_creatures") == 0 ||
|
||||||
|
strcmp(name, "insurance") == 0 ||
|
||||||
strcmp(name, "druguse") == 0 ||
|
strcmp(name, "druguse") == 0 ||
|
||||||
strcmp(name, "xenophobic") == 0 ||
|
strcmp(name, "xenophobic") == 0 ||
|
||||||
strcmp(name, "corruptionspread") == 0 ||
|
strcmp(name, "corruptionspread") == 0 ||
|
||||||
@@ -488,6 +489,11 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
pData->curBackground.value[BG_PERC_CTH_CREATURE] = min(20, max(-20, (INT16) atol(pData->szCharData) ));
|
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)
|
else if(strcmp(name, "druguse") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
|
|||||||
@@ -7686,6 +7686,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //CHINESE
|
#endif //CHINESE
|
||||||
|
|||||||
@@ -7685,6 +7685,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //DUTCH
|
#endif //DUTCH
|
||||||
|
|||||||
@@ -7669,6 +7669,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //ENGLISH
|
#endif //ENGLISH
|
||||||
|
|||||||
@@ -7669,6 +7669,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //FRENCH
|
#endif //FRENCH
|
||||||
|
|||||||
@@ -7494,6 +7494,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //GERMAN
|
#endif //GERMAN
|
||||||
|
|||||||
@@ -7672,6 +7672,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //ITALIAN
|
#endif //ITALIAN
|
||||||
|
|||||||
@@ -7691,6 +7691,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //POLISH
|
#endif //POLISH
|
||||||
|
|||||||
@@ -7671,6 +7671,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //RUSSIAN
|
#endif //RUSSIAN
|
||||||
|
|||||||
@@ -7689,6 +7689,7 @@ STR16 szBackgroundText_Value[]=
|
|||||||
|
|
||||||
L" %s%d%% chance of success with door breaching charges\n",
|
L" %s%d%% chance of success with door breaching charges\n",
|
||||||
L" %s%d%% cth with firearms against creatures\n",
|
L" %s%d%% cth with firearms against creatures\n",
|
||||||
|
L" %s%d%% insurance cost\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //TAIWANESE
|
#endif //TAIWANESE
|
||||||
|
|||||||
Reference in New Issue
Block a user