Newer
Older
\newtoggle{intro}
\settoggle{intro}{true}
\newtoggle{personality}
\settoggle{personality}{false}
\setcounter{tocdepth}{1}
\setcounter{secnumdepth}{1}
%%%%%%%%%%%%% Season Numbers %%%%%%%%%%%%%
% We need these in seasons.sty
\newcounter{cycle}
\newcounter{temperature}
%%%%%%%%%%%%%%%%%%%% RANDOM NUMBERS %%%%%%%%%%%%%%%%%%%%
\newcounter{r4}
\setcounter{r4}{\day}
\addtocounter{r4}{1}
\whileboolexpr{
test {\ifnumcomp{\value{r4}}{>}{4}}
}
{\addtocounter{r4}{-3}}
\newcounter{r2}
\setcounter{r2}{\value{r4}}
\newcounter{r2b}
\setcounter{r2b}{\value{r2}}
\addtocounter{r2b}{-1}
\setcounter{r3b}{\value{r4}}
\addtocounter{r3b}{-1}
\divide\value{r4b} by 7
\stepcounter{r4b}
\newcounter{r6}
\setcounter{r6}{\month}
\newcounter{r6b}
\setcounter{r6b}{\month}
\newcounter{rn1t0}
\setcounter{rn1t0}{-1}
\newcounter{r0t1}
\setcounter{r0t1}{0}
\newcounter{r2t3}
\setcounter{r2t3}{2}
\newcounter{r3t4}
\setcounter{r3t4}{3}
\newcounter{rn3t3}
\setcounter{rn3t3}{3}
\newcounter{r4t5}
\setcounter{r4t5}{4}
\newcounter{r4t6}
\setcounter{r4t6}{4}
\newcounter{r12}
\setcounter{r12}{\month}
\newcounter{enc}
\newcounter{list}
\newcounter{age}
\setcounter{age}{1}
\newcounter{gold}
\setcounter{gold}{\day}
\setcounter{enc}{0}
\newcounter{noAppearing}
\setcounter{noAppearing}{1}
\ifnum\value{r2}>1%
\setcounter{r2}{1}%
\else%
\stepcounter{r2}%
\fi%
\setcounter{enc}{\value{r2}}%
\setcounter{r2b}{1}%
\else%
\setcounter{r2b}{2}%
\fi%
\setcounter{r2c}{1}%
\else%
\stepcounter{r2c}%
\fi%
}
\newcommand{\randomthree}{%
\ifnum\value{r3}>2%
\setcounter{r3}{1}%
\fi%
\ifnum\value{r3}<1%
\setcounter{r3}{2}%
\fi%
\stepcounter{r3}%
\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}%
\ifodd\value{r3}%
\stepcounter{r2b}%
\stepcounter{r3b}%
\multiply\value{rn3t3} by -1%
\addtocounter{rn3t3}{0}%
\stepcounter{r4t6}%
\stepcounter{r0t1}%
\stepcounter{rn1t0}
\fi%
\ifodd\value{r3b}%
\stepcounter{r3t4}%
\else%
\stepcounter{r2t3}%
\stepcounter{r4b}%
\fi%
\foreach\c in {r2,r2b,r2c}%
{\ifnum\value{\c}>2\setcounter{\c}{1}\stepcounter{r3c}\fi}%
{\ifnum\value{\c}>3\setcounter{\c}{1}\addtocounter{r6b}{-1}\fi}%
{\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%
\ifnum\value{r6b}<1\setcounter{r6b}{6}\fi%
\setcounter{r6}{\value{rn1t2}}%
\addtocounter{r6}{\value{r2t4}}%
\setcounter{r12}{\value{r6}}%
\addtocounter{r12}{\value{r6b}}%
}
\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%
\ifstrequal{#1}{b}{%
\bigLine
}{}
\begin{multicols}{2}
#2
\vfill\null
\columnbreak
#3
\end{multicols}
\ifstrequal{#1}{t}{%
\bigLine
}{}
\newcommand\playCommentary[3][b]{
\begin{figure*}[#1!]
\ifstrequal{#1}{b}{%
\bigLine
}{}
\noindent%
#3
\end{multicols}
\ifstrequal{#1}{t}{%
\bigLine
}{}
\end{figure*}
}{}
\rowcolors{2}{}{background!6}%
\needspace{2em}
\newenvironment{nametable}[2][cL]
{
\rowcolors{2}{}{background!6}%
\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}{}{background!6}\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\declareRegions[1]{
\foreach \area in {segments,#1}%
{\startcontents[\area]
\stopcontents[\area]}
}
% the first thread gets a ticked box in the toc.
% the rest get an empty box, so the GM can tick it once it's ready.
\newcommand{\threadToc}{\printcontents[\region]{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 threads
\newcommand{\threadMiniToc}{%
\printcontents[segments]{t}{3}{\setcounter{tocdepth}{3}}%
\newcounter{segNo}
\newcounter{segNoSpare}
\newcommand{\threadName}{}
\foreach \area in {#1}%
{\resumecontents[\area]}
\startcontents[segments]
\threadMiniToc%
\setcounter{segNoSpare}{\expandafter\thesegNo}%
\ifstrequal{#1}{}{}{(#1)~}%
\bfseries#3 -- \mdseries#4]%
{\large{\scshape\ifnum\thesegNo<1 1\else \thesegNo\fi)}~\large#3\ \hint{\ifglsentryexists{#2}{\Glsfmttext{#2}}{#2}}}
% Floating SQ ToCs, e.g.:
% Goblin Attacks!
% 1 - Scouting - the PCs spot a goblin
% 2 - Rude Awakening - A goblin raids the PCs food
% 3 - Raiders Galore - Goblins raid a local bailey
\titlecontents{tsubsubsection}
[3em]
{%
\contentspush{\scshape\large%
\ifnum\thesegNoSpare=0 % The thread num is set to 0 to stop
% the first part being ready.
1%
\else%
\thecontentslabel%
}%
{}%
{}%
\titlecontents*{fsubsection}%
[20pt]
{%
\needspace{5\baselineskip}
{\quad\textcolor{background}{\titlerule*[1pc]{---}}}%
\titlecontents{fsubsubsection}
[5em]
{%
\vspace{.3em}%
\contentspush{%
\ifnum\thesegNoSpare>0%
Part~\thesegNoSpare%
\else%
Part~1%
\fi:\quad%
\raggedright%
}%
\thecontentslabel%
}%
{}%
{}%
{ \enspace\titlerule*[1pc]{.}\bfseries\large\contentspage }%
[]%
%\titlecontents*{lsubsection}[0pt]
%{\adforn{10}~\large\raggedright}{}{}
%{}[][]
\newcommand\printThreadsInRegion[1]{
\label{threadList:#1}
\printcontents[#1]{f}{2}{\setcounter{tocdepth}{3}}
}
\ifglsentryexists{\x}{%
\section*{\Glsfmttext{\x}}
}{%
\section*{\x}
}%
\printcontents[\x]{f}{2}{\setcounter{tocdepth}{3}}
\newcommand\hint[1]{%
\iftoggle{examplecharacter}{}%
{\textcolor{background}{\small(\textbf{#1})}}
%%%%%%%%%%%%%%%%%%%% 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}