|
|
|
@ -107,7 +107,7 @@ BOOL CWeaponEinarShovel::Deploy()
@@ -107,7 +107,7 @@ BOOL CWeaponEinarShovel::Deploy()
|
|
|
|
|
|
|
|
|
|
void CWeaponEinarShovel::Holster( int skiplocal /* = 0 */ ) |
|
|
|
|
{ |
|
|
|
|
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; |
|
|
|
|
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; |
|
|
|
|
SendWeaponAnim( SHOVEL_HOLSTER ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -116,7 +116,7 @@ void CWeaponEinarShovel::PrimaryAttack()
@@ -116,7 +116,7 @@ void CWeaponEinarShovel::PrimaryAttack()
|
|
|
|
|
if( !Swing( 1 ) ) |
|
|
|
|
{ |
|
|
|
|
SetThink( &CWeaponEinarShovel::SwingAgain ); |
|
|
|
|
pev->nextthink = gpGlobals->time + 0.1; |
|
|
|
|
pev->nextthink = gpGlobals->time + 0.1f; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -143,10 +143,10 @@ int CWeaponEinarShovel::Swing( int fFirst )
@@ -143,10 +143,10 @@ int CWeaponEinarShovel::Swing( int fFirst )
|
|
|
|
|
UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); |
|
|
|
|
|
|
|
|
|
#ifndef CLIENT_DLL |
|
|
|
|
if( tr.flFraction >= 1.0 ) |
|
|
|
|
if( tr.flFraction >= 1.0f ) |
|
|
|
|
{ |
|
|
|
|
UTIL_TraceHull( vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT( m_pPlayer->pev ), &tr ); |
|
|
|
|
if( tr.flFraction < 1.0 ) |
|
|
|
|
if( tr.flFraction < 1.0f ) |
|
|
|
|
{ |
|
|
|
|
// Calculate the point of intersection of the line (or hull) and the object we hit
|
|
|
|
|
// This is and approximation of the "best" intersection
|
|
|
|
@ -157,12 +157,12 @@ int CWeaponEinarShovel::Swing( int fFirst )
@@ -157,12 +157,12 @@ int CWeaponEinarShovel::Swing( int fFirst )
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
if( tr.flFraction >= 1.0 ) |
|
|
|
|
if( tr.flFraction >= 1.0f ) |
|
|
|
|
{ |
|
|
|
|
if( fFirst ) |
|
|
|
|
{ |
|
|
|
|
// miss
|
|
|
|
|
if( RANDOM_FLOAT( 0.0, 1.0 ) <= 0.25 ) |
|
|
|
|
if( RANDOM_FLOAT( 0.0f, 1.0f ) <= 0.25f ) |
|
|
|
|
++m_iSwing; |
|
|
|
|
switch( ( m_iSwing++ ) % 2 ) |
|
|
|
|
{ |
|
|
|
@ -176,7 +176,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
@@ -176,7 +176,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
|
|
|
|
|
SendWeaponAnim( SHOVEL_ATTACK3MISS ); |
|
|
|
|
break;*/ |
|
|
|
|
} |
|
|
|
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5; |
|
|
|
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f; |
|
|
|
|
|
|
|
|
|
// player "shoot" animation
|
|
|
|
|
m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); |
|
|
|
@ -211,7 +211,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
@@ -211,7 +211,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
|
|
|
|
|
CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); |
|
|
|
|
|
|
|
|
|
// play thwack, smack, or dong sound
|
|
|
|
|
float flVol = 1.0; |
|
|
|
|
float flVol = 1.0f; |
|
|
|
|
int fHitWorld = TRUE; |
|
|
|
|
|
|
|
|
|
if( pEntity ) |
|
|
|
@ -222,17 +222,17 @@ int CWeaponEinarShovel::Swing( int fFirst )
@@ -222,17 +222,17 @@ int CWeaponEinarShovel::Swing( int fFirst )
|
|
|
|
|
if( g_pGameRules->IsMultiplayer() ) |
|
|
|
|
{ |
|
|
|
|
// more damage in multiplayer
|
|
|
|
|
flDmg = gSkillData.plrDmgCrowbar * 1.6; |
|
|
|
|
flDmg = gSkillData.plrDmgCrowbar * 1.6f; |
|
|
|
|
} |
|
|
|
|
else if( m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) |
|
|
|
|
else if( m_flNextPrimaryAttack + 1.0f < UTIL_WeaponTimeBase() ) |
|
|
|
|
{ |
|
|
|
|
// first swing does full damage
|
|
|
|
|
flDmg = gSkillData.plrDmgCrowbar * 1.2; |
|
|
|
|
flDmg = gSkillData.plrDmgCrowbar * 1.2f; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// subsequent swings do half
|
|
|
|
|
flDmg = gSkillData.plrDmgCrowbar * 0.6; |
|
|
|
|
flDmg = gSkillData.plrDmgCrowbar * 0.6f; |
|
|
|
|
} |
|
|
|
|
pEntity->TraceAttack( m_pPlayer->pev, flDmg, gpGlobals->v_forward, &tr, DMG_CLUB ); |
|
|
|
|
ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); |
|
|
|
@ -277,7 +277,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
@@ -277,7 +277,7 @@ int CWeaponEinarShovel::Swing( int fFirst )
|
|
|
|
|
if( !pEntity->IsAlive() ) |
|
|
|
|
return TRUE; |
|
|
|
|
else |
|
|
|
|
flVol = 0.1; |
|
|
|
|
flVol = 0.1f; |
|
|
|
|
|
|
|
|
|
fHitWorld = FALSE; |
|
|
|
|
} |
|
|
|
@ -315,10 +315,10 @@ int CWeaponEinarShovel::Swing( int fFirst )
@@ -315,10 +315,10 @@ int CWeaponEinarShovel::Swing( int fFirst )
|
|
|
|
|
|
|
|
|
|
m_pPlayer->m_iWeaponVolume = flVol * SHOVEL_WALLHIT_VOLUME; |
|
|
|
|
#endif |
|
|
|
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; |
|
|
|
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; |
|
|
|
|
|
|
|
|
|
SetThink( &CWeaponEinarShovel::Smack ); |
|
|
|
|
pev->nextthink = UTIL_WeaponTimeBase() + 0.2; |
|
|
|
|
pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; |
|
|
|
|
} |
|
|
|
|
#ifdef CROWBAR_IDLE_ANIM |
|
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); |
|
|
|
@ -333,22 +333,22 @@ void CWeaponEinarShovel::WeaponIdle( void )
@@ -333,22 +333,22 @@ void CWeaponEinarShovel::WeaponIdle( void )
|
|
|
|
|
{ |
|
|
|
|
int iAnim; |
|
|
|
|
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); |
|
|
|
|
if( flRand > 0.9 ) |
|
|
|
|
if( flRand > 0.9f ) |
|
|
|
|
{ |
|
|
|
|
iAnim = SHOVEL_IDLE2; |
|
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; |
|
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if( flRand > 0.5 ) |
|
|
|
|
if( flRand > 0.5f ) |
|
|
|
|
{ |
|
|
|
|
iAnim = SHOVEL_IDLE; |
|
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0; |
|
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
iAnim = SHOVEL_IDLE3; |
|
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; |
|
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
SendWeaponAnim( iAnim ); |
|
|
|
|