示例#1
0
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 );

		}
	}
		
}