\documentclass[a4paper, 10pt, oneside]{scrartcl}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage{russian}
\defaultfontfeatures{Mapping=tex-text, Scale=MatchLowercase}
\newcommand{\setrusfont}[1]{
  \setmainfont{#1}
  \newfontfamily{\cyrillicfont}{#1}
}
\setrusfont{PT Serif}
\setcounter{secnumdepth}{-1}
\setcounter{tocdepth}{4}

\usepackage[a4paper,
            xetex,
            includehead,
            includefoot,
            top=1cm,
            bottom=1cm,
            left=2.5cm,
            right=2.5cm]{geometry}
\usepackage{epsdice}
\usepackage[fontsize=15pt]{scrextend}
\usepackage{titlesec}
\titleformat{\section}[block]{\Large\bfseries\filcenter}{}{1em}{}

\usepackage{fancyhdr}
\pagestyle{empty}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}

\usepackage{marvosym}
\usepackage{forloop}
\usepackage{hyperref}

\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds}
\usepackage{longtable}

\usepackage{rotfloat}
\usepackage{multirow}

\usepackage{rotating}

\newcommand{\cuthere}{%
  \LeftScissors\cleaders\hbox{\CuttingLine}\hfill\RightScissors
  \vspace{-1.5em}
}
\newcommand{\markpage}[2]{
  \fancyfoot[C]{#1}
  \fancyhead[C]{#1}
  \fancyhead[R]{Автор: #2}
  \fancyfoot[R]{Автор: #2}
}
\newcommand{\clearmark}{
  \fancyhead{}
  \fancyfoot{}
}

\newcommand{\markdialogue}[2]{
  \markpage{Диалог "#1"}{#2}
  \addcontentsline{toc}{subsection}{#1}
}
\newcounter{lives}
\newcommand{\life}[1]{
  \medskip
  Если ты ранен, зачеркни 1 жизнь: 
  \forloop{lives}{1}{\not{\value{lives} > #1}}{
    {\Huge $\heartsuit$}
  }
}
\newcommand{\authornote}[1]{
  \vspace{\baselineskip}
  \hfill
  \begin{minipage}[c]{0.8\textwidth}
    #1
  \end{minipage}
  \vspace{\baselineskip}
}
\newcommand{\authormood}[1]{
  \medskip
  \textit{#1}
  \medskip
}
\newcommand{\yourcharacter}[1]{
  \subsubsection*{Твой персонаж: #1}
  \addcontentsline{toc}{subsubsection}{#1}
}

\tikzstyle{object} = [rectangle, rounded corners, text width=4cm, fill=red!20!yellow!20, anchor=center, minimum height=4cm]
\tikzstyle{quality} = [circle, text width=3.5cm, fill=red!10!green!10, anchor=center, minimum height=3.5cm]
\tikzstyle{effect} = [diamond, text width=2.9cm, fill=blue!10!red!10!white, anchor=center, minimum height=2cm]

\newcommand{\drawsticker}[2]{
  \begin{tikzpicture}[font=\small]
    \draw node [#1,align=center]{#2};
  \end{tikzpicture}
}
\newcommand{\drawobject}[1]{
  \drawsticker{object}{#1}
}
\newcommand{\drawquality}[1]{
  \drawsticker{quality}{#1}
}
\newcommand{\draweffect}[1]{
  \drawsticker{effect}{#1}
}

\newcommand{\objectrow}[3]{
  \drawobject{#1} & \drawobject{#2} & \drawobject{#3}\\ \medskip
}
\newcommand{\qualityrow}[3]{
  \drawquality{#1} & \drawquality{#2} & \drawquality{#3}\\ \medskip
}
\newcommand{\effectrow}[3]{
  \draweffect{#1} & \draweffect{#2} & \draweffect{#3}\\ \medskip
}

\newcommand{\foldingline}{
  \par
  {
    \leavevmode
    \cleaders\hbox{\CuttingLine}\hfill\kern0pt \par
  }
}

\newcommand{\pagecard}[1]{
  \topskip0pt
  \vspace*{\fill}
    \begin{center} \Huge #1 \end{center}
  \vspace*{\fill}
  \foldingline
  \vspace*{\fill}
  \foldingline
  \vspace*{\fill}
  \begin{center}
    \begin{turn}{180}
      \Huge #1
    \end{turn}
  \end{center}
  \vspace*{\fill}
  \newpage
}

\usepackage[freepin,boxed,crossmark]{ticket}

\ticketSize{85}{55}
\ticketNumbers{2}{4}
\renewcommand{\ticketdefault}{%
  \put(37, 42){\includegraphics[width=1cm]{logo.png}}
}

% now what do you like to put in your ticket
\newcommand{\confpin}[3]{\ticket{%
  \put(42,30){\makebox[0mm]{\bfseries\Large #1}}
  \put(42,20){\makebox[0mm]{\bfseries\large #2}}
  \put(42,10){\makebox[0mm]{\bfseries #3}}
}}


\begin{document}
\pagestyle{fancy}
\setlength{\headheight}{0.5cm}
\setlength{\headsep}{0.5cm}
\setlength{\footskip}{0.5cm}

\input{tilapian}

\end{document}
