diff --git a/GameSettings.cpp b/GameSettings.cpp index d121b68d..6043bb93 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -151,11 +151,6 @@ BOOLEAN UsingImprovedInterruptSystem() return (!is_networked && gGameExternalOptions.fImprovedInterruptSystem); } -BOOLEAN UsingEnemiesDropAllItemsSystem() -{ - return gGameExternalOptions.fEnemiesDropAllItems; -} - BOOLEAN UsingInventoryCostsAPSystem() { #ifdef JA2EDITOR @@ -1146,7 +1141,7 @@ void LoadGameExternalOptions() gGameExternalOptions.bAssignedTraitsRarity = iniReader.ReadInteger("Tactical Difficulty Settings", "ASSIGNED_SKILL_TRAITS_RARITY ", 0, -100, 100); // Flugente: drop all is now set in the ini instead of the starting screen - gGameExternalOptions.fEnemiesDropAllItems = iniReader.ReadBoolean("Tactical Difficulty Settings", "DROP_ALL", FALSE ); + gGameExternalOptions.fEnemiesDropAllItems = iniReader.ReadInteger("Tactical Difficulty Settings", "DROP_ALL", 0, 0, 2 ); // HEADROCK HAM B2.8: At "1", Militia will drop their equipment similar to enemies, IF killed by non-player character. At "2" they drop whenever killed. gGameExternalOptions.ubMilitiaDropEquipment = iniReader.ReadInteger("Tactical Difficulty Settings","MILITIA_DROP_EQUIPMENT", 0, 0, 2 ); diff --git a/GameSettings.h b/GameSettings.h index 33ec0f61..7ead1358 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -278,7 +278,6 @@ bool UsingNewCTHSystem(); BOOLEAN UsingFoodSystem(); BOOLEAN UsingBackGroundSystem(); BOOLEAN UsingImprovedInterruptSystem(); -BOOLEAN UsingEnemiesDropAllItemsSystem(); BOOLEAN UsingInventoryCostsAPSystem(); BOOLEAN IsNIVModeValid(bool checkRes = true); @@ -1088,7 +1087,7 @@ typedef struct UINT16 usMaxTargetCoweringPenalty; // Flugente: drop all is now set in the ini instead of the starting screen - BOOLEAN fEnemiesDropAllItems; + UINT8 fEnemiesDropAllItems; // HEADROCK HAM B2.8: If this is turned on, Militia will drop their equipment similar to enemies, IF killed by non-player character. UINT8 ubMilitiaDropEquipment; diff --git a/GameVersion.cpp b/GameVersion.cpp index 62a1e904..ffd96ab1 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -55,8 +55,8 @@ #endif -CHAR8 czVersionNumber[16] = { "Build 19.01.02" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 19.04.22" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; -CHAR16 zRevisionNumber[16] = { L"Revision 8647" }; +CHAR16 zRevisionNumber[16] = { L"Revision 8675" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Tactical/Inventory Choosing.cpp b/Tactical/Inventory Choosing.cpp index 1359d4d2..a8537e3b 100644 --- a/Tactical/Inventory Choosing.cpp +++ b/Tactical/Inventory Choosing.cpp @@ -2327,7 +2327,7 @@ void RandomlyChooseWhichItemsAreDroppable( SOLDIERCREATE_STRUCT *pp, INT8 bSoldi //Madd //if ( gGameSettings.fOptions[TOPTION_DROP_ALL] ) // EXTERNILIZED TO THE INI INSTEAD - SANDRO -if ( UsingEnemiesDropAllItemsSystem() ) +if ( gGameExternalOptions.fEnemiesDropAllItems == 1 ) { ENEMYAMMODROPRATE = 100; ENEMYGRENADEDROPRATE = 100; @@ -2446,7 +2446,7 @@ else //TODO: someday maybe pp->Inv[i].fFlags &= ~ITEM_REPAIRABLE; //if ( gGameSettings.fOptions[TOPTION_DROP_ALL] ) // EXTERNILIZED TO THE INI INSTEAD - SANDRO - if ( UsingEnemiesDropAllItemsSystem() ) + if ( gGameExternalOptions.fEnemiesDropAllItems == 1 ) { // WANNE: "Drop all" should mean "Drop all" /* @@ -2488,7 +2488,7 @@ else } //if ( gGameSettings.fOptions[TOPTION_DROP_ALL] ) // EXTERNILIZED TO THE INI INSTEAD - SANDRO - if ( UsingEnemiesDropAllItemsSystem() ) + if ( gGameExternalOptions.fEnemiesDropAllItems == 1 ) return; // WANNE: Randomly choose which type of items should be dropped diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 3b8cf5cc..efd0c193 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -6915,7 +6915,9 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) if ( Item[pObj->usItem].damageable && Item[pObj->usItem].usItemClass != IC_THROWING_KNIFE ) // Madd: drop crappier items from enemies on higher difficulty levels - note the quick fix for throwing knives { - (*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random( 20 ); + // silversurfer: externalized this + //(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random( 20 ); + (*pObj)[0]->data.objectStatus -= Random( zDiffSetting[gGameOptions.ubDifficultyLevel].usLootStatusModifier ); (*pObj)[0]->data.objectStatus = min( max( (*pObj)[0]->data.objectStatus, 1 ), 100 ); // never below 1% or above 100% (*pObj)[0]->data.sRepairThreshold = max( 1, min( 100, ((*pObj)[0]->data.objectStatus + 200) / 3 ) ); diff --git a/Tactical/Rotting Corpses.cpp b/Tactical/Rotting Corpses.cpp index d24a6037..38ecde4c 100644 --- a/Tactical/Rotting Corpses.cpp +++ b/Tactical/Rotting Corpses.cpp @@ -1020,8 +1020,10 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE { // Check if it's supposed to be dropped // silversurfer: new option to drop items from CIV_TEAM regardless of "OBJECT_UNDROPPABLE" flag + // the same applies for enemy soldiers if mild drop all has been enabled if ( !( (*pObj).fFlags & OBJECT_UNDROPPABLE ) || pSoldier->bTeam == gbPlayerNum - || ( gGameExternalOptions.fCiviliansDropAll && pSoldier->bTeam == CIV_TEAM && !IsVehicle(pSoldier) )) + || ( gGameExternalOptions.fCiviliansDropAll && pSoldier->bTeam == CIV_TEAM && !IsVehicle(pSoldier) ) + || ( gGameExternalOptions.fEnemiesDropAllItems == 2 && pSoldier->bTeam == ENEMY_TEAM ) ) { // and make sure that it really is a droppable item type // if ( !(Item[ pObj->usItem ].fFlags & ITEM_DEFAULT_UNDROPPABLE) ) @@ -1042,10 +1044,19 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE { // silversurfer: externalized this //(*pObj)[0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20); - (*pObj)[0]->data.objectStatus -= Random( zDiffSetting[gGameOptions.ubDifficultyLevel].usLootStatusModifier ); - (*pObj)[0]->data.objectStatus = min(max((*pObj)[0]->data.objectStatus,1),100); // never below 1% or above 100% + // if mild drop all is enabled and the item was usually not allowed to drop we will reduce its status considerably + if ( gGameExternalOptions.fEnemiesDropAllItems == 2 && pSoldier->bTeam == ENEMY_TEAM && (*pObj).fFlags & OBJECT_UNDROPPABLE ) + { + (*pObj)[0]->data.objectStatus -= 60 + Random( zDiffSetting[gGameOptions.ubDifficultyLevel].usLootStatusModifier ); + (*pObj)[0]->data.objectStatus = min(max((*pObj)[0]->data.objectStatus,1),100); // never below 1% or above 100% + } + else + { + (*pObj)[0]->data.objectStatus -= Random( zDiffSetting[gGameOptions.ubDifficultyLevel].usLootStatusModifier ); + (*pObj)[0]->data.objectStatus = min(max((*pObj)[0]->data.objectStatus,1),100); // never below 1% or above 100% - (*pObj)[0]->data.sRepairThreshold = max(1, min(100, ((*pObj)[0]->data.objectStatus + 200)/3 )); + } + (*pObj)[0]->data.sRepairThreshold = max(1, min(100, ((*pObj)[0]->data.objectStatus + 200)/3 )); } } @@ -2496,7 +2507,7 @@ void ReduceAttachmentsOnGunForNonPlayerChars(SOLDIERTYPE *pSoldier, OBJECTTYPE * Assert(UsingNewAttachmentSystem()==true); //If this item has any attachments, is not from a player, and is overwriteable. It's also only for guns. - if((*pObj)[0]->AttachmentListSize() > 0 && pSoldier->bTeam != gbPlayerNum && !((*pObj).fFlags & OBJECT_NO_OVERWRITE) && Item[pObj->usItem].usItemClass == IC_GUN && !UsingEnemiesDropAllItemsSystem() ) + if((*pObj)[0]->AttachmentListSize() > 0 && pSoldier->bTeam != gbPlayerNum && !((*pObj).fFlags & OBJECT_NO_OVERWRITE) && Item[pObj->usItem].usItemClass == IC_GUN && !(gGameExternalOptions.fEnemiesDropAllItems == 1) ) { UINT8 slotCount = 0; for(std::list::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter, ++slotCount) @@ -2509,11 +2520,19 @@ void ReduceAttachmentsOnGunForNonPlayerChars(SOLDIERTYPE *pSoldier, OBJECTTYPE * int i; for(i = 0; i < MAX_DEFAULT_ATTACHMENTS && Item[pObj->usItem].defaultattachments[i] != iter->usItem; i++){} + // with mild drop all attachments of undropable items need to be damaged as well as the base item + if( gGameExternalOptions.fEnemiesDropAllItems == 2 && pSoldier->bTeam == ENEMY_TEAM && (*pObj).fFlags & OBJECT_UNDROPPABLE ) + { + (*iter)[0]->data.objectStatus -= 60 + Random( zDiffSetting[gGameOptions.ubDifficultyLevel].usLootStatusModifier ); + (*iter)[0]->data.objectStatus = min(max((*iter)[0]->data.objectStatus,1),100); // never below 1% or above 100% + } + if(Item[pObj->usItem].defaultattachments[i] == iter->usItem) continue; //Erase this attachment or not? - if(!Chance(gGameExternalOptions.usAttachmentDropRate)){ + if(!Chance(gGameExternalOptions.usAttachmentDropRate)) + { (*pObj).RemoveAttachment(&(*iter), 0, 0, pSoldier, 0, 1); iter = (*pObj)[0]->attachments.begin(); advance(iter, slotCount); diff --git a/Tactical/Tactical Save.cpp b/Tactical/Tactical Save.cpp index 3d364f19..4e5b679a 100644 --- a/Tactical/Tactical Save.cpp +++ b/Tactical/Tactical Save.cpp @@ -2910,7 +2910,9 @@ BOOLEAN AddDeadSoldierToUnLoadedSector( INT16 sMapX, INT16 sMapY, UINT8 bMapZ, S if ( Item[pSoldier->inv[i].usItem].damageable ) // Madd: drop crappier items on higher difficulty levels { - pSoldier->inv[i][0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20); + // silversurfer: externalized this + //pSoldier->inv[i][0]->data.objectStatus -= (gGameOptions.ubDifficultyLevel - 1) * Random(20); + pSoldier->inv[i][0]->data.objectStatus -= Random( zDiffSetting[gGameOptions.ubDifficultyLevel].usLootStatusModifier ); pSoldier->inv[i][0]->data.objectStatus = max(pSoldier->inv[i][0]->data.objectStatus,1); // never below 1% } pWorldItems[ bCount ].object = pSoldier->inv[i];