Exemplo n.º 1
0
void CCrowbar::PrimaryAttack()
{
	if (! Swing( 1 ))
	{
		SetThink( &CCrowbar::SwingAgain );
		pev->nextthink = gpGlobals->time + 0.1;
	}
}
Exemplo n.º 2
0
void CCrowbar::PrimaryAttack()
{
	if (! Swing( 1 ))
	{
		SetThink(&CCrowbar:: SwingAgain );
		SetNextThink( 0.1 );
	}
}
Exemplo n.º 3
0
void PrimeSwing::RecFactorial( mpz_class& _result, int _number, PrimeSieve& _sieve )
{
    // Stop recursion here
    if (_number < 2)
    {
        _result = 1;
        return;
    }

    // Continue calculating recursively
    RecFactorial(_result, _number / 2, _sieve);
    _result *= _result;
    _result *= Swing(_number, _sieve);
}
//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
void CBaseHL2MPBludgeonWeapon::PrimaryAttack()
{

#ifndef CLIENT_DLL
    CHL2MP_Player *pPlayer = ToHL2MPPlayer( GetPlayerOwner() );
    // Move other players back to history positions based on local player's lag
    lagcompensation->StartLagCompensation( pPlayer, pPlayer->GetCurrentCommand() );
#endif
    Swing( false );
#ifndef CLIENT_DLL
    // Move other players back to history positions based on local player's lag
    lagcompensation->FinishLagCompensation( pPlayer );
#endif

}
//-----------------------------------------------------------------------------
// Animation event
//-----------------------------------------------------------------------------
void CWeaponSlappers::Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator )
{
	switch( pEvent->event )
	{
	case EVENT_WEAPON_AR2:
		Swing( false );
		break;

	case EVENT_WEAPON_MELEE_HIT:
		HandleAnimEventMeleeHit( pEvent, pOperator );
		break;

	default:
		BaseClass::Operator_HandleAnimEvent( pEvent, pOperator );
		break;
	}
}
Exemplo n.º 6
0
void CAK74::SecondaryAttack()
{
		if ( m_pPlayer->m_bIron )
	m_pPlayer->m_bIron = FALSE;
	else
	m_pPlayer->m_bIron = TRUE;
	
	m_flNextSecondaryAttack = m_flNextSecondaryAttack + 0.5;

	return;

	if (! Swing( 1 ))
	{
		SetThink( SwingAgain );
		pev->nextthink = gpGlobals->time + 0.5; //0.1
	}
}
Exemplo n.º 7
0
//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
void CWeaponSDKMelee::PrimaryAttack()
{
	
#ifndef CLIENT_DLL
	CSDKPlayer *pPlayer = ToSDKPlayer( GetPlayerOwner() );
	pPlayer->NoteWeaponFired();
	// Move other players back to history positions based on local player's lag
	lagcompensation->StartLagCompensation( pPlayer, pPlayer->GetCurrentCommand() );
#endif
	Swing( false );

#ifndef CLIENT_DLL
	// Move other players back to history positions based on local player's lag
	lagcompensation->FinishLagCompensation( pPlayer );
#endif

}
Exemplo n.º 8
0
//------------------------------------------------------------------------------
// Purpose : Update weapon
//------------------------------------------------------------------------------
void CWeaponDAMelee::ItemPostFrame( void )
{
	CDAPlayer *pPlayer = GetPlayerOwner();
	if ( pPlayer == NULL )
		return;

	if (IsDoingDrugs())
	{
		if (MaintainDoDrugs())
			return;
	}
	else if (IsThrowingGrenade())
	{
		if (MaintainGrenadeToss())
			return;
	}
	else if ((pPlayer->m_nButtons & IN_ALT2) && !IsThrowingGrenade() && pPlayer->GetAmmoCount(GetAmmoDef()->Index("grenades")) && pPlayer->CanAttack())
	{
		bool bAllow = (m_flNextPrimaryAttack < GetCurrentTime());
		if (m_bInReload)
			bAllow = true;

		if (bAllow)
		{
			StartGrenadeToss();
			return;
		}
	}

	if (GetSwingTime() > 0 && GetSwingTime() <= GetCurrentTime())
	{
		Swing();
	}
	else if ( (pPlayer->m_nButtons & IN_ATTACK) && (m_flNextPrimaryAttack <= GetCurrentTime()) && pPlayer->CanAttack() )
	{
		PrimaryAttack();
	} 
	else if ( (pPlayer->m_nButtons & IN_ATTACK2) && (m_flNextSecondaryAttack <= GetCurrentTime()) && pPlayer->CanAttack() )
	{
		SecondaryAttack();
	}
	else 
	{
		WeaponIdle();
	}
}
// -----------------------------------------------------------------------------
// Purpose:
// -----------------------------------------------------------------------------
void CTFHammerfists::Punch( void )
{
	// Get the current player.
	CTFPlayer *pPlayer = GetTFPlayerOwner();
	if ( !pPlayer )
		return;

	// Swing the weapon.
	Swing( pPlayer );

	m_flNextSecondaryAttack = m_flNextPrimaryAttack;

#if !defined( CLIENT_DLL ) 
	// We might or might not add Merc voice lines for ragemode, so just leave this in
	pPlayer->SpeakWeaponFire();
#endif
}
Exemplo n.º 10
0
// -----------------------------------------------------------------------------
// Purpose:
// -----------------------------------------------------------------------------
void CTFWeaponBaseMelee::PrimaryAttack()
{
	// Get the current player.
	CTFPlayer *pPlayer = GetTFPlayerOwner();
	if ( !pPlayer )
		return;

	if ( !CanAttack() )
		return;

	// Set the weapon usage mode - primary, secondary.
	m_iWeaponMode = TF_WEAPON_PRIMARY_MODE;
	m_bConnected = false;

	// Swing the weapon.
	Swing( pPlayer );

#if !defined( CLIENT_DLL ) 
	pPlayer->SpeakWeaponFire();
	CTF_GameStats.Event_PlayerFiredWeapon( pPlayer, IsCurrentAttackACritical() );
#endif
}
Exemplo n.º 11
0
//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
void CBaseHL2MPBludgeonWeapon::SecondaryAttack()
{
    Swing( true );
}
Exemplo n.º 12
0
void CBaseMelee::Fire()
{
	Swing();
}
void CTDPWeaponMaul::ThirdAttack()
{
	Swing(true);
}
void CTDPWeaponMaul::SecondaryAttack()
{
	Swing(true);
}
void CTDPWeaponMaul::PrimaryAttack()
{
	Swing(false);
}
Exemplo n.º 16
0
void CCrowbar::SwingAgain( void )
{
	Swing( 0 );
}
//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
void CWeaponCrowbar::PrimaryAttack()
{
	Swing();
}
Exemplo n.º 18
0
void CKnife::PrimaryAttack(void)
{
	Swing(TRUE);
}
Exemplo n.º 19
0
void CAK74::SwingAgain( void )
{
	Swing( 0 );
}
Exemplo n.º 20
0
//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
void CWeaponSDKMelee::SecondaryAttack()
{
	Swing( true );
}
Exemplo n.º 21
0
//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
void CBaseHLBludgeonWeapon::PrimaryAttack()
{
	Swing( false );
}
Exemplo n.º 22
0
void CKnife::SwingAgain(void)
{
	Swing(FALSE);
}