//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFWeaponBaseMelee::DoViewModelAnimation( void ) { Activity act = ( m_iWeaponMode == TF_WEAPON_PRIMARY_MODE ) ? ACT_VM_HITCENTER : ACT_VM_SWINGHARD; if (IsCurrentAttackACritical()) act = ACT_VM_SWINGHARD; SendWeaponAnim( act ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFHammerfists::DoViewModelAnimation( void ) { Activity act; if ( IsCurrentAttackACritical() ) { act = ACT_VM_SWINGHARD; } else { act = ( m_iWeaponMode == TF_WEAPON_PRIMARY_MODE ) ? ACT_VM_HITLEFT : ACT_VM_HITRIGHT; } SendWeaponAnim( act ); }
// ----------------------------------------------------------------------------- // Purpose: // ----------------------------------------------------------------------------- void CTFWeaponBaseMelee::PrimaryAttack() { // Get the current player. CTFPlayer *pPlayer = GetTFPlayerOwner(); if ( !pPlayer ) return; if ( !CanAttack() ) return; // Set the weapon usage mode - primary, secondary. m_iWeaponMode = TF_WEAPON_PRIMARY_MODE; m_bConnected = false; // Swing the weapon. Swing( pPlayer ); #if !defined( CLIENT_DLL ) pPlayer->SpeakWeaponFire(); CTF_GameStats.Event_PlayerFiredWeapon( pPlayer, IsCurrentAttackACritical() ); #endif }