mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Fix: do not apply disguise if we are seen by an enemy
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7181 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -41,15 +41,6 @@ class SOLDIERTYPE;
|
|||||||
|
|
||||||
//******* Local Defines **************************************************
|
//******* Local Defines **************************************************
|
||||||
|
|
||||||
enum COVER_VALUES
|
|
||||||
{
|
|
||||||
INVALID_COVER=-1,
|
|
||||||
NO_COVER=0,
|
|
||||||
MIN_COVER=1,
|
|
||||||
MED_COVER=2,
|
|
||||||
MAX_COVER=3
|
|
||||||
};
|
|
||||||
|
|
||||||
// Flugente: mines display - stuff needs to be here
|
// Flugente: mines display - stuff needs to be here
|
||||||
enum MINES_VALUES
|
enum MINES_VALUES
|
||||||
{
|
{
|
||||||
@@ -136,8 +127,6 @@ void RemoveMinesObjectsFromViewArea(); // added by Flugente, has to be declared
|
|||||||
void RemoveTraitObjectsFromViewArea();
|
void RemoveTraitObjectsFromViewArea();
|
||||||
|
|
||||||
void CalculateCover();
|
void CalculateCover();
|
||||||
void CalculateCoverForSoldier( SOLDIERTYPE* pForSoldier, const INT32& sTargetGridNo, const BOOLEAN& fRoof, INT8& bCover );
|
|
||||||
void CalculateCoverFromSoldier( SOLDIERTYPE* pFromSoldier, const INT32& sTargetGridNo, const BOOLEAN& fRoof, INT8& bCover, SOLDIERTYPE* pToSoldier=NULL );
|
|
||||||
|
|
||||||
void GetGridNoForViewPort( const INT32& ubX, const INT32& ubY, INT32& sGridNo );
|
void GetGridNoForViewPort( const INT32& ubX, const INT32& ubY, INT32& sGridNo );
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,24 @@ void SwitchCoverDrawMode();
|
|||||||
void RemoveVisibleGridNoAtSelectedGridNo();
|
void RemoveVisibleGridNoAtSelectedGridNo();
|
||||||
void DisplayGridNoVisibleToSoldierGrid( );
|
void DisplayGridNoVisibleToSoldierGrid( );
|
||||||
|
|
||||||
|
void CalculateCoverForSoldier( SOLDIERTYPE* pForSoldier, const INT32& sTargetGridNo, const BOOLEAN& fRoof, INT8& bCover );
|
||||||
|
void CalculateCoverFromSoldier( SOLDIERTYPE* pFromSoldier, const INT32& sTargetGridNo, const BOOLEAN& fRoof, INT8& bCover, SOLDIERTYPE* pToSoldier = NULL );
|
||||||
|
|
||||||
|
|
||||||
#define DC_MAX_COVER_RANGE 43 //31
|
#define DC_MAX_COVER_RANGE 43 //31
|
||||||
#define DC__SOLDIER_VISIBLE_RANGE 43 //31
|
#define DC__SOLDIER_VISIBLE_RANGE 43 //31
|
||||||
#define DC__MIN_SIZE 4
|
#define DC__MIN_SIZE 4
|
||||||
#define DC__MAX_SIZE 21 //11
|
#define DC__MAX_SIZE 21 //11
|
||||||
|
|
||||||
|
enum COVER_VALUES
|
||||||
|
{
|
||||||
|
INVALID_COVER = -1,
|
||||||
|
NO_COVER = 0,
|
||||||
|
MIN_COVER = 1,
|
||||||
|
MED_COVER = 2,
|
||||||
|
MAX_COVER = 3
|
||||||
|
};
|
||||||
|
|
||||||
// Flugente: mines display - stuff needs to be here
|
// Flugente: mines display - stuff needs to be here
|
||||||
// Sevenfm: moved here from DisplayCover.cpp
|
// Sevenfm: moved here from DisplayCover.cpp
|
||||||
enum MINES_DRAW_MODE {
|
enum MINES_DRAW_MODE {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
// sevenfm: needed for _KeyDown(SHIFT)
|
// sevenfm: needed for _KeyDown(SHIFT)
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
|
#include "DisplayCover.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "InterfaceItemImages.h"
|
#include "InterfaceItemImages.h"
|
||||||
@@ -299,9 +299,6 @@ void DoorMenuBackregionCallback( MOUSE_REGION * pRegion, INT32 iReason );
|
|||||||
|
|
||||||
UINT32 CalcUIMessageDuration( STR16 wString );
|
UINT32 CalcUIMessageDuration( STR16 wString );
|
||||||
|
|
||||||
// sevenfm: this function is needed to show cover in health bar
|
|
||||||
extern void CalculateCoverForSoldier( SOLDIERTYPE* pForSoldier, const INT32& sTargetGridNo, const BOOLEAN& fRoof, INT8& bCover );
|
|
||||||
|
|
||||||
extern FLOAT Distance2D( FLOAT dDeltaX, FLOAT dDeltaY );
|
extern FLOAT Distance2D( FLOAT dDeltaX, FLOAT dDeltaY );
|
||||||
|
|
||||||
// Flugente: toggle display of enemy role indicators
|
// Flugente: toggle display of enemy role indicators
|
||||||
|
|||||||
+24
-17
@@ -58,6 +58,7 @@
|
|||||||
#include "opplist.h"
|
#include "opplist.h"
|
||||||
#include "Sys Globals.h"//dnl ch74 201013
|
#include "Sys Globals.h"//dnl ch74 201013
|
||||||
#include "CampaignStats.h" // added by Flugente
|
#include "CampaignStats.h" // added by Flugente
|
||||||
|
#include "DisplayCover.h" // added by Flugente
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
@@ -9572,30 +9573,36 @@ BOOLEAN ApplyClothes( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fUseAPs
|
|||||||
// first, remove the covert flags, and then reapply the correct ones, in case we switch between civilian and military clothes
|
// first, remove the covert flags, and then reapply the correct ones, in case we switch between civilian and military clothes
|
||||||
pSoldier->usSoldierFlagMask &= ~(SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER);
|
pSoldier->usSoldierFlagMask &= ~(SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER);
|
||||||
|
|
||||||
// we now have to determine wether we are currently wearing civilian or military clothes
|
// we can onyl dsiguise sucessfully if we are not seen
|
||||||
for ( UINT8 i = UNIFORM_ENEMY_ADMIN; i <= UNIFORM_ENEMY_ELITE; ++i )
|
INT8 bCover = MAX_COVER;
|
||||||
|
CalculateCoverForSoldier( pSoldier, pSoldier->sGridNo, pSoldier->pathing.bLevel, bCover );
|
||||||
|
if ( bCover == MAX_COVER )
|
||||||
{
|
{
|
||||||
// both parts have to fit. We cant mix different uniforms and get soldier disguise
|
// we now have to determine wether we are currently wearing civilian or military clothes
|
||||||
if ( COMPARE_PALETTEREP_ID(pSoldier->VestPal, gUniformColors[ i ].vest) && COMPARE_PALETTEREP_ID(pSoldier->PantsPal, gUniformColors[ i ].pants) )
|
for ( UINT8 i = UNIFORM_ENEMY_ADMIN; i <= UNIFORM_ENEMY_ELITE; ++i )
|
||||||
{
|
{
|
||||||
pSoldier->usSoldierFlagMask |= SOLDIER_COVERT_SOLDIER;
|
// both parts have to fit. We cant mix different uniforms and get soldier disguise
|
||||||
|
if ( COMPARE_PALETTEREP_ID(pSoldier->VestPal, gUniformColors[ i ].vest) && COMPARE_PALETTEREP_ID(pSoldier->PantsPal, gUniformColors[ i ].pants) )
|
||||||
|
{
|
||||||
|
pSoldier->usSoldierFlagMask |= SOLDIER_COVERT_SOLDIER;
|
||||||
|
|
||||||
|
if ( pSoldier->bTeam == OUR_TEAM )
|
||||||
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_SOLDIER], pSoldier->GetName() );
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if not dressed as a soldier, we must be dressed as a civilian
|
||||||
|
if ( !(pSoldier->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER) )
|
||||||
|
{
|
||||||
|
pSoldier->usSoldierFlagMask |= SOLDIER_COVERT_CIV;
|
||||||
|
|
||||||
if ( pSoldier->bTeam == OUR_TEAM )
|
if ( pSoldier->bTeam == OUR_TEAM )
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_SOLDIER], pSoldier->GetName() );
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_CIVILIAN], pSoldier->GetName() );
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if not dressed as a soldier, we must be dressed as a civilian
|
|
||||||
if ( !(pSoldier->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER) )
|
|
||||||
{
|
|
||||||
pSoldier->usSoldierFlagMask |= SOLDIER_COVERT_CIV;
|
|
||||||
|
|
||||||
if ( pSoldier->bTeam == OUR_TEAM )
|
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_CIVILIAN], pSoldier->GetName() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// reevaluate sight - otherwise we could hide by changing clothes in plain sight!
|
// reevaluate sight - otherwise we could hide by changing clothes in plain sight!
|
||||||
OtherTeamsLookForMan(pSoldier);
|
OtherTeamsLookForMan(pSoldier);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user