From 92e759555db73ab698ff7205b63b4c5b2c99e6ba Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 21 Feb 2018 18:49:35 +0000 Subject: [PATCH] - New enemy role: display whether an enemy carries a key For more, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=21774&goto=352502&#msg_352502 - If ENHANCED_CLOSE_COMBAT_SYSTEM is on, stealing multiple items from an enemy is possible if he is not on alert git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8523 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface.cpp | 21 +++++++++++++++++++++ Tactical/Weapons.cpp | 9 ++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Tactical/Interface.cpp b/Tactical/Interface.cpp index 7641c0e8..50913626 100644 --- a/Tactical/Interface.cpp +++ b/Tactical/Interface.cpp @@ -6396,6 +6396,27 @@ BOOLEAN ShowSoldierRoleSymbol(SOLDIERTYPE* pSoldier) sYPos += 20; } + // do we carry a key? + for ( int ubLoop = 0; ubLoop < NUM_KEYS; ++ubLoop ) + { + if ( SoldierHasKey( pSoldier, ubLoop ) ) + { + // Add bars + iBack = RegisterBackgroundRect( BGND_FLAG_SINGLE, NULL, sXPos, sYPos, (INT16)( sXPos + 20 ), (INT16)( sYPos + 20 ) ); + + if ( iBack != -1 ) + { + SetBackgroundRectFilled( iBack ); + } + + BltVideoObjectFromIndex( FRAME_BUFFER, guiENEMYROLES, 11, sXPos, sYPos, VO_BLT_TRANSSHADOW, NULL ); + + sYPos += 20; + + break; + } + } + return true; } diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index cde00f90..5703c95d 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -3505,7 +3505,14 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea // Do we have the chance to steal more than 1 item? // SANDRO - taking items from collapsed soldiers is treated differently // Flugente: if we are on the same team, allow guaranteed full access - if ( AllowedToStealFromTeamMate(pSoldier->ubID, pTargetSoldier->ubID) || ( fSoldierCollapsed || (!gGameExternalOptions.fEnhancedCloseCombatSystem && iDiceRoll < (iHitChance * 2 / 3))) && pSoldier->bTeam == gbPlayerNum ) + // otherwise, if we are the player, we can steal multiple items if the other guy is collapsed, or we are succesful, and + // if using fEnhancedCloseCombatSystem, only allow this if the other guy is not alerted + if ( AllowedToStealFromTeamMate(pSoldier->ubID, pTargetSoldier->ubID) || + pSoldier->bTeam == gbPlayerNum && + ( fSoldierCollapsed || + ( iDiceRoll < ( iHitChance * 2 / 3 ) && + !gGameExternalOptions.fEnhancedCloseCombatSystem || + pSoldier->aiData.bAlertStatus < STATUS_RED ) ) ) { // first, charge extra Aps, because it's difficlut to pickup from other soldier if (gGameExternalOptions.fEnhancedCloseCombatSystem)