void CNPC_Controller::Event_Killed( const CTakeDamageInfo &info ) { if( ShouldGib(info) ) { //remove the balls if (m_pBall[0]) { UTIL_Remove( m_pBall[0] ); m_pBall[0] = NULL; } if (m_pBall[1]) { UTIL_Remove( m_pBall[1] ); m_pBall[1] = NULL; } } else { // fade balls if (m_pBall[0]) { m_pBall[0]->FadeAndDie( 2 ); m_pBall[0] = NULL; } if (m_pBall[1]) { m_pBall[1]->FadeAndDie( 2 ); m_pBall[1] = NULL; } } BaseClass::Event_Killed( info ); }
void CASW_Simple_Alien::Event_Killed( const CTakeDamageInfo &info ) { if (ASWGameRules()) { ASWGameRules()->AlienKilled(this, info); } if (m_hSpawner.Get()) m_hSpawner->AlienKilled(this); // Calculate death force Vector forceVector = CalcDeathForceVector( info ); StopLoopingSounds(); DeathSound(info); // todo: remove touch function? SetState(ASW_SIMPLE_ALIEN_DEAD); // todo: Select a death pose to extrapolate the ragdoll's velocity? //SelectDeathPose( info ); if (!ShouldGib(info)) { SetCollisionGroup(ASW_COLLISION_GROUP_PASSABLE); // don't block marines by dead bodies if ( BecomeRagdollOnClient( forceVector ) ) { } } else { Event_Gibbed( info ); } }