void Grapple::StopShooting() { if (attached) DetachRope(); else Weapon::StopShooting(); }
//----------------------------------------------------------------------------- // Purpose: Give the harpoon a yank //----------------------------------------------------------------------------- void CWeaponHarpoon::YankHarpoon( void ) { CBasePlayer *pPlayer = dynamic_cast<CBasePlayer*>( GetOwner() ); if ( !pPlayer ) return; #if !defined( CLIENT_DLL ) if ( m_bActiveHarpoon && m_hHarpoon.Get() ) { // If the harpoon's impaled something, pull it towards me CBaseEntity *pTarget = m_hHarpoon->GetImpaledTarget(); if ( pTarget ) { if ( !pTarget->IsBSPModel() && pTarget->GetMoveType() != MOVETYPE_NONE ) { // Bring him to me! EmitSound( "Harpoon.Yank" ); // Get a yank vector, and raise it a little to get them off the ground if they're on it Vector vecOverHere = ( pPlayer->GetAbsOrigin() - pTarget->GetAbsOrigin() ); VectorNormalize( vecOverHere ); if ( pTarget->GetFlags() & FL_ONGROUND ) { pTarget->SetGroundEntity( NULL ); vecOverHere.z = 0.5; } pTarget->ApplyAbsVelocityImpulse( vecOverHere * 500 ); PlayAttackAnimation( ACT_VM_HAULBACK ); } } m_hHarpoon->SetThink( SUB_Remove ); m_hHarpoon->SetNextThink( gpGlobals->curtime + 5.0 ); m_hHarpoon = NULL; m_bActiveHarpoon = false; } DetachRope(); #endif }