当前位置: 首页>>代码示例>>C++>>正文


C++ CBaseCombatCharacter::GetActiveWeapon方法代码示例

本文整理汇总了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

}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:30,代码来源:weapon_slam.cpp

示例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);
}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:14,代码来源:weapon_rocket_launcher.cpp

示例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.
}
开发者ID:djoslin0,项目名称:ges-legacy-code,代码行数:11,代码来源:weapon_shotgun.cpp

示例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();
	}
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:11,代码来源:weapon_manhack.cpp

示例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;
	}
}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:13,代码来源:sdk_playeranimstate.cpp


注:本文中的CBaseCombatCharacter::GetActiveWeapon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。