Fix: if a spy is closer to an enemy than COVERT_CLOSE_DETECTION_RANGE tiles, he won't examined as thorough

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7799 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-03-29 15:40:01 +00:00
parent 37f1ac452a
commit 6891d102c3
+32 -28
View File
@@ -15446,6 +15446,10 @@ BOOLEAN SOLDIERTYPE::EquipmentTooGood( BOOLEAN fCloselook )
; ;
else else
{ {
// if we're not that close, we wont even see this, so don't check
if ( !fCloselook )
continue;
// item will be detected if someone looks - check for the LBE item that gave us this slot. If that one is covert, this item is also covert // item will be detected if someone looks - check for the LBE item that gave us this slot. If that one is covert, this item is also covert
UINT8 checkslot = 0; UINT8 checkslot = 0;
switch ( uiNIVSlotType[bLoop] ) switch ( uiNIVSlotType[bLoop] )
@@ -15527,7 +15531,7 @@ BOOLEAN SOLDIERTYPE::EquipmentTooGood( BOOLEAN fCloselook )
++numberofattachments; ++numberofattachments;
// no ordinary soldier is allowed that many attachments -> not covert // no ordinary soldier is allowed that many attachments -> not covert
if ( numberofattachments > gGameExternalOptions.iMaxEnemyAttachments ) if ( fCloselook && numberofattachments > gGameExternalOptions.iMaxEnemyAttachments )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TOOMANYATTACHMENTS], this->GetName( ), Item[pObj->usItem].szItemName ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TOOMANYATTACHMENTS], this->GetName( ), Item[pObj->usItem].szItemName );
return TRUE; return TRUE;
@@ -15592,7 +15596,7 @@ BOOLEAN SOLDIERTYPE::EquipmentTooGood( BOOLEAN fCloselook )
} }
// no ordinary soldier is allowed that many attachments > not covert // no ordinary soldier is allowed that many attachments > not covert
if ( numberofattachments > gGameExternalOptions.iMaxEnemyAttachments ) if ( fCloselook && numberofattachments > gGameExternalOptions.iMaxEnemyAttachments )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TOOMANYATTACHMENTS], this->GetName( ), Item[pObj->usItem].szItemName ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TOOMANYATTACHMENTS], this->GetName( ), Item[pObj->usItem].szItemName );
return TRUE; return TRUE;
@@ -15666,38 +15670,38 @@ BOOLEAN SOLDIERTYPE::SeemsLegit( UINT8 ubObserverID )
case 2: case 2:
// a covert ops expert can get as close as he wants, even dressed up as a soldier, without arousing suspicion // a covert ops expert can get as close as he wants, even dressed up as a soldier, without arousing suspicion
// exceptions: we are discovered if we are close and bleeding, or if we are drunk while dressed as a soldier // exceptions: we are discovered if we are close and bleeding, or if we are drunk while dressed as a soldier
{ {
// if we are openly bleeding: not covert // if we are openly bleeding: not covert
if ( gSkillTraitValues.fCODetectIfBleeding && this->bBleeding > 0 ) if ( gSkillTraitValues.fCODetectIfBleeding && this->bBleeding > 0 )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_BLEEDING], this->GetName( ) ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_BLEEDING], this->GetName( ) );
return FALSE; return FALSE;
} }
if ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER && GetDrunkLevel( this ) != SOBER ) if ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER && GetDrunkLevel( this ) != SOBER )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DRUNKEN_SOLDIER], this->GetName( ) ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DRUNKEN_SOLDIER], this->GetName( ) );
return FALSE; return FALSE;
} }
} }
break; break;
case 1: case 1:
// at lvl covert ops, we can be discovered if we are too close to the enemy and bleed or dressed up as a soldier // at lvl covert ops, we can be discovered if we are too close to the enemy and bleed or dressed up as a soldier
// however, if we are dressed up as a civilian, we can get as close as we like, we won't be discovered // however, if we are dressed up as a civilian, we can get as close as we like, we won't be discovered
{ {
// if we are openly bleeding: not covert // if we are openly bleeding: not covert
if ( gSkillTraitValues.fCODetectIfBleeding && this->bBleeding > 0 ) if ( gSkillTraitValues.fCODetectIfBleeding && this->bBleeding > 0 )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_BLEEDING], this->GetName( ) ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_BLEEDING], this->GetName( ) );
return FALSE; return FALSE;
} }
if ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER ) if ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER )
{ {
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TOO_CLOSE], this->GetName( ) ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TOO_CLOSE], this->GetName( ) );
return FALSE; return FALSE;
} }
} }
break; break;
case 0: case 0:
default: default: