dirt system: added an option that controls wether a gun also gets cleaned on fully repairing it

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5904 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-03-07 02:21:46 +00:00
parent 30a7e22a3d
commit 86d6d60959
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -1569,6 +1569,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.fAdvRepairSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","ADVANCED_REPAIR", FALSE);
gGameExternalOptions.fOnlyRepairGunsArmour = iniReader.ReadBoolean("Strategic Gameplay Settings","ONLY_REPAIR_GUNS_AND_ARMOUR", FALSE);
gGameExternalOptions.fDirtSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","DIRT_SYSTEM", FALSE);
gGameExternalOptions.fFullRepairCleansGun = iniReader.ReadBoolean("Strategic Gameplay Settings","FULL_REPAIR_CLEANS_GUN", FALSE);
gGameExternalOptions.usSectorDirtDivider = iniReader.ReadInteger("Strategic Gameplay Settings","SECTOR_DIRT_DIVIDER", 1000, 1, 100000);
// Flugente: prisoner system
+1
View File
@@ -1182,6 +1182,7 @@ typedef struct
BOOLEAN fAdvRepairSystem; // allow thresholds to repairing
BOOLEAN fOnlyRepairGunsArmour; // we can only repair guns and armour
BOOLEAN fDirtSystem; // allow dirt on items increase the chance for weapon jamming
BOOLEAN fFullRepairCleansGun; // repairing a gun up to its current repair threshold also cleans the gun
UINT32 usSectorDirtDivider; // divide a guns dirt factor by this to get dirt increase for every turn
// Flugente: prisoner related settings
+1 -1
View File
@@ -3935,7 +3935,7 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
if ( (*pObj)[ubLoop]->data.objectStatus == threshold )
{
// if item was fully repaired, consider it cleaned
if ( gGameExternalOptions.fDirtSystem )
if ( gGameExternalOptions.fDirtSystem && gGameExternalOptions.fFullRepairCleansGun )
(*pObj)[ubLoop]->data.bDirtLevel = 0.0f;
}
// note: this system is bad if we can repair only 1% per hour (which is rather we are total losers)