本文整理汇总了C++中CBaseCombatCharacter::SetAmmoCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatCharacter::SetAmmoCount方法的具体用法?C++ CBaseCombatCharacter::SetAmmoCount怎么用?C++ CBaseCombatCharacter::SetAmmoCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseCombatCharacter
的用法示例。
在下文中一共展示了CBaseCombatCharacter::SetAmmoCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WeaponIdle
void CWeapon_Manhack::WeaponIdle( void )
{
/*bool hasAmmo = false;
CBaseCombatCharacter *pOwner = GetOwner();
if (pOwner==NULL) return false;
if (pOwner->GetAmmoCount(m_iSecondaryAmmoType) > 0)
hasAmmo=true;*/
// Ready to switch animations?
int iAnim;
//TERO: lets set how many Manhacks we have online
CBaseCombatCharacter *pOwner = GetOwner();
if (pOwner)
{
pOwner->SetAmmoCount( NumberOfManhacks(), m_iSecondaryAmmoType );
}
if ( (HasNPCManhack() || !m_bHasAmmo) && !m_bSpawnSomeMore )
{
iAnim=ACT_SLAM_DETONATOR_IDLE;
m_bIsDoingController=true;
UpdateControllerPanel();
//TERO:
if (m_bIsDrawing)
iAnim=ACT_SLAM_DETONATOR_DRAW;
else if (m_bIsDoingShit)
iAnim=ACT_SLAM_DETONATOR_DETONATE;
else if (m_bIsDoingShitToo)
iAnim=ACT_VM_HOLSTER; //ACT_SLAM_DETONATOR_THROW_DRAW
if (HasWeaponIdleTimeElapsed() || m_bSkip)
{
SendWeaponAnim( iAnim );
m_bSkip=false;
}
}
else
{
UpdateControllerPanel();
iAnim=ACT_VM_IDLE;
m_bSkip =false;
if (m_bIsDoingController)
{
m_bIsDoingShitToo=true;
m_bRedraw=true;
m_bSkip=true;
m_bIsDoingController=false;
}
if ( HasWeaponIdleTimeElapsed() || m_bSkip )
{
if (m_bIsDrawing)
iAnim=ACT_VM_DRAW;
else if (m_bIsDoingShit)
iAnim=ACT_VM_THROW;
else if (m_bIsDoingShitToo)
iAnim=ACT_SLAM_DETONATOR_HOLSTER;
SendWeaponAnim( iAnim );
}
}
}