本文整理汇总了C++中CBaseCombatCharacter::GetActiveWeapon方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatCharacter::GetActiveWeapon方法的具体用法?C++ CBaseCombatCharacter::GetActiveWeapon怎么用?C++ CBaseCombatCharacter::GetActiveWeapon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseCombatCharacter
的用法示例。
在下文中一共展示了CBaseCombatCharacter::GetActiveWeapon方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Weapon_Switch
//-----------------------------------------------------------------------------
// Purpose: Switch to next best weapon
// Input :
// Output :
//-----------------------------------------------------------------------------
void CWeapon_SLAM::Weapon_Switch( void )
{
// Note that we may pick the SLAM again, when we switch
// weapons, in which case we have to save and restore the
// detonator armed state.
// The SLAMs may be about to blow up, but haven't done so yet
// and the deploy function will find the undetonated charges
// and we are armed
bool saveState = m_bDetonatorArmed;
CBaseCombatCharacter *pOwner = GetOwner();
pOwner->SwitchToNextBestWeapon( pOwner->GetActiveWeapon() );
if (pOwner->GetActiveWeapon() == this)
{
m_bDetonatorArmed = saveState;
}
#ifndef CLIENT_DLL
// If not armed and have no ammo
if (!m_bDetonatorArmed && pOwner->GetAmmoCount(m_iSecondaryAmmoType) <= 0)
{
pOwner->ClearActiveWeapon();
}
#endif
}
示例2: OnReloadOffscreen
//-----------------------------------------------------------------------------
// Purpose: Put the rocket back on the end of the rocket launcher after we reload it.
//-----------------------------------------------------------------------------
void CGEWeaponRocketLauncher::OnReloadOffscreen(void)
{
BaseClass::OnReloadOffscreen();
CBaseCombatCharacter *pOwner = GetOwner();
if (!pOwner)
return;
if (pOwner->GetActiveWeapon() == this)
SwitchBodygroup(1, 0);
}
示例3: OnReloadOffscreen
void CWeaponShotgun::OnReloadOffscreen(void)
{
BaseClass::OnReloadOffscreen();
CBaseCombatCharacter *pOwner = GetOwner();
if (!pOwner)
return;
if (pOwner->GetActiveWeapon() == this)
CalculateShellVis(true); // Check shell count when we reload, but adjust for the amount of ammo we're about to take out of the clip.
}
示例4: WeaponSwitch
void CWeapon_Manhack::WeaponSwitch( void )
{
CBaseCombatCharacter *pOwner = GetOwner();
if (pOwner==NULL) return;
pOwner->SwitchToNextBestWeapon( pOwner->GetActiveWeapon() );
if (CPropVehicleManhack::GetManhackVehicle() == NULL && pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0)
{
pOwner->ClearActiveWeapon();
}
}
示例5: IsOuterGrenadePrimed
bool CSDKPlayerAnimState::IsOuterGrenadePrimed()
{
CBaseCombatCharacter *pChar = m_pOuter->MyCombatCharacterPointer();
if ( pChar )
{
CBaseSDKGrenade *pGren = dynamic_cast<CBaseSDKGrenade*>( pChar->GetActiveWeapon() );
return pGren && pGren->IsPinPulled();
}
else
{
return false;
}
}