mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
- if MERCS_CAN_DO_ADVANCED_REPAIRS is TRUE, mercs with the technician trait can raise an item's damage threshold(by merc05)
- Fix: blade weapons ignored their damage chance git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5917 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1568,6 +1568,7 @@ void LoadGameExternalOptions()
|
|||||||
// Flugente: advanced repair/dirt system
|
// Flugente: advanced repair/dirt system
|
||||||
gGameExternalOptions.fAdvRepairSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","ADVANCED_REPAIR", FALSE);
|
gGameExternalOptions.fAdvRepairSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","ADVANCED_REPAIR", FALSE);
|
||||||
gGameExternalOptions.fOnlyRepairGunsArmour = iniReader.ReadBoolean("Strategic Gameplay Settings","ONLY_REPAIR_GUNS_AND_ARMOUR", FALSE);
|
gGameExternalOptions.fOnlyRepairGunsArmour = iniReader.ReadBoolean("Strategic Gameplay Settings","ONLY_REPAIR_GUNS_AND_ARMOUR", FALSE);
|
||||||
|
gGameExternalOptions.fMercsCanDoAdvancedRepairs = iniReader.ReadBoolean("Strategic Gameplay Settings","MERCS_CAN_DO_ADVANCED_REPAIRS", FALSE);
|
||||||
gGameExternalOptions.fDirtSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","DIRT_SYSTEM", FALSE);
|
gGameExternalOptions.fDirtSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","DIRT_SYSTEM", FALSE);
|
||||||
gGameExternalOptions.fFullRepairCleansGun = iniReader.ReadBoolean("Strategic Gameplay Settings","FULL_REPAIR_CLEANS_GUN", 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);
|
gGameExternalOptions.usSectorDirtDivider = iniReader.ReadInteger("Strategic Gameplay Settings","SECTOR_DIRT_DIVIDER", 1000, 1, 100000);
|
||||||
|
|||||||
@@ -1181,6 +1181,7 @@ typedef struct
|
|||||||
// Flugente: advanced repair/dirt system
|
// Flugente: advanced repair/dirt system
|
||||||
BOOLEAN fAdvRepairSystem; // allow thresholds to repairing
|
BOOLEAN fAdvRepairSystem; // allow thresholds to repairing
|
||||||
BOOLEAN fOnlyRepairGunsArmour; // we can only repair guns and armour
|
BOOLEAN fOnlyRepairGunsArmour; // we can only repair guns and armour
|
||||||
|
BOOLEAN fMercsCanDoAdvancedRepairs; // allow mercs with technician/engineer trait (New Trait System) to raise weapon threshold
|
||||||
BOOLEAN fDirtSystem; // allow dirt on items increase the chance for weapon jamming
|
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
|
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
|
UINT32 usSectorDirtDivider; // divide a guns dirt factor by this to get dirt increase for every turn
|
||||||
|
|||||||
@@ -3915,11 +3915,22 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
|
|||||||
|
|
||||||
// Flugente: if using the new advanced repair system, we can only repair up to the repair threshold
|
// Flugente: if using the new advanced repair system, we can only repair up to the repair threshold
|
||||||
INT16 threshold = 100;
|
INT16 threshold = 100;
|
||||||
if ( gGameExternalOptions.fAdvRepairSystem && ( (Item[pObj->usItem].usItemClass & IC_WEAPON) || (Item[pObj->usItem].usItemClass & IC_ARMOUR) ) )
|
if ( gGameExternalOptions.fAdvRepairSystem && (Item[pObj->usItem].usItemClass & (IC_WEAPON|IC_ARMOUR)) )
|
||||||
threshold = (*pObj)[ubLoop]->data.sRepairThreshold;
|
{
|
||||||
|
if ( !gGameExternalOptions.fMercsCanDoAdvancedRepairs || !HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) )
|
||||||
|
{
|
||||||
|
threshold = (*pObj)[ubLoop]->data.sRepairThreshold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// repairable, try to repair it
|
// repairable, try to repair it
|
||||||
DoActualRepair( pSoldier, pObj->usItem, &((*pObj)[ubLoop]->data.objectStatus), threshold, pubRepairPtsLeft );
|
DoActualRepair( pSoldier, pObj->usItem, &((*pObj)[ubLoop]->data.objectStatus), threshold, pubRepairPtsLeft );
|
||||||
|
|
||||||
|
if ( gGameExternalOptions.fAdvRepairSystem && gGameExternalOptions.fMercsCanDoAdvancedRepairs && ( HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) ) && ( (Item[pObj->usItem].usItemClass & (IC_WEAPON|IC_ARMOUR)) ) )
|
||||||
|
(*pObj)[ubLoop]->data.sRepairThreshold = max((*pObj)[ubLoop]->data.sRepairThreshold, (*pObj)[ubLoop]->data.objectStatus);
|
||||||
|
|
||||||
|
// repairable, try to repair it
|
||||||
|
DoActualRepair( pSoldier, pObj->usItem, &((*pObj)[ubLoop]->data.objectStatus), threshold, pubRepairPtsLeft );
|
||||||
|
|
||||||
// if the item was repaired to full status and the repair wa at least 5%, add a point
|
// if the item was repaired to full status and the repair wa at least 5%, add a point
|
||||||
if ( (*pObj)[ubLoop]->data.objectStatus == threshold && (((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 4 ))
|
if ( (*pObj)[ubLoop]->data.objectStatus == threshold && (((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 4 ))
|
||||||
|
|||||||
@@ -2941,7 +2941,8 @@ BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
|
|
||||||
(*pObj)[0]->data.objectStatus -= (INT8) Random( bMaxDrop ); // 0 to (maxDrop - 1)
|
(*pObj)[0]->data.objectStatus -= (INT8) Random( bMaxDrop ); // 0 to (maxDrop - 1)
|
||||||
|
|
||||||
if ( bMaxDrop > 0 )
|
// Flugente: reduce repair threshold
|
||||||
|
if ( bMaxDrop > 0 && Random(100) < Item[pObj->usItem].usDamageChance )
|
||||||
{
|
{
|
||||||
(*pObj)[0]->data.sRepairThreshold = max((*pObj)[0]->data.objectStatus, (*pObj)[0]->data.sRepairThreshold - 1);
|
(*pObj)[0]->data.sRepairThreshold = max((*pObj)[0]->data.objectStatus, (*pObj)[0]->data.sRepairThreshold - 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user