本文整理汇总了C++中CTFPlayer::ClearWeaponFireScene方法的典型用法代码示例。如果您正苦于以下问题:C++ CTFPlayer::ClearWeaponFireScene方法的具体用法?C++ CTFPlayer::ClearWeaponFireScene怎么用?C++ CTFPlayer::ClearWeaponFireScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTFPlayer
的用法示例。
在下文中一共展示了CTFPlayer::ClearWeaponFireScene方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WindDown
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFMinigun::WindDown( void )
{
// Get the player owning the weapon.
CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() );
if ( !pPlayer )
return;
SendWeaponAnim( ACT_MP_ATTACK_STAND_POSTFIRE );
// Set the appropriate firing state.
m_iWeaponState = AC_STATE_IDLE;
pPlayer->m_Shared.RemoveCond( TF_COND_AIMING );
#ifdef CLIENT_DLL
WeaponSoundUpdate();
#else
pPlayer->ClearWeaponFireScene();
#endif
// Time to weapon idle.
m_flTimeWeaponIdle = gpGlobals->curtime + 2.0;
// Update player's speed
pPlayer->TeamFortress_SetSpeed();
#ifdef CLIENT_DLL
m_flBarrelTargetVelocity = 0;
#endif
}
示例2: SharedAttack
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFMinigun::SharedAttack()
{
CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() );
if ( !pPlayer )
return;
if ( !CanAttack() )
{
WeaponIdle();
return;
}
if ( pPlayer->m_nButtons & IN_ATTACK )
{
m_iWeaponMode = TF_WEAPON_PRIMARY_MODE;
}
else if ( pPlayer->m_nButtons & IN_ATTACK2 )
{
m_iWeaponMode = TF_WEAPON_SECONDARY_MODE;
}
switch ( m_iWeaponState )
{
default:
case AC_STATE_IDLE:
{
// Removed the need for cells to powerup the AC
WindUp();
m_flNextPrimaryAttack = gpGlobals->curtime + 1.0;
m_flNextSecondaryAttack = gpGlobals->curtime + 1.0;
m_flTimeWeaponIdle = gpGlobals->curtime + 1.0;
m_flStartedFiringAt = -1;
pPlayer->DoAnimationEvent( PLAYERANIMEVENT_ATTACK_PRE );
break;
}
case AC_STATE_STARTFIRING:
{
// Start playing the looping fire sound
if ( m_flNextPrimaryAttack <= gpGlobals->curtime )
{
if ( m_iWeaponMode == TF_WEAPON_SECONDARY_MODE )
{
m_iWeaponState = AC_STATE_SPINNING;
#ifdef GAME_DLL
pPlayer->SpeakWeaponFire( MP_CONCEPT_WINDMINIGUN );
#endif
}
else
{
m_iWeaponState = AC_STATE_FIRING;
#ifdef GAME_DLL
pPlayer->SpeakWeaponFire( MP_CONCEPT_FIREMINIGUN );
#endif
}
m_flNextSecondaryAttack = m_flNextPrimaryAttack = m_flTimeWeaponIdle = gpGlobals->curtime + 0.1;
}
break;
}
case AC_STATE_FIRING:
{
if ( m_iWeaponMode == TF_WEAPON_SECONDARY_MODE )
{
#ifdef GAME_DLL
pPlayer->ClearWeaponFireScene();
pPlayer->SpeakWeaponFire( MP_CONCEPT_WINDMINIGUN );
#endif
m_iWeaponState = AC_STATE_SPINNING;
m_flNextSecondaryAttack = m_flNextPrimaryAttack = m_flTimeWeaponIdle = gpGlobals->curtime + 0.1;
}
else if ( pPlayer->GetAmmoCount(m_iPrimaryAmmoType) <= 0 )
{
m_iWeaponState = AC_STATE_DRYFIRE;
}
else
{
if ( m_flStartedFiringAt < 0 )
{
m_flStartedFiringAt = gpGlobals->curtime;
}
#ifdef GAME_DLL
if ( m_flNextFiringSpeech < gpGlobals->curtime )
{
m_flNextFiringSpeech = gpGlobals->curtime + 5.0;
pPlayer->SpeakConceptIfAllowed( MP_CONCEPT_MINIGUN_FIREWEAPON );
}
#endif
// Only fire if we're actually shooting
BaseClass::PrimaryAttack(); // fire and do timers
CalcIsAttackCritical();
m_bCritShot = IsCurrentAttackACrit();
pPlayer->DoAnimationEvent( PLAYERANIMEVENT_ATTACK_PRIMARY );
//.........这里部分代码省略.........