class AgentMovingHitPrereqCondition extends BaseHitPrereqCondition
{
	var m_isMoving : Bool;
	var m_object : CName;

	public override function SetData( recordID : TweakDBID )
	{
		super.SetData( recordID );
		m_isMoving = TweakDBInterface.GetBool( recordID + T".isMoving", false );
		m_object = TweakDBInterface.GetCName( recordID + T".object", '' );
	}

	public override function Evaluate( hitEvent : gameHitEvent ) : Bool
	{
		var objectToCheck : weak< gamePuppet >;
		var result : Bool;
		objectToCheck = ( ( gamePuppet )( GetObjectToCheck( m_object, hitEvent ) ) );
		if( objectToCheck )
		{
			if( m_isMoving )
			{
				result = Vector4.Length2D( objectToCheck.GetVelocity() ) > 0.40000001;
			}
			else
			{
				result = Vector4.Length2D( objectToCheck.GetVelocity() ) <= 0.1;
			}
		}
		if( result )
		{
			result = CheckOnlyOncePerShot( hitEvent );
		}
		return ( ( m_invert ) ? ( !( result ) ) : ( result ) );
	}

}

