class DistanceCoveredHitPrereqCondition extends BaseHitPrereqCondition
{
	var m_distanceRequired : Float;
	var m_comparisonType : EComparisonType;

	public override function SetData( recordID : TweakDBID )
	{
		var str : String;
		m_distanceRequired = TweakDBInterface.GetFloat( recordID + T".distanceRequired", 0.0 );
		str = TweakDBInterface.GetString( recordID + T".comparisonType", "" );
		m_comparisonType = ( ( EComparisonType )( ( ( Int32 )( EnumValueFromString( "EComparisonType", str ) ) ) ) );
		super.SetData( recordID );
	}

	public override function Evaluate( hitEvent : gameHitEvent ) : Bool
	{
		var distanceCovered : Float;
		var result : Bool;
		if( hitEvent )
		{
			distanceCovered = Vector4.Distance( hitEvent.attackData.GetAttackPosition(), hitEvent.target.GetWorldPosition() );
			result = ProcessCompare( m_comparisonType, distanceCovered, m_distanceRequired );
			if( result )
			{
				result = CheckOnlyOncePerShot( hitEvent );
			}
			return ( ( m_invert ) ? ( !( result ) ) : ( result ) );
		}
		return false;
	}

}

