| 378 | #include "stalker_movement_manager.h" |
| 379 | |
| 380 | void CCharacterPhysicsSupport::KillHit(SHit& H) |
| 381 | { |
| 382 | TestForWounded(); |
| 383 | Fmatrix prev_pose; |
| 384 | prev_pose.set(mXFORM); |
| 385 | ActivateShell(H.who); |
| 386 | |
| 387 | #ifdef DEBUG |
| 388 | if (Type() == etStalker && xr_strcmp(dbg_stalker_death_anim, "none") != 0) |
| 389 | { |
| 390 | if (cmp(prev_pose, mXFORM)) |
| 391 | { |
| 392 | xr_delete(m_interactive_motion); |
| 393 | if (b_death_anim_velocity) |
| 394 | m_interactive_motion = xr_new<imotion_velocity>(); |
| 395 | else |
| 396 | m_interactive_motion = xr_new<imotion_position>(); |
| 397 | m_interactive_motion->setup(dbg_stalker_death_anim, m_pPhysicsShell); |
| 398 | } |
| 399 | } |
| 400 | #endif |
| 401 | |
| 402 | if (g_bCopDeathAnim) |
| 403 | { |
| 404 | float hit_angle = 0; |
| 405 | MotionID m = m_death_anims.motion(m_EntityAlife, H, hit_angle); |
| 406 | |
| 407 | CAI_Stalker* const holder = m_EntityAlife.cast_stalker(); |
| 408 | if (holder && (holder->wounded())) // || holder->movement().current_params().cover() |
| 409 | m = MotionID(); |
| 410 | |
| 411 | if (m.valid()) |
| 412 | { |
| 413 | xr_delete(m_interactive_motion); |
| 414 | m_interactive_motion = xr_new<imotion_position>(); |
| 415 | m_interactive_motion->setup(m, m_pPhysicsShell); |
| 416 | |
| 417 | H.impulse *= 0.1f; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | if (!m_was_wounded) |
| 422 | { |
| 423 | H.impulse *= (H.type() == ALife::eHitTypeExplosion ? 1.f : skel_fatal_impulse_factor); |
| 424 | } |
| 425 | |
| 426 | if (is_imotion(m_interactive_motion)) |
| 427 | m_interactive_motion->play(m_pPhysicsShell); |
| 428 | |
| 429 | if (!is_imotion(m_interactive_motion)) |
| 430 | m_flags.set(fl_block_hit, TRUE); |
| 431 | } |
| 432 | |
| 433 | void CCharacterPhysicsSupport::in_Hit(SHit& H, bool is_killing) |
| 434 | { |
nothing calls this directly
no test coverage detected