New modifiers for Item Properties

The new Item_Settings.ini is there to host modifiers for item properties in the different XML files. For now it is only used for the Weapon Overheating feature to adjust parameters based on gun class.
It uses the new struct gItemSettings which is populated in function void LoadItemSettings() on game start.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6463 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2013-10-02 12:40:08 +00:00
parent bc7b3e2d62
commit cc51c13529
6 changed files with 95 additions and 1 deletions
+15
View File
@@ -1457,6 +1457,9 @@ FLOAT GetGunOverheatDamagePercentage( FLOAT usTemperature, UINT16 usIndx )
{
FLOAT damagethreshold = Weapon[Item[ usIndx ].ubClassIndex].usOverheatingDamageThreshold;
if ( Item[usIndx].usItemClass & IC_GUN )
damagethreshold *= gItemSettings.fOverheatDamageThresholdModifier[Weapon[Item[ usIndx ].uiIndex].ubWeaponType];
return usTemperature/ damagethreshold ;
}
@@ -1465,6 +1468,9 @@ FLOAT GetGunOverheatJamPercentage( FLOAT usTemperature, UINT16 usIndx )
{
FLOAT jamthreshold = Weapon[Item[ usIndx ].ubClassIndex].usOverheatingJamThreshold;
if ( Item[usIndx].usItemClass & IC_GUN )
jamthreshold *= gItemSettings.fOverheatJamThresholdModifier[Weapon[Item[ usIndx ].uiIndex].ubWeaponType];
return usTemperature/ jamthreshold ;
}
@@ -12071,6 +12077,9 @@ FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
{
singleshottemperature = Weapon[ pObj->usItem ].usOverheatingSingleShotTemperature;
if ( Item[pObj->usItem].usItemClass & IC_GUN )
singleshottemperature *= gItemSettings.fOverheatTemperatureModifier[ Weapon[ pObj->usItem ].ubWeaponType ];
// determine modificator according to attachments
FLOAT modificator = 1.0f + GetTemperatureModifier(pObj);
@@ -12137,6 +12146,9 @@ FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj )
{
jamthreshold = Weapon[ pObj->usItem ].usOverheatingJamThreshold;
if ( Item[pObj->usItem].usItemClass & IC_GUN )
jamthreshold *= gItemSettings.fOverheatJamThresholdModifier[ Weapon[ pObj->usItem ].ubWeaponType ];
// determine modificator according to attachments
FLOAT modificator = 1.0f + GetOverheatJamThresholdModifier(pObj);
@@ -12171,6 +12183,9 @@ FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj )
{
damagethreshold = Weapon[ pObj->usItem ].usOverheatingDamageThreshold;
if ( Item[pObj->usItem].usItemClass & IC_GUN )
damagethreshold *= gItemSettings.fOverheatDamageThresholdModifier[ Weapon[ pObj->usItem ].ubWeaponType ];
// determine modificator according to attachments
FLOAT modificator = 1.0f + GetOverheatDamageThresholdModifier(pObj);