Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

689 lines
19 KiB

  1. //====== Copyright � 1996-2003, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "cbase.h"
  7. #include "tier0/vprof.h"
  8. #include "animation.h"
  9. #include "studio.h"
  10. #include "apparent_velocity_helper.h"
  11. #include "utldict.h"
  12. #include "portal_playeranimstate.h"
  13. #include "base_playeranimstate.h"
  14. #include "movevars_shared.h"
  15. #ifdef CLIENT_DLL
  16. #include "C_Portal_Player.h"
  17. #include "C_Weapon_Portalgun.h"
  18. #include "c_te_effect_dispatch.h"
  19. #include "particle_parse.h"
  20. #else
  21. #include "Portal_Player.h"
  22. #include "Weapon_Portalgun.h"
  23. #endif
  24. #define PORTAL_RUN_SPEED 320.0f
  25. #define PORTAL_CROUCHWALK_SPEED 110.0f
  26. ConVar anim_forcedamaged( "anim_forcedamaged", "0", FCVAR_CHEAT | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Force the player to use the secondary damaged animations." );
  27. ConVar anim_min_collision_speed_threshold("anim_min_collision_speed_threshold", "195.f", FCVAR_CHEAT | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY );
  28. //-----------------------------------------------------------------------------
  29. // Purpose:
  30. // Input : *pPlayer -
  31. // Output : CMultiPlayerAnimState*
  32. //-----------------------------------------------------------------------------
  33. CPortalPlayerAnimState* CreatePortalPlayerAnimState( CPortal_Player *pPlayer )
  34. {
  35. // Setup the movement data.
  36. MultiPlayerMovementData_t movementData;
  37. movementData.m_flBodyYawRate = 720.0f;
  38. movementData.m_flRunSpeed = PORTAL_RUN_SPEED;
  39. movementData.m_flWalkSpeed = -1;
  40. movementData.m_flSprintSpeed = -1.0f;
  41. // Create animation state for this player.
  42. CPortalPlayerAnimState *pRet = new CPortalPlayerAnimState( pPlayer, movementData );
  43. // Specific Portal player initialization.
  44. pRet->InitPortal( pPlayer );
  45. return pRet;
  46. }
  47. //-----------------------------------------------------------------------------
  48. // Purpose:
  49. // Input : -
  50. //-----------------------------------------------------------------------------
  51. CPortalPlayerAnimState::CPortalPlayerAnimState()
  52. {
  53. m_pPortalPlayer = NULL;
  54. // Don't initialize Portal specific variables here. Init them in InitPortal()
  55. }
  56. //-----------------------------------------------------------------------------
  57. // Purpose:
  58. // Input : *pPlayer -
  59. // &movementData -
  60. //-----------------------------------------------------------------------------
  61. CPortalPlayerAnimState::CPortalPlayerAnimState( CBasePlayer *pPlayer, MultiPlayerMovementData_t &movementData )
  62. : CMultiPlayerAnimState( pPlayer, movementData )
  63. {
  64. m_pPortalPlayer = NULL;
  65. // Don't initialize Portal specific variables here. Init them in InitPortal()
  66. }
  67. //-----------------------------------------------------------------------------
  68. // Purpose:
  69. // Input : -
  70. //-----------------------------------------------------------------------------
  71. CPortalPlayerAnimState::~CPortalPlayerAnimState()
  72. {
  73. }
  74. //-----------------------------------------------------------------------------
  75. // Purpose: Initialize Portal specific animation state.
  76. // Input : *pPlayer -
  77. //-----------------------------------------------------------------------------
  78. void CPortalPlayerAnimState::InitPortal( CPortal_Player *pPlayer )
  79. {
  80. m_pPortalPlayer = pPlayer;
  81. m_bInAirWalk = false;
  82. m_flHoldDeployedPoseUntilTime = 0.0f;
  83. m_bLanding = false;
  84. m_bWasInTractorBeam = false;
  85. m_bFirstTractorBeamFrame = false;
  86. m_bBridgeRemovedFromUnder = false;
  87. m_bDying = false;
  88. m_nDamageStage = DAMAGE_STAGE_NONE;
  89. m_fNextBouncePredictTime = 0.0f;
  90. m_fPrevBouncePredict = 4.0f;
  91. }
  92. //-----------------------------------------------------------------------------
  93. // Purpose:
  94. //-----------------------------------------------------------------------------
  95. void CPortalPlayerAnimState::ClearAnimationState( void )
  96. {
  97. m_bInAirWalk = false;
  98. m_vLastVelocity = vec3_origin;
  99. m_bLanding = false;
  100. m_bWasInTractorBeam = false;
  101. m_bFirstTractorBeamFrame = false;
  102. m_bBridgeRemovedFromUnder = false;
  103. m_bDying = false;
  104. m_nDamageStage = DAMAGE_STAGE_NONE;
  105. BaseClass::ClearAnimationState();
  106. }
  107. //-----------------------------------------------------------------------------
  108. // Purpose:
  109. // Input : actDesired -
  110. // Output : Activity
  111. //-----------------------------------------------------------------------------
  112. Activity CPortalPlayerAnimState::TranslateActivity( Activity actDesired )
  113. {
  114. Activity translateActivity = BaseClass::TranslateActivity( actDesired );
  115. // if injured
  116. if ( m_nDamageStage == DAMAGE_STAGE_FINAL )
  117. {
  118. switch ( translateActivity )
  119. {
  120. case ACT_MP_STAND_IDLE:
  121. {
  122. translateActivity = ACT_MP_STAND_SECONDARY;
  123. break;
  124. }
  125. case ACT_MP_RUN:
  126. {
  127. translateActivity = ACT_MP_RUN_SECONDARY;
  128. break;
  129. }
  130. }
  131. }
  132. if ( GetPortalPlayer()->GetActiveWeapon() )
  133. {
  134. translateActivity = GetPortalPlayer()->GetActiveWeapon()->ActivityOverride( translateActivity, false );
  135. }
  136. return translateActivity;
  137. }
  138. //-----------------------------------------------------------------------------
  139. // Purpose:
  140. // Input : event -
  141. //-----------------------------------------------------------------------------
  142. void CPortalPlayerAnimState::DoAnimationEvent( PlayerAnimEvent_t event, int nData )
  143. {
  144. Activity iWeaponActivity = ACT_INVALID;
  145. #if defined CLIENT_DLL
  146. RANDOM_CEG_TEST_SECRET();
  147. #endif
  148. switch( event )
  149. {
  150. case PLAYERANIMEVENT_ATTACK_PRIMARY:
  151. case PLAYERANIMEVENT_ATTACK_SECONDARY:
  152. {
  153. CPortal_Player *pPlayer = GetPortalPlayer();
  154. if ( !pPlayer )
  155. return;
  156. CWeaponPortalBase *pWpn = pPlayer->GetActivePortalWeapon();
  157. if ( pWpn )
  158. {
  159. // Weapon primary fire.
  160. if ( GetBasePlayer()->GetFlags() & FL_DUCKING )
  161. {
  162. RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_CROUCH_PRIMARYFIRE );
  163. }
  164. else
  165. {
  166. RestartGesture( GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MP_ATTACK_STAND_PRIMARYFIRE );
  167. }
  168. iWeaponActivity = ACT_VM_PRIMARYATTACK;
  169. }
  170. else // unarmed player
  171. {
  172. }
  173. break;
  174. }
  175. case PLAYERANIMEVENT_JUMP:
  176. {
  177. m_bInAirWalk = false;
  178. m_bLanding = false;
  179. BaseClass::DoAnimationEvent( event, nData );
  180. break;
  181. }
  182. case PLAYERANIMEVENT_DIE:
  183. {
  184. m_bDying = true;
  185. break;
  186. }
  187. case PLAYERANIMEVENT_FLINCH_CHEST:
  188. case PLAYERANIMEVENT_FLINCH_HEAD:
  189. case PLAYERANIMEVENT_FLINCH_LEFTARM:
  190. case PLAYERANIMEVENT_FLINCH_RIGHTARM:
  191. case PLAYERANIMEVENT_FLINCH_LEFTLEG:
  192. case PLAYERANIMEVENT_FLINCH_RIGHTLEG:
  193. {
  194. IncreaseDamageStage();
  195. BaseClass::DoAnimationEvent( event, nData );
  196. break;
  197. }
  198. default:
  199. {
  200. BaseClass::DoAnimationEvent( event, nData );
  201. break;
  202. }
  203. }
  204. #ifdef CLIENT_DLL
  205. // Make the weapon play the animation as well
  206. if ( iWeaponActivity != ACT_INVALID )
  207. {
  208. CBaseCombatWeapon *pWeapon = GetPortalPlayer()->GetActiveWeapon();
  209. if ( pWeapon )
  210. {
  211. pWeapon->SendWeaponAnim( iWeaponActivity );
  212. }
  213. }
  214. #endif
  215. }
  216. //-----------------------------------------------------------------------------
  217. // Purpose:
  218. //-----------------------------------------------------------------------------
  219. void CPortalPlayerAnimState::Update( float eyeYaw, float eyePitch )
  220. {
  221. // Profile the animation update.
  222. VPROF( "CPortalPlayerAnimState::Update" );
  223. // Get the player
  224. CPortal_Player *pPlayer = GetPortalPlayer();
  225. if ( pPlayer == NULL )
  226. return;
  227. // Get the studio header for the player.
  228. CStudioHdr *pStudioHdr = pPlayer->GetModelPtr();
  229. if ( !pStudioHdr )
  230. return;
  231. // Check to see if we should be updating the animation state - dead, ragdolled?
  232. if ( !ShouldUpdateAnimState() )
  233. {
  234. ClearAnimationState();
  235. return;
  236. }
  237. // Store the eye angles.
  238. m_flEyeYaw = AngleNormalize( eyeYaw );
  239. m_flEyePitch = AngleNormalize( eyePitch );
  240. // Compute the player sequences.
  241. ComputeSequences( pStudioHdr );
  242. if ( SetupPoseParameters( pStudioHdr ) )
  243. {
  244. // Pose parameter - what direction are the player's legs running in.
  245. ComputePoseParam_MoveYaw( pStudioHdr );
  246. // Pose parameter - Torso aiming (up/down).
  247. ComputePoseParam_AimPitch( pStudioHdr );
  248. // Pose parameter - Torso aiming (rotation).
  249. ComputePoseParam_AimYaw( pStudioHdr );
  250. }
  251. // Store this for collision results
  252. GetOuterAbsVelocity( m_vLastVelocity );
  253. }
  254. //-----------------------------------------------------------------------------
  255. // Purpose:
  256. //-----------------------------------------------------------------------------
  257. CEG_NOINLINE void CPortalPlayerAnimState::Teleport( const Vector *pNewOrigin, const QAngle *pNewAngles, CPortal_Player* pPlayer )
  258. {
  259. QAngle absangles = pPlayer->GetAbsAngles();
  260. m_angRender = absangles;
  261. m_angRender.x = m_angRender.z = 0.0f;
  262. if ( pPlayer )
  263. {
  264. #if defined GAME_DLL
  265. CEG_PROTECT_MEMBER_FUNCTION( CPortalPlayerAnimState_Teleport );
  266. #endif
  267. // Snap the yaw pose parameter lerping variables to face new angles.
  268. m_flCurrentFeetYaw = m_flGoalFeetYaw = m_flEyeYaw = pPlayer->EyeAngles()[YAW];
  269. }
  270. }
  271. void CPortalPlayerAnimState::TransformYAWs( const matrix3x4_t &matTransform )
  272. {
  273. QAngle qOldAngles = vec3_angle;
  274. QAngle qAngles;
  275. qOldAngles[YAW] = m_flEyeYaw;
  276. qAngles = TransformAnglesToWorldSpace( qOldAngles, matTransform );
  277. m_flEyeYaw = qAngles[YAW];
  278. qOldAngles[YAW] = m_flGoalFeetYaw;
  279. qAngles = TransformAnglesToWorldSpace( qOldAngles, matTransform );
  280. m_flGoalFeetYaw = qAngles[YAW];
  281. qOldAngles[YAW] = m_flCurrentFeetYaw;
  282. qAngles = TransformAnglesToWorldSpace( qOldAngles, matTransform );
  283. m_flCurrentFeetYaw = qAngles[YAW];
  284. }
  285. bool CPortalPlayerAnimState::ShouldLongFall( void ) const
  286. {
  287. CPortal_Player *pPortalPlayer = GetPortalPlayer();
  288. return ( m_bWasInTractorBeam ||
  289. m_bBridgeRemovedFromUnder ||
  290. ( !pPortalPlayer->GetTractorBeam() &&
  291. pPortalPlayer->GetAirTime() > 2.0f &&
  292. pPortalPlayer->GetAbsVelocity().AsVector2D().Length() < 450.0f ) );
  293. }
  294. //-----------------------------------------------------------------------------
  295. // Purpose:
  296. // Input : *idealActivity -
  297. // Output : Returns true on success, false on failure.
  298. //-----------------------------------------------------------------------------
  299. bool CPortalPlayerAnimState::HandleMoving( Activity &idealActivity )
  300. {
  301. float flSpeed = GetOuterXYSpeed();
  302. CPortal_Player *pPortalPlayer = GetPortalPlayer();
  303. // If we're off the ground and not moving, do an airwalk
  304. bool bOnGround = ( pPortalPlayer->GetFlags() & FL_ONGROUND );
  305. if ( bOnGround == false )
  306. {
  307. if ( m_bWasInTractorBeam || m_bBridgeRemovedFromUnder )
  308. {
  309. idealActivity = ACT_MP_LONG_FALL;
  310. }
  311. else
  312. {
  313. idealActivity = ACT_MP_AIRWALK;
  314. }
  315. m_bInAirWalk = true;
  316. }
  317. else
  318. {
  319. CEG_GCV_PRE();
  320. static const int CEG_SPEED_POWER = CEG_GET_CONSTANT_VALUE( PaintSpeedPower );
  321. CEG_GCV_POST();
  322. bool bHasSpeedPower = pPortalPlayer->GetPaintPower( CEG_SPEED_POWER ).m_State == ACTIVE_PAINT_POWER;
  323. #ifdef CLIENT_DLL
  324. if ( engine->HasPaintmap() && !bHasSpeedPower && !pPortalPlayer->IsLocalPlayer() )
  325. {
  326. // FIXME: Is this doing extra work in splitscreen?
  327. // Non-local players don't update paint powers on the client because this has to happen in gamemovement!
  328. // Quickly figure out if speed paint should be active
  329. CPortal_Player::PaintPowerInfoVector activePowers;
  330. pPortalPlayer->ChooseActivePaintPowers( activePowers );
  331. PaintPowerConstRange activeRange = GetConstRange( activePowers );
  332. for( PaintPowerConstIter i = activeRange.first; i != activeRange.second; ++i )
  333. {
  334. const PaintPowerInfo_t &newPower = *i;
  335. if ( newPower.m_PaintPowerType == CEG_SPEED_POWER )
  336. {
  337. bHasSpeedPower = true;
  338. }
  339. }
  340. // Clear the surface information
  341. // NOTE: Calling this after Activating/Using/Deactivating paint powers makes sticky boxes not very sticky
  342. // and that's why I moved it back over here. -Brett
  343. pPortalPlayer->ClearSurfacePaintPowerInfo();
  344. }
  345. #endif
  346. if ( flSpeed > MOVING_MINIMUM_SPEED && bHasSpeedPower )
  347. {
  348. idealActivity = ACT_MP_RUN_SPEEDPAINT;
  349. }
  350. else if ( flSpeed > MOVING_MINIMUM_SPEED )
  351. {
  352. m_flHoldDeployedPoseUntilTime = 0.0;
  353. idealActivity = ACT_MP_RUN;
  354. }
  355. else if ( m_flHoldDeployedPoseUntilTime > gpGlobals->curtime )
  356. {
  357. // Unless we move, hold the deployed pose for a number of seconds after being deployed
  358. idealActivity = ACT_MP_DEPLOYED_IDLE;
  359. }
  360. else
  361. {
  362. return BaseClass::HandleMoving( idealActivity );
  363. }
  364. }
  365. if ( idealActivity == ACT_MP_RUN && anim_forcedamaged.GetBool() )
  366. {
  367. idealActivity = ACT_MP_RUN_SECONDARY;
  368. }
  369. return true;
  370. }
  371. //-----------------------------------------------------------------------------
  372. // Purpose:
  373. // Input :
  374. // Output :
  375. //-----------------------------------------------------------------------------
  376. Activity CPortalPlayerAnimState::CalcMainActivity()
  377. {
  378. Activity idealActivity = BaseClass::CalcMainActivity();
  379. if ( HandleBouncing( idealActivity ) ||
  380. HandleLanding() ||
  381. HandleTractorBeam( idealActivity ) ||
  382. HandleInAir( idealActivity ) )
  383. {
  384. if ( idealActivity == ACT_MP_DOUBLEJUMP && m_eCurrentMainSequenceActivity != ACT_MP_DOUBLEJUMP )
  385. {
  386. m_pPlayer->SetCycle( 0 );
  387. }
  388. }
  389. if (idealActivity == ACT_MP_STAND_IDLE && anim_forcedamaged.GetBool())
  390. {
  391. idealActivity = ACT_MP_STAND_SECONDARY;
  392. }
  393. return idealActivity;
  394. }
  395. //-----------------------------------------------------------------------------
  396. // Purpose:
  397. // Input : *idealActivity -
  398. // Output : Returns true on success, false on failure.
  399. //-----------------------------------------------------------------------------
  400. bool CPortalPlayerAnimState::HandleDucking( Activity &idealActivity )
  401. {
  402. if ( ( GetBasePlayer()->GetFlags() & FL_DUCKING ) || GetBasePlayer()->m_Local.m_bDucking || GetBasePlayer()->m_Local.m_bDucked )
  403. {
  404. if ( GetOuterXYSpeed() < MOVING_MINIMUM_SPEED )
  405. {
  406. idealActivity = ACT_MP_CROUCH_IDLE;
  407. }
  408. else
  409. {
  410. idealActivity = ACT_MP_CROUCHWALK;
  411. }
  412. return true;
  413. }
  414. return false;
  415. }
  416. bool CPortalPlayerAnimState::HandleDying( Activity &idealActivity )
  417. {
  418. if ( m_bDying )
  419. {
  420. if ( m_bFirstDyingFrame )
  421. {
  422. // Reset the animation.
  423. RestartMainSequence();
  424. m_bFirstDyingFrame = false;
  425. #ifdef CLIENT_DLL
  426. //DispatchParticleEffect( "bot_death_B_gib", GetPortalPlayer()->WorldSpaceCenter(), GetPortalPlayer()->GetAbsAngles(), GetPortalPlayer() );
  427. #endif
  428. }
  429. if ( GetPortalPlayer()->m_Shared.InCond( PORTAL_COND_DEATH_CRUSH ) )
  430. {
  431. idealActivity = ACT_MP_DEATH_CRUSH;
  432. }
  433. else
  434. {
  435. idealActivity = ACT_DIESIMPLE;
  436. }
  437. return true;
  438. }
  439. else
  440. {
  441. if ( !m_bFirstDyingFrame )
  442. {
  443. m_bFirstDyingFrame = true;
  444. }
  445. }
  446. return false;
  447. }
  448. bool CPortalPlayerAnimState::HandleInAir( Activity &idealActivity )
  449. {
  450. CPortal_Player *pPortalPlayer = GetPortalPlayer();
  451. if ( pPortalPlayer->GetFlags() & FL_ONGROUND )
  452. {
  453. return false;
  454. }
  455. if ( m_bWasInTractorBeam || m_bBridgeRemovedFromUnder )
  456. {
  457. m_bLanding = true;
  458. idealActivity = ACT_MP_LONG_FALL;
  459. return true;
  460. }
  461. else
  462. {
  463. Vector vecVelocity;
  464. GetOuterAbsVelocity( vecVelocity );
  465. if ( vecVelocity.z > 300.0f || m_bInAirWalk )
  466. {
  467. // In an air walk.
  468. m_bJumping = false;
  469. idealActivity = ACT_MP_AIRWALK;
  470. m_bInAirWalk = true;
  471. m_bLanding = true;
  472. return true;
  473. }
  474. }
  475. return false;
  476. }
  477. ConVar sv_bounce_anim_time_predict( "sv_bounce_anim_time_predict", "0.2", FCVAR_REPLICATED );
  478. ConVar sv_bounce_anim_time_continue( "sv_bounce_anim_time_continue", "0.5", FCVAR_REPLICATED );
  479. bool CPortalPlayerAnimState::HandleBouncing( Activity &idealActivity )
  480. {
  481. CPortal_Player *pPortalPlayer = GetPortalPlayer();
  482. float fNextBounceOffsetTime = pPortalPlayer->PredictedBounce();
  483. bool bPredictedBounce = fNextBounceOffsetTime < sv_bounce_anim_time_predict.GetFloat();
  484. if ( bPredictedBounce || pPortalPlayer->GetPortalPlayerLocalData().m_fBouncedTime + sv_bounce_anim_time_continue.GetFloat() > gpGlobals->curtime )
  485. {
  486. // They're anticipating to hit a bounce soon
  487. if ( bPredictedBounce )
  488. {
  489. pPortalPlayer->OnBounced( fNextBounceOffsetTime );
  490. }
  491. m_bJumping = true;
  492. m_bInAirWalk = true;
  493. m_bLanding = true;
  494. idealActivity = ACT_MP_DOUBLEJUMP;
  495. return true;
  496. }
  497. return false;
  498. }
  499. bool CPortalPlayerAnimState::HandleTractorBeam( Activity &idealActivity )
  500. {
  501. if ( GetPortalPlayer()->GetPortalPlayerLocalData().m_hTractorBeam.Get() )
  502. {
  503. if ( m_bFirstTractorBeamFrame )
  504. {
  505. RestartMainSequence();
  506. m_bFirstTractorBeamFrame = false;
  507. }
  508. m_bWasInTractorBeam = true;
  509. idealActivity = ACT_MP_TRACTORBEAM_FLOAT;
  510. return true;
  511. }
  512. else
  513. {
  514. if ( !m_bFirstTractorBeamFrame )
  515. {
  516. RANDOM_CEG_TEST_SECRET_PERIOD( 8, 15 );
  517. m_bFirstTractorBeamFrame = true;
  518. }
  519. }
  520. return false;
  521. }
  522. bool CPortalPlayerAnimState::HandleLanding()
  523. {
  524. // Check to see if we were in the air and now we are basically on the ground or water.
  525. if ( m_bLanding && GetBasePlayer()->GetFlags() & FL_ONGROUND )
  526. {
  527. m_bJumping = false;
  528. m_bInAirWalk = false;
  529. m_bLanding = false;
  530. m_bWasInTractorBeam = false;
  531. m_bBridgeRemovedFromUnder = false;
  532. RestartMainSequence();
  533. RANDOM_CEG_TEST_SECRET_PERIOD( 91, 172 );
  534. RestartGesture( GESTURE_SLOT_JUMP, ACT_MP_JUMP_LAND );
  535. return true;
  536. }
  537. return false;
  538. }
  539. //-----------------------------------------------------------------------------
  540. // Purpose:
  541. //-----------------------------------------------------------------------------
  542. bool CPortalPlayerAnimState::HandleJumping( Activity &idealActivity )
  543. {
  544. Vector vecVelocity;
  545. GetOuterAbsVelocity( vecVelocity );
  546. // Jumping.
  547. if ( m_bJumping )
  548. {
  549. if ( m_bFirstJumpFrame )
  550. {
  551. m_bFirstJumpFrame = false;
  552. RestartMainSequence(); // Reset the animation.
  553. }
  554. // Don't check if he's on the ground for a sec.. sometimes the client still has the
  555. // on-ground flag set right when the message comes in.
  556. else if ( gpGlobals->curtime - m_flJumpStartTime > 0.2f )
  557. {
  558. // In an air walk.
  559. m_bJumping = false;
  560. idealActivity = ACT_MP_AIRWALK;
  561. m_bInAirWalk = true;
  562. }
  563. // if we're still jumping
  564. if ( m_bJumping )
  565. {
  566. idealActivity = ACT_MP_JUMP_START;
  567. }
  568. }
  569. if ( m_bJumping )
  570. return true;
  571. return false;
  572. }
  573. //-----------------------------------------------------------------------------
  574. // Purpose:
  575. //-----------------------------------------------------------------------------
  576. bool CPortalPlayerAnimState::SetupPoseParameters( CStudioHdr *pStudioHdr )
  577. {
  578. CPortal_Player *pPortalPlayer = ToPortalPlayer( GetBasePlayer() );
  579. if ( pPortalPlayer && ( pPortalPlayer->m_Shared.InCond( PORTAL_COND_TAUNTING ) || pPortalPlayer->m_Shared.InCond( PORTAL_COND_DROWNING ) ) )
  580. return false;
  581. return BaseClass::SetupPoseParameters( pStudioHdr );
  582. }
  583. void CPortalPlayerAnimState::IncreaseDamageStage()
  584. {
  585. if ( m_nDamageStage < DAMAGE_STAGE_FINAL )
  586. {
  587. //Disable this for E3
  588. //m_nDamageStage++;
  589. }
  590. }