diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index 384511c3f..1a6b96192 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -3148,6 +3148,37 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, BOOLEAN fStea fFailure=FALSE; + // Flugente: if we are disguised and try to steal from a conscious enemy, there is a chance that he notices us and we lose our disguise. If he can see us this always happens + if ( !fSoldierCollapsed && pSoldier->bSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER) ) + { + BOOLEAN fUncovered = FALSE; + + // if he sees us, always loose disguise + if ( pTargetSoldier->aiData.bOppList[ pSoldier->ubID ] == SEEN_CURRENTLY ) + fUncovered = TRUE; + else + { + UINT8 chance = 10; + + if ( pTargetSoldier->aiData.bOppList[ pSoldier->ubID ] == SEEN_LAST_TURN ) + chance += 40; + + chance += pSoldier->aiData.bAlertStatus * 10; + + if ( Chance(chance) ) + fUncovered = TRUE; + } + + if ( fUncovered ) + { + pSoldier->LooseDisguise(); + pSoldier->Strip(); + + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_STEAL_FAIL], pSoldier->name ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_UNCOVERED], pTargetSoldier->name, pSoldier->name ); + } + } + // 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 diff --git a/Utils/Text.h b/Utils/Text.h index 05bc92173..861d2a2ae 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -688,6 +688,7 @@ enum STR_COVERT_UNCOVER_SINGLE, STR_COVERT_TEST_OK, STR_COVERT_TEST_FAIL, + STR_COVERT_STEAL_FAIL, TEXT_NUM_COVERT_STR }; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index d36884579..902b78add 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -7492,6 +7492,7 @@ STR16 szCovertTextStr[]= L"%s was uncovered!", L"%s's disguise seems to be ok...", L"%s's disguise will not hold.", + L"%s was caught stealing!", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 66721132f..04b77322b 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -7489,6 +7489,7 @@ STR16 szCovertTextStr[]= L"%s was uncovered!", L"%s's disguise seems to be ok...", L"%s's disguise will not hold.", + L"%s was caught stealing!", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 6442f7603..eb2e3c828 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -7478,6 +7478,7 @@ STR16 szCovertTextStr[]= L"%s was uncovered!", L"%s's disguise seems to be ok...", L"%s's disguise will not hold.", + L"%s was caught stealing!", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 0af442bff..129315fba 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -7473,6 +7473,7 @@ STR16 szCovertTextStr[]= L"%s was uncovered!", L"%s's disguise seems to be ok...", L"%s's disguise will not hold.", + L"%s was caught stealing!", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 7dff722d2..cd025d703 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -7301,6 +7301,7 @@ STR16 szCovertTextStr[]= L"%s wurde enttarnt!", L"%s's Verkleidung sollte überzeugen", L"%s's Verkleidung wird auffliegen!", + L"%s wurde beim Stehlen erwischt!", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 346219082..11a5fbb69 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -7475,6 +7475,7 @@ STR16 szCovertTextStr[]= L"%s was uncovered!", L"%s's disguise seems to be ok...", L"%s's disguise will not hold.", + L"%s was caught stealing!", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 79f58ac2d..d8359d74c 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -7496,6 +7496,7 @@ STR16 szCovertTextStr[]= L"%s was uncovered!", L"%s's disguise seems to be ok...", L"%s's disguise will not hold.", + L"%s was caught stealing!", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index c28f1dc68..8be61f0b0 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -7477,6 +7477,7 @@ STR16 szCovertTextStr[]= L"%s was uncovered!", L"%s's disguise seems to be ok...", L"%s's disguise will not hold.", + L"%s was caught stealing!", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index cd8766b2f..d33012f87 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -7493,6 +7493,7 @@ STR16 szCovertTextStr[]= L"%s was uncovered!", L"%s's disguise seems to be ok...", L"%s's disguise will not hold.", + L"%s was caught stealing!", }; STR16 szCorpseTextStr[]=