diff --git a/GameSettings.cpp b/GameSettings.cpp index 44ab0b68e..817f1ad2c 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1310,6 +1310,8 @@ void LoadGameExternalOptions() // enable schedules and decision making for any named npc regardless of their team gGameExternalOptions.fAllNamedNpcsDecideAction = iniReader.ReadBoolean("Tactical Gameplay Settings", "ALL_NAMED_NPCS_DECIDE_ACTION", FALSE); + gGameExternalOptions.fAccessOtherMercInventories = iniReader.ReadBoolean("Tactical Gameplay Settings","ACCESS_OTHER_MERC_INVENTORIES", TRUE); + //################# Tactical Cover System Settings ################## // CPT: Cover System Settings diff --git a/GameSettings.h b/GameSettings.h index 309979c69..fc77f63f1 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -489,6 +489,9 @@ typedef struct UINT16 usMilitiaAmmo_OptimalMagCount; BOOLEAN fMilitiaUseSectorClassSpecificTaboos; + // Flugente - allow accessing other mercs inventory via 'stealing' + BOOLEAN fAccessOtherMercInventories; + // WDS - Improve Tony's and Devin's inventory like BR's BOOLEAN tonyUsesBRSetting; BOOLEAN devinUsesBRSetting; diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 7cac8c0a2..36970730e 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -6293,69 +6293,75 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet } else { - // Check, if we can steal the item - // CHRISL: Added new case definitions for new inventory pockets - switch (i) + // Flugente: if we are on the same team, allow guaranteed full access + if ( gGameExternalOptions.fAccessOtherMercInventories && pOpponent->bTeam == pSoldier->bTeam ) + fStealItem = TRUE; + else { - case HANDPOS: - case GUNSLINGPOCKPOS: + // Check, if we can steal the item + // CHRISL: Added new case definitions for new inventory pockets + switch (i) { - // Flugente: if item has a weapon sling attached, it can't be stolen - if ( HasAttachmentOfClass(pObject, AC_SLING) ) - fStealItem = FALSE; - else - fStealItem = TRUE; + case HANDPOS: + case GUNSLINGPOCKPOS: + { + // Flugente: if item has a weapon sling attached, it can't be stolen + if ( HasAttachmentOfClass(pObject, AC_SLING) ) + fStealItem = FALSE; + else + fStealItem = TRUE; + break; + } + case SECONDHANDPOS: + case KNIFEPOCKPOS: + case BIGPOCK1POS: + case BIGPOCK2POS: + case BIGPOCK3POS: + case BIGPOCK4POS: + case BIGPOCK5POS: + case BIGPOCK6POS: + case BIGPOCK7POS: + case MEDPOCK1POS: + case MEDPOCK2POS: + case MEDPOCK3POS: + case MEDPOCK4POS: + case SMALLPOCK1POS: + case SMALLPOCK2POS: + case SMALLPOCK3POS: + case SMALLPOCK4POS: + case SMALLPOCK5POS: + case SMALLPOCK6POS: + case SMALLPOCK7POS: + case SMALLPOCK8POS: + case SMALLPOCK9POS: + case SMALLPOCK10POS: + case SMALLPOCK11POS: + case SMALLPOCK12POS: + case SMALLPOCK13POS: + case SMALLPOCK14POS: + case SMALLPOCK15POS: + case SMALLPOCK16POS: + case SMALLPOCK17POS: + case SMALLPOCK18POS: + case SMALLPOCK19POS: + case SMALLPOCK20POS: + case SMALLPOCK21POS: + case SMALLPOCK22POS: + case SMALLPOCK23POS: + case SMALLPOCK24POS: + case SMALLPOCK25POS: + case SMALLPOCK26POS: + case SMALLPOCK27POS: + case SMALLPOCK28POS: + case SMALLPOCK29POS: + case SMALLPOCK30POS: + fStealItem = TRUE; + break; + default: + fStealItem = FALSE; break; } - case SECONDHANDPOS: - case KNIFEPOCKPOS: - case BIGPOCK1POS: - case BIGPOCK2POS: - case BIGPOCK3POS: - case BIGPOCK4POS: - case BIGPOCK5POS: - case BIGPOCK6POS: - case BIGPOCK7POS: - case MEDPOCK1POS: - case MEDPOCK2POS: - case MEDPOCK3POS: - case MEDPOCK4POS: - case SMALLPOCK1POS: - case SMALLPOCK2POS: - case SMALLPOCK3POS: - case SMALLPOCK4POS: - case SMALLPOCK5POS: - case SMALLPOCK6POS: - case SMALLPOCK7POS: - case SMALLPOCK8POS: - case SMALLPOCK9POS: - case SMALLPOCK10POS: - case SMALLPOCK11POS: - case SMALLPOCK12POS: - case SMALLPOCK13POS: - case SMALLPOCK14POS: - case SMALLPOCK15POS: - case SMALLPOCK16POS: - case SMALLPOCK17POS: - case SMALLPOCK18POS: - case SMALLPOCK19POS: - case SMALLPOCK20POS: - case SMALLPOCK21POS: - case SMALLPOCK22POS: - case SMALLPOCK23POS: - case SMALLPOCK24POS: - case SMALLPOCK25POS: - case SMALLPOCK26POS: - case SMALLPOCK27POS: - case SMALLPOCK28POS: - case SMALLPOCK29POS: - case SMALLPOCK30POS: - fStealItem = TRUE; - break; - default: - fStealItem = FALSE; - break; } } diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 16670f7ea..13f826abe 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -5675,7 +5675,8 @@ void HandleHandCursorClick( INT32 usMapPos, UINT32 *puiNewEvent ) // Check if we are on a merc... if so.. steal! if ( gfUIFullTargetFound ) { - if ( ( guiUIFullTargetFlags & ENEMY_MERC ) && !( guiUIFullTargetFlags & UNCONSCIOUS_MERC ) ) + // Flugente: allow stealing if the other guy is an enemy, OR if we are on the same team + if ( (( guiUIFullTargetFlags & ENEMY_MERC ) && !( guiUIFullTargetFlags & UNCONSCIOUS_MERC )) || (gGameExternalOptions.fAccessOtherMercInventories && guiUIFullTargetFlags & OWNED_MERC) ) { sActionGridNo = FindAdjacentGridEx( pSoldier, MercPtrs[ gusUIFullTargetID ]->sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE ); if ( sActionGridNo == -1 ) diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index ef44fd94b..78ec2b4cc 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -3088,7 +3088,12 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea if (fStealing) { // Calculate the possible chance to steal! - if ( AM_A_ROBOT( pTargetSoldier ) || TANK( pTargetSoldier ) || CREATURE_OR_BLOODCAT( pTargetSoldier ) || TANK( pTargetSoldier ) || (SOLDIER_CLASS_MILITIA(pTargetSoldier->ubSoldierClass) && (gGameExternalOptions.ubMilitiaDropEquipment != 2)) ) // added militia here - SANDRO + // Flugente: if we are on the same team, allow guaranteed full access + if ( gGameExternalOptions.fAccessOtherMercInventories && pTargetSoldier->bTeam == pSoldier->bTeam ) + { + iHitChance = 100; + } + else if ( AM_A_ROBOT( pTargetSoldier ) || TANK( pTargetSoldier ) || CREATURE_OR_BLOODCAT( pTargetSoldier ) || TANK( pTargetSoldier ) || (SOLDIER_CLASS_MILITIA(pTargetSoldier->ubSoldierClass) && (gGameExternalOptions.ubMilitiaDropEquipment != 2)) ) // added militia here - SANDRO { iHitChance = 0; } @@ -3182,7 +3187,8 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea // WDS 07/19/2008 - Random number use fix // Do we have the chance to steal more than 1 item? // SANDRO - taking items from collapsed soldiers is treated differently - if (( fSoldierCollapsed || (!gGameExternalOptions.fEnhancedCloseCombatSystem && iDiceRoll < (iHitChance * 2 / 3))) && pSoldier->bTeam == gbPlayerNum ) + // Flugente: if we are on the same team, allow guaranteed full access + if ( (gGameExternalOptions.fAccessOtherMercInventories && pTargetSoldier->bTeam == pSoldier->bTeam ) || ( fSoldierCollapsed || (!gGameExternalOptions.fEnhancedCloseCombatSystem && iDiceRoll < (iHitChance * 2 / 3))) && pSoldier->bTeam == gbPlayerNum ) { // first, charge extra Aps, because it's difficlut to pickup from other soldier if (gGameExternalOptions.fEnhancedCloseCombatSystem)