当前位置: 首页>>代码示例>>C++>>正文


C++ CBaseTFPlayer::SetParrying方法代码示例

本文整理汇总了C++中CBaseTFPlayer::SetParrying方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseTFPlayer::SetParrying方法的具体用法?C++ CBaseTFPlayer::SetParrying怎么用?C++ CBaseTFPlayer::SetParrying使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBaseTFPlayer的用法示例。


在下文中一共展示了CBaseTFPlayer::SetParrying方法的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;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:20,代码来源:weapon_combatshield.cpp

示例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;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:74,代码来源:weapon_combatshield.cpp


注:本文中的CBaseTFPlayer::SetParrying方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。