abstract class DamageSystemHelper
{

	public static function GetHitShape( hitEvent : gameHitEvent ) : HitShapeData
	{
		return hitEvent.hitRepresentationResult.hitShapes[ 0 ];
	}

	public static function GetHitShapeUserDataBase( const data : ref< HitShapeData > ) : HitShapeUserDataBase
	{
		return ( ( HitShapeUserDataBase )( data.userData ) );
	}

	public static function GetLocalizedDamageMultiplier( type : EHitShapeType, armorPenetration : Float, useModernFormula : Bool ) : Float
	{
		var multiplier : Float;
		if( useModernFormula )
		{
			switch( type )
			{
				case EHitShapeType.None:
					multiplier = 0.0;
				break;
				case EHitShapeType.Flesh:
					multiplier = 1.0;
				break;
				case EHitShapeType.Metal:
					multiplier = 1.0 - ( 0.5 * ( 1.0 - armorPenetration ) );
				break;
				case EHitShapeType.Cyberware:
					multiplier = 1.0 - ( 0.5 * ( 1.0 - armorPenetration ) );
				break;
				case EHitShapeType.Armor:
					multiplier = 1.0 - ( 0.5 * ( 1.0 - armorPenetration ) );
				break;
				default:
					multiplier = 1.0;
				break;
			}
		}
		else
		{
			switch( type )
			{
				case EHitShapeType.None:
					multiplier = 0.0;
				break;
				case EHitShapeType.Flesh:
					multiplier = 1.0;
				break;
				case EHitShapeType.Metal:
					multiplier = 0.85000002;
				break;
				case EHitShapeType.Cyberware:
					multiplier = 0.60000002;
				break;
				case EHitShapeType.Armor:
					multiplier = 0.85000002;
				break;
				default:
					multiplier = 1.0;
				break;
			}
		}
		return multiplier;
	}

	public static function IsHitShapeArmored( type : EHitShapeType ) : Bool
	{
		switch( type )
		{
			case EHitShapeType.None:
				return false;
			case EHitShapeType.Flesh:
				return false;
			case EHitShapeType.Metal:
				return true;
			case EHitShapeType.Cyberware:
				return true;
			case EHitShapeType.Armor:
				return true;
			default:
				return false;
		}
	}

	public static function GetHitShapeTypeFromData( const data : ref< HitShapeData > ) : EHitShapeType
	{
		var baseData : HitShapeUserDataBase;
		baseData = ( ( HitShapeUserDataBase )( data.userData ) );
		if( baseData )
		{
			return baseData.m_hitShapeType;
		}
		return EHitShapeType.None;
	}

	public static function IsProtectionLayer( const data : ref< HitShapeData > ) : Bool
	{
		var baseData : HitShapeUserDataBase;
		baseData = ( ( HitShapeUserDataBase )( data.userData ) );
		if( baseData )
		{
			return baseData.m_isProtectionLayer;
		}
		return false;
	}

	public static function DoQuickHacksPierceProtection( const data : ref< HitShapeData > ) : Bool
	{
		var baseData : HitShapeUserDataBase;
		baseData = ( ( HitShapeUserDataBase )( data.userData ) );
		if( baseData )
		{
			return baseData.m_quickHacksPierceProtection;
		}
		return false;
	}

}

