|
|
|
@ -270,25 +270,25 @@ void CHudHealth::CalcDamageDirection( vec3_t vecFrom )
@@ -270,25 +270,25 @@ void CHudHealth::CalcDamageDirection( vec3_t vecFrom )
|
|
|
|
|
if( side > 0 ) |
|
|
|
|
{ |
|
|
|
|
if( side > 0.3 ) |
|
|
|
|
m_fAttackFront = max( m_fAttackFront, side ); |
|
|
|
|
m_fAttackFront = Q_max( m_fAttackFront, side ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
float f = fabs( side ); |
|
|
|
|
if( f > 0.3 ) |
|
|
|
|
m_fAttackRear = max( m_fAttackRear, f ); |
|
|
|
|
m_fAttackRear = Q_max( m_fAttackRear, f ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if( front > 0 ) |
|
|
|
|
{ |
|
|
|
|
if( front > 0.3 ) |
|
|
|
|
m_fAttackRight = max( m_fAttackRight, front ); |
|
|
|
|
m_fAttackRight = Q_max( m_fAttackRight, front ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
float f = fabs( front ); |
|
|
|
|
if( f > 0.3 ) |
|
|
|
|
m_fAttackLeft = max( m_fAttackLeft, f ); |
|
|
|
|
m_fAttackLeft = Q_max( m_fAttackLeft, f ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -310,28 +310,28 @@ int CHudHealth::DrawPain( float flTime )
@@ -310,28 +310,28 @@ int CHudHealth::DrawPain( float flTime )
|
|
|
|
|
if( m_fAttackFront > 0.4 ) |
|
|
|
|
{ |
|
|
|
|
GetPainColor( r, g, b ); |
|
|
|
|
shade = a * max( m_fAttackFront, 0.5 ); |
|
|
|
|
shade = a * Q_max( m_fAttackFront, 0.5 ); |
|
|
|
|
ScaleColors( r, g, b, shade ); |
|
|
|
|
SPR_Set( m_hSprite, r, g, b ); |
|
|
|
|
|
|
|
|
|
x = ScreenWidth / 2 - SPR_Width( m_hSprite, 0 ) / 2; |
|
|
|
|
y = ScreenHeight / 2 - SPR_Height( m_hSprite, 0 ) * 3; |
|
|
|
|
SPR_DrawAdditive( 0, x, y, NULL ); |
|
|
|
|
m_fAttackFront = max( 0, m_fAttackFront - fFade ); |
|
|
|
|
m_fAttackFront = Q_max( 0, m_fAttackFront - fFade ); |
|
|
|
|
} else |
|
|
|
|
m_fAttackFront = 0; |
|
|
|
|
|
|
|
|
|
if( m_fAttackRight > 0.4 ) |
|
|
|
|
{ |
|
|
|
|
GetPainColor( r, g, b ); |
|
|
|
|
shade = a * max( m_fAttackRight, 0.5 ); |
|
|
|
|
shade = a * Q_max( m_fAttackRight, 0.5 ); |
|
|
|
|
ScaleColors( r, g, b, shade ); |
|
|
|
|
SPR_Set( m_hSprite, r, g, b ); |
|
|
|
|
|
|
|
|
|
x = ScreenWidth / 2 + SPR_Width( m_hSprite, 1 ) * 2; |
|
|
|
|
y = ScreenHeight / 2 - SPR_Height( m_hSprite,1 ) / 2; |
|
|
|
|
SPR_DrawAdditive( 1, x, y, NULL ); |
|
|
|
|
m_fAttackRight = max( 0, m_fAttackRight - fFade ); |
|
|
|
|
m_fAttackRight = Q_max( 0, m_fAttackRight - fFade ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
m_fAttackRight = 0; |
|
|
|
@ -339,14 +339,14 @@ int CHudHealth::DrawPain( float flTime )
@@ -339,14 +339,14 @@ int CHudHealth::DrawPain( float flTime )
|
|
|
|
|
if( m_fAttackRear > 0.4 ) |
|
|
|
|
{ |
|
|
|
|
GetPainColor( r, g, b ); |
|
|
|
|
shade = a * max( m_fAttackRear, 0.5 ); |
|
|
|
|
shade = a * Q_max( m_fAttackRear, 0.5 ); |
|
|
|
|
ScaleColors( r, g, b, shade ); |
|
|
|
|
SPR_Set( m_hSprite, r, g, b ); |
|
|
|
|
|
|
|
|
|
x = ScreenWidth / 2 - SPR_Width( m_hSprite, 2 ) / 2; |
|
|
|
|
y = ScreenHeight / 2 + SPR_Height( m_hSprite, 2 ) * 2; |
|
|
|
|
SPR_DrawAdditive( 2, x, y, NULL ); |
|
|
|
|
m_fAttackRear = max( 0, m_fAttackRear - fFade ); |
|
|
|
|
m_fAttackRear = Q_max( 0, m_fAttackRear - fFade ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
m_fAttackRear = 0; |
|
|
|
@ -354,7 +354,7 @@ int CHudHealth::DrawPain( float flTime )
@@ -354,7 +354,7 @@ int CHudHealth::DrawPain( float flTime )
|
|
|
|
|
if( m_fAttackLeft > 0.4 ) |
|
|
|
|
{ |
|
|
|
|
GetPainColor( r, g, b ); |
|
|
|
|
shade = a * max( m_fAttackLeft, 0.5 ); |
|
|
|
|
shade = a * Q_max( m_fAttackLeft, 0.5 ); |
|
|
|
|
ScaleColors( r, g, b, shade ); |
|
|
|
|
SPR_Set( m_hSprite, r, g, b ); |
|
|
|
|
|
|
|
|
@ -362,7 +362,7 @@ int CHudHealth::DrawPain( float flTime )
@@ -362,7 +362,7 @@ int CHudHealth::DrawPain( float flTime )
|
|
|
|
|
y = ScreenHeight / 2 - SPR_Height( m_hSprite,3 ) / 2; |
|
|
|
|
SPR_DrawAdditive( 3, x, y, NULL ); |
|
|
|
|
|
|
|
|
|
m_fAttackLeft = max( 0, m_fAttackLeft - fFade ); |
|
|
|
|
m_fAttackLeft = Q_max( 0, m_fAttackLeft - fFade ); |
|
|
|
|
} else |
|
|
|
|
m_fAttackLeft = 0; |
|
|
|
|
|
|
|
|
@ -394,7 +394,7 @@ int CHudHealth::DrawDamage( float flTime )
@@ -394,7 +394,7 @@ int CHudHealth::DrawDamage( float flTime )
|
|
|
|
|
SPR_Set( gHUD.GetSprite( m_HUD_dmg_bio + i ), r, g, b ); |
|
|
|
|
SPR_DrawAdditive( 0, pdmg->x, pdmg->y, &gHUD.GetSpriteRect( m_HUD_dmg_bio + i ) ); |
|
|
|
|
|
|
|
|
|
pdmg->fExpire = min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire ); |
|
|
|
|
pdmg->fExpire = Q_min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire ); |
|
|
|
|
|
|
|
|
|
if( pdmg->fExpire <= flTime // when the time has expired
|
|
|
|
|
&& a < 40 ) // and the flash is at the low point of the cycle
|
|
|
|
|