Newer
Older
\setcounter{age}{\value{r3}}%
}
\newcommand{\randomthreeB}{%
\ifnum\value{r3b}>2%
\setcounter{r3b}{1}%
\fi%
\ifodd\value{r3}%
\stepcounter{r3b}%
\setcounter{r3c}{1}%
\ifodd\value{r12}%
\stepcounter{r3c}%
\fi%
\ifodd\value{r3}%
\fi%
}
\newcommand{\randomfour}{%
\setcounter{track}{\value{r4}}%
}
\newcommand{\randomfourB}{%
\randomthreeB%
\setcounter{r4b}{\value{r3b}}%
\stepcounter{r4b}%
\newcommand\randomize{%
\stepcounter{r2}%
\stepcounter{r3}%
\stepcounter{r4}%
\setcounter{rn4tn1}{\value{r4b}}%
\addtocounter{rn4tn1}{-5}%
\setcounter{r12}{\value{r3c}}%
\multiply\value{r12} by 3%
\ifodd\value{r3}%
\stepcounter{r2b}%
\stepcounter{r3b}%
\multiply\value{rn3t3} by -1%
\addtocounter{rn3t3}{0}%
\stepcounter{r3c}%
\stepcounter{r4t6}%
\stepcounter{r0t1}%
\stepcounter{rn1t0}
\fi%
\ifodd\value{r3b}%
\stepcounter{r3t4}%
\else%
\stepcounter{r2t3}%
\stepcounter{r3c}%
\stepcounter{r4b}%
\fi%
\foreach\c in {r2,r2b,r2c}%
{\ifnum\value{\c}>2\setcounter{\c}{1}\fi}%
\foreach\c in {r3,r3b,r3c}%
{\ifnum\value{\c}>3\setcounter{\c}{1}\fi}%
\foreach\c in {r4,r4b}%
{\ifnum\value{\c}>4\setcounter{\c}{1}\stepcounter{rn1t2}\fi}%
\ifnum\value{r0t1}>1\setcounter{r0t1}{0}\fi%
\ifnum\value{rn1t0}>0\setcounter{rn1t0}{-1}\fi%
\ifnum\value{r2t3}>3\setcounter{r2t3}{2}\stepcounter{rn1t2}\fi%
\ifnum\value{r3t4}>4\setcounter{r3t4}{3}\fi%
\ifnum\value{r4t5}>5\setcounter{r4t5}{4}\fi%
\ifnum\value{r4t6}>6\setcounter{r4t6}{4}\fi%
}
\newcommand\set[2]{%
\ifltxcounter{#2}{\setcounter{#1}{\value{#2}}}{\setcounter{#1}{#2}}%
}
\newcounter{stackedNo}
\newcommand\stack[2]{%
\ifltxcounter{#1}{\setcounter{stackedNo}{\value{#1}}}{\setcounter{stackedNo}{#1}}%
\ifltxcounter{#2}{\setcounter{diceNo2}{\value{#2}}}{\setcounter{diceNo2}{#2}}%
\ifnum\value{stackedNo}>\value{diceNo2}%
\roundUp{diceNo2}%
\addtocounter{stackedNo}{\value{diceNo2}}%
\else%
\roundUp{stackedNo}%
\addtocounter{stackedNo}{\value{diceNo2}}%
\fi%
%%% Index
\def\breakitem{\par\goodbreak\hangindent 40\p@}
\indexsetup{
noclearpage,
level=\section,
% Make floats hug the text.
\setlength\intextsep{0em}
%\renewcommand\tabularxcolumn[1]{m{#1}}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\normalfont\raggedright\arraybackslash}X}
%%%%%%%%%%%%%%%%%%%% Environments %%%%%%%%%%%%%%%%%%%%
{%
\it
\begin{quotation}%
\noindent%
}%
\newcommand*\@NoIndentAfter{%
\@ifnextchar\par{%
\def\par{%
\everypar{\setbox\z@\lastbox\everypar{}}%
\@restorepar%
}%
}{}%
}
\newrobustcmd*{\NoIndentAfterThis}{\@NoIndentAfter\par\par}
\AfterEndEnvironment{enumerate}{\NoIndentAfterThis}
\AfterEndEnvironment{itemize}{\NoIndentAfterThis}
\AfterEndEnvironment{description}{\NoIndentAfterThis}
\AfterEndEnvironment{dlist}{\NoIndentAfterThis}
\AfterEndEnvironment{list}{\NoIndentAfterThis}
\AfterEndEnvironment{boxtext}{\NoIndentAfterThis}
\AfterEndEnvironment{speechtext}{\NoIndentAfterThis}
\AfterEndEnvironment{exampletext}{\NoIndentAfterThis}
\AfterEndEnvironment{nametable}{\NoIndentAfterThis}
\AfterEndEnvironment{boxtable}{\NoIndentAfterThis}
\AfterEndEnvironment{tcolorbox}{\NoIndentAfterThis}
\AfterEndEnvironment{multicols}{\NoIndentAfterThis}
{
\parindent2em%
\needspace{2em}
\vspace{1em}%
\it%
\newcommand\sideBySide[2]{
\end{multicols}
\vspace{-1em}
sidebyside,
before lower={\parindent15pt},
]
\ifstrequal{#1}{b}{%
\bigLine
}{}
\begin{multicols}{2}
#2
\vfill\null
\columnbreak
#3
\end{multicols}
\ifstrequal{#1}{t}{%
\bigLine
}{}
\rowcolors{2}{}{gray!10}\needspace{2em}
\par\noindent
\newenvironment{nametable}[2][cL]
{
\rowcolors{2}{}{gray!10}\needspace{6em}%
\begin{center}\npcsymbol~\titleFont\textbf{#2}~\npcsymbol\end{center}%
\par\noindent\nobreak%
\tabularx{\linewidth}{#1}
\hline
}%
{
\hline
\endtabularx
\newtcolorbox{wideTable}[2][cX]{
tabularx=#1,
float*=h!,
ornamented,
adjusted title=#2,
bottom=1em,
top=-1pt,
left=3pt,
right=6pt,
code={\rowcolors{2}{}{gray!10}\needspace{1em}}
}
%%%%%%%%%%%%%%%%%%% COMMANDS %%%%%%%%%%%%%%%%%%%%
\newcommand{\story}[2]{%
\subsubsection[#2]{The #2\\\hint{Cost: #1}}%
\index{#2 (Story)}%
\newcommand{\startingCondition}[1]{
\ifnum\value{list}<95
\item
#1
\fi
}
\arabic{list}: \textbf{\ifdefmacro{#2}{#2}{\MakeUppercase#2}}%
\newcommand\declareSQareas[1]{
\foreach \area in {sq,#1}%
{\startcontents[\area]
\stopcontents[\area]}
}
% the first side quest gets a ticked box in the toc.
% the rest get an empty box, so the GM can tick it once it's ready.
\newtoggle{firstsq}
\settoggle{firstsq}{true}
\newcommand{\sqtoc}{\printcontents[\sqarea]{l}{2}{\section*{Summaries}\setcounter{tocdepth}{3}}}
% Change the to depth from 2 to 3 in order to output a miniature table of contents on all side quests
\newcommand{\sqminitoc}{%
\printcontents[sq]{t}{3}{\setcounter{tocdepth}{3}}%
\newcommand{\sidequest}[2][]{
\vspace{1em}
\stopcontents[sq]
\foreach \area in {#1}%
{\resumecontents[\area]}
\renewcommand{\sqName}{#2}
\foreach \area in {#1}%
{\stopcontents[\area]}
\startcontents[sq]
\sqminitoc%
\bigLine
\vspace{1em}
\refstepcounter{sqNo}
\resumecontents[#1]
\subsubsection[%
\settoggle{firstsq}{false}
\stopcontents[#1]%
% Floating SQ ToCs
\titlecontents{tsubsubsection}
[3em]
{%
\contentspush{\scshape\large\arabic{sqNoSpare}~---~}%
\thecontentslabel%
}%
{}%
{}%
\titlecontents*{fsubsection}%
[20pt]
{%
\vspace{1em}\textcolor{\pageSideColor}{\adforn{54}}%
\quad\large%
\setcounter{sqNo}{0}%
}%
{}%
{}%
{\quad\textcolor{\pageSideColor}{\titlerule*[1pc]{---}}}%
[]%
[]
\titlecontents{fsubsubsection}
[5em]
{%
\vspace{.3em}%
\contentspush{%
\raggedright%
}%
\thecontentslabel%
}%
{}%
{}%
{ \enspace\titlerule*[1pc]{.}\bfseries\large\contentspage }%
[]%
%\titlecontents*{lsubsection}[0pt]
%{\adforn{10}~\large\raggedright}{}{}
%{}[][]
\newcommand\printAllSideQuests[1]{
\foreach \x in {#1}{
\printcontents[\x]{f}{2}{\setcounter{tocdepth}{3}}
\newcommand\hint[1]{%
\iftoggle{examplecharacter}{}%
%%%%%%%%%%%%%%%%%%%% Rules to Reference %%%%%%%%%%%%%%%%%%%%
\newcommand\makeRule[5]{
\subsubsection[#2: \roll{#3}{#4}, \glsentrytext{tn} #5]{#2}
\label{#1}%
\textit{\roll{#3}{#4}, \glsentrytext{tn}~#5.}%
}
\newcommand\makeAutoRule[3]{
\subsubsection[#2: #3]{#2}