//----------------------------------------------------------------------------- // Purpose: Allows firing as fast as button is pressed //----------------------------------------------------------------------------- void CWeaponAK47::ItemPostFrame( void ) { BaseClass::ItemPostFrame(); if ( m_bInReload ) { return; } CBasePlayer *pOwner = ToBasePlayer( GetOwner() ); if ( pOwner == NULL ) { return; } if ( pOwner->m_nButtons & IN_ATTACK ) { if (m_flAttackEnds<gpGlobals->curtime) { SendWeaponAnim(ACT_VM_IDLE); } } else { //The firing cycle ended. Reset the burst counter to the max value m_iBurst=BURST; if ( ( pOwner->m_nButtons & IN_ATTACK ) && ( m_flNextPrimaryAttack < gpGlobals->curtime ) && ( m_iClip1 <= 0 ) ) { DryFire(); } } CheckZoomToggle(); //check the character's current stance for the accuracy calculation GetStance(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponCrossbow::ItemPostFrame() { // Allow zoom toggling CheckZoomToggle(); if ( m_bMustReload && HasWeaponIdleTimeElapsed() ) Reload(); BaseClass::ItemPostFrame(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponShock::ItemPostFrame( void ) { // Allow zoom toggling CheckZoomToggle(); if ( m_bMustReload && HasWeaponIdleTimeElapsed() ) { Reload(); } BaseClass::ItemPostFrame(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponGrapple::ItemPostFrame(void) { // Allow zoom toggling CheckZoomToggle(); CBasePlayer *pOwner = ToBasePlayer(GetOwner()); if ((pOwner->m_nButtons & IN_ATTACK)) { if (m_flNextPrimaryAttack < gpGlobals->curtime) { PrimaryAttack(); } } else if (m_bMustReload) //&& HasWeaponIdleTimeElapsed() ) { Reload(); } #ifndef CLIENT_DLL if (m_hHook) { if (m_hRope) m_hRope->RecalculateLength(); if (!(pOwner->m_nButtons & IN_ATTACK)) { m_hHook->SetTouch(NULL); m_hHook->SetThink(NULL); UTIL_Remove(m_hHook); m_hHook = NULL; NotifyHookDied(); m_bMustReload = true; } } #endif // BaseClass::ItemPostFrame(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponAK47::ItemBusyFrame( void ) { // Allow zoom toggling even when we're reloading CheckZoomToggle(); BaseClass::ItemBusyFrame(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponGrapple::ItemBusyFrame(void) { // Allow zoom toggling even when we're reloading CheckZoomToggle(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CWeaponCrossbow::ItemBusyFrame() { // Allow zoom toggling even when we're reloading CheckZoomToggle(); }
void CWeaponTranquilizer::ItemPostFrame( void ) { CheckZoomToggle(); UpdateLaserPosition(); BaseClass::ItemPostFrame(); }