class HitDistanceCoveredPrereqState extends GenericHitPrereqState
{

	public override function Evaluate( hitEvent : gameHitEvent ) : Bool
	{
		var distanceCovered : Float;
		const var prereq : HitDistanceCoveredPrereq;
		prereq = ( ( HitDistanceCoveredPrereq )( GetPrereq() ) );
		if( hitEvent )
		{
			distanceCovered = Vector4.Distance( hitEvent.attackData.GetAttackPosition(), hitEvent.target.GetWorldPosition() );
			return ProcessCompare( prereq.m_comparisonType, distanceCovered, prereq.m_distanceRequired );
		}
		return false;
	}

}

class HitDistanceCoveredPrereq extends GenericHitPrereq
{
	default m_isSync = true;
	default m_callbackType = gameDamageCallbackType.HitTriggered;
	default m_pipelineStage = gameDamagePipelineStage.PreProcess;
	var m_distanceRequired : Float;
	var m_comparisonType : EComparisonType;

	protected override function Initialize( 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 ) ) ) ) );
	}

}

