From e98c1ce83c38a2d908fd49b572ec2bb0e9bbcb93 Mon Sep 17 00:00:00 2001 From: MaddMugsy Date: Fri, 9 Nov 2012 08:10:23 +0000 Subject: [PATCH] -Added check in CONSIDERED_NEUTRAL macro for SOLDIER_COVERT_CIV and SOLDIER_COVERT_SOLDIER flags. This should prevent enemies from targeting a disguised merc with sniper and spread fire. -Added screen messages when disguise changes to indicate civilian or soldier disguise -Enabled mercs disguised as soldiers to carry >2 guns, if the additional guns are covert or hidden git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5679 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameInitOptionsScreen.cpp | 4 ++-- GameVersion.cpp | 2 +- Tactical/Items.cpp | 5 +++++ Tactical/Soldier Control.cpp | 6 +++--- Tactical/Soldier Control.h | 2 +- Utils/Text.h | 3 ++- Utils/_ChineseText.cpp | 2 ++ Utils/_DutchText.cpp | 2 ++ Utils/_EnglishText.cpp | 2 ++ Utils/_FrenchText.cpp | 2 ++ Utils/_GermanText.cpp | 2 ++ Utils/_ItalianText.cpp | 2 ++ Utils/_PolishText.cpp | 2 ++ Utils/_RussianText.cpp | 2 ++ Utils/_TaiwaneseText.cpp | 2 ++ 15 files changed, 32 insertions(+), 8 deletions(-) diff --git a/GameInitOptionsScreen.cpp b/GameInitOptionsScreen.cpp index 48922639..ca374a96 100644 --- a/GameInitOptionsScreen.cpp +++ b/GameInitOptionsScreen.cpp @@ -626,7 +626,7 @@ UINT32 GameInitOptionsScreenInit( void ) // Difficulty Level (Default: Experienced = 1) gGameOptions.ubDifficultyLevel = ((UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_DIFFICULTY_LEVEL, 1)) + 1; - // Bobby Ray Quantity (Default: Great = 2) + // Bobby Ray Quality (Default: Great = 2) gGameOptions.ubBobbyRayQuality = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_BOBBY_RAY_QUALITY, 2); // Bobby Ray Quantity (Default: Great = 2) @@ -3583,7 +3583,7 @@ UINT32 GameInitOptionsScreenInit( void ) // Difficulty Level (Default: Experienced = 1) gGameOptions.ubDifficultyLevel = ((UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_DIFFICULTY_LEVEL, 1)) + 1; - // Bobby Ray Quantity (Default: Great = 2) + // Bobby Ray Quality (Default: Great = 2) gGameOptions.ubBobbyRayQuality = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_BOBBY_RAY_QUALITY, 2); // Bobby Ray Quantity (Default: Great = 2) diff --git a/GameVersion.cpp b/GameVersion.cpp index a5408537..40a5bb37 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -50,7 +50,7 @@ #elif defined (JA113DEMO) CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.5520 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Release v1.13.5520 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.5521 (Development Build)" }; #endif #endif diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 0ee87246..b84130db 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -9329,13 +9329,18 @@ BOOLEAN ApplyClothes( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj) if ( COMPARE_PALETTEREP_ID(pSoldier->VestPal, gUniformColors[ i ].vest) && COMPARE_PALETTEREP_ID(pSoldier->PantsPal, gUniformColors[ i ].pants) ) { pSoldier->bSoldierFlagMask |= SOLDIER_COVERT_SOLDIER; + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_SOLDIER], pSoldier->name ); + break; } } // if not dressed as a soldier, we must be dressed as a civilian if ( !(pSoldier->bSoldierFlagMask & SOLDIER_COVERT_SOLDIER) ) + { pSoldier->bSoldierFlagMask |= SOLDIER_COVERT_CIV; + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_CIVILIAN], pSoldier->name ); + } } } diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 271cc03a..197c4feb 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -14497,7 +14497,7 @@ BOOLEAN SOLDIERTYPE::LooksLikeACivilian( void ) BOOLEAN checkfurther = FALSE; // further checks it item is not covert. This means that a gun that has that tag will not be detected if its inside a pocket! - if ( bLoop == HANDPOS || bLoop == SECONDHANDPOS || bLoop == GUNSLINGPOCKPOS || bLoop == HELMETPOS || bLoop == VESTPOS || bLoop == LEGPOS || bLoop == HEAD1POS || bLoop == HEAD2POS ) + if ( !HasItemFlag(this->inv[bLoop].usItem, COVERT) && (bLoop == HANDPOS || bLoop == SECONDHANDPOS || bLoop == GUNSLINGPOCKPOS || bLoop == HELMETPOS || bLoop == VESTPOS || bLoop == LEGPOS || bLoop == HEAD1POS || bLoop == HEAD2POS) ) checkfurther = TRUE; else if ( bLoop == KNIFEPOCKPOS && !HasItemFlag(this->inv[bLoop].usItem, COVERT) ) checkfurther = TRUE; @@ -14629,7 +14629,7 @@ BOOLEAN SOLDIERTYPE::EquipmentTooGood( BOOLEAN fCloselook ) } // further checks it item is not covert. This means that an item that has that tag will not be detected if it is inside a pocket! - if ( bLoop == HANDPOS || bLoop == SECONDHANDPOS || bLoop == GUNSLINGPOCKPOS || bLoop == HELMETPOS || bLoop == VESTPOS || bLoop == LEGPOS || bLoop == HEAD1POS || bLoop == HEAD2POS ) + if (!HasItemFlag(this->inv[bLoop].usItem, COVERT) && (bLoop == HANDPOS || bLoop == SECONDHANDPOS || bLoop == GUNSLINGPOCKPOS || bLoop == HELMETPOS || bLoop == VESTPOS || bLoop == LEGPOS || bLoop == HEAD1POS || bLoop == HEAD2POS) ) ; else if ( bLoop == KNIFEPOCKPOS && !HasItemFlag(this->inv[bLoop].usItem, COVERT) ) ; @@ -14675,7 +14675,7 @@ BOOLEAN SOLDIERTYPE::EquipmentTooGood( BOOLEAN fCloselook ) // if that item is a gun, explosives, military armour or facewear, investigate further if ( (Item[this->inv[bLoop].usItem].usItemClass & (IC_GUN|IC_LAUNCHER|IC_ARMOUR|IC_FACE) ) ) { - if ( (Item[this->inv[bLoop].usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) ) + if ( Item[this->inv[bLoop].usItem].usItemClass & (IC_GUN|IC_LAUNCHER) && !HasItemFlag(this->inv[bLoop].usItem, COVERT) ) { ++numberofguns; diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index 6868f364..3d6730c8 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -410,7 +410,7 @@ extern CLOTHES_STRUCT Clothes[CLOTHES_MAX]; // This macro should be used whenever we want to see if someone is neutral // IF WE ARE CONSIDERING ATTACKING THEM. Creatures & bloodcats will attack neutrals // but they can't attack empty vehicles!! -#define CONSIDERED_NEUTRAL( me, them ) ( (them->aiData.bNeutral) && ( me->bTeam != CREATURE_TEAM || (them->flags.uiStatusFlags & SOLDIER_VEHICLE) ) ) +#define CONSIDERED_NEUTRAL( me, them ) ( (them->aiData.bNeutral || them->bSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER)) && ( me->bTeam != CREATURE_TEAM || (them->flags.uiStatusFlags & SOLDIER_VEHICLE) ) ) typedef struct { diff --git a/Utils/Text.h b/Utils/Text.h index 02bb8a7e..8f66ce92 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -681,7 +681,8 @@ enum STR_COVERT_BAD_PALETTE, STR_COVERT_NO_SKILL, STR_COVERT_NO_UNIFORM_FOUND, - + STR_COVERT_DISGUISED_AS_CIVILIAN, + STR_COVERT_DISGUISED_AS_SOLDIER, TEXT_NUM_COVERT_STR }; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 69720af2..811b3cbc 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -7441,6 +7441,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 3dcc7179..72914734 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -7434,6 +7434,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 33a5e748..b3049be9 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -7422,6 +7422,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 66b1b808..cca970bc 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -7408,6 +7408,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 37924a1e..3e81dca0 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -7249,6 +7249,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 93f07c60..2d49b169 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -7421,6 +7421,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index a1bc2c68..ff32af93 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -7435,6 +7435,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 03c9d546..d9e98ca0 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -7387,6 +7387,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]= diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index 4fb1dbc4..3a855d20 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -7438,6 +7438,8 @@ STR16 szCovertTextStr[]= L"Bad palette found!", L"You need the covert skill to do this!", L"No uniform found!", + L"%s is now disguised as a civilian.", + L"%s is now disguised as a soldier.", }; STR16 szCorpseTextStr[]=