game/server/shit/npc_alien_trooper.cpp
void CSTrooper :: TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
{
	// check for helmet shot
	if (ptr->iHitgroup == 11)
	{
		// make sure we're wearing one
		if (GetBodygroup( 1 ) == (bitsDamageType & (DMG_SHOCK | DMG_SLASH | DMG_BLAST | DMG_CLUB)))
		{
			// absorb damage
			flDamage -= 20;
			if (flDamage <= 0)
			{
				UTIL_Ricochet( ptr->vecEndPos, 1.0 );
				flDamage = 0.01;
			}
		}
		// it's head shot anyways
		ptr->iHitgroup = HITGROUP_HEAD;
	}
	CSquadMonster::TraceAttack( pevAttacker, flDamage, vecDir, ptr, bitsDamageType );
}
//=========================================================
// TraceAttack - make sure we're not taking it in the helmet
//=========================================================
make sure we're not taking it in the helmet
make sure we ' re not taking it in the helmet
void CSTrooper :: TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
{
	if (ptr->iHitgroup == 11)
	{
		if (GetBodygroup( 1 ) == (bitsDamageType & (DMG_SHOCK | DMG_SLASH | DMG_BLAST | DMG_CLUB)))
		{
			flDamage -= 20;
			if (flDamage <= 0)
			{
				UTIL_Ricochet( ptr->vecEndPos, 1.0 );
				flDamage = 0.01;
			}
		}
		ptr->iHitgroup = HITGROUP_HEAD;
	}
	CSquadMonster::TraceAttack( pevAttacker, flDamage, vecDir, ptr, bitsDamageType );
}
void CSTrooper :: TraceAttack ( entvars_t * pevAttacker , float flDamage , Vector vecDir , TraceResult * ptr , int bitsDamageType ) { if ( ptr -> iHitgroup == 11 ) { if ( GetBodygroup ( 1 ) == ( bitsDamageType & ( DMG_SHOCK | DMG_SLASH | DMG_BLAST | DMG_CLUB ) ) ) { flDamage -= 20 ; if ( flDamage <= 0 ) { UTIL_Ricochet ( ptr -> vecEndPos , 1.0 ) ; flDamage = 0.01 ; } } ptr -> iHitgroup = HITGROUP_HEAD ; } CSquadMonster :: TraceAttack ( pevAttacker , flDamage , vecDir , ptr , bitsDamageType ) ; }
TraceAttack - make sure we're not taking it in the helmet
TraceAttack - make sure we ' re not taking it in the helmet
// check for helmet shot // make sure we're wearing one // absorb damage // it's head shot anyways