本文整理汇总了C++中CBaseCombatWeapon::ResetEventsParity方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatWeapon::ResetEventsParity方法的具体用法?C++ CBaseCombatWeapon::ResetEventsParity怎么用?C++ CBaseCombatWeapon::ResetEventsParity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseCombatWeapon
的用法示例。
在下文中一共展示了CBaseCombatWeapon::ResetEventsParity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//.........这里部分代码省略.........
if ( m_pHL2MPPlayer->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_CROUCH_PRIMARYFIRE );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_STAND_PRIMARYFIRE );
iGestureActivity = ACT_VM_PRIMARYATTACK;
break;
}
case PLAYERANIMEVENT_VOICE_COMMAND_GESTURE:
{
if ( !IsGestureSlotActive( GESTURE_SLOT_ATTACK_AND_RELOAD ) )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, (Activity)nData );
break;
}
case PLAYERANIMEVENT_ATTACK_SECONDARY:
{
// Weapon secondary fire.
if ( m_pHL2MPPlayer->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_CROUCH_SECONDARYFIRE );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_STAND_SECONDARYFIRE );
iGestureActivity = ACT_VM_PRIMARYATTACK;
break;
}
case PLAYERANIMEVENT_ATTACK_PRE:
{
if ( m_pHL2MPPlayer->GetFlags() & FL_DUCKING )
{
// Weapon pre-fire. Used for minigun windup, sniper aiming start, etc in crouch.
iGestureActivity = ACT_MP_ATTACK_CROUCH_PREFIRE;
}
else
{
// Weapon pre-fire. Used for minigun windup, sniper aiming start, etc.
iGestureActivity = ACT_MP_ATTACK_STAND_PREFIRE;
}
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, iGestureActivity, false );
break;
}
case PLAYERANIMEVENT_ATTACK_POST:
{
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_STAND_POSTFIRE );
break;
}
case PLAYERANIMEVENT_RELOAD:
{
// Weapon reload.
if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_CROUCH );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_STAND );
break;
}
case PLAYERANIMEVENT_RELOAD_LOOP:
{
// Weapon reload.
if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_CROUCH_LOOP );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_STAND_LOOP );
break;
}
case PLAYERANIMEVENT_RELOAD_END:
{
// Weapon reload.
if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_CROUCH_END );
else
RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_RELOAD_STAND_END );
break;
}
default:
{
BaseClass::DoAnimationEvent( event, nData );
break;
}
}
#ifdef CLIENT_DLL
// Make the weapon play the animation as well
if ( iGestureActivity != ACT_INVALID )
{
CBaseCombatWeapon *pWeapon = GetHL2MPPlayer()->GetActiveWeapon();
if ( pWeapon )
{
pWeapon->EnsureCorrectRenderingModel();
pWeapon->SendWeaponAnim( iGestureActivity );
// Force animation events!
pWeapon->ResetEventsParity(); // reset event parity so the animation events will occur on the weapon.
pWeapon->DoAnimationEvents( pWeapon->GetModelPtr() );
}
}
#endif
}