mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged from revision: 7114
Updates/Fixes (by Sevenfm) 1. Added grenade throwing range modifier to item_settings.ini: RANGE_GRENADE_MODIFIER = 1.0 This modifier is applied to grenades and regular thrown items. 2. Changed 100 to bBreathMax in throwing range penalty calculation. This should make grenades more useful. 3. Minor visual fixes (alt healthbar placement, 'roof' text placement when SHOW_ENEMY_WEAPON is true ) 4. Added xml tags for merge type <13>: you can use u.knife on tripwire roll to get 2 tripwires. Status of tripwire roll will be reduced by 2 points. Also lookup table for merges is updated for xml editor to work correctly. 5. Added several new loadscreenhints. 6. Press 'y' in tactical for quick transformation of item in hand - useful for switching flashlights on and off. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7116 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+175
-143
@@ -1944,7 +1944,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)(sYPos ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
fRaiseName = TRUE;
|
||||
}
|
||||
else if ( gfUIMouseOnValidCatcher == 3 && pSoldier->ubID == gubUIValidCatcherID )
|
||||
@@ -1953,7 +1952,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)(sYPos ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
fRaiseName = TRUE;
|
||||
}
|
||||
else if ( gfUIMouseOnValidCatcher == 4 && pSoldier->ubID == gubUIValidCatcherID )
|
||||
@@ -1962,7 +1960,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)(sYPos ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
fRaiseName = TRUE;
|
||||
}
|
||||
else if ( pSoldier->bAssignment >= ON_DUTY )
|
||||
@@ -1972,7 +1969,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)(sYPos ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
fRaiseName = TRUE;
|
||||
}
|
||||
else if ( pSoldier->bTeam == gbPlayerNum && pSoldier->bAssignment < ON_DUTY && pSoldier->bAssignment != CurrentSquad() && !( pSoldier->flags.uiStatusFlags & SOLDIER_MULTI_SELECTED ) )
|
||||
@@ -1985,7 +1981,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)(sYPos ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
fRaiseName = TRUE;
|
||||
}
|
||||
|
||||
@@ -2043,7 +2038,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos - 10 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2081,7 +2075,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, sYPos, (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2096,7 +2089,7 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
INT16 interval = gGameExternalOptions.ubShowHealthBarsOnHead;
|
||||
//if( interval > 3 )
|
||||
// interval -= 2;
|
||||
sXPos += 27;
|
||||
sXPos += 28;
|
||||
sYPos += 7;
|
||||
iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sXPos, sYPos-1, (INT16)(sXPos + 24 ), (INT16)(sYPos + 3 + interval*3 ) );
|
||||
if ( iBack != -1 )
|
||||
@@ -2120,7 +2113,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
SetFontForeground( FONT_MCOLOR_DKRED );
|
||||
gprintfdirty( sXPos-2-len, sYPos-2, NameStr );
|
||||
mprintf( sXPos-2-len, sYPos-2, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2173,7 +2165,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)(sYPos + 10 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2186,7 +2177,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + 10 ), (INT16)(80 ), 1, pStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, pStr );
|
||||
mprintf( sX, sY, pStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
|
||||
//-----------------
|
||||
if ( pSoldier->bInSector && pSoldier->ubProfile == NO_PROFILE )
|
||||
@@ -2205,7 +2195,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + 20 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
else if (gGameExternalOptions.fEnemyNames == TRUE && gGameExternalOptions.fEnemyRank == FALSE)
|
||||
{
|
||||
@@ -2225,7 +2214,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + 20 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2250,7 +2238,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + 20 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2271,7 +2258,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + 20 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
else if (gGameExternalOptions.fCivGroupName == TRUE && pSoldier->ubCivilianGroup > 0 )
|
||||
{
|
||||
@@ -2287,7 +2273,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + 20 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2297,18 +2282,21 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
}
|
||||
else //pSoldier->ubProfile != NO_PROFILE || ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
// show (roof) text
|
||||
if ( pSoldier->pathing.bLevel != 0 )
|
||||
{
|
||||
// Display name
|
||||
// sevenfm: fix for overlapping with SHOW_ENEMY_WEAPON feature
|
||||
if( !gGameExternalOptions.fShowEnemyWeapon || !gfUIFullTargetFound )
|
||||
{
|
||||
SetFont( TINYFONT1 );
|
||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
||||
SetFontForeground( FONT_YELLOW );
|
||||
|
||||
swprintf( NameStr, gzLateLocalizedString[ 15 ] );
|
||||
FindFontCenterCoordinates( sXPos, (INT16)(sYPos + 10 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
FindFontCenterCoordinates( sXPos, (INT16)(sYPos + 10), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
pStr = GetSoldierHealthString( pSoldier );
|
||||
@@ -2326,7 +2314,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, sYPos, (INT16)(80 ), 1, pStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, pStr );
|
||||
mprintf( sX, sY, pStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
|
||||
//-----------------
|
||||
if ( pSoldier->bInSector && pSoldier->ubProfile == NO_PROFILE )
|
||||
@@ -2345,7 +2332,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos -10 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -2364,7 +2350,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + 20 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
}
|
||||
else if (gGameExternalOptions.fEnemyNames == TRUE)
|
||||
{
|
||||
@@ -2384,7 +2369,6 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + 20 ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2416,135 +2400,21 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
//legion2
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// show weapon name and additional info
|
||||
BOOLEAN showExactInfo = FALSE;
|
||||
INT16 height = 0;
|
||||
SOLDIERTYPE *pSelectedSoldier, *pTargetSoldier;
|
||||
|
||||
pSelectedSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
pTargetSoldier = pSoldier;
|
||||
// calc max range for exact info
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
showExactInfo = ShowExactInfo( pSelectedSoldier, pTargetSoldier );
|
||||
//FindFontCenterCoordinates( sXPos, (INT16)( sYPos ), (INT16)(80 ), 1, L"", TINYFONT1, &sX, &sY );
|
||||
|
||||
// show weapon/armour/items info
|
||||
if ( gGameExternalOptions.fShowEnemyWeapon && gTacticalStatus.ubCurrentTeam == OUR_TEAM && pTargetSoldier->ubBodyType <= REGFEMALE )
|
||||
{
|
||||
height = 30;
|
||||
|
||||
SetFont( TINYFONT1 );
|
||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
||||
|
||||
if( !gGameExternalOptions.fEnemyRank || !gGameExternalOptions.fEnemyNames )
|
||||
height = 10;
|
||||
|
||||
swprintf( NameStr, L"" );
|
||||
GetEnemyInfoString( pSelectedSoldier, pTargetSoldier, showExactInfo, NameStr );
|
||||
// print item name
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + height ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
maxWidth = __max( maxWidth, StringPixLength ( NameStr, TINYFONT1 ) );
|
||||
// sevenfm: show weapon name and additional info
|
||||
ShowEnemyWeapon( sX, sY, pSoldier );
|
||||
ShowEnemyHealthBar( sX, sY, pSoldier );
|
||||
ShowAdditionalInfo( sX, sY, pSoldier );
|
||||
ShowRankIcon( sXPos, sYPos, pSoldier );
|
||||
}
|
||||
|
||||
height = 0;
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + height ), (INT16)(80 ), 1, L"", TINYFONT1, &sX, &sY );
|
||||
|
||||
// show enemy health bar
|
||||
if( gGameExternalOptions.ubShowEnemyHealth > 1 && gTacticalStatus.ubCurrentTeam == OUR_TEAM )
|
||||
{
|
||||
UINT8 ubLines = gGameExternalOptions.ubShowEnemyHealth - 1;
|
||||
INT32 iBarWidth = 24;
|
||||
INT32 iBarHeight;
|
||||
|
||||
iBarHeight = 2 + 3 * ubLines - 1;
|
||||
sY += 10;
|
||||
sY -= iBarHeight;
|
||||
sX -= iBarWidth / 2;
|
||||
|
||||
iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + iBarWidth), (INT16)(sY + iBarHeight ) );
|
||||
if ( iBack != -1 )
|
||||
SetBackgroundRectFilled( iBack );
|
||||
|
||||
DrawEnemyHealthBar( pSoldier, sX, sY, ubLines, iBarWidth - 2, iBarHeight );
|
||||
}
|
||||
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + height ), (INT16)(80 ), 1, L"", TINYFONT1, &sX, &sY );
|
||||
sX-=maxWidth / 2 + StringPixLength ( L"***", TINYFONT1 );
|
||||
|
||||
// show additional info
|
||||
if( gGameExternalOptions.fShowEnemyAwareness && gTacticalStatus.ubCurrentTeam == OUR_TEAM )
|
||||
{
|
||||
SetFont( TINYFONT1 );
|
||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
||||
// show awareness sign only when in stealth mode or disguised
|
||||
if( ( gusSelectedSoldier != NOBODY ) &&
|
||||
( MercPtrs[ gusSelectedSoldier ]->bStealthMode || MercPtrs[ gusSelectedSoldier ]->bSoldierFlagMask & ( SOLDIER_COVERT_CIV | SOLDIER_COVERT_SOLDIER ) ) )
|
||||
{
|
||||
if( pSoldier->aiData.bOppList[ MercPtrs[ gusSelectedSoldier ]->ubID ] == SEEN_CURRENTLY )
|
||||
swprintf( NameStr, L"%s", L"<*>" );
|
||||
else
|
||||
swprintf( NameStr, L"%s", L"<->" );
|
||||
|
||||
SetFontForeground( FONT_GRAY1 );
|
||||
switch ( pSoldier->aiData.bAlertStatus )
|
||||
{
|
||||
case STATUS_GREEN: // everything's OK, no suspicion
|
||||
SetFontForeground( FONT_GREEN );
|
||||
break;
|
||||
case STATUS_YELLOW: // he or his friend heard something
|
||||
SetFontForeground( FONT_YELLOW );
|
||||
break;
|
||||
case STATUS_RED: // has definite evidence of opponent
|
||||
SetFontForeground( FONT_ORANGE );
|
||||
break;
|
||||
case STATUS_BLACK: // currently sees an active opponent
|
||||
SetFontForeground( FONT_DKRED );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( showExactInfo )
|
||||
{
|
||||
if( gGameExternalOptions.ubShowEnemyHealth > 1 )
|
||||
{
|
||||
gprintfdirty( sX + maxWidth / 2 - 15, sY + height, NameStr );
|
||||
mprintf( sX + maxWidth / 2 - 13, sY + height, NameStr );
|
||||
}
|
||||
else
|
||||
{
|
||||
gprintfdirty( sX, sY + height, NameStr );
|
||||
mprintf( sX, sY + height, NameStr );
|
||||
}
|
||||
height += 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
// show rank icon
|
||||
if( gGameExternalOptions.ubShowEnemyRankIcon && gTacticalStatus.ubCurrentTeam == OUR_TEAM )
|
||||
//&& (!gGameExternalOptions.fEnemyNames) && (!gGameExternalOptions.fEnemyRank))
|
||||
{
|
||||
sX = sXPos + 50;
|
||||
sY = sYPos + 17;
|
||||
if(gGameExternalOptions.fEnemyNames)
|
||||
sY+=10;
|
||||
if(gGameExternalOptions.fEnemyRank)
|
||||
sY+=10;
|
||||
|
||||
iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + 22 ), (INT16)(sY + 14 ) );
|
||||
if ( iBack != -1 )
|
||||
SetBackgroundRectFilled( iBack );
|
||||
|
||||
DrawRankIcon( pSoldier->stats.bExpLevel, sX, sY );
|
||||
}
|
||||
}
|
||||
// Flugente: soldier profiles
|
||||
else if ( pSoldier->bTeam == MILITIA_TEAM && gGameExternalOptions.fSoldierProfiles_Militia && pSoldier->usSoldierProfile )
|
||||
{
|
||||
@@ -2574,6 +2444,9 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
}
|
||||
// sevenfm: show weapon name and additional info
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos ), (INT16)(80 ), 1, L"", TINYFONT1, &sX, &sY );
|
||||
ShowEnemyWeapon( sX, sY, pSoldier );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6316,12 +6189,15 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
|
||||
{
|
||||
case AIM_SHOT_HEAD:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_HELMET] );
|
||||
//swprintf( NameStr, L"%s", L"Helmet" );
|
||||
break;
|
||||
case AIM_SHOT_TORSO:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_VEST] );
|
||||
//swprintf( NameStr, L"%s", L"Vest" );
|
||||
break;
|
||||
case AIM_SHOT_LEGS:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_LEGGINGS] );
|
||||
//swprintf( NameStr, L"%s", L"Leggings" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -6424,6 +6300,162 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShowEnemyWeapon( INT16 sX, INT16 sY, SOLDIERTYPE* pTargetSoldier )
|
||||
{
|
||||
SOLDIERTYPE *pSelectedSoldier;
|
||||
BOOLEAN showExactInfo = FALSE;
|
||||
CHAR16 NameStr[ MAX_ENEMY_NAMES_CHARS ];
|
||||
UINT16 usTotalWidth;
|
||||
INT32 iRange;
|
||||
INT32 iVisibleDistance;
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
pSelectedSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
else
|
||||
return;
|
||||
|
||||
if( gGameExternalOptions.fEnemyRank || gGameExternalOptions.fEnemyNames )
|
||||
return;
|
||||
|
||||
iRange = GetRangeInCellCoordsFromGridNoDiff( pSelectedSoldier->sGridNo, pTargetSoldier->sGridNo ) / 10;
|
||||
iVisibleDistance = (INT32)( pSelectedSoldier->GetMaxDistanceVisible( pTargetSoldier->sGridNo, 0, CALC_FROM_WANTED_DIR) ) ;
|
||||
|
||||
if( iRange > iVisibleDistance )
|
||||
return;
|
||||
|
||||
if( !pTargetSoldier->bVisible )
|
||||
return;
|
||||
|
||||
// calc max range for exact info
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
showExactInfo = ShowExactInfo( pSelectedSoldier, pTargetSoldier );
|
||||
|
||||
// show weapon/armour/items info
|
||||
if ( gGameExternalOptions.fShowEnemyWeapon && gTacticalStatus.ubCurrentTeam == OUR_TEAM && pTargetSoldier->ubBodyType <= REGFEMALE )
|
||||
{
|
||||
SetFont( TINYFONT1 );
|
||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
||||
|
||||
swprintf( NameStr, L"" );
|
||||
GetEnemyInfoString( pSelectedSoldier, pTargetSoldier, showExactInfo, NameStr );
|
||||
usTotalWidth = StringPixLength ( NameStr, TINYFONT1 );
|
||||
sX -= usTotalWidth/2;
|
||||
|
||||
// print item name
|
||||
gprintfdirty( sX, sY + 10, NameStr );
|
||||
mprintf( sX, sY + 10, NameStr );
|
||||
}
|
||||
}
|
||||
|
||||
void ShowAdditionalInfo( INT16 sX, INT16 sY, SOLDIERTYPE* pTargetSoldier )
|
||||
{
|
||||
BOOLEAN showExactInfo;
|
||||
CHAR16 NameStr[ MAX_ENEMY_NAMES_CHARS ];
|
||||
SOLDIERTYPE *pSelectedSoldier;
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
pSelectedSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
else
|
||||
return;
|
||||
|
||||
if( gGameExternalOptions.fEnemyRank || gGameExternalOptions.fEnemyNames )
|
||||
return;
|
||||
|
||||
// calc max range for exact info
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
showExactInfo = ShowExactInfo( pSelectedSoldier, pTargetSoldier );
|
||||
|
||||
sX -= StringPixLength ( L"*", TINYFONT1 );
|
||||
if( gGameExternalOptions.fShowEnemyAwareness && gTacticalStatus.ubCurrentTeam == OUR_TEAM )
|
||||
{
|
||||
SetFont( TINYFONT1 );
|
||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
||||
// show awareness sign only when in stealth mode or disguised
|
||||
if( ( gusSelectedSoldier != NOBODY ) &&
|
||||
( MercPtrs[ gusSelectedSoldier ]->bStealthMode || MercPtrs[ gusSelectedSoldier ]->bSoldierFlagMask & ( SOLDIER_COVERT_CIV | SOLDIER_COVERT_SOLDIER ) ) )
|
||||
{
|
||||
if( pTargetSoldier->aiData.bOppList[ MercPtrs[ gusSelectedSoldier ]->ubID ] == SEEN_CURRENTLY )
|
||||
swprintf( NameStr, L"%s", L"*" );
|
||||
else
|
||||
swprintf( NameStr, L"%s", L"-" );
|
||||
|
||||
SetFontForeground( FONT_GRAY1 );
|
||||
switch ( pTargetSoldier->aiData.bAlertStatus )
|
||||
{
|
||||
case STATUS_GREEN: // everything's OK, no suspicion
|
||||
SetFontForeground( FONT_GREEN );
|
||||
break;
|
||||
case STATUS_YELLOW: // he or his friend heard something
|
||||
SetFontForeground( FONT_YELLOW );
|
||||
break;
|
||||
case STATUS_RED: // has definite evidence of opponent
|
||||
SetFontForeground( FONT_ORANGE );
|
||||
break;
|
||||
case STATUS_BLACK: // currently sees an active opponent
|
||||
SetFontForeground( FONT_DKRED );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( showExactInfo )
|
||||
{
|
||||
// this feature is a part of 'show enemy health bar'
|
||||
if( gGameExternalOptions.ubShowEnemyHealth > 1 )
|
||||
{
|
||||
gprintfdirty( sX - 15, sY, NameStr );
|
||||
mprintf( sX - 15, sY, NameStr );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShowEnemyHealthBar( INT16 sX, INT16 sY, SOLDIERTYPE* pSoldier )
|
||||
{
|
||||
INT32 iBack;
|
||||
UINT8 ubLines = gGameExternalOptions.ubShowEnemyHealth - 1;
|
||||
INT32 iBarWidth = 24;
|
||||
INT32 iBarHeight;
|
||||
|
||||
// show enemy health bar
|
||||
if( gGameExternalOptions.ubShowEnemyHealth > 1 && gTacticalStatus.ubCurrentTeam == OUR_TEAM )
|
||||
{
|
||||
iBarHeight = 2 + 3 * ubLines - 1;
|
||||
sY += 10;
|
||||
sY -= iBarHeight;
|
||||
sX -= iBarWidth / 2;
|
||||
|
||||
iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + iBarWidth), (INT16)(sY + iBarHeight ) );
|
||||
if ( iBack != -1 )
|
||||
SetBackgroundRectFilled( iBack );
|
||||
|
||||
DrawEnemyHealthBar( pSoldier, sX, sY, ubLines, iBarWidth - 2, iBarHeight );
|
||||
}
|
||||
}
|
||||
|
||||
void ShowRankIcon( INT16 sXPos, INT16 sYPos, SOLDIERTYPE* pSoldier )
|
||||
{
|
||||
INT32 iBack;
|
||||
INT16 sX, sY;
|
||||
|
||||
if( gGameExternalOptions.ubShowEnemyRankIcon && gTacticalStatus.ubCurrentTeam == OUR_TEAM )
|
||||
//&& (!gGameExternalOptions.fEnemyNames) && (!gGameExternalOptions.fEnemyRank))
|
||||
{
|
||||
sX = sXPos + 50;
|
||||
sY = sYPos + 17;
|
||||
if(gGameExternalOptions.fEnemyNames)
|
||||
sY+=10;
|
||||
if(gGameExternalOptions.fEnemyRank)
|
||||
sY+=10;
|
||||
|
||||
iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + 11 ), (INT16)(sY + 14 ) );
|
||||
if ( iBack != -1 )
|
||||
SetBackgroundRectFilled( iBack );
|
||||
|
||||
DrawRankIcon( pSoldier->stats.bExpLevel, sX, sY );
|
||||
}
|
||||
}
|
||||
|
||||
void DrawLine( INT32 x1, INT32 y1, INT32 x2, INT32 y2, UINT16 color8, UINT16 color16, UINT8 *pDestBuf )
|
||||
{
|
||||
if(gbPixelDepth==16)
|
||||
|
||||
Reference in New Issue
Block a user