本文整理汇总了C++中CBaseTFPlayer::SetBlocking方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseTFPlayer::SetBlocking方法的具体用法?C++ CBaseTFPlayer::SetBlocking怎么用?C++ CBaseTFPlayer::SetBlocking使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseTFPlayer
的用法示例。
在下文中一共展示了CBaseTFPlayer::SetBlocking方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Holster
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CWeaponCombatShield::Holster( CBaseCombatWeapon *pSwitchingTo )
{
CBaseTFPlayer *player = ToBaseTFPlayer( GetOwner() );
if ( player )
{
player->SetBlocking( false );
player->SetParrying( false );
if ( m_iShieldState != SS_DOWN &&
m_iShieldState != SS_UNAVAILABLE )
{
SetShieldState( SS_LOWERING );
}
}
return true;
}
示例2: SetShieldState
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponCombatShield::SetShieldState( int iShieldState )
{
CBaseTFPlayer *pOwner = ToBaseTFPlayer( GetOwner() );
if ( !pOwner )
return;
switch (iShieldState )
{
default:
case SS_DOWN:
pOwner->SetBlocking( false );
m_flShieldUpStartTime = 0;
m_flShieldParryEndTime = 0;
m_flShieldUnavailableEndTime = 0;
m_flShieldRaisedTime = 0.0f;
m_flShieldLoweredTime = 0.0f;
break;
case SS_UP:
SendWeaponAnim( ACT_VM_FIDGET );
pOwner->SetBlocking( true );
m_flShieldDownStartTime = 0.0f;
m_flShieldParryEndTime = 0;
m_flShieldUnavailableEndTime = 0;
m_flShieldRaisedTime = 0.0f;
m_flShieldLoweredTime = 0.0f;
break;
case SS_PARRYING:
pOwner->SetBlocking( false );
pOwner->SetParrying( true );
m_flShieldParryEndTime = gpGlobals->curtime + PARRY_OPPORTUNITY_LENGTH;
m_flShieldParrySwingEndTime = gpGlobals->curtime + 1.0f; // a hack to make it look ok
m_flShieldUnavailableEndTime = gpGlobals->curtime + SequenceDuration();
m_flNextPrimaryAttack = m_flShieldUnavailableEndTime;
m_flShieldRaisedTime = 0.0f;
m_flShieldLoweredTime = 0.0f;
break;
case SS_PARRYING_FINISH_SWING:
pOwner->SetBlocking( false );
pOwner->SetParrying( false );
break;
case SS_UNAVAILABLE:
SendWeaponAnim( ACT_VM_HAULBACK );
pOwner->SetBlocking( false );
pOwner->SetParrying( false );
break;
case SS_RAISING:
{
pOwner->SetBlocking( false );
pOwner->SetParrying( false );
m_flShieldRaisedTime = gpGlobals->curtime + SequenceDuration();
m_flShieldUpStartTime = gpGlobals->curtime;
}
break;
case SS_LOWERING:
{
SendWeaponAnim( ACT_VM_HAULBACK );
pOwner->SetBlocking( false );
pOwner->SetParrying( false );
m_flShieldLoweredTime = gpGlobals->curtime + SequenceDuration();
m_flShieldDownStartTime = gpGlobals->curtime;
}
break;
};
m_iShieldState = iShieldState;
}