mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Feature improvement: allow accessing other merc inventories when ACCESS_OTHER_MERC_INVENTORIES is TRUE. Even works with dying mercs.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6033 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1310,6 +1310,8 @@ void LoadGameExternalOptions()
|
|||||||
// enable schedules and decision making for any named npc regardless of their team
|
// 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.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 ##################
|
//################# Tactical Cover System Settings ##################
|
||||||
|
|
||||||
// CPT: Cover System Settings
|
// CPT: Cover System Settings
|
||||||
|
|||||||
@@ -489,6 +489,9 @@ typedef struct
|
|||||||
UINT16 usMilitiaAmmo_OptimalMagCount;
|
UINT16 usMilitiaAmmo_OptimalMagCount;
|
||||||
BOOLEAN fMilitiaUseSectorClassSpecificTaboos;
|
BOOLEAN fMilitiaUseSectorClassSpecificTaboos;
|
||||||
|
|
||||||
|
// Flugente - allow accessing other mercs inventory via 'stealing'
|
||||||
|
BOOLEAN fAccessOtherMercInventories;
|
||||||
|
|
||||||
// WDS - Improve Tony's and Devin's inventory like BR's
|
// WDS - Improve Tony's and Devin's inventory like BR's
|
||||||
BOOLEAN tonyUsesBRSetting;
|
BOOLEAN tonyUsesBRSetting;
|
||||||
BOOLEAN devinUsesBRSetting;
|
BOOLEAN devinUsesBRSetting;
|
||||||
|
|||||||
+64
-58
@@ -6293,69 +6293,75 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Check, if we can steal the item
|
// Flugente: if we are on the same team, allow guaranteed full access
|
||||||
// CHRISL: Added new case definitions for new inventory pockets
|
if ( gGameExternalOptions.fAccessOtherMercInventories && pOpponent->bTeam == pSoldier->bTeam )
|
||||||
switch (i)
|
fStealItem = TRUE;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
case HANDPOS:
|
// Check, if we can steal the item
|
||||||
case GUNSLINGPOCKPOS:
|
// CHRISL: Added new case definitions for new inventory pockets
|
||||||
|
switch (i)
|
||||||
{
|
{
|
||||||
// Flugente: if item has a weapon sling attached, it can't be stolen
|
case HANDPOS:
|
||||||
if ( HasAttachmentOfClass(pObject, AC_SLING) )
|
case GUNSLINGPOCKPOS:
|
||||||
fStealItem = FALSE;
|
{
|
||||||
else
|
// Flugente: if item has a weapon sling attached, it can't be stolen
|
||||||
fStealItem = TRUE;
|
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;
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5675,7 +5675,8 @@ void HandleHandCursorClick( INT32 usMapPos, UINT32 *puiNewEvent )
|
|||||||
// Check if we are on a merc... if so.. steal!
|
// Check if we are on a merc... if so.. steal!
|
||||||
if ( gfUIFullTargetFound )
|
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 );
|
sActionGridNo = FindAdjacentGridEx( pSoldier, MercPtrs[ gusUIFullTargetID ]->sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||||
if ( sActionGridNo == -1 )
|
if ( sActionGridNo == -1 )
|
||||||
|
|||||||
@@ -3088,7 +3088,12 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
if (fStealing)
|
if (fStealing)
|
||||||
{
|
{
|
||||||
// Calculate the possible chance to steal!
|
// 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;
|
iHitChance = 0;
|
||||||
}
|
}
|
||||||
@@ -3182,7 +3187,8 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea
|
|||||||
// WDS 07/19/2008 - Random number use fix
|
// WDS 07/19/2008 - Random number use fix
|
||||||
// Do we have the chance to steal more than 1 item?
|
// Do we have the chance to steal more than 1 item?
|
||||||
// SANDRO - taking items from collapsed soldiers is treated differently
|
// 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
|
// first, charge extra Aps, because it's difficlut to pickup from other soldier
|
||||||
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
if (gGameExternalOptions.fEnhancedCloseCombatSystem)
|
||||||
|
|||||||
Reference in New Issue
Block a user