- 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:
Flugente
2013-03-10 16:07:08 +00:00
parent 29867c0302
commit f5f114e52e
4 changed files with 17 additions and 3 deletions
+13 -2
View File
@@ -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
INT16 threshold = 100;
if ( gGameExternalOptions.fAdvRepairSystem && ( (Item[pObj->usItem].usItemClass & IC_WEAPON) || (Item[pObj->usItem].usItemClass & IC_ARMOUR) ) )
threshold = (*pObj)[ubLoop]->data.sRepairThreshold;
if ( gGameExternalOptions.fAdvRepairSystem && (Item[pObj->usItem].usItemClass & (IC_WEAPON|IC_ARMOUR)) )
{
if ( !gGameExternalOptions.fMercsCanDoAdvancedRepairs || !HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) )
{
threshold = (*pObj)[ubLoop]->data.sRepairThreshold;
}
}
// repairable, try to repair it
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 ( (*pObj)[ubLoop]->data.objectStatus == threshold && (((*pObj)[ubLoop]->data.objectStatus - ubBeforeRepair) > 4 ))