MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / KillHit

Method KillHit

ogsr_engine/xrGame/CharacterPhysicsSupport.cpp:380–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378#include "stalker_movement_manager.h"
379
380void 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
433void CCharacterPhysicsSupport::in_Hit(SHit& H, bool is_killing)
434{

Callers

nothing calls this directly

Calls 14

TypeFunction · 0.85
xr_deleteFunction · 0.85
is_imotionFunction · 0.85
cast_stalkerMethod · 0.80
typeMethod · 0.80
cmpFunction · 0.70
MotionIDClass · 0.70
xr_strcmpFunction · 0.50
setMethod · 0.45
setupMethod · 0.45
motionMethod · 0.45
woundedMethod · 0.45

Tested by

no test coverage detected