From 6c0d94dadd75dac039d767526ebd818d348a3e33 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 10 Mar 2013 01:15:19 +0000 Subject: [PATCH] - DIRT_GLOBAL_MODIFIER is a global modifier to dirt generation - second cleaning button in menu now orders entire team to clean their guns - global overheating modifier now also multiplies attachment modifiers - cleaning kits always use up 1% on use git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5913 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 1 + GameSettings.h | 3 ++- Tactical/Handle Items.cpp | 14 +++++++------- Tactical/Interface Enhanced.cpp | 2 +- Tactical/Items.cpp | 5 ++++- Tactical/ShopKeeper Interface.cpp | 2 +- Tactical/Soldier Control.cpp | 9 ++++----- Tactical/Weapons.cpp | 5 ++++- Utils/_ChineseText.cpp | 4 ++-- Utils/_DutchText.cpp | 4 ++-- Utils/_EnglishText.cpp | 4 ++-- Utils/_FrenchText.cpp | 4 ++-- Utils/_GermanText.cpp | 4 ++-- Utils/_ItalianText.cpp | 4 ++-- Utils/_PolishText.cpp | 4 ++-- Utils/_RussianText.cpp | 4 ++-- Utils/_TaiwaneseText.cpp | 4 ++-- 17 files changed, 42 insertions(+), 35 deletions(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index b5cb27d25..6501dad14 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1571,6 +1571,7 @@ void LoadGameExternalOptions() 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); + gGameExternalOptions.iDirtGlobalModifier = iniReader.ReadFloat ("Strategic Gameplay Settings","DIRT_GLOBAL_MODIFIER", 1.25f, 0.1f, 10.0f); // Flugente: prisoner system gGameExternalOptions.fAllowPrisonerSystem = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_TAKE_PRISONERS", TRUE); diff --git a/GameSettings.h b/GameSettings.h index ff962c9e2..2cd7aa845 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -1164,7 +1164,7 @@ typedef struct BOOLEAN fDisplayOverheatThermometer; // Should a 'thermometer' for guns and replacable barrels be displayed? UINT8 ubOverheatThermometerRedOffset; // amount of red colour while temperature is below threshold FLOAT iCooldownModificatorLonelyBarrel; // Cooldown modificator for barrels left alone in the landscape ;-) - FLOAT iOverheatTemperatureGlobalModfier; // a global modifier to the singel shot temperature value, if one feels that all values should be lower/higher + FLOAT iOverheatTemperatureGlobalModfier; // a global modifier to the single shot temperature value, if one feels that all values should be lower/higher // Flugente: Weapon Mounting BOOLEAN fWeaponResting; // Should it be possible to rest your weapon on structures in crouched position? @@ -1184,6 +1184,7 @@ typedef struct 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 + FLOAT iDirtGlobalModifier; // a global modifier to dirt generation, if one feels that all values should be lower/higher // Flugente: prisoner related settings BOOLEAN fAllowPrisonerSystem; diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index d7477ba27..ecae5bdb4 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -134,7 +134,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo ); // added by Flugente void StartTacticalFunctionSelectionMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel ); -void CleanWeapons( BOOLEAN fCleanAll ); +void CleanWeapons( BOOLEAN fEntireTeam ); void Strip( SOLDIERTYPE * pSoldier ); void StartCorpseMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel ); @@ -4748,7 +4748,7 @@ void StartTacticalFunctionSelectionMessageBox( SOLDIERTYPE * pSoldier, INT32 sGr DoMessageBox( MSG_BOX_BASIC_MEDIUM_BUTTONS, TacticalStr[ FUNCTION_SELECTION_STR ], GAME_SCREEN, MSG_BOX_FLAG_GENERIC_EIGHT_BUTTONS, TacticalFunctionSelectionMessageBoxCallBack, NULL ); } -void CleanWeapons( BOOLEAN fCleanAll ) +void CleanWeapons( BOOLEAN fEntireTeam ) { if ( !gGameExternalOptions.fDirtSystem ) return; @@ -4758,7 +4758,7 @@ void CleanWeapons( BOOLEAN fCleanAll ) return; // if in turnbased mode, perform this action only for the selected merc, and use up APs - if ( gTacticalStatus.uiFlags & TURNBASED ) + if ( !fEntireTeam || gTacticalStatus.uiFlags & TURNBASED ) { if ( gusSelectedSoldier == NOBODY ) return; @@ -4766,7 +4766,7 @@ void CleanWeapons( BOOLEAN fCleanAll ) SOLDIERTYPE* pSoldier = MercPtrs[ gusSelectedSoldier ]; if ( pSoldier->bActive ) - pSoldier->CleanWeapon(fCleanAll); + pSoldier->CleanWeapon(FALSE); } else // perform action for every merc in this sector { @@ -4782,7 +4782,7 @@ void CleanWeapons( BOOLEAN fCleanAll ) //if the merc is in this sector if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bInSector && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) ) { - pSoldier->CleanWeapon(fCleanAll); + pSoldier->CleanWeapon(TRUE); } } } @@ -4905,11 +4905,11 @@ void TacticalFunctionSelectionMessageBoxCallBack( UINT8 ubExitValue ) SectorFillCanteens(); break; case 2: - // clean a single weapon + // clean weapons of selected merc CleanWeapons(FALSE); break; case 3: - // clean all weapons + // clean weapons of entire team CleanWeapons(TRUE); break; case 4: diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index f4251b7d9..17f401cb2 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -11425,7 +11425,7 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop; sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop; - iFloatModifier[0] = Item[ gpItemDescObject->usItem ].dirtIncreaseFactor; + iFloatModifier[0] = Item[ gpItemDescObject->usItem ].dirtIncreaseFactor * gGameExternalOptions.iDirtGlobalModifier; iFloatModifier[2] = GetItemDirtIncreaseFactor( gpItemDescObject, TRUE ); iFloatModifier[1] = iFloatModifier[2] - iFloatModifier[0]; diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 44468d267..fbd7a962b 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -14702,9 +14702,12 @@ FLOAT GetItemDirtIncreaseFactor( OBJECTTYPE * pObj, BOOLEAN fConsiderAmmo ) } } - // ammo modifies how much dirt a single shot makes, but only while shooting + // ammo modifies how much dirt a single shot makes, but only while shooting, not when a gun gets dirty due to environmental effects if ( fConsiderAmmo ) dirtincreasefactor *= (1.0f + AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].dirtModificator); + + // multiply again for global modifer + dirtincreasefactor *= gGameExternalOptions.iDirtGlobalModifier; // dirt factor has to be >= 0 (items don't clean themselves) dirtincreasefactor = max(0.0f, dirtincreasefactor); diff --git a/Tactical/ShopKeeper Interface.cpp b/Tactical/ShopKeeper Interface.cpp index bab9e7f8e..0c8a01e27 100644 --- a/Tactical/ShopKeeper Interface.cpp +++ b/Tactical/ShopKeeper Interface.cpp @@ -3177,7 +3177,7 @@ BOOLEAN RepairIsDone(DEALER_SPECIAL_ITEM* pSpecial) // fix it up (*iter)[0]->data.objectStatus = 100; - // Flugente: shopkeepers will also restore an item's repair threshold + // Flugente: shopkeepers will also restore an item's repair threshold and clean it (*iter)[0]->data.sRepairThreshold = 100; (*iter)[0]->data.bDirtLevel = 0.0f; } diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 0db8ad4c2..35d268865 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -14485,7 +14485,7 @@ OBJECTTYPE* SOLDIERTYPE::GetCleaningKit() return( pObj ); } -// use cleaning kits to clean weapons in inventory. fCleanAll = TRUE: clean all eapons found, otherwise just the first one +// use cleaning kits to clean weapons in inventory. fCleanAll = TRUE: clean all weapons found, otherwise just the first one void SOLDIERTYPE::CleanWeapon( BOOLEAN fCleanAll ) { // in turnbased, this action costs APs. remove them if possible, otherwise, return @@ -14526,16 +14526,15 @@ void SOLDIERTYPE::CleanWeapon( BOOLEAN fCleanAll ) ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[WEAPON_CLEANING_STR], this->name, Item[pObj->usItem].szItemName ); - // 33% chance to use up 1% of the cleaning kit - if ( Random(2) > 0 ) - UseKitPoints( pCleaningKit, 1, this ); + // always use up 1% of the cleaning kit (they last too long otherwise) + UseKitPoints( pCleaningKit, 1, this ); if ( gTacticalStatus.uiFlags & TURNBASED ) { // use up APs DeductPoints( this, apcost, 0, AFTERACTION_INTERRUPT ); - // if fCleanAll is false, only clean one weapon + // if fCleanAll is false, only clean first weapon if (!fCleanAll ) return; diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index 04da73eb9..4f455d85e 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -11762,7 +11762,7 @@ FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj ) singleshottemperature = Weapon[ pObj->usItem ].usOverheatingSingleShotTemperature; // determine modificator according to attachments - FLOAT modificator = gGameExternalOptions.iOverheatTemperatureGlobalModfier; + FLOAT modificator = 1.0f; attachmentList::iterator iterend = (*pObj)[0]->attachments.end(); for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter) @@ -11777,6 +11777,9 @@ FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj ) modificator += AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].temperatureModificator; singleshottemperature *= modificator; + + // multiply again for global modifer + singleshottemperature *= gGameExternalOptions.iOverheatTemperatureGlobalModfier; } return singleshottemperature; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 881ad7005..191a074c5 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -2922,8 +2922,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical L"你想要做的是什么?", L"装满水壶", - L"清理枪支污垢", - L"清理所有枪支污垢", + L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Team)", L"脱掉衣服", // added by Flugente: decide what to do with the corpses diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 8fe3a965f..2bda15683 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -2919,8 +2919,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical // TODO.Translate L"What do you want to do?", L"Fill canteens", - L"Clean gun", - L"Clean all guns", + L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Team)", L"Take off clothes", // added by Flugente: decide what to do with the corpses diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 8d7cc60d5..13f47bbb7 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -2921,8 +2921,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical L"What do you want to do?", L"Fill canteens", - L"Clean gun", - L"Clean all guns", + L"Clean guns (Merc)", + L"Clean guns (Team)", L"Take off clothes", // added by Flugente: decide what to do with the corpses diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 670303c7e..5ed560185 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -2926,8 +2926,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical // TODO.Translate L"What do you want to do?", L"Fill canteens", - L"Clean gun", - L"Clean all guns", + L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Team)", L"Take off clothes", // added by Flugente: decide what to do with the corpses diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 25af2d1d2..90978988e 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -2924,8 +2924,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical L"Was möchten Sie tun?", L"Feldflasche auffüllen", - L"Waffe reinigen", - L"Alle Waffen reinigen", + L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Team)", L"Kleidung ausziehen", // added by Flugente: decide what to do with the corpses diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 420c5a7a9..ecf855635 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -2913,8 +2913,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical // TODO.Translate L"What do you want to do?", L"Fill canteens", - L"Clean gun", - L"Clean all guns", + L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Team)", L"Take off clothes", // added by Flugente: decide what to do with the corpses diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 80dc453a2..906ac20cc 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -2930,8 +2930,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical // TODO.Translate L"What do you want to do?", L"Fill canteens", - L"Clean gun", - L"Clean all guns", + L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Team)", L"Take off clothes", // added by Flugente: decide what to do with the corpses diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 3bbdd4dd4..ff2ce004b 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -2921,8 +2921,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical // TODO.Translate L"Что будем делать?", L"Наполнить фляги", - L"Почистить оружие", - L"Почистить всё оружие", + L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Team)", L"Снять одежду", // added by Flugente: decide what to do with the corpses diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index d237199aa..174be6e42 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -2923,8 +2923,8 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical // TODO.Translate L"What do you want to do?", L"Fill canteens", - L"Clean gun", - L"Clean all guns", + L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Team)", L"Take off clothes", // added by Flugente: decide what to do with the corpses