|
|
@ -63,9 +63,6 @@ void CBarnacleGrapple::Precache( void ) |
|
|
|
PRECACHE_MODEL( "sprites/tongue.spr" ); |
|
|
|
PRECACHE_MODEL( "sprites/tongue.spr" ); |
|
|
|
|
|
|
|
|
|
|
|
UTIL_PrecacheOther( "grapple_tip" ); |
|
|
|
UTIL_PrecacheOther( "grapple_tip" ); |
|
|
|
m_flNextPrimaryAttack = 0; |
|
|
|
|
|
|
|
m_flNextSecondaryAttack = 0; |
|
|
|
|
|
|
|
m_flTimeWeaponIdle = 0; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CBarnacleGrapple::Spawn( void ) |
|
|
|
void CBarnacleGrapple::Spawn( void ) |
|
|
@ -110,7 +107,7 @@ int CBarnacleGrapple::AddToPlayer( CBasePlayer* pPlayer ) |
|
|
|
BOOL CBarnacleGrapple::Deploy() |
|
|
|
BOOL CBarnacleGrapple::Deploy() |
|
|
|
{ |
|
|
|
{ |
|
|
|
int r = DefaultDeploy("models/v_bgrap.mdl", "models/p_bgrap.mdl", BGRAPPLE_UP, "gauss" ); |
|
|
|
int r = DefaultDeploy("models/v_bgrap.mdl", "models/p_bgrap.mdl", BGRAPPLE_UP, "gauss" ); |
|
|
|
m_flTimeWeaponIdle = gpGlobals->time + 1.1; |
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.1; |
|
|
|
return r; |
|
|
|
return r; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -128,7 +125,7 @@ void CBarnacleGrapple::WeaponIdle( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ResetEmptySound(); |
|
|
|
ResetEmptySound(); |
|
|
|
|
|
|
|
|
|
|
|
if( m_flTimeWeaponIdle > gpGlobals->time ) |
|
|
|
if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if( m_fireState != OFF ) |
|
|
|
if( m_fireState != OFF ) |
|
|
@ -146,19 +143,19 @@ void CBarnacleGrapple::WeaponIdle( void ) |
|
|
|
if( flNextIdle <= 0.5 ) |
|
|
|
if( flNextIdle <= 0.5 ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
iAnim = BGRAPPLE_LONGIDLE; |
|
|
|
iAnim = BGRAPPLE_LONGIDLE; |
|
|
|
m_flTimeWeaponIdle = gpGlobals->time + 10.0; |
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 10.0; |
|
|
|
} |
|
|
|
} |
|
|
|
else if( flNextIdle > 0.95 ) |
|
|
|
else if( flNextIdle > 0.95 ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
EMIT_SOUND_DYN( ENT(m_pPlayer->pev), CHAN_STATIC, "weapons/bgrapple_cough.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM ); |
|
|
|
EMIT_SOUND_DYN( ENT(m_pPlayer->pev), CHAN_STATIC, "weapons/bgrapple_cough.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM ); |
|
|
|
|
|
|
|
|
|
|
|
iAnim = BGRAPPLE_COUGH; |
|
|
|
iAnim = BGRAPPLE_COUGH; |
|
|
|
m_flTimeWeaponIdle = gpGlobals->time + 4.6; |
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 4.6; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
iAnim = BGRAPPLE_BREATHE; |
|
|
|
iAnim = BGRAPPLE_BREATHE; |
|
|
|
m_flTimeWeaponIdle = gpGlobals->time + 2.566; |
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.566; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SendWeaponAnim( iAnim ); |
|
|
|
SendWeaponAnim( iAnim ); |
|
|
@ -168,7 +165,7 @@ void CBarnacleGrapple::PrimaryAttack( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( m_bMissed ) |
|
|
|
if( m_bMissed ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_flTimeWeaponIdle = gpGlobals->time + 0.1; |
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -300,7 +297,7 @@ void CBarnacleGrapple::PrimaryAttack( void ) |
|
|
|
|
|
|
|
|
|
|
|
m_pPlayer->m_iWeaponVolume = 450; |
|
|
|
m_pPlayer->m_iWeaponVolume = 450; |
|
|
|
|
|
|
|
|
|
|
|
m_flTimeWeaponIdle = gpGlobals->time + 0.1; |
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1; |
|
|
|
#ifndef CLIENT_DLL |
|
|
|
#ifndef CLIENT_DLL |
|
|
|
if( g_pGameRules->IsMultiplayer() ) |
|
|
|
if( g_pGameRules->IsMultiplayer() ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -317,7 +314,7 @@ void CBarnacleGrapple::PrimaryAttack( void ) |
|
|
|
|
|
|
|
|
|
|
|
if( !m_pTip ) |
|
|
|
if( !m_pTip ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_flNextPrimaryAttack = gpGlobals->time + 0.01; |
|
|
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.01; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -425,7 +422,7 @@ void CBarnacleGrapple::PrimaryAttack( void ) |
|
|
|
else |
|
|
|
else |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_flNextPrimaryAttack = gpGlobals->time + 0.01; |
|
|
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.01; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -466,9 +463,9 @@ void CBarnacleGrapple::EndAttack( void ) |
|
|
|
|
|
|
|
|
|
|
|
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/bgrapple_pull.wav", 0.0, ATTN_NONE, SND_STOP, 100 ); |
|
|
|
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/bgrapple_pull.wav", 0.0, ATTN_NONE, SND_STOP, 100 ); |
|
|
|
|
|
|
|
|
|
|
|
m_flTimeWeaponIdle = gpGlobals->time + 0.9; |
|
|
|
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.9; |
|
|
|
|
|
|
|
|
|
|
|
m_flNextPrimaryAttack = gpGlobals->time + 0.01; |
|
|
|
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.01; |
|
|
|
|
|
|
|
|
|
|
|
DestroyEffect(); |
|
|
|
DestroyEffect(); |
|
|
|
|
|
|
|
|
|
|
|