//----------------------------------------------------------------------------- // Purpose: Secondary attack switches between satchel charge and tripmine mode // Input : // Output : //----------------------------------------------------------------------------- void CWeapon_SLAM::SecondaryAttack( void ) { CBaseCombatCharacter *pOwner = GetOwner(); if (!pOwner) { return; } if (m_bDetonatorArmed) { StartSatchelDetonate(); } }
//----------------------------------------------------------------------------- // Purpose: Secondary attack switches between satchel charge and tripmine mode // Input : // Output : //----------------------------------------------------------------------------- void CWeapon_SLAM::SecondaryAttack( void ) { return; // Nothin for now. SLAM's just a tripmine. CBaseCombatCharacter *pOwner = GetOwner(); if (!pOwner) { return; } if (m_bDetonatorArmed) { StartSatchelDetonate(); } else if (pOwner->GetAmmoCount(m_iSecondaryAmmoType) > 0) { if (m_tSlamState == SLAM_TRIPMINE_READY) { // Play sound for going to throw mode EmitSound( "Weapon_SLAM.ThrowMode" ); if (CanAttachSLAM()) { SetSlamState(SLAM_SATCHEL_ATTACH); SendWeaponAnim( ACT_SLAM_TRIPMINE_TO_STICKWALL_ND ); } else { SetSlamState(SLAM_SATCHEL_THROW); SendWeaponAnim( ACT_SLAM_TRIPMINE_TO_THROW_ND ); } } else { // Play sound for going to tripmine mode EmitSound( "Weapon_SLAM.TripMineMode" ); if (m_tSlamState == SLAM_SATCHEL_ATTACH) { SetSlamState(SLAM_TRIPMINE_READY); SendWeaponAnim( ACT_SLAM_STICKWALL_TO_TRIPMINE_ND ); } else { SetSlamState(SLAM_TRIPMINE_READY); SendWeaponAnim( ACT_SLAM_THROW_TO_TRIPMINE_ND ); } } m_flNextSecondaryAttack = gpGlobals->curtime + SequenceDuration(); } }