mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
New options in ja2_options.ini (by Sevenfm)
1) PLAYER_HIT_COUNT = 0 This works as ENEMY_HIT_COUNT option, but for player mercs. Possible values: 0 - 4 2) SOLDIER_TOOLTIP_DISPLAY_SUPPRESSION_INFO = TRUE Show additional info in tactical tooltip: - APs lost due to suppression - Suppression Tolerance - Effective Shock Level ( Shock level modified by traits and backgrounds. This value is compared with current suppression tolerance to determine "cowering" effect ) - AI morale level 3) SHOW_ENEMY_WEAPON = TRUE Show enemy weapon name above soldier - after health, name and rank. You can see exact weapon name only on short distances, range calculation is similar to dynamic tooltips and based on soldiers actual viewing range and experience. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6691 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2298,6 +2298,89 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( gGameExternalOptions.fShowEnemyWeapon )
|
||||
{
|
||||
INT16 height = 30;
|
||||
INT32 range;
|
||||
UINT32 maxExactWeaponDistance;
|
||||
BOOLEAN showExactWeaponType = FALSE;
|
||||
|
||||
if( !gGameExternalOptions.fEnemyRank || !gGameExternalOptions.fEnemyNames )
|
||||
height = 10;
|
||||
|
||||
// calc range to target
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
range = GetRangeInCellCoordsFromGridNoDiff( MercPtrs[ gusSelectedSoldier ]->sGridNo, pSoldier->sGridNo ) / 10;
|
||||
|
||||
// calc max range for exact weapon type based on visible distance
|
||||
maxExactWeaponDistance = (UINT32)( MercPtrs[ gusSelectedSoldier ]->GetMaxDistanceVisible( pSoldier->sGridNo, 0, CALC_FROM_WANTED_DIR) ) / 2 ;
|
||||
// apply experience level factor
|
||||
maxExactWeaponDistance *= 1 + (FLOAT(EffectiveExpLevel(MercPtrs[ gusSelectedSoldier ]))/ 10);
|
||||
|
||||
// check for bad weather conditions
|
||||
if ( gGameExternalOptions.gfAllowLimitedVision )
|
||||
maxExactWeaponDistance *= 1 - (FLOAT (gGameExternalOptions.ubVisDistDecreasePerRainIntensity) / 100);
|
||||
|
||||
if ( maxExactWeaponDistance >= range )
|
||||
showExactWeaponType = TRUE;
|
||||
}
|
||||
|
||||
// for testing - show calculated ranges on screen
|
||||
/*
|
||||
swprintf( NameStr, L"range=%d", range );
|
||||
gprintfdirty( sXPos + 100, sYPos + 10, NameStr );
|
||||
mprintf( sXPos + 100, sYPos + 10, NameStr );
|
||||
|
||||
swprintf( NameStr, L"max dist=%d", maxExactWeaponDistance );
|
||||
gprintfdirty( sXPos + 100, sYPos + 20, NameStr );
|
||||
mprintf( sXPos + 100, sYPos + 20, NameStr );
|
||||
*/
|
||||
|
||||
if ( WeaponInHand( pSoldier ) )
|
||||
{
|
||||
SetFont( TINYFONT1 );
|
||||
SetFontBackground( FONT_MCOLOR_BLACK );
|
||||
SetFontForeground( FONT_ORANGE );
|
||||
|
||||
if ( showExactWeaponType )
|
||||
{
|
||||
swprintf( NameStr, L"%s", ItemNames[ pSoldier->inv[ HANDPOS ].usItem ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// display general weapon class
|
||||
switch( Weapon[pSoldier->inv[ HANDPOS ].usItem].ubWeaponClass )
|
||||
{
|
||||
case HANDGUNCLASS:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_HANDGUN] );
|
||||
break;
|
||||
case SMGCLASS:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_SMG] );
|
||||
break;
|
||||
case RIFLECLASS:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_RIFLE] );
|
||||
break;
|
||||
case MGCLASS:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_MG] );
|
||||
break;
|
||||
case SHOTGUNCLASS:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_SHOTGUN] );
|
||||
break;
|
||||
case KNIFECLASS:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_KNIFE] );
|
||||
break;
|
||||
default:
|
||||
swprintf( NameStr, L"%s", gzTooltipStrings[STR_TT_HEAVY_WEAPON] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
FindFontCenterCoordinates( sXPos, (INT16)( sYPos + height ), (INT16)(80 ), 1, NameStr, TINYFONT1, &sX, &sY );
|
||||
gprintfdirty( sX, sY, NameStr );
|
||||
mprintf( sX, sY, NameStr );
|
||||
}
|
||||
}
|
||||
}
|
||||
// Flugente: soldier profiles
|
||||
else if ( pSoldier->bTeam == MILITIA_TEAM && gGameExternalOptions.fSoldierProfiles_Militia && pSoldier->usSoldierProfile )
|
||||
|
||||
Reference in New Issue
Block a user