From c677c462bc20f6d239d63a49baa5980b5dfcd42a Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 19 May 2015 20:47:07 +0000 Subject: [PATCH] In order to keep trait-related settings where traits are defined, moved MERCS_CAN_DO_ADVANCED_REPAIRS from JA2_Options.ini to Skills_Settings.ini under [Technician] settings. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7867 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 2 +- GameSettings.h | 2 +- Laptop/personnel.cpp | 5 +++++ Strategic/Assignments.cpp | 8 ++++---- Tactical/Interface Enhanced.cpp | 6 +++--- Utils/_Ja25ChineseText.cpp | 1 + Utils/_Ja25DutchText.cpp | 1 + Utils/_Ja25EnglishText.cpp | 1 + Utils/_Ja25FrenchText.cpp | 1 + Utils/_Ja25GermanText.cpp | 1 + Utils/_Ja25ItalianText.cpp | 1 + Utils/_Ja25PolishText.cpp | 1 + Utils/_Ja25RussianText.cpp | 1 + 13 files changed, 22 insertions(+), 9 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index c6d64021..ac6365cb 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1811,7 +1811,6 @@ void LoadGameExternalOptions() // Flugente: advanced repair/dirt system gGameExternalOptions.fAdvRepairSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","ADVANCED_REPAIR", 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.fFullRepairCleansGun = iniReader.ReadBoolean("Strategic Gameplay Settings","FULL_REPAIR_CLEANS_GUN", FALSE); gGameExternalOptions.usSectorDirtDivider = iniReader.ReadInteger("Strategic Gameplay Settings","SECTOR_DIRT_DIVIDER", 1000, 1, 100000); @@ -2385,6 +2384,7 @@ void LoadSkillTraitsExternalSettings() gSkillTraitValues.ubTETraitsNumToRepairRobot = iniReader.ReadInteger("Technician","NUMBER_TRAITS_TO_BE_ABLE_TO_REPAIR_THE_ROBOT", 1, 0, 2); gSkillTraitValues.ubTERepairRobotPenaltyReduction = iniReader.ReadInteger("Technician","REPAIR_SPEED_ROBOT_PENALTY_REDUCTION", 30, 0, 100); if (gSkillTraitValues.ubTETraitsNumToRepairRobot == 2) {gSkillTraitValues.ubTERepairRobotPenaltyReduction /= 2; } + gSkillTraitValues.fTETraitsCanRestoreItemThreshold = iniReader.ReadBoolean( "Technician", "MERCS_CAN_DO_ADVANCED_REPAIRS", FALSE ); // DOCTOR gSkillTraitValues.ubDONumberTraitsNeededForSurgery = iniReader.ReadInteger("Doctor","NUMBER_OF_TRAITS_NEEDED_FOR_SURGERY", 1, 0, 2); diff --git a/GameSettings.h b/GameSettings.h index 342dca6c..001f9874 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -1299,7 +1299,6 @@ typedef struct // Flugente: advanced repair/dirt system BOOLEAN fAdvRepairSystem; // allow thresholds to repairing 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 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 @@ -1681,6 +1680,7 @@ typedef struct UINT8 ubTECtHControlledRobotBonus; UINT8 ubTERepairRobotPenaltyReduction; UINT8 ubTETraitsNumToRepairRobot; + BOOLEAN fTETraitsCanRestoreItemThreshold; // DOCTOR UINT8 ubDONumberTraitsNeededForSurgery; diff --git a/Laptop/personnel.cpp b/Laptop/personnel.cpp index 78cbd3e8..0dc000b2 100644 --- a/Laptop/personnel.cpp +++ b/Laptop/personnel.cpp @@ -7781,6 +7781,11 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve wcscat( apStr, atStr ); } } + if ( gGameExternalOptions.fAdvRepairSystem && gSkillTraitValues.fTETraitsCanRestoreItemThreshold ) + { + swprintf( atStr, gzIMPMajorTraitsHelpTextsTechnician[10] ); + wcscat( apStr, atStr ); + } break; } case DOCTOR_NT: diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index e73187f9..182dacf0 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -4608,7 +4608,7 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE * INT16 threshold = 100; if ( gGameExternalOptions.fAdvRepairSystem && (Item[pObj->usItem].usItemClass & (IC_WEAPON|IC_ARMOUR)) ) { - if ( !gGameExternalOptions.fMercsCanDoAdvancedRepairs || !HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) ) + if ( !gSkillTraitValues.fTETraitsCanRestoreItemThreshold || !HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) ) { threshold = (*pObj)[ubLoop]->data.sRepairThreshold; } @@ -4625,7 +4625,7 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE * // 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)) ) ) + if ( gGameExternalOptions.fAdvRepairSystem && gSkillTraitValues.fTETraitsCanRestoreItemThreshold && (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); // if the item was repaired to full status and the repair wa at least 5%, add a point @@ -5003,14 +5003,14 @@ BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, IN if ( gGameExternalOptions.fOnlyRepairGunsArmour ) { if ( ((Item[usItem].usItemClass & IC_WEAPON|IC_ARMOUR) != 0) && ( bStatus < bThreshold - || ( gGameExternalOptions.fMercsCanDoAdvancedRepairs && HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) )) ) + || (gSkillTraitValues.fTETraitsCanRestoreItemThreshold && HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ))) ) return ( TRUE ); else return ( FALSE ); } if ( ((Item[usItem].usItemClass & IC_WEAPON|IC_ARMOUR) != 0) && bStatus >= bThreshold - && ( !gGameExternalOptions.fMercsCanDoAdvancedRepairs || !HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) ) ) + && (!gSkillTraitValues.fTETraitsCanRestoreItemThreshold || !HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT )) ) // nay return ( FALSE ); } diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index 92b98e8c..9bd6d1ae 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -1477,14 +1477,14 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr if ( gGameExternalOptions.fUseNewCTHCalculation && cnt == 6 && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[64], szUDBGenWeaponsStatsExplanationsTooltipText[ cnt ]); - else if ( cnt == 10 && gGameExternalOptions.fAdvRepairSystem && !gGameExternalOptions.fMercsCanDoAdvancedRepairs ) + else if ( cnt == 10 && gGameExternalOptions.fAdvRepairSystem && !gSkillTraitValues.fTETraitsCanRestoreItemThreshold ) swprintf( pStr, L"%s%s", szUDBGenWeaponsStatsTooltipText[ cnt ], szUDBGenWeaponsStatsExplanationsTooltipText[ 22 ]); else swprintf( pStr, L"%s%s", szUDBGenWeaponsStatsTooltipText[ cnt ], szUDBGenWeaponsStatsExplanationsTooltipText[ cnt ]); } else { - if ( cnt == 11 && gGameExternalOptions.fAdvRepairSystem && !gGameExternalOptions.fMercsCanDoAdvancedRepairs ) + if ( cnt == 11 && gGameExternalOptions.fAdvRepairSystem && !gSkillTraitValues.fTETraitsCanRestoreItemThreshold ) swprintf( pStr, L"%s", gzWeaponStatsFasthelpTactical[ 32 ]); else swprintf( pStr, L"%s", gzWeaponStatsFasthelpTactical[ cnt ]); @@ -1828,7 +1828,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ItemDescCallback ); MSYS_AddRegion( &gUDBFasthelpRegions[ iRegionsCreated ]); - if ( cnt == 3 && gGameExternalOptions.fAdvRepairSystem && !gGameExternalOptions.fMercsCanDoAdvancedRepairs ) + if ( cnt == 3 && gGameExternalOptions.fAdvRepairSystem && !gSkillTraitValues.fTETraitsCanRestoreItemThreshold ) swprintf( pStr, L"%s%s", szUDBGenArmorStatsTooltipText[ cnt ], szUDBGenArmorStatsExplanationsTooltipText[ 4 ]); else swprintf( pStr, L"%s%s", szUDBGenArmorStatsTooltipText[ cnt ], szUDBGenArmorStatsExplanationsTooltipText[ cnt ]); diff --git a/Utils/_Ja25ChineseText.cpp b/Utils/_Ja25ChineseText.cpp index 4f959459..e9231688 100644 --- a/Utils/_Ja25ChineseText.cpp +++ b/Utils/_Ja25ChineseText.cpp @@ -229,6 +229,7 @@ STR16 gzIMPMajorTraitsHelpTextsTechnician[]= L"机器人命中率 +%d%s, (由%s控制时)(翻译注:程序参数问题只能用这个语序)\n",// L"+%d%s CtH of robot controlled by the %s\n", L"只有 %s 可以修理机器人\n",// L"%s trait grants you the ability to repair the robot\n", L"修理机器人的速度惩罚 -%d%s\n",// L"Reduced penalty to repair speed of the robot by %d%s\n", + L"Able to restore item threshold to 100%% during repair\n", // TODO.Translate }; STR16 gzIMPMajorTraitsHelpTextsDoctor[]= { diff --git a/Utils/_Ja25DutchText.cpp b/Utils/_Ja25DutchText.cpp index d62443da..7e17be67 100644 --- a/Utils/_Ja25DutchText.cpp +++ b/Utils/_Ja25DutchText.cpp @@ -230,6 +230,7 @@ STR16 gzIMPMajorTraitsHelpTextsTechnician[]= L"+%d%s robot's CtH controlled by the %s\n", L"%s trait grants ability to repair the robot\n", L"Reduced penalty to repair speed of the robot by %d%s\n", + L"Able to restore item threshold to 100%% during repair\n", // TODO.Translate }; STR16 gzIMPMajorTraitsHelpTextsDoctor[]= diff --git a/Utils/_Ja25EnglishText.cpp b/Utils/_Ja25EnglishText.cpp index ae5a9137..87a18570 100644 --- a/Utils/_Ja25EnglishText.cpp +++ b/Utils/_Ja25EnglishText.cpp @@ -230,6 +230,7 @@ STR16 gzIMPMajorTraitsHelpTextsTechnician[]= L"+%d%s robot's CtH controlled by the %s\n", L"%s trait grants ability to repair the robot\n", L"Reduced penalty to repair speed of the robot by %d%s\n", + L"Able to restore item threshold to 100%% during repair\n", }; STR16 gzIMPMajorTraitsHelpTextsDoctor[]= diff --git a/Utils/_Ja25FrenchText.cpp b/Utils/_Ja25FrenchText.cpp index 4d28dfc8..de2e1e0a 100644 --- a/Utils/_Ja25FrenchText.cpp +++ b/Utils/_Ja25FrenchText.cpp @@ -231,6 +231,7 @@ STR16 gzIMPMajorTraitsHelpTextsTechnician[]= L"+%d%s de chance de toucher avec le robot contrôlé par %s\n", L"%s vous accorde la capacité de réparer le robot\n", L"Pénalité réduite sur la vitesse à réparer le robot de %d%s\n", + L"Able to restore item threshold to 100%% during repair\n", // TODO.Translate }; STR16 gzIMPMajorTraitsHelpTextsDoctor[]= { diff --git a/Utils/_Ja25GermanText.cpp b/Utils/_Ja25GermanText.cpp index ef780a2e..e464952e 100644 --- a/Utils/_Ja25GermanText.cpp +++ b/Utils/_Ja25GermanText.cpp @@ -230,6 +230,7 @@ STR16 gzIMPMajorTraitsHelpTextsTechnician[]= L"+%d%s Trefferchance des Roboters, wenn vom %s gesteuert\n", L"Der %s kann den Roboter reparieren\n", L"%d%s Reduzierung des Geschwindigkeitsabzugs beim Reparieren des Roboters\n", + L"Able to restore item threshold to 100%% during repair\n", // TODO.Translate }; STR16 gzIMPMajorTraitsHelpTextsDoctor[]= diff --git a/Utils/_Ja25ItalianText.cpp b/Utils/_Ja25ItalianText.cpp index a991d033..6765a4b7 100644 --- a/Utils/_Ja25ItalianText.cpp +++ b/Utils/_Ja25ItalianText.cpp @@ -228,6 +228,7 @@ STR16 gzIMPMajorTraitsHelpTextsTechnician[]= L"+%d%s robot's CtH controlled by the %s\n", L"%s trait grants ability to repair the robot\n", L"Reduced penalty to repair speed of the robot by %d%s\n", + L"Able to restore item threshold to 100%% during repair\n", // TODO.Translate }; STR16 gzIMPMajorTraitsHelpTextsDoctor[]= diff --git a/Utils/_Ja25PolishText.cpp b/Utils/_Ja25PolishText.cpp index 83197459..351a5ae7 100644 --- a/Utils/_Ja25PolishText.cpp +++ b/Utils/_Ja25PolishText.cpp @@ -230,6 +230,7 @@ STR16 gzIMPMajorTraitsHelpTextsTechnician[]= L"+%d%s robot's CtH controlled by the %s\n", L"%s trait grants ability to repair the robot\n", L"Reduced penalty to repair speed of the robot by %d%s\n", + L"Able to restore item threshold to 100%% during repair\n", // TODO.Translate }; STR16 gzIMPMajorTraitsHelpTextsDoctor[]= diff --git a/Utils/_Ja25RussianText.cpp b/Utils/_Ja25RussianText.cpp index bd6c4aef..e29a5aa2 100644 --- a/Utils/_Ja25RussianText.cpp +++ b/Utils/_Ja25RussianText.cpp @@ -229,6 +229,7 @@ STR16 gzIMPMajorTraitsHelpTextsTechnician[]= L"+%d%s к шансу попадания по цели роботу, управляемому %s\n", L"%s даёт возможность ремонтировать робота\n", L"Понижен штраф на скорость ремонта робота на %d%s\n", + L"Able to restore item threshold to 100%% during repair\n", // TODO.Translate }; STR16 gzIMPMajorTraitsHelpTextsDoctor[]= {