diff --git a/04-gear.tex b/04-gear.tex index b71e697..3a9c54f 100644 --- a/04-gear.tex +++ b/04-gear.tex @@ -16,7 +16,7 @@ \subsection{Холодное оружие} \weapon{Камень}{Самый обыкновенный камень.} -\weaponstats{0}{0,5} +\weaponstats{0}{2.5} \meleestats{4}{5}{Рукопашный Урон + 1} \throwingstats{4}{5}{Рукопашный Урон + 1}{5-15} diff --git a/special.cls b/special.cls index 161effa..75b1eea 100644 --- a/special.cls +++ b/special.cls @@ -35,20 +35,30 @@ \pagestyle{empty} \setcounter{secnumdepth}{0} \setcounter{tocdepth}{2} +\RequirePackage{ifthen} +\RequirePackage{pgf}%rounding + +\newcommand*{\RoundNum}[1]{\pgfmathprintnumber[fixed,precision=0]{#1}}% \chapterstyle{southall} %%% +\newcommand{\equalsNothing}[1]{% + \ifthenelse{\equal{\unexpanded{#1}}{}}{true}{false}% +} + \newcommand{\weapon}[2]{ \subsubsection{#1} #2\par } -\newcommand{\weaponstats}[2]{ - \begin{table}[h] \begin{tabulary}{\textwidth}{CC} - Цена & #1\\ - Вес & #2\\ - Минимальная Сила & \\ - Дальность & 1 +\newcommand{\calcmaxstrength}[1]{\RoundNum{\pgfmathparse{#1/1.1}}}% +\newcommand{\maxstrength}[1]{\ifthenelse{\calcmaxstrength{#1} < 1}{1}{\calcmaxstrength{#1}}} +\newcommand{\weaponstats}[2]{% + \begin{table}[h] \begin{tabulary}{\textwidth}{CC}% + Цена & #1 \\ + Вес & #2 \\ + Минимальная Сила & \maxstrength{#2} \\ + Дальность & 1% \end{tabulary}\end{table} } % Холодное оружие.