diff --git a/config/Makefile b/config/Makefile index de6839d90e08a3f08247da8ca5e8732bb0050cca..e5949843f9f72518e861bb4c8a9fea6a126b1738 100644 --- a/config/Makefile +++ b/config/Makefile @@ -1,11 +1,14 @@ -filename=example +filename=docs output: ${filename}.pdf ${filename}.pdf: ${filename}.tex bind.sty monsters.sty pdflatex ${filename}.tex -new: - if [ ! -d .git ] && [ -e ../.git ] - then - cp -n main.tex .gitignore .. - fi +docs.aux: + pdflatex docs.tex + pdflatex docs.tex +docs: docs.aux + pdflatex docs.tex +test: + pdflatex test.tex +all: docs test clean: rm -f *pdf *.aux *.toc *.acn *.acr *.log *.ptc *.out *.idx *.ist *.alg *.glo diff --git a/config/bind.sty b/config/bind.sty index bd1df914b11a5b91d97147957e9dd409e6225dc5..0cab9e727c5e27972cfb9ea982b82d2b4d28b560 100644 --- a/config/bind.sty +++ b/config/bind.sty @@ -1,787 +1,3 @@ -\ProvidesPackage{bind} -\RequirePackage[acronym]{glossaries} -\setacronymstyle{short-long-desc} -\RequirePackage{glossary-mcols} -\RequirePackage{glossaries-extra} -\RequirePackage{gfsartemisia-euler} % fancy fonts -\RequirePackage[T1]{fontenc} % -\RequirePackage{stmaryrd} % For boxy Maths symbols -\RequirePackage{wasysym} % for circly Maths symbols -\RequirePackage{dingbat} % for curly section symbols -\RequirePackage{appendix} -\RequirePackage{geometry} % changes page borders - \geometry{margin=50pt} -\RequirePackage[ - scale=1, - angle=0, - opacity=1, - contents={} -]{background}% for fancy borders -\RequirePackage{svg} -\RequirePackage{alltt} - \svgsetup{width=\textwidth} -\RequirePackage{tabularx} -\RequirePackage{wrapfig} -\RequirePackage{float} -\RequirePackage{epigraph} % part quotes -\RequirePackage{microtype} % more precise word-placement -\RequirePackage{makeidx} -\RequirePackage[english]{babel} -\RequirePackage{multicol} - \raggedcolumns -\RequirePackage{graphicx} -\RequirePackage{etoolbox} -\RequirePackage{titlesec,titletoc} -\RequirePackage{needspace} -\RequirePackage{tikz} - \usetikzlibrary{calc,mindmap,trees}% calc for fancy borders - \usetikzlibrary{intersections}% for very fancy borders with intersecting lines -\RequirePackage{pifont} -\RequirePackage{colortbl} -\RequirePackage[poster]{tcolorbox} -\tcbuselibrary{breakable,raster} -\tcbuselibrary{skins} % used for wiggly-border boxes - -%%%%% Add fancy page chapter sides %%%%% -\pagestyle{plain}% needed for fancy borders -\newcounter{chapshift} -\addtocounter{chapshift}{-1} - -\newcounter{pageDarkness} -\setcounter{pageDarkness}{20} - -\newcommand\pageSideColor{% - black!\arabic{pageDarkness}% -} - -\newtoggle{sideTab} -\settoggle{sideTab}{true} - -\newcommand\ChapFrame{% - \AddEverypageHook{% - \iftoggle{sideTab}% - { - \ifodd\value{page} - \backgroundsetup{contents={% - \begin{tikzpicture}[overlay,remember picture] - \node[ - fill=\pageSideColor, - inner sep=5pt, - rectangle, - text width=1.2cm, - text height=4.33cm, - align=center, - anchor=north east - ] - at ($ (current page.north east) + (-0cm,-2*\thechapshift cm) $) - {\rotatebox{90}{\hspace*{.3cm}\parbox[c][1.5cm][t]{3.4cm}{% - \raggedright\textcolor{white}{\scshape\rightmark}}}}; - \end{tikzpicture}% - }% - } - \else - \backgroundsetup{contents={% - \begin{tikzpicture}[overlay,remember picture] - \node[ - fill=\pageSideColor, - inner sep=5pt, - rectangle, - text width=1.2cm, - text height=4.33cm, - align=center, - anchor=north west - ] - at ($ (current page.north west) + (-0cm,-2*\thechapshift cm) $) - {\rotatebox{90}{\hspace*{.3cm}\parbox[c][1.5cm][t]{3.4cm}{% - \raggedright\textcolor{white}{\scshape\leftmark}}}}; - \end{tikzpicture}% - }% - } - \fi - } - {}% - \BgMaterial - }% - \stepcounter{chapshift}% -} - -% redefinition of \chaptermark to contain only the title -\renewcommand\chaptermark[1]{\markboth{\thechapter.~#1}{}} - - -\RequirePackage{xr-hyper} -\RequirePackage[ -pdfstartpage=1, -hidelinks=true, -bookmarks=true]% -{hyperref} - -%%%%%%%%%% Allow for external referencing - -\newcommand*{\externalReferent}[1]{ - \newtoggle{#1} - \IfFileExists{../#1/main.aux}{ - \makeatletter - \@addtofilelist{../#1/main.tex} - \@addtofilelist{../#1/main.aux}% - \makeatother - \externaldocument{../#1/main}% - \settoggle{#1}{true} - }% - {\typeout{No file #1.} - \settoggle{#1}{false} - } -} - - -%%%%%%%%%% Section Headers %%%%%%%%%% - -%%% Allow quotes under part headers -\makeatletter -\let\old@endpart\@endpart -\renewcommand\@endpart[1][]{% -\begin{quote}#1\end{quote}% -\old@endpart} -\makeatother - -%%%%%%%%%% Give higher penalty to ~ -% The ~ character usually functions as a space with a high penalty for line breaks. -% This stops the line breaks altogether, so we can write 'Athletics 3', without a line-break between the Skill and the number. - -\DeclareRobustCommand{\nobreakspace}{% - \leavevmode\nobreak\ } -\catcode `\~=13 -\def~{\nobreakspace{}} - -%%%%% Make table of contents two column - -\makeatletter -\renewcommand\tableofcontents{% -\begin{multicols}{2} - - \@starttoc{toc}% -\end{multicols} -} -% and make repeating function -\newcommand{\Repeat}[1]{% - \expandafter\@Repeat\expandafter{\the\numexpr #1\relax}% -} - -\def\@Repeat#1{% - \ifnum#1>0 - \expandafter\@@Repeat\expandafter{\the\numexpr #1-1\expandafter\relax\expandafter}% - \else - \expandafter\@gobble - \fi -} -\def\@@Repeat#1#2{% - \@Repeat{#1}{#2}#2% -} -\makeatother - - -\newcommand{\chapnumfont}{ - \fontsize{50}{0} - \selectfont -} - -% change bullet points - -\renewcommand{\labelitemi}{\ding{250}} -\renewcommand{\labelitemii}{\ding{254}} - -%%%%%%%%%% Encounter Numbers - -\newcounter{encnum} -\setcounter{encnum}{1} -\newcommand{\encsymbol}{\ding{168}} -\newcommand{\encnum}{\ifnumcomp{\value{encnum}}{=}{1}{$A$}{\arabic{encnum}}\encsymbol\addtocounter{encnum}{1}} -\newcommand{\sqarea}{town} - -\newcommand{\headingtype}{CHAPTER} - -\newcommand{\pic}[1]{ - \needspace{4cm} - \noindent% - \IfFileExists{images/#1.svg}{% - \noindent\includesvg[width=\linewidth]{images/#1} - }{% - \includegraphics[width=\linewidth]{images/#1.jpg} - } - -} - -\newcommand{\sidepic}[3][5]{ - \needspace{4cm} - \begin{wrapfigure}{R}{.#1\linewidth} - \noindent% - \IfFileExists{images/#2.svg}{% - \includesvg[width=\linewidth]{images/#2} - }{ - \includegraphics[width=\linewidth]{images/#2.jpg} - } - #3 - \end{wrapfigure} -} - -\newcommand{\toppic}[2]{ - \begin{figure*}[t!] - \IfFileExists{images/#1.svg}{ - \includesvg[width=\textwidth]{images/#1} - }{ - \includegraphics[width=\textwidth]{images/#1.jpg} - } - #2 - \end{figure*} -} - -\newcommand{\toppicBorder}[2]{ - \begin{figure*}[t!] - \begin{tcolorbox}[before upper={\parindent0pt},colframe=black,colback=gray] - \IfFileExists{images/#1.svg}{ - \includesvg[width=\textwidth]{images/#1} - }{ - \includegraphics[width=\textwidth]{images/#1.jpg} - } - #2 - \end{tcolorbox} - \end{figure*} -} - -\newcommand{\bottompic}[2]{ - \begin{figure*}[b!] - \IfFileExists{images/#1.svg}{ - \includesvg[width=\textwidth]{images/#1} - }{ - \includegraphics[width=\textwidth]{images/#1.jpg} - } - #2 - \end{figure*} -} - -\newcommand{\bottompicBorder}[2]{ - \begin{figure*}[b!] - \begin{tcolorbox}[before upper={\parindent0pt},colframe=black,colback=gray] - \IfFileExists{images/#1.svg}{ - \includesvg[width=\textwidth]{images/#1} - }{ - \includegraphics[width=\textwidth]{images/#1.jpg} - } - #2 - \end{tcolorbox} - \end{figure*} -} - -% Define the 'ornamentedbox' environment - -% Wiggly Borders -\makeatletter -\tikzset{ - use path for main/.code={% - \tikz@addmode{% - \expandafter\pgfsyssoftpath@setcurrentpath\csname tikz@intersect@path@name@#1\endcsname - }% - }, - use path for actions/.code={% - \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\expandafter\let\expandafter\tikz@actions@path\csname tikz@intersect@path@name@#1\endcsname}% - }, - use path/.style={% - use path for main=#1, - use path for actions=#1, - } -} -\makeatother - -\colorlet{ornamentedFrameInner}{white} -\colorlet{ornamentedFrameOuter}{gray} - -\tikzset{ornamented frame inner/.style={color=ornamentedFrameInner, - line width=2pt}, - ornamented frame outer/.style={color=ornamentedFrameOuter, - line width=3pt}} - -\tcbsubskin{ornamented}{empty}{ - skin first=ornamented, skin last=ornamented, - title engine=standard, - colbacktitle=white, - frame code={ - % Account for the line widths in order not to draw beyond the bounding - % box---except for a few very small details for which this is intentional. - \coordinate (north west) at ([shift={(1.5pt,-1.5pt)}]frame.north west); - \coordinate (north east) at ([shift={(-1.5pt,-1.5pt)}]frame.north east); - \coordinate (south east) at ([shift={(-1.5pt,1.5pt)}]frame.south east); - \coordinate (south west) at ([shift={(1.5pt,1.5pt)}]frame.south west); - % - \foreach \xoffset/\point in {34pt/north west, -34pt/north east, - 34pt/south west, -34pt/south east} { - \fill[color=ornamentedFrameOuter] - ([xshift=\xoffset]\point) circle[radius=2.5pt]; - } - % - \path[name path=ornament 1] - ([yshift=-4pt]north west) - [rounded corners=0.5pt] -- ++(23pt,0) - [rounded corners=2pt] -- ++(3pt,-4pt) - -- ([shift={(-26pt,-8pt)}]north east) - [rounded corners=0.5pt] -- ++(3pt,4pt) - [rounded corners=4pt] -- ([yshift=-4pt]north east) - -- ([yshift=4pt]south east) - [rounded corners=0.5pt] -- ++(-23pt,0) - [rounded corners=2pt] -- ++(-3pt,4pt) - -- ([shift={(26pt,8pt)}]south west) - [rounded corners=0.5pt] -- ++(-3pt,-4pt) - [rounded corners=4pt] -- ([yshift=4pt]south west) - -- cycle; - % - \path[rounded corners=0.5pt, name path=ornament 2] - ([yshift=-20pt]north west) - -- ++(-4pt,3pt) - -- ++(0,4pt) - to[out=0, in=-90] ([shift={(8pt,0pt)}]north west) - -- ([shift={(34pt,0pt)}]north west) - -- ([shift={(-8pt,0pt)}]north east) - to[out=-90, in=180] ([shift={(4pt,-13pt)}]north east) - -- ++(0,-4pt) - -- ++(-4pt,-3pt) - -- ([yshift=20pt]south east) - -- ++(4pt,-3pt) - -- ++(0,-4pt) - to[out=180, in=90] ([shift={(-8pt,0pt)}]south east) - -- ([shift={(8pt,0pt)}]south west) - to[out=90, in=0] ([shift={(-4pt,13pt)}]south west) - -- ++(0,4pt) - -- ++(4pt,3pt) - -- cycle; - % - \draw[ornamented frame outer, use path=ornament 1]; - \draw[ornamented frame outer, use path=ornament 2]; - \draw[ornamented frame inner, use path=ornament 1]; - \draw[ornamented frame inner, use path=ornament 2]; - % - \foreach \xoffset/\point in {34pt/north west, -34pt/north east, - 34pt/south west, -34pt/south east} { - \fill[color=black] - ([xshift=\xoffset]\point) circle[radius=3pt]; - } - } -} - -% These parameters---especially those related to geometry---are better located -% here in a style than in the subskin definition (see the Subskins section of -% the tcolorbox manual). -\tcbset{ornamented/.style={skin=ornamented, toptitle=14.5pt, top=15pt, bottom=9.5pt, - coltitle=black} -} - -% Convenient style to use with a tcolorbox preceded by text (or anything), -% when one wants to prevent any page break before the tcolorbox. -\tcbset{skip and no break/.style={ - before={\par\nopagebreak\vspace{2ex}\noindent}} -} - -% Style suitable for an “on line” (in the middle of a paragraph) -% 'ornamentedbox'. -\tcbset{my on line/.style={ - capture=hbox, tcbox raise base, top=14pt, bottom=14pt, - before={\kern 5pt}, after={\kern 5pt}} -} - -%%%%% TColorBox Basic Setup %%%%% - -\tcbset{enhanced, -ornamented, -before upper={\parindent15pt}, -fonttitle=\bfseries,coltitle=black,attach boxed title to top center= -{yshift=-0.25mm-\tcboxedtitleheight/2,yshifttext=-2mm-\tcboxedtitleheight/2}, -boxed title style={boxrule=-0.5mm, -frame code={ \path[tcb fill frame] ([xshift=-4mm]frame.west) --- (frame.north west) -- (frame.north east) -- ([xshift=4mm]frame.east) --- (frame.south east) -- (frame.south west) -- cycle; }, -interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west) --- (interior.north west) -- (interior.north east) --- ([xshift=2mm]interior.east) -- (interior.south east) -- (interior.south west) --- cycle;} -} -} - - -\newtcolorbox{boxtext}[1][]{ornamented,colback=white,fonttitle=\scshape, #1} - -% Chapter Heading Color -\colorlet{chapnumcol}{black!100} - -%%%%% Section Formatting %%%%% - -\newcommand{\frontpage}[3]{ - \iftoggle{verbose}{ - \begin{titlepage} - \centering - \vspace{2cm} - {\scshape\Huge\bfseries #1\par} - \vspace{2cm} - \includegraphics[width=0.6\textwidth]{#3}\par\vspace{1cm} - {\Large #2\par} - \vspace{1.5cm} - {\large Last edited \today\par} - - \end{titlepage} - \cleardoublepage - }{} -} - -\titleformat{\chapter}[display] -{\bfseries} -{% - \ChapFrame - \ifnum\value{pageDarkness}<80 - \addtocounter{pageDarkness}{7} - \else - \colorlet{chapnumcol}{black!40} - \fi - \hspace*{-1.5em} -\begin{tikzpicture} - \node[minimum width=\linewidth+3em, text=white, fill=\pageSideColor, inner sep=1, outer sep=0, anchor=south] (rectinit) {\Huge \headingtype}; - \node[minimum width=.75\textwidth, text=white, inner sep=3, outer sep=0, anchor=south west, text width=.75\textwidth, align=right] at (rectinit.south west) (chapname) {}; - \node[minimum width=.25\textwidth, inner sep=-5, outer sep=0, anchor=south west, text width=.25\textwidth, align=left] at (chapname.south east) {\chapnumfont\textcolor{chapnumcol}{\Roman{chapter}}}; -\end{tikzpicture}} -{0pt} -{\Huge} - - -\titleformat{\section}[frame] -{\needspace{20em}\normalfont} -{\filright -\footnotesize -\enspace SECTION \thesection\enspace} -{8pt} -{\Large\bfseries\filcenter} - -\titleformat{\subsection}% - {\needspace{13em}\center\large\bfseries}% - {}% - {1em}% - {}% - [\rule{.9\linewidth}{.2pt}] -% -\titleformat{\subsubsection} -{\needspace{4em}\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{} - -%%%%% Character Sheet Tracker - - \newcounter{track} - \setcounter{track}{18} - \newcommand{\tracker}{\center\noindent\arabic{track}\addtocounter{track}{-1}\vspace{.54cm} - - } - -%%%%% NPC Names - -\newcommand{\name}{} -\newcommand{\personality}{} -\newcommand{\mannerism}{} -\newcommand{\archetype}{} -\newcommand{\npcsymbol}{} -\newcommand{\npc}[2]{\settoggle{personality}{false}\renewcommand{\name}{#1 #2}\renewcommand{\npcsymbol}{#1}} -\newcommand{\NPC}[5]{\renewcommand{\name}{#1 #2} -\renewcommand{\npcsymbol}{#1} -\settoggle{personality}{true} -\renewcommand{\personality}{#3} -\renewcommand{\mannerism}{#4} -\renewcommand{\archetype}{#5} -} -\newcommand{\T}{\opposition\settoggle{team}{true}} % groups -\newcommand{\M}{\mars} % male -\newcommand{\F}{\venus} % female -\newcommand{\E}{\mercury} % blood casters -\newcommand{\A}{\taurus} % creature -\newcommand{\N}{\leftmoon} % nura -\newcommand{\D}{\fullmoon} % undead - -\newcommand{\monster}[1]{\needspace{4em}\vspace{.38cm} \ding{70} #1 \ding{70}\vspace{.18cm}} - -%%%%%%%%%%%%%%%%%%%% TOGGLES %%%%%%%%%%%%%%%%%%%% - -\newtoggle{verbose} -\settoggle{verbose}{true} -\newtoggle{personality} -\settoggle{personality}{false} - -% This toggle tells you if this is just one creature or a team. -\newtoggle{team} -\settoggle{team}{false} - -\iftoggle{verbose}{ - \setcounter{tocdepth}{1} - \setcounter{secnumdepth}{1} -} - -\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} -\newcounter{r2c} -\setcounter{r2c}{2} -\newcounter{r3} -\setcounter{r3}{\month} - \divide\value{r3} by 4 -\newcounter{r3b} - \setcounter{r3b}{\value{r4}} - \addtocounter{r3b}{-1} -\newcounter{r3c} - \setcounter{r3c}{0} -\newcounter{r4b} - \setcounter{r4b}{\day} -\newcounter{r12} -\setcounter{r12}{\month} -\newcounter{enc} -\newcounter{list} -\newcounter{spelllevel} -\setcounter{spelllevel}{0} - -\newcounter{age} -\setcounter{age}{1} -\newcounter{gold} -\setcounter{gold}{\day} -\setcounter{enc}{0} - - -%%%%%%%%%%%%%%%%%%%% LAYOUT %%%%%%%%%%%%%%%%%%%% -\makeindex -\raggedbottom - -\newcommand{\currentsphere}{magic} -\newcommand{\sphere}[1]{\setcounter{spelllevel}{0}\renewcommand{\currentsphere}{#1}\index{#1}\section{\currentsphere}} -\newcommand{\spelllevel}{\addtocounter{spelllevel}{1}% - \subsection{\currentsphere~ Level \arabic{spelllevel}}} -\newcommand{\enhancement}[3]{\paragraph[(#1) #2: #3]{(#1) Enhancement -- #2:}\index{Enhancement!#2}} -\newcommand{\magicitem}[7]{\vspace{2em}\needspace{4em}\noindent\textbf{#1} -\index{Magical Item!#1} - - \noindent - \textit{Spells: #2, }% - \textit{Path: #3, }% - \textit{Duration: #4, }% - \textit{Type: #5, }% - \textit{Potency: +#6, }% - \textit{MP: #7}% - % Type can be 'Pocket Spell', 'Talisman', or 'Artefact'. - \needspace{2em}% -} - -\newcommand{\manalake}[8]{\subsection{#1 (Level #8)} - - \textit{Spells: #2, }\textit{Path: #3, }\textit{Duration: #4, }\textit{Type: #5, }\textit{Potence: #6, }\textit{#7 MP}% Type can be 'pocket spell', 'magical item', or 'artefact'. - \index{Mana Lakes!#1} - \vspace{.3em} -} - -\newcommand{\spell}[4]{\subsubsection[#1: #4]{#1} - -{\it Type: #2, Skill: #3} - -\noindent} - -% Toggles for knacks - -%%%%%%%%%%%%%%%%%%%% Environments %%%%%%%%%%%%%%%%%%%% - -\newenvironment{speechtext}{ - \begin{boxtext}\it -\begin{quotation}\noindent}% -{\end{quotation} -\end{boxtext}% -} - -\newenvironment{rolltable}% -{\vspace{.3cm}\begin{tabular}{|lp{.8\textwidth}} - - -Roll & Result \\ -\hline - -}% -{\end{tabular}} - - -\newenvironment{exampletext}{\needspace{2em}\vspace{.3cm} - -\rule{.9\linewidth}{0.2pt} - -\vspace{.3cm} - -\it}{\normalfont\vspace{2em}} - -\newtcolorbox{xpchart}[1]{tabularx={l|p{.8\textwidth}},adjusted title=XP Rewards for #1,bottom=10pt} - -\newtcolorbox[use counter=enc, use counter=list]{encounters}[1]{ornamented,adjusted title=Encounters in #1,tabularx={XXp{.6\textwidth}},bottom=10pt,code={\setcounter{enc}{19}\setcounter{list}{18}}} - -\newtcolorbox{rollchart}{tabularx={p{.25\linewidth}X},top=10pt,bottom=10pt} - -\newtcolorbox{xpbox}[1]{tabularx={lc},bottom=10pt,top=10pt,equal height group=#1} - - -%%%%%%%%%%%%%%%%%%% COMMANDS %%%%%%%%%%%%%%%%%%%% - -\newcommand{\story}[2]{% -\subsubsection{#2} -Cost: #1\par\noindent} - -\newcommand{\best}[2][\C]{\npc{#1}{#2}\subsubsection{#2}\index{Antagonists!#2}} - -\newcounter{random} -\setcounter{random}{1} -\newcounter{increment} -\setcounter{increment}{1} - -\newcommand{\random}{ - \addtocounter{random}{\value{page}} - \multiply\value{random} by \value{chapter}\addtocounter{random}{\value{increment}} - \whileboolexpr{ - test {\ifnumcomp{\value{random}}{>}{100}} - } - {\addtocounter{random}{-100}} - \whileboolexpr{ - test {\ifnumcomp{\value{random}}{>}{10}} - } - {\addtocounter{random}{-10}} - \addtocounter{increment}{1} -} - -\newcommand{\randomtwo}{% - \ifnumcomp{\value{r2}}{>}{1}{\setcounter{r2}{1}}{\addtocounter{r2}{1}}% -\setcounter{enc}{\value{r2}}% -} - -\newcommand{\randomtwoB}{ - \ifodd\value{r3b}\setcounter{r2b}{1}\else\setcounter{r2b}{2}\fi% -} - -\newcommand{\randomtwoC}{ - \ifnum\value{r2c}>1% - \setcounter{r2c}{1}\else% - \addtocounter{r2c}{1}% - \fi% -} - -\newcommand{\randomthree}{% - \ifnumcomp{\value{r3}}{>}{2}{\setcounter{r3}{1}}{\addtocounter{r3}{1}}% - \setcounter{age}{\value{r3}}% - \ifnum\value{r3}<1\setcounter{r3}{2}\fi% -} - -\newcommand{\randomthreeB}{% - \ifnum\value{r3b}>2% - \setcounter{r3b}{1}% - \else% - \addtocounter{r3b}{1}% - \fi% - \ifnum\value{r3b}<1% - \setcounter{r3b}{3} - \fi% -} - -\newcommand{\randomthreeC}{ - \ifnum\value{r3c}>3% - \setcounter{r3c}{1}\else% - \addtocounter{r3c}{1}% - \fi% -} - -\newcommand{\randomfour}{% - \ifnumcomp{\value{r4}}{>}{3}{\setcounter{r4}{1}}{\addtocounter{r4}{1}}% - \ifnumcomp{\value{r4}}{<}{1}{\setcounter{r4}{1}}{} - \setcounter{track}{\value{r4}}% -} - -\newcommand{\randomfourB}{% - \ifnum\value{r4b}>3\setcounter{r4b}{1}% - \else% - \addtocounter{r4b}{1}% - \fi% -} - -\newcommand{\randomdozen}{% - \ifnum\value{r12}>12\setcounter{r12}{2}\fi% - \ifnum\value{r12}<4\setcounter{r12}{2}\fi% - \ifnum\value{age}>0\addtocounter{r12}{\value{age}}\else\ifnum\value{r4}>0\addtocounter{r12}{\value{r4}}\else\addtocounter{r12}{3}\fi\fi% -} - -\newcommand{\mapentry}[1]{\needspace{2em}\addtocounter{list}{1}\subsubsection[#1]{\arabic{list}: #1}} -\newcommand{\li}{\addtocounter{enc}{-1}\arabic{enc}&} -\newcommand{\lii}{\addtocounter{list}{-1}\arabic{list}&} - -%%%%% Side Quests - -% 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 tocdepth from 2 to 3 in order to output a miniature table of contents on all side quests -\newcommand{\sqminitoc}{ - - \begin{figure*}[t] - - \begin{tcolorbox}[ornamented,adjusted title={Summary: \sqName}] - \vspace{-1em} - \printcontents[sq]{l}{2}{\setcounter{tocdepth}{3}} - - \end{tcolorbox} - - \end{figure*} -} - -\newcommand{\sqName}{} - -\newcommand{\sidequest}[1]{\renewcommand{\sqName}{#1} - \resumecontents[\sqarea] - \subsection{\sqName} - \stopcontents[\sqarea] - \settoggle{firstsq}{true} -} - -\newcommand{\sqpart}[3]{\resumecontents[#1]\subsubsection[\iftoggle{firstsq}{\CheckedBox}{\Square} #2 -- #3]{(#1) #2}\stopcontents[#1]\settoggle{firstsq}{false}} - -%%%%% Character Sheet Commands - -\newcommand{\trait}[1]{ -\vspace{.2cm} #1 \line(1,0){30} - - \begin{tabular}{p{0em}p{0em}p{0em}p{0em}p{0em}p{0em}p{0em}p{0em}p{0em}} - - \ding{108} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} \\ - \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} \\ - \end{tabular} - -} - - \newcommand{\shortline}{\line(1,0){22}} - \newcommand{\weeline}{\line(1,0){30} \hspace{.6cm}} - \newcommand{\vlongline}{\line(1,0){100}\hspace{0.8cm}} - \newcommand{\writeline}{\line(1,0){59}} -\newcommand{\fiveboxes}{\ding{111}\ding{111}\ding{111}\ding{111}\ding{111}} -\newcommand{\threeboxes}{\ding{111}\ding{111}\ding{111}} -\newcommand{\threecircles}{\ding{109}\ding{109}\ding{109}} -\newcommand{\tenboxes}{ \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} \\} -\newcommand{\tencircles}{\ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} \\} -\newcommand{\attributecircles}{\ding{175}\ding{174}\ding{173}\ding{172}{\Large\ding{109}}\ding{172}\ding{173}\ding{174}\ding{175}} -\newcommand{\Split}{ - \line(1,0){120} - - } -\newcommand{\skill}[1]{#1 & \ding{109} & \ding{109} & \ding{109} \\ -} - -\newcommand{\longline}{\line(1,0){320}\par\vspace{.2cm}} +\RequirePackage{config/layout} +\RequirePackage{config/stats} +\RequirePackage{config/monsters} diff --git a/config/docs.tex b/config/docs.tex new file mode 100644 index 0000000000000000000000000000000000000000..51f728182afa40a98a2b5c2336fbd9dc5f5e90f8 --- /dev/null +++ b/config/docs.tex @@ -0,0 +1,176 @@ +\documentclass[a4paper,openany]{book} +\usepackage{layout} +\usepackage{stats} +\usepackage{monsters} +\usepackage{lipsum} + +\date{\today} + +\begin{document} + +\chapter{How to Make Monsters} + +\section{Introduction} + +\begin{multicols}{2} + +\subsection{All about Dragons} + +\begin{boxtext} + +As you embark upon your first adventure, you summon your first monster with a simple backstroke. +You write down {\tt\textbackslash dragon}, and behold! + +\end{boxtext} + +\dragon + +Each time you conjure the dragon, it will look a little different. +The next one might look like this: + +\dragon + +If you find it hard to tell the difference between all the dragons, you can give them names in square brackets with the {\tt\textbackslash NPC command}, like this: + +{\tt\textbackslash dragon[\textbackslash npc\{\textbackslash M\}\{Bob the dragon\}] } + +Which then makes a male dragon called ``Bob'': + +\dragon[\npc{\M}{Bob the Dragon}] + +The first field can also indicate a female with an {\tt\textbackslash F} (\F), a team of people with a {\tt\textbackslash T} (\T), or undead with \textbackslash D (\D). + +With a little study, you can summon dozens of monsters, including {\tt\textbackslash humansoldier}, {\tt\textbackslash basilisk}, and {\tt \textbackslash ghoul}. + +\subsection{Individual NPCs} + +Individual characters can be created by using the {\tt\textbackslash npc} command then the \textbackslash person command, with its nine arguments: + +\begin{verbatim} + +\npc{\M}{Alice} + +\person{0}% STRENGTH +{1}% DEXTERITY +{-1}% SPEED +{{2}% INTELLIGENCE +{0}% WITS +{0}}% CHARISMA +{0}% DR +{1}% COMBAT +{Academics 1, Survival 1}% SKILLS +{\longsword, adventuring equipment}% EQUIPMENT +{} + +\end{verbatim} + +\npc{\M}{Alice} +\person{0}% STRENGTH +{1}% DEXTERITY +{-1}% SPEED +{{2}% INTELLIGENCE +{0}% WITS +{0}}% CHARISMA +{0}% DR +{1}% COMBAT +{Academics 1, Survival 1}% SKILLS +{\longsword, adventuring equipment}% EQUIPMENT +{} + +You can add things for these people to say with a {\tt\textbackslash begin\{speechtext\}} command: + +\begin{speechtext} + + ``Would you tell me, please, which way I ought to go from here?'' + + ``That depends a good deal on where you want to get to.'' + +\end{speechtext} + +\subsection{And now for something completely different} + +This is a magical item. + +\begin{verbatim} + +\magicitem{Noodle of Death}% NAME + {Extinguish}% SPELL + {Divinity (FSM)}% PATH + {Instant}% DURATION + {Pocket Spell}% TYPE + {2}% Potency + {5}% MP + +\end{verbatim} + +\magicitem{Noodle of Death}% NAME + {Extinguish}% SPELL + {Divinity (FSM)}% PATH + {Instant}% DURATION + {Pocket Spell}% TYPE + {2}% Potency + {5}% MP + +\subsection{Encounters} + +Make encounter tables like this: + +\begin{verbatim} + + \begin{encounters}{Wonderland} + + Fields & Gardens & Results \\\hline + + \li & Doormouse \\ + \li & Dodo \\ + \li \lii Unicorn \\ + \li \lii Red Queen \\ + & \lii Black Queen \\ + & \lii Green Queen \\ + +\end{verbatim} + +\begin{encounters}{Wonderland} + + Fields & Gardens & Results \\\hline + + \li & Doormouse \\ + \li & Dodo \\ + \li \lii Unicorn \\ + \li \lii Red Queen \\ + & \lii Black Queen \\ + & \lii Green Queen \\ + + +\end{encounters} + +And charts about roll successes like this: + +\begin{verbatim} + + + \begin{rollchart} + + Roll & Result \\\hline + + 12 & Success \\ + + 11 & Failure \\ + + \end{rollchart} + +\end{verbatim} + +\begin{rollchart} + + Roll & Result \\\hline + + 12 & Success \\ + + 11 & Failure \\ + +\end{rollchart} + +\end{multicols} + +\end{document} diff --git a/config/layout.sty b/config/layout.sty new file mode 100644 index 0000000000000000000000000000000000000000..bd1df914b11a5b91d97147957e9dd409e6225dc5 --- /dev/null +++ b/config/layout.sty @@ -0,0 +1,787 @@ +\ProvidesPackage{bind} +\RequirePackage[acronym]{glossaries} +\setacronymstyle{short-long-desc} +\RequirePackage{glossary-mcols} +\RequirePackage{glossaries-extra} +\RequirePackage{gfsartemisia-euler} % fancy fonts +\RequirePackage[T1]{fontenc} % +\RequirePackage{stmaryrd} % For boxy Maths symbols +\RequirePackage{wasysym} % for circly Maths symbols +\RequirePackage{dingbat} % for curly section symbols +\RequirePackage{appendix} +\RequirePackage{geometry} % changes page borders + \geometry{margin=50pt} +\RequirePackage[ + scale=1, + angle=0, + opacity=1, + contents={} +]{background}% for fancy borders +\RequirePackage{svg} +\RequirePackage{alltt} + \svgsetup{width=\textwidth} +\RequirePackage{tabularx} +\RequirePackage{wrapfig} +\RequirePackage{float} +\RequirePackage{epigraph} % part quotes +\RequirePackage{microtype} % more precise word-placement +\RequirePackage{makeidx} +\RequirePackage[english]{babel} +\RequirePackage{multicol} + \raggedcolumns +\RequirePackage{graphicx} +\RequirePackage{etoolbox} +\RequirePackage{titlesec,titletoc} +\RequirePackage{needspace} +\RequirePackage{tikz} + \usetikzlibrary{calc,mindmap,trees}% calc for fancy borders + \usetikzlibrary{intersections}% for very fancy borders with intersecting lines +\RequirePackage{pifont} +\RequirePackage{colortbl} +\RequirePackage[poster]{tcolorbox} +\tcbuselibrary{breakable,raster} +\tcbuselibrary{skins} % used for wiggly-border boxes + +%%%%% Add fancy page chapter sides %%%%% +\pagestyle{plain}% needed for fancy borders +\newcounter{chapshift} +\addtocounter{chapshift}{-1} + +\newcounter{pageDarkness} +\setcounter{pageDarkness}{20} + +\newcommand\pageSideColor{% + black!\arabic{pageDarkness}% +} + +\newtoggle{sideTab} +\settoggle{sideTab}{true} + +\newcommand\ChapFrame{% + \AddEverypageHook{% + \iftoggle{sideTab}% + { + \ifodd\value{page} + \backgroundsetup{contents={% + \begin{tikzpicture}[overlay,remember picture] + \node[ + fill=\pageSideColor, + inner sep=5pt, + rectangle, + text width=1.2cm, + text height=4.33cm, + align=center, + anchor=north east + ] + at ($ (current page.north east) + (-0cm,-2*\thechapshift cm) $) + {\rotatebox{90}{\hspace*{.3cm}\parbox[c][1.5cm][t]{3.4cm}{% + \raggedright\textcolor{white}{\scshape\rightmark}}}}; + \end{tikzpicture}% + }% + } + \else + \backgroundsetup{contents={% + \begin{tikzpicture}[overlay,remember picture] + \node[ + fill=\pageSideColor, + inner sep=5pt, + rectangle, + text width=1.2cm, + text height=4.33cm, + align=center, + anchor=north west + ] + at ($ (current page.north west) + (-0cm,-2*\thechapshift cm) $) + {\rotatebox{90}{\hspace*{.3cm}\parbox[c][1.5cm][t]{3.4cm}{% + \raggedright\textcolor{white}{\scshape\leftmark}}}}; + \end{tikzpicture}% + }% + } + \fi + } + {}% + \BgMaterial + }% + \stepcounter{chapshift}% +} + +% redefinition of \chaptermark to contain only the title +\renewcommand\chaptermark[1]{\markboth{\thechapter.~#1}{}} + + +\RequirePackage{xr-hyper} +\RequirePackage[ +pdfstartpage=1, +hidelinks=true, +bookmarks=true]% +{hyperref} + +%%%%%%%%%% Allow for external referencing + +\newcommand*{\externalReferent}[1]{ + \newtoggle{#1} + \IfFileExists{../#1/main.aux}{ + \makeatletter + \@addtofilelist{../#1/main.tex} + \@addtofilelist{../#1/main.aux}% + \makeatother + \externaldocument{../#1/main}% + \settoggle{#1}{true} + }% + {\typeout{No file #1.} + \settoggle{#1}{false} + } +} + + +%%%%%%%%%% Section Headers %%%%%%%%%% + +%%% Allow quotes under part headers +\makeatletter +\let\old@endpart\@endpart +\renewcommand\@endpart[1][]{% +\begin{quote}#1\end{quote}% +\old@endpart} +\makeatother + +%%%%%%%%%% Give higher penalty to ~ +% The ~ character usually functions as a space with a high penalty for line breaks. +% This stops the line breaks altogether, so we can write 'Athletics 3', without a line-break between the Skill and the number. + +\DeclareRobustCommand{\nobreakspace}{% + \leavevmode\nobreak\ } +\catcode `\~=13 +\def~{\nobreakspace{}} + +%%%%% Make table of contents two column + +\makeatletter +\renewcommand\tableofcontents{% +\begin{multicols}{2} + + \@starttoc{toc}% +\end{multicols} +} +% and make repeating function +\newcommand{\Repeat}[1]{% + \expandafter\@Repeat\expandafter{\the\numexpr #1\relax}% +} + +\def\@Repeat#1{% + \ifnum#1>0 + \expandafter\@@Repeat\expandafter{\the\numexpr #1-1\expandafter\relax\expandafter}% + \else + \expandafter\@gobble + \fi +} +\def\@@Repeat#1#2{% + \@Repeat{#1}{#2}#2% +} +\makeatother + + +\newcommand{\chapnumfont}{ + \fontsize{50}{0} + \selectfont +} + +% change bullet points + +\renewcommand{\labelitemi}{\ding{250}} +\renewcommand{\labelitemii}{\ding{254}} + +%%%%%%%%%% Encounter Numbers + +\newcounter{encnum} +\setcounter{encnum}{1} +\newcommand{\encsymbol}{\ding{168}} +\newcommand{\encnum}{\ifnumcomp{\value{encnum}}{=}{1}{$A$}{\arabic{encnum}}\encsymbol\addtocounter{encnum}{1}} +\newcommand{\sqarea}{town} + +\newcommand{\headingtype}{CHAPTER} + +\newcommand{\pic}[1]{ + \needspace{4cm} + \noindent% + \IfFileExists{images/#1.svg}{% + \noindent\includesvg[width=\linewidth]{images/#1} + }{% + \includegraphics[width=\linewidth]{images/#1.jpg} + } + +} + +\newcommand{\sidepic}[3][5]{ + \needspace{4cm} + \begin{wrapfigure}{R}{.#1\linewidth} + \noindent% + \IfFileExists{images/#2.svg}{% + \includesvg[width=\linewidth]{images/#2} + }{ + \includegraphics[width=\linewidth]{images/#2.jpg} + } + #3 + \end{wrapfigure} +} + +\newcommand{\toppic}[2]{ + \begin{figure*}[t!] + \IfFileExists{images/#1.svg}{ + \includesvg[width=\textwidth]{images/#1} + }{ + \includegraphics[width=\textwidth]{images/#1.jpg} + } + #2 + \end{figure*} +} + +\newcommand{\toppicBorder}[2]{ + \begin{figure*}[t!] + \begin{tcolorbox}[before upper={\parindent0pt},colframe=black,colback=gray] + \IfFileExists{images/#1.svg}{ + \includesvg[width=\textwidth]{images/#1} + }{ + \includegraphics[width=\textwidth]{images/#1.jpg} + } + #2 + \end{tcolorbox} + \end{figure*} +} + +\newcommand{\bottompic}[2]{ + \begin{figure*}[b!] + \IfFileExists{images/#1.svg}{ + \includesvg[width=\textwidth]{images/#1} + }{ + \includegraphics[width=\textwidth]{images/#1.jpg} + } + #2 + \end{figure*} +} + +\newcommand{\bottompicBorder}[2]{ + \begin{figure*}[b!] + \begin{tcolorbox}[before upper={\parindent0pt},colframe=black,colback=gray] + \IfFileExists{images/#1.svg}{ + \includesvg[width=\textwidth]{images/#1} + }{ + \includegraphics[width=\textwidth]{images/#1.jpg} + } + #2 + \end{tcolorbox} + \end{figure*} +} + +% Define the 'ornamentedbox' environment + +% Wiggly Borders +\makeatletter +\tikzset{ + use path for main/.code={% + \tikz@addmode{% + \expandafter\pgfsyssoftpath@setcurrentpath\csname tikz@intersect@path@name@#1\endcsname + }% + }, + use path for actions/.code={% + \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\expandafter\let\expandafter\tikz@actions@path\csname tikz@intersect@path@name@#1\endcsname}% + }, + use path/.style={% + use path for main=#1, + use path for actions=#1, + } +} +\makeatother + +\colorlet{ornamentedFrameInner}{white} +\colorlet{ornamentedFrameOuter}{gray} + +\tikzset{ornamented frame inner/.style={color=ornamentedFrameInner, + line width=2pt}, + ornamented frame outer/.style={color=ornamentedFrameOuter, + line width=3pt}} + +\tcbsubskin{ornamented}{empty}{ + skin first=ornamented, skin last=ornamented, + title engine=standard, + colbacktitle=white, + frame code={ + % Account for the line widths in order not to draw beyond the bounding + % box---except for a few very small details for which this is intentional. + \coordinate (north west) at ([shift={(1.5pt,-1.5pt)}]frame.north west); + \coordinate (north east) at ([shift={(-1.5pt,-1.5pt)}]frame.north east); + \coordinate (south east) at ([shift={(-1.5pt,1.5pt)}]frame.south east); + \coordinate (south west) at ([shift={(1.5pt,1.5pt)}]frame.south west); + % + \foreach \xoffset/\point in {34pt/north west, -34pt/north east, + 34pt/south west, -34pt/south east} { + \fill[color=ornamentedFrameOuter] + ([xshift=\xoffset]\point) circle[radius=2.5pt]; + } + % + \path[name path=ornament 1] + ([yshift=-4pt]north west) + [rounded corners=0.5pt] -- ++(23pt,0) + [rounded corners=2pt] -- ++(3pt,-4pt) + -- ([shift={(-26pt,-8pt)}]north east) + [rounded corners=0.5pt] -- ++(3pt,4pt) + [rounded corners=4pt] -- ([yshift=-4pt]north east) + -- ([yshift=4pt]south east) + [rounded corners=0.5pt] -- ++(-23pt,0) + [rounded corners=2pt] -- ++(-3pt,4pt) + -- ([shift={(26pt,8pt)}]south west) + [rounded corners=0.5pt] -- ++(-3pt,-4pt) + [rounded corners=4pt] -- ([yshift=4pt]south west) + -- cycle; + % + \path[rounded corners=0.5pt, name path=ornament 2] + ([yshift=-20pt]north west) + -- ++(-4pt,3pt) + -- ++(0,4pt) + to[out=0, in=-90] ([shift={(8pt,0pt)}]north west) + -- ([shift={(34pt,0pt)}]north west) + -- ([shift={(-8pt,0pt)}]north east) + to[out=-90, in=180] ([shift={(4pt,-13pt)}]north east) + -- ++(0,-4pt) + -- ++(-4pt,-3pt) + -- ([yshift=20pt]south east) + -- ++(4pt,-3pt) + -- ++(0,-4pt) + to[out=180, in=90] ([shift={(-8pt,0pt)}]south east) + -- ([shift={(8pt,0pt)}]south west) + to[out=90, in=0] ([shift={(-4pt,13pt)}]south west) + -- ++(0,4pt) + -- ++(4pt,3pt) + -- cycle; + % + \draw[ornamented frame outer, use path=ornament 1]; + \draw[ornamented frame outer, use path=ornament 2]; + \draw[ornamented frame inner, use path=ornament 1]; + \draw[ornamented frame inner, use path=ornament 2]; + % + \foreach \xoffset/\point in {34pt/north west, -34pt/north east, + 34pt/south west, -34pt/south east} { + \fill[color=black] + ([xshift=\xoffset]\point) circle[radius=3pt]; + } + } +} + +% These parameters---especially those related to geometry---are better located +% here in a style than in the subskin definition (see the Subskins section of +% the tcolorbox manual). +\tcbset{ornamented/.style={skin=ornamented, toptitle=14.5pt, top=15pt, bottom=9.5pt, + coltitle=black} +} + +% Convenient style to use with a tcolorbox preceded by text (or anything), +% when one wants to prevent any page break before the tcolorbox. +\tcbset{skip and no break/.style={ + before={\par\nopagebreak\vspace{2ex}\noindent}} +} + +% Style suitable for an “on line” (in the middle of a paragraph) +% 'ornamentedbox'. +\tcbset{my on line/.style={ + capture=hbox, tcbox raise base, top=14pt, bottom=14pt, + before={\kern 5pt}, after={\kern 5pt}} +} + +%%%%% TColorBox Basic Setup %%%%% + +\tcbset{enhanced, +ornamented, +before upper={\parindent15pt}, +fonttitle=\bfseries,coltitle=black,attach boxed title to top center= +{yshift=-0.25mm-\tcboxedtitleheight/2,yshifttext=-2mm-\tcboxedtitleheight/2}, +boxed title style={boxrule=-0.5mm, +frame code={ \path[tcb fill frame] ([xshift=-4mm]frame.west) +-- (frame.north west) -- (frame.north east) -- ([xshift=4mm]frame.east) +-- (frame.south east) -- (frame.south west) -- cycle; }, +interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west) +-- (interior.north west) -- (interior.north east) +-- ([xshift=2mm]interior.east) -- (interior.south east) -- (interior.south west) +-- cycle;} +} +} + + +\newtcolorbox{boxtext}[1][]{ornamented,colback=white,fonttitle=\scshape, #1} + +% Chapter Heading Color +\colorlet{chapnumcol}{black!100} + +%%%%% Section Formatting %%%%% + +\newcommand{\frontpage}[3]{ + \iftoggle{verbose}{ + \begin{titlepage} + \centering + \vspace{2cm} + {\scshape\Huge\bfseries #1\par} + \vspace{2cm} + \includegraphics[width=0.6\textwidth]{#3}\par\vspace{1cm} + {\Large #2\par} + \vspace{1.5cm} + {\large Last edited \today\par} + + \end{titlepage} + \cleardoublepage + }{} +} + +\titleformat{\chapter}[display] +{\bfseries} +{% + \ChapFrame + \ifnum\value{pageDarkness}<80 + \addtocounter{pageDarkness}{7} + \else + \colorlet{chapnumcol}{black!40} + \fi + \hspace*{-1.5em} +\begin{tikzpicture} + \node[minimum width=\linewidth+3em, text=white, fill=\pageSideColor, inner sep=1, outer sep=0, anchor=south] (rectinit) {\Huge \headingtype}; + \node[minimum width=.75\textwidth, text=white, inner sep=3, outer sep=0, anchor=south west, text width=.75\textwidth, align=right] at (rectinit.south west) (chapname) {}; + \node[minimum width=.25\textwidth, inner sep=-5, outer sep=0, anchor=south west, text width=.25\textwidth, align=left] at (chapname.south east) {\chapnumfont\textcolor{chapnumcol}{\Roman{chapter}}}; +\end{tikzpicture}} +{0pt} +{\Huge} + + +\titleformat{\section}[frame] +{\needspace{20em}\normalfont} +{\filright +\footnotesize +\enspace SECTION \thesection\enspace} +{8pt} +{\Large\bfseries\filcenter} + +\titleformat{\subsection}% + {\needspace{13em}\center\large\bfseries}% + {}% + {1em}% + {}% + [\rule{.9\linewidth}{.2pt}] +% +\titleformat{\subsubsection} +{\needspace{4em}\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{} + +%%%%% Character Sheet Tracker + + \newcounter{track} + \setcounter{track}{18} + \newcommand{\tracker}{\center\noindent\arabic{track}\addtocounter{track}{-1}\vspace{.54cm} + + } + +%%%%% NPC Names + +\newcommand{\name}{} +\newcommand{\personality}{} +\newcommand{\mannerism}{} +\newcommand{\archetype}{} +\newcommand{\npcsymbol}{} +\newcommand{\npc}[2]{\settoggle{personality}{false}\renewcommand{\name}{#1 #2}\renewcommand{\npcsymbol}{#1}} +\newcommand{\NPC}[5]{\renewcommand{\name}{#1 #2} +\renewcommand{\npcsymbol}{#1} +\settoggle{personality}{true} +\renewcommand{\personality}{#3} +\renewcommand{\mannerism}{#4} +\renewcommand{\archetype}{#5} +} +\newcommand{\T}{\opposition\settoggle{team}{true}} % groups +\newcommand{\M}{\mars} % male +\newcommand{\F}{\venus} % female +\newcommand{\E}{\mercury} % blood casters +\newcommand{\A}{\taurus} % creature +\newcommand{\N}{\leftmoon} % nura +\newcommand{\D}{\fullmoon} % undead + +\newcommand{\monster}[1]{\needspace{4em}\vspace{.38cm} \ding{70} #1 \ding{70}\vspace{.18cm}} + +%%%%%%%%%%%%%%%%%%%% TOGGLES %%%%%%%%%%%%%%%%%%%% + +\newtoggle{verbose} +\settoggle{verbose}{true} +\newtoggle{personality} +\settoggle{personality}{false} + +% This toggle tells you if this is just one creature or a team. +\newtoggle{team} +\settoggle{team}{false} + +\iftoggle{verbose}{ + \setcounter{tocdepth}{1} + \setcounter{secnumdepth}{1} +} + +\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} +\newcounter{r2c} +\setcounter{r2c}{2} +\newcounter{r3} +\setcounter{r3}{\month} + \divide\value{r3} by 4 +\newcounter{r3b} + \setcounter{r3b}{\value{r4}} + \addtocounter{r3b}{-1} +\newcounter{r3c} + \setcounter{r3c}{0} +\newcounter{r4b} + \setcounter{r4b}{\day} +\newcounter{r12} +\setcounter{r12}{\month} +\newcounter{enc} +\newcounter{list} +\newcounter{spelllevel} +\setcounter{spelllevel}{0} + +\newcounter{age} +\setcounter{age}{1} +\newcounter{gold} +\setcounter{gold}{\day} +\setcounter{enc}{0} + + +%%%%%%%%%%%%%%%%%%%% LAYOUT %%%%%%%%%%%%%%%%%%%% +\makeindex +\raggedbottom + +\newcommand{\currentsphere}{magic} +\newcommand{\sphere}[1]{\setcounter{spelllevel}{0}\renewcommand{\currentsphere}{#1}\index{#1}\section{\currentsphere}} +\newcommand{\spelllevel}{\addtocounter{spelllevel}{1}% + \subsection{\currentsphere~ Level \arabic{spelllevel}}} +\newcommand{\enhancement}[3]{\paragraph[(#1) #2: #3]{(#1) Enhancement -- #2:}\index{Enhancement!#2}} +\newcommand{\magicitem}[7]{\vspace{2em}\needspace{4em}\noindent\textbf{#1} +\index{Magical Item!#1} + + \noindent + \textit{Spells: #2, }% + \textit{Path: #3, }% + \textit{Duration: #4, }% + \textit{Type: #5, }% + \textit{Potency: +#6, }% + \textit{MP: #7}% + % Type can be 'Pocket Spell', 'Talisman', or 'Artefact'. + \needspace{2em}% +} + +\newcommand{\manalake}[8]{\subsection{#1 (Level #8)} + + \textit{Spells: #2, }\textit{Path: #3, }\textit{Duration: #4, }\textit{Type: #5, }\textit{Potence: #6, }\textit{#7 MP}% Type can be 'pocket spell', 'magical item', or 'artefact'. + \index{Mana Lakes!#1} + \vspace{.3em} +} + +\newcommand{\spell}[4]{\subsubsection[#1: #4]{#1} + +{\it Type: #2, Skill: #3} + +\noindent} + +% Toggles for knacks + +%%%%%%%%%%%%%%%%%%%% Environments %%%%%%%%%%%%%%%%%%%% + +\newenvironment{speechtext}{ + \begin{boxtext}\it +\begin{quotation}\noindent}% +{\end{quotation} +\end{boxtext}% +} + +\newenvironment{rolltable}% +{\vspace{.3cm}\begin{tabular}{|lp{.8\textwidth}} + + +Roll & Result \\ +\hline + +}% +{\end{tabular}} + + +\newenvironment{exampletext}{\needspace{2em}\vspace{.3cm} + +\rule{.9\linewidth}{0.2pt} + +\vspace{.3cm} + +\it}{\normalfont\vspace{2em}} + +\newtcolorbox{xpchart}[1]{tabularx={l|p{.8\textwidth}},adjusted title=XP Rewards for #1,bottom=10pt} + +\newtcolorbox[use counter=enc, use counter=list]{encounters}[1]{ornamented,adjusted title=Encounters in #1,tabularx={XXp{.6\textwidth}},bottom=10pt,code={\setcounter{enc}{19}\setcounter{list}{18}}} + +\newtcolorbox{rollchart}{tabularx={p{.25\linewidth}X},top=10pt,bottom=10pt} + +\newtcolorbox{xpbox}[1]{tabularx={lc},bottom=10pt,top=10pt,equal height group=#1} + + +%%%%%%%%%%%%%%%%%%% COMMANDS %%%%%%%%%%%%%%%%%%%% + +\newcommand{\story}[2]{% +\subsubsection{#2} +Cost: #1\par\noindent} + +\newcommand{\best}[2][\C]{\npc{#1}{#2}\subsubsection{#2}\index{Antagonists!#2}} + +\newcounter{random} +\setcounter{random}{1} +\newcounter{increment} +\setcounter{increment}{1} + +\newcommand{\random}{ + \addtocounter{random}{\value{page}} + \multiply\value{random} by \value{chapter}\addtocounter{random}{\value{increment}} + \whileboolexpr{ + test {\ifnumcomp{\value{random}}{>}{100}} + } + {\addtocounter{random}{-100}} + \whileboolexpr{ + test {\ifnumcomp{\value{random}}{>}{10}} + } + {\addtocounter{random}{-10}} + \addtocounter{increment}{1} +} + +\newcommand{\randomtwo}{% + \ifnumcomp{\value{r2}}{>}{1}{\setcounter{r2}{1}}{\addtocounter{r2}{1}}% +\setcounter{enc}{\value{r2}}% +} + +\newcommand{\randomtwoB}{ + \ifodd\value{r3b}\setcounter{r2b}{1}\else\setcounter{r2b}{2}\fi% +} + +\newcommand{\randomtwoC}{ + \ifnum\value{r2c}>1% + \setcounter{r2c}{1}\else% + \addtocounter{r2c}{1}% + \fi% +} + +\newcommand{\randomthree}{% + \ifnumcomp{\value{r3}}{>}{2}{\setcounter{r3}{1}}{\addtocounter{r3}{1}}% + \setcounter{age}{\value{r3}}% + \ifnum\value{r3}<1\setcounter{r3}{2}\fi% +} + +\newcommand{\randomthreeB}{% + \ifnum\value{r3b}>2% + \setcounter{r3b}{1}% + \else% + \addtocounter{r3b}{1}% + \fi% + \ifnum\value{r3b}<1% + \setcounter{r3b}{3} + \fi% +} + +\newcommand{\randomthreeC}{ + \ifnum\value{r3c}>3% + \setcounter{r3c}{1}\else% + \addtocounter{r3c}{1}% + \fi% +} + +\newcommand{\randomfour}{% + \ifnumcomp{\value{r4}}{>}{3}{\setcounter{r4}{1}}{\addtocounter{r4}{1}}% + \ifnumcomp{\value{r4}}{<}{1}{\setcounter{r4}{1}}{} + \setcounter{track}{\value{r4}}% +} + +\newcommand{\randomfourB}{% + \ifnum\value{r4b}>3\setcounter{r4b}{1}% + \else% + \addtocounter{r4b}{1}% + \fi% +} + +\newcommand{\randomdozen}{% + \ifnum\value{r12}>12\setcounter{r12}{2}\fi% + \ifnum\value{r12}<4\setcounter{r12}{2}\fi% + \ifnum\value{age}>0\addtocounter{r12}{\value{age}}\else\ifnum\value{r4}>0\addtocounter{r12}{\value{r4}}\else\addtocounter{r12}{3}\fi\fi% +} + +\newcommand{\mapentry}[1]{\needspace{2em}\addtocounter{list}{1}\subsubsection[#1]{\arabic{list}: #1}} +\newcommand{\li}{\addtocounter{enc}{-1}\arabic{enc}&} +\newcommand{\lii}{\addtocounter{list}{-1}\arabic{list}&} + +%%%%% Side Quests + +% 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 tocdepth from 2 to 3 in order to output a miniature table of contents on all side quests +\newcommand{\sqminitoc}{ + + \begin{figure*}[t] + + \begin{tcolorbox}[ornamented,adjusted title={Summary: \sqName}] + \vspace{-1em} + \printcontents[sq]{l}{2}{\setcounter{tocdepth}{3}} + + \end{tcolorbox} + + \end{figure*} +} + +\newcommand{\sqName}{} + +\newcommand{\sidequest}[1]{\renewcommand{\sqName}{#1} + \resumecontents[\sqarea] + \subsection{\sqName} + \stopcontents[\sqarea] + \settoggle{firstsq}{true} +} + +\newcommand{\sqpart}[3]{\resumecontents[#1]\subsubsection[\iftoggle{firstsq}{\CheckedBox}{\Square} #2 -- #3]{(#1) #2}\stopcontents[#1]\settoggle{firstsq}{false}} + +%%%%% Character Sheet Commands + +\newcommand{\trait}[1]{ +\vspace{.2cm} #1 \line(1,0){30} + + \begin{tabular}{p{0em}p{0em}p{0em}p{0em}p{0em}p{0em}p{0em}p{0em}p{0em}} + + \ding{108} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} \\ + \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} \\ + \end{tabular} + +} + + \newcommand{\shortline}{\line(1,0){22}} + \newcommand{\weeline}{\line(1,0){30} \hspace{.6cm}} + \newcommand{\vlongline}{\line(1,0){100}\hspace{0.8cm}} + \newcommand{\writeline}{\line(1,0){59}} +\newcommand{\fiveboxes}{\ding{111}\ding{111}\ding{111}\ding{111}\ding{111}} +\newcommand{\threeboxes}{\ding{111}\ding{111}\ding{111}} +\newcommand{\threecircles}{\ding{109}\ding{109}\ding{109}} +\newcommand{\tenboxes}{ \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} & \ding{111} \\} +\newcommand{\tencircles}{\ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} & \ding{109} \\} +\newcommand{\attributecircles}{\ding{175}\ding{174}\ding{173}\ding{172}{\Large\ding{109}}\ding{172}\ding{173}\ding{174}\ding{175}} +\newcommand{\Split}{ + \line(1,0){120} + + } +\newcommand{\skill}[1]{#1 & \ding{109} & \ding{109} & \ding{109} \\ +} + +\newcommand{\longline}{\line(1,0){320}\par\vspace{.2cm}} diff --git a/config/monsters.sty b/config/monsters.sty index 6af5ee3872e7b15b1326725e28daf284a1984b3b..5d4b500c53e1d82f57ced0feaf5fbfb930d2709f 100644 --- a/config/monsters.sty +++ b/config/monsters.sty @@ -1,607 +1,4 @@ -\ProvidesPackage{monsters} -%%%%%%%%%%%%%%%%%%%% Introduction -% This is a list of monster-commands. You put in the command, like "\dragon", and a dragon will be conjured unto your pdf. -% If you're unhapy with your dragon, copy-paste the bit where it says \dragon{blah}{bla}, then change those numbers. - -%%%%%%%%%%%%%%%%%%%% LOOT %%%%%%%%%%%%%%%%%%%% -\newtoggle{bestiarychapter} -\settoggle{bestiarychapter}{false} - -\newcommand{\lootSmall}{% -\iftoggle{bestiarychapter}{% -\ifodd\value{r2}$3D6$\else$2D6$\fi cp}{ -\randomdozen\arabic{r12} cp}% -} - -\newcommand{\lootMedium}{% -\iftoggle{bestiarychapter}{% -\ifodd\value{r2}$3D6$\else$2D6$\fi~sp}{% -\addtocounter{gold}{\thepage}\divide\value{gold} by \value{r4}% -\ifnum\value{gold}<4% - \setcounter{gold}{7}\fi% -\arabic{gold}~sp}% -} - -\newcommand{\lootBig}{% -\iftoggle{bestiarychapter}{% -\ifodd\thepage $3D6-2$\else$2D6+4$\fi gp}{% -\randomdozen\addtocounter{r12}{8}\arabic{r12}gp}% -} - -\newcommand{\lootMagic}{% - \iftoggle{team}{Mana stone holding 2 MP}% - {\iftoggle{bestiarychapter}{}% - {\ifnumcomp{\value{r2}}{>}{1}% - {\ifodd\value{r3}% - \ifodd\value{r4}% - \ifodd\value{r3b}% - Sorcerer's Eye% - \else% - Deck of Cards\fi\else Wild Seeds\fi\else\ifodd\value{r2b}Bag of Holding% - \else% - Defensive Heart% - \fi% - \fi}% - {\ifodd\value{r3}% - \ifodd\value{r4}% - Portal Scroll% - \else% - Sleeping Dust% - \fi% - \else% - \ifodd\value{r2b}% - \ifnum\value{dr}>0% - Ring of Asphyxiation% - \else - Ghost Shield% - \fi% - \else% - Bag of Tricks% - \fi% - \fi}% -}}} - -\newcommand{\lootJewellery}{% -\iftoggle{bestiarychapter}{jewellery worth \ifodd\value{r2}$3D6$sp\else$1D6+2$gp\fi}% - {\ifnumcomp{\value{r2}}{>}{1}{\ifodd\value{r3}% - \ifodd\value{r4}% - golden necklace worth \arabic{r12}~sp\else% - golden ring worth \thechapter~sp\fi\else% - jewel encrusted dagger worth \thepage~sp\fi}% - {\ifodd\value{r3}% - \ifodd\value{r4}% - ornate silver earrings worth 1 gp\else - gem encrusted broach worth \thechapter gp\fi\else% - \randomthreeB saphire pendant worth \arabic{r3b}gp\fi}}} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% _ -% _ __ ___ ___ _ __ ___| |_ ___ _ __ -%| '_ ` _ \ / _ \| '_ \/ __| __/ _ \ '__| -%| | | | | | (_) | | | \__ \ || __/ | -%|_| |_| |_|\___/|_| |_|___/\__\___|_| -% -% _ _ -% ___| |_ __ _| |_ ___ -%/ __| __/ _` | __/ __| -%\__ \ || (_| | |_\__ \ -%|___/\__\__,_|\__|___/ -% - -\newtoggle{mind} -\newtoggle{examplecharacter} -\settoggle{examplecharacter}{false} -\newtoggle{debug}\settoggle{debug}{false} -\newcommand{\ent}[1]{\textbf{#1}} -\newcommand{\test}{} -\newcommand{\skills}{} -\newcommand{\equipment}{} -\newcommand{\mods}{} -\newcommand{\printknacks}{} -\newcommand{\weaponknackone}{} -\newcommand{\weaponknacktwo}{} - -\newcommand{\calculatedamage}[1]{% - \setcounter{damagebonus}{#1}% - \setcounter{numberofdice}{1}% -\whileboolexpr{ - test {\ifnumcomp{\value{damagebonus}}{>}{3}} - }% - {\addtocounter{damagebonus}{-4}\addtocounter{numberofdice}{1}}% - {$\arabic{numberofdice}D6\ifnumcomp{\value{damagebonus}}{>}{0}{+\arabic{damagebonus}$}{\ifnumcomp{\value{damagebonus}}{<}{0}{\arabic{damagebonus}$}{$}}}% - } - - -%%%%%%%%%%%%%%%%%%%% Character Generation %%%%%%%%%%%%%%%%%%%% -% -% _ -% ___ ___ _ _ _ __ | |_ ___ _ __ ___ -% / __/ _ \| | | | '_ \| __/ _ \ '__/ __| -%| (_| (_) | |_| | | | | || __/ | \__ \ -% \___\___/ \__,_|_| |_|\__\___|_| |___/ -% -% -% Attributes: str, dex, spd, int, wts, cha -% secondary str, dex and spd -\newcounter{str} -\newcounter{dex} -\newcounter{spd} -\newcounter{int} -\newcounter{wts} -\newcounter{cha} -\newcounter{att} -\newcounter{dam} -\newcounter{dr} -\newcounter{knacks} -\newcounter{foxhop}% set to '1' if the character has fox hop -\setcounter{foxhop}{0} - - -\newcounter{strb} -\newcounter{dexb} -\newcounter{spdb} -\newcounter{attb} -\newcounter{damb} -% -% Extras: MP hp fp -% Derived: dicenumber, dicebonus, -\newcounter{mp} -\newcounter{mpb} -\newcounter{sp} -\newcounter{hp} -\newcounter{fp} -\newcounter{numberofdice} -\newcounter{damagebonus} -\newcounter{xp} -\newcounter{xpbonus} -\newcounter{attackXPtotal} -\newcounter{defenceXPtotal} - -% _ -% ___ ___ _ __ ___ _ __ ___ __ _ _ __ __| |___ -% / __/ _ \| '_ ` _ \| '_ ` _ \ / _` | '_ \ / _` / __| -% | (_| (_) | | | | | | | | | | | (_| | | | | (_| \__ \ -% \___\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|\__,_|___/ -% - - - -% magic -\newcommand{\mana}[1]{\setcounter{mp}{#1}} -\newcommand{\aldaron}{\addtocounter{mp}{2}Aldaron} -\newcommand{\conjuration}{\addtocounter{mp}{2}Conjuration} -\newcommand{\enchantment}{\addtocounter{mp}{2}Enchantment} -\newcommand{\fate}{\addtocounter{mp}{2}Fate} -\newcommand{\force}{\addtocounter{mp}{2}Force} -\newcommand{\invocation}{\addtocounter{mp}{2}Invocation} -\newcommand{\illusion}{\addtocounter{mp}{2}Illusion} -\newcommand{\necromancy}{\addtocounter{mp}{2}Necromancy} -\newcommand{\polymorph}{\addtocounter{mp}{2}Polymorph} -\newcommand{\saurecanta}{\addtocounter{mp}{2}Saurecanta} -\newcommand{\lockedmana}[1]{\setcounter{mpb}{-#1}} -\newcommand{\armourtype}{N} - -\newcommand{\knacks}[1]{ \\ - \ent{Knacks:} & #1 -} - -%%%%%%%%%%%%%%%%%%%%% Knacks -% -\newcommand{\adrenalinesurge}{Adrenaline Surge\addtocounter{strb}{1}\addtocounter{knacks}{1}} -\newcommand{\disarm}{Disarm\addtocounter{knacks}{1}\addtocounter{xpbonus}{1}} -\newcommand{\guardian}{Guardian\addtocounter{knacks}{1}} -\newcommand{\furiousblows}{Furious Blows\addtocounter{knacks}{1}} -\newcommand{\firststrike}{First Strike\addtocounter{spd}{1}\addtocounter{spdb}{2}\addtocounter{knacks}{1}} -\newcommand{\specialist}[1]{Specialist (#1)\addtocounter{knacks}{1}} -\newcommand{\bloodcaster}{Blood Caster\addtocounter{knacks}{1}} -\newcommand{\combatcaster}{Combat Caster\addtocounter{knacks}{1}} -\newcommand{\backtothewall}{Back to the Wall\addtocounter{knacks}{1}} -\newcommand{\laststand}{Last Stand\addtocounter{knacks}{1}} -\newcommand{\perfectsneakattack}{Perfect Sneak Attack\addtocounter{knacks}{1}\addtocounter{strb}{\value{knacks}}\addtocounter{strb}{2}} -\newcommand{\precisestrike}{Precise Strike\addtocounter{knacks}{1}} -\newcommand{\quickshot}{Quick Shot\addtocounter{knacks}{1}} -\newcommand{\stunningstrike}{Stunning Strike\addtocounter{knacks}{1}\addtocounter{xpbonus}{1}} -\newcommand{\charge}{\addtocounter{knacks}{1}\setcounter{track}{\value{knacks}}\addtocounter{track}{1}\divide\value{track} by 2\addtocounter{attb}{\value{track}}\addtocounter{strb}{\value{track}}\addtocounter{spdb}{\value{track}}Extreme Charge} -\newcommand{\snapshot}{Snap Shot\addtocounter{knacks}{1}\addtocounter{strb}{2}} -\newcommand{\defender}{Defender\addtocounter{knacks}{1}\addtocounter{xpbonus}{1}} -\newcommand{\dodger}{Dodger\addtocounter{knacks}{1}} -\newcommand{\foxhop}{Fox Hop\addtocounter{knacks}{1}\setcounter{foxhop}{1}} -\newcommand{\mightydraw}{Mighty Draw\addtocounter{knacks}{1}} -\newcommand{\finishingblow}{Finishing Blow\addtocounter{knacks}{1}} -\newcommand{\unstoppable}{Unstoppable\addtocounter{hp}{2}\addtocounter{knacks}{1}} - -%%%%% Weapons - -\newcommand{\javelin}{Javelin\addtocounter{str}{1}\addtocounter{spd}{2}} -\newcommand{\Dagger}{Dagger\addtocounter{str}{1}} -\newcommand{\shortsword}{Shortsword\addtocounter{str}{1}\addtocounter{spd}{1}\addtocounter{dex}{2}} -\newcommand{\club}{Club\addtocounter{str}{2}\addtocounter{spd}{1}\addtocounter{dex}{1}} -\newcommand{\rapier}{Rapier\addtocounter{str}{1}\addtocounter{spd}{2}\addtocounter{dex}{1}} -\newcommand{\longsword}{Longsword\addtocounter{str}{1}\addtocounter{spd}{1}\addtocounter{dex}{3}} -\newcommand{\greatsword}{Greatsword\addtocounter{str}{2}\addtocounter{spd}{1}\addtocounter{dex}{2}} -\newcommand{\spear}{Spear\addtocounter{str}{1}\addtocounter{spd}{1}\addtocounter{dex}{2}\addtocounter{spdb}{2}} -\newcommand{\quarterstaff}{Quarterstaff\addtocounter{spd}{1}\addtocounter{dex}{2}\addtocounter{spdb}{2}} -\newcommand{\greataxe}{Greataxe\addtocounter{str}{3}\addtocounter{spd}{1}\addtocounter{dex}{1}} -\newcommand{\woodaxe}{Wood axe\addtocounter{str}{2}\addtocounter{dex}{1}} -\newcommand{\greatclub}{Greatclub\addtocounter{str}{4}\addtocounter{spd}{1}\addtocounter{dex}{1}} -\newcommand{\longbow}{Longbow} -\newcommand{\shield}{\addtocounter{dex}{1}shield} -\newcommand{\bucklar}{\addtocounter{dex}{1}bucklar shield} - -% ARMOUR - -\newcommand{\partialelvish}{partial leather armour% - \ifnumcomp{\value{dr}}{>}{2}% - {\addtocounter{dr}{1}}% - {\divide\value{dr} by 2 \addtocounter{dr}{2}}% -} - -\newcommand{\partialleather}{partial leather armour% - \ifnumcomp{\value{dr}}{>}{3}% - {\addtocounter{dr}{2}}% - {\divide\value{dr} by 2 \addtocounter{dr}{3}}% -} - -\newcommand{\completeleather}{full leather armour\gdef\armourtype{C}% - \ifnumcomp{\value{dr}}{>}{3}% - {\addtocounter{dr}{2}}% - {\divide\value{dr} by 2 \addtocounter{dr}{3}}% -} - -\newcommand{\partialchain}{partial chainmail% - \ifnumcomp{\value{dr}}{>}{4}% - {\addtocounter{dr}{2}}% - {\divide\value{dr} by 2 \addtocounter{dr}{4}}% -} - -\newcommand{\completechain}{complete chain armour\gdef\armourtype{C}% - \ifnumcomp{\value{dr}}{>}{4}% - {\addtocounter{dr}{2}}% - {\divide\value{dr} by 2 \addtocounter{dr}{4}}% -} - -\newcommand{\partialplate}{partial plate armour% - \ifnumcomp{\value{dr}}{>}{5}% - {\addtocounter{dr}{3}}% - {\divide\value{dr} by 2 \addtocounter{dr}{5}}% -} - -\newcommand{\completeplate}{complete plate armour\gdef\armourtype{C}% - \ifnumcomp{\value{dr}}{>}{5}% - {\addtocounter{dr}{3}}% - {\divide\value{dr} by 2 \addtocounter{dr}{5}}% -} - -% -% _ __ ___ _ __ ___ ___ _ __ -%| '_ \ / _ \ '__/ __|/ _ \| '_ \ -%| |_) | __/ | \__ \ (_) | | | | -%| .__/ \___|_| |___/\___/|_| |_| -%|_| -% -% -% _ _ -%% ___| |__ __ _ _ __ __ _ ___| |_ ___ _ __ -%% / __| '_ \ / _` | '__/ _` |/ __| __/ _ \ '__| -%%| (__| | | | (_| | | | (_| | (__| || __/ | -%% \___|_| |_|\__,_|_| \__,_|\___|\__\___|_| -%% -%% optional counters, such as mana, are cleaned -%% clear: weaponsknack1 and 2, -%% -% -\newcommand{\mind}[3]{ -\setcounter{int}{#1}\setcounter{wts}{#2}\setcounter{cha}{#3} -} -% - -%%%%%%%%%%% Person -% -\newcommand{\person}[9]{\settoggle{mind}{true} -\setcounter{str}{#1} -\setcounter{dex}{#2} -\setcounter{spd}{#3} -\mind#4 -\setcounter{dr}{#5} -\setcounter{att}{#6} -\renewcommand{\skills}{#7} -\renewcommand{\equipment}{#8} -\renewcommand{\mods}{#9} - -\clean - -\renewcommand{\armourtype}{P} -\gdef\armourtype{P} - -\begin{tcolorbox}[title={\name}, before upper={\parindent0pt}, halign=flush left, left=2mm, watermark text=\npcsymbol] - -\iftoggle{personality}{ - -\textbf{Archetype:} \archetype - -\textbf{Personality:} \personality - -\textbf{Mannerism:} \mannerism - -\vspace{1em} - -\settoggle{personality}{false}}% -{} -\creaturestats - -\derivedstats -\end{tcolorbox} - \settoggle{debug}{false} - \settoggle{examplecharacter}{false} - -} - -\newcommand{\animal}[9]{\settoggle{mind}{false} -\setcounter{str}{#1} -\setcounter{dex}{#2} -\setcounter{spd}{#3} -\setcounter{wts}{#4} -\setcounter{dr}{#5} -\setcounter{att}{#6} -\renewcommand{\skills}{#7} -\renewcommand{\abilities}{#8} -\renewcommand{\mods}{#9} - -\clean - -\renewcommand{\armourtype}{C} - -\begin{tcolorbox}[title={\name},before upper={\parindent0pt},watermark text=\npcsymbol] - -\iftoggle{personality}{ - -\textbf{Personality:} \personality -\textbf{Mannerism:} \mannerism - -\vspace{1em} - -\settoggle{personality}{false}}% -{} -\creaturestats - -\derivedstats - -\end{tcolorbox} - -} - -\newcommand{\clean}{ - \setcounter{fp}{5} - \setcounter{sp}{0} - \setcounter{knacks}{0} - \renewcommand{\armourtype}{N} - \renewcommand{\weaponknackone}{} - \renewcommand{\weaponknacktwo}{} - \setcounter{mp}{0} - \setcounter{mpb}{0} - \setcounter{xpbonus}{0} - \settoggle{team}{false} - -} - -%% _ _ _ _ _ -%% __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ -%% / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| -%%| (_| | |_| |_| | | | |_) | |_| | || __/\__ \ -%% \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ -%% -%% Print the line, -%% print the attributes. -%% print the skills -%% print the knacks -%% print the equipment -% -\newcommand{\creaturestats}{ - \vspace{.1cm} - -\setcounter{strb}{0} -\setcounter{spdb}{0} -\setcounter{dexb}{0} - -\iftoggle{mind}{ -\begin{tabularx}{\textwidth}{lrlrlr} - Strength & \arabic{str} & Dexterity & \arabic{dex} & Speed & \arabic{spd} \\ - Intelligence & \arabic{int} & Wits & \arabic{wts} & Charisma & \arabic{cha} \\}{% -\begin{tabularx}{\textwidth}{lrlrlr} - Strength & \arabic{str} & Dexterity & \arabic{dex} & Speed & \arabic{spd} \\ - Wits & \arabic{wts} \\ - } - \setcounter{hp}{\value{str}} -\end{tabularx} -\hrule - \addtocounter{hp}{6} - - \iftoggle{examplecharacter}{}{ - \addtocounter{dex}{7} -} -\vspace{.1cm} -\raggedright -\noindent\begin{tabular}{p{.3\textwidth}>{\raggedright\arraybackslash}p{.65\textwidth}} - - \ent{Skills:} & \ifnumcomp{\value{att}}{=}{0}{\setcounter{att}{-1}}{\iftoggle{mind}{Combat \arabic{att}, }{Aggression \arabic{att}, }} \skills \\ - \iftoggle{mind}{\ent{Equipment:} & \equipment \\}{\ent{Abilities:} & \abilities \\} - - \addtocounter{strb}{\value{str}} - \addtocounter{dexb}{\value{dex}} - \addtocounter{spdb}{\value{spd}} - \setcounter{damb}{\value{dam}} - \setcounter{attb}{\value{att}} - - \mods - -\end{tabular} - - \weaponknackone - \weaponknacktwo - -\iftoggle{examplecharacter}{}{ - \addtocounter{att}{8} - \addtocounter{attb}{8} -} - -\vspace{.1cm} - -} - -%% _ _ _ -%% __| | ___ _ __ ___| |_ __ _| |_ ___ -%% / _` |/ _ \ '__/ __| __/ _` | __/ __| -%%| (_| | __/ | \__ \ || (_| | |_\__ \ -%% \__,_|\___|_| |___/\__\__,_|\__|___/ -%% -%% -%% dice instead of Damage -%% print out att, spd, DAM, dex, dr (type), str -%% -% -\newcommand{\derivedstats}{ - \iftoggle{debug}{str is \arabic{str}, strb is \arabic{strb}.}{} - - \hrule - - \vspace{.1cm} - -\noindent Attack \arabic{att}\ifnumcomp{\value{att}}{=}{\value{attb}}{}{ (\arabic{attb})}, - Initiative \arabic{spd}\ifnumcomp{\value{spd}}{=}{\value{spdb}}{}{ (\arabic{spdb})}, - Damage \calculatedamage{\value{str}}\ifnumcomp{\value{str}}{=}{\value{strb}}{}{ (\calculatedamage{\value{strb}})}, - \iftoggle{examplecharacter}{\mbox{Defence \arabic{dex},} }{ - TN \arabic{dex}% - \ifnumcomp{\value{dr}}{>}{0}{\ifnum\pdfstrcmp{\armourtype}{P}=0\addtocounter{dexb}{3} (\arabic{dexb})\fi\ifnum\pdfstrcmp{\armourtype}{C}=0\addtocounter{dexb}{5} (\arabic{dexb})\fi}{}, - }% - \ifnumcomp{\value{dr}}{>}{0}{DR \arabic{dr}~\armourtype, }{}% - \ifnum\value{mp}>0% - \addtocounter{mp}{\value{int}}% - \mbox{ - \ifnum\value{mpb}=0% - \arabic{mp}~MP% - \else% - \addtocounter{mpb}{\value{mp}}% - \arabic{mpb} / \arabic{mp} MP% - \fi - \iftoggle{bestiarychapter}% - {, }% - { \Repeat{\value{mp}}{\ding{111}}, }% - } - \fi - \mbox{\arabic{hp} HP \iftoggle{bestiarychapter}{}{% - \ \Repeat{\value{hp}}{\ding{111}}% - }% - }% - \ifnumcomp{\value{sp}}{>}{0}% - {, \mbox{% - \arabic{sp} SP % - \iftoggle{bestiarychapter}{}{\Repeat{\value{sp}}{\ding{111}}}% - }% - }% - {}% -\iftoggle{examplecharacter}{\addtocounter{fp}{\value{cha}}, \arabic{fp} FP}{} - - - - - \iftoggle{examplecharacter}{}{ - \calculateXP - } - } -% -% -%% __ ______ -%% \ \/ / _ \ -%% \ /| |_) | -%% / \| __/ -%% /_/\_\_| -%% - \newcommand{\calculateXP}{ -%% Sanitize: init+5, dam+5, - \addtocounter{spdb}{5} - \addtocounter{strb}{5} - \addtocounter{dex}{5} - \addtocounter{dr}{2} - - -% Sanitize: dex+5, dr+1, -% attackXPtotal= strb x spdb x damb -\vspace{.1cm} - -\hrule -\vspace{.1cm} - \setcounter{attackXPtotal}{\value{attb}} - - \multiply\value{attackXPtotal} by \value{spdb} - - - \multiply\value{attackXPtotal} by \value{strb} - - \iftoggle{debug}{Attack total: \arabic{attackXPtotal}}{} - -% defenceXPtotal= dex x dr x hp - \setcounter{defenceXPtotal}{\value{dex}} - \multiply\value{defenceXPtotal} by \value{dr} - \multiply\value{defenceXPtotal} by \value{hp} - -\iftoggle{debug}{Defence total: \arabic{defenceXPtotal}}{} - -% XP = attackXPtotal + defenceXPtotal - \setcounter{xp}{\value{attackXPtotal}} - \addtocounter{xp}{\value{defenceXPtotal}} - \addtocounter{xp}{-350} - \multiply\value{mp} by 100 - \addtocounter{xp}{\value{mp}} -\ifnumcomp{\value{xp}}{<}{120}{\ifnumcomp{\value{xp}}{>}{100}{$1/2$ XP}{$1/3$}}{% - \divide\value{xp} by 120% - \addtocounter{xp}{\value{xpbonus}}% -\arabic{xp} XP}% -% if {mind} print fate points. -% -\iftoggle{examplecharacter}{% -}{ - \iftoggle{mind}% - {\addtocounter{fp}{\value{cha}} \arabic{fp} FP % - \iftoggle{bestiarychapter}% - {}% - {\Repeat{\value{fp}}{\ding{111}}} -}{} - \vspace{.1cm} - \hrule -} - - \vspace{.1cm} - - } -% -%%%%%%%%%%%%%%%%%%%% Creature Abilities - -\newcommand{\abilities}[1]{ \\ - \ent{Abilities:} & #1 - } - -\newcommand{\claws}{ - Claws (+1 Damage) \addtocounter{str}{1} - } - -\newcommand{\quadraped}{% - Quadraped (double movement)% -} - -\newcommand{\teeth}{% - Teeth (+1 Damage after grapple)\addtocounter{str}{1}% -} - - \newcommand{\web}{ - \setcounter{track}{6}\addtocounter{track}{\value{str}} - Web (Strength + Athletics, TN \arabic{track} to break free as a movement action) - } - - -%%%%%%%%%%%%%%%%%%%%% Magic Path -\newcommand{\Path}[2]{ \\ - \raggedright \ent{Path of #1:} & #2 - } %% _ %% ___ _ __ ___ __ _| |_ _ _ _ __ ___ ___ %% / __| '__/ _ \/ _` | __| | | | '__/ _ \/ __| diff --git a/config/stats.sty b/config/stats.sty new file mode 100644 index 0000000000000000000000000000000000000000..22cc22c3e726e2b65504ece6c62547d8f6052f5b --- /dev/null +++ b/config/stats.sty @@ -0,0 +1,604 @@ +\ProvidesPackage{monsters} +%%%%%%%%%%%%%%%%%%%% Introduction +% This is a list of monster-commands. You put in the command, like "\dragon", and a dragon will be conjured unto your pdf. +% If you're unhapy with your dragon, copy-paste the bit where it says \dragon{blah}{bla}, then change those numbers. + +%%%%%%%%%%%%%%%%%%%% LOOT %%%%%%%%%%%%%%%%%%%% +\newtoggle{bestiarychapter} +\settoggle{bestiarychapter}{false} + +\newcommand{\lootSmall}{% +\iftoggle{bestiarychapter}{% +\ifodd\value{r2}$3D6$\else$2D6$\fi cp}{ +\randomdozen\arabic{r12} cp}% +} + +\newcommand{\lootMedium}{% +\iftoggle{bestiarychapter}{% +\ifodd\value{r2}$3D6$\else$2D6$\fi~sp}{% +\addtocounter{gold}{\thepage}\divide\value{gold} by \value{r4}% +\ifnum\value{gold}<4% + \setcounter{gold}{7}\fi% +\arabic{gold}~sp}% +} + +\newcommand{\lootBig}{% +\iftoggle{bestiarychapter}{% +\ifodd\thepage $3D6-2$\else$2D6+4$\fi gp}{% +\randomdozen\addtocounter{r12}{8}\arabic{r12}gp}% +} + +\newcommand{\lootMagic}{% + \iftoggle{team}{Mana stone holding 2 MP}% + {\iftoggle{bestiarychapter}{}% + {\ifnumcomp{\value{r2}}{>}{1}% + {\ifodd\value{r3}% + \ifodd\value{r4}% + \ifodd\value{r3b}% + Sorcerer's Eye% + \else% + Deck of Cards\fi\else Wild Seeds\fi\else\ifodd\value{r2b}Bag of Holding% + \else% + Defensive Heart% + \fi% + \fi}% + {\ifodd\value{r3}% + \ifodd\value{r4}% + Portal Scroll% + \else% + Sleeping Dust% + \fi% + \else% + \ifodd\value{r2b}% + \ifnum\value{dr}>0% + Ring of Asphyxiation% + \else + Ghost Shield% + \fi% + \else% + Bag of Tricks% + \fi% + \fi}% +}}} + +\newcommand{\lootJewellery}{% +\iftoggle{bestiarychapter}{jewellery worth \ifodd\value{r2}$3D6$sp\else$1D6+2$gp\fi}% + {\ifnumcomp{\value{r2}}{>}{1}{\ifodd\value{r3}% + \ifodd\value{r4}% + golden necklace worth \arabic{r12}~sp\else% + golden ring worth \thechapter~sp\fi\else% + jewel encrusted dagger worth \thepage~sp\fi}% + {\ifodd\value{r3}% + \ifodd\value{r4}% + ornate silver earrings worth 1 gp\else + gem encrusted broach worth \thechapter gp\fi\else% + \randomthreeB saphire pendant worth \arabic{r3b}gp\fi}}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% _ +% _ __ ___ ___ _ __ ___| |_ ___ _ __ +%| '_ ` _ \ / _ \| '_ \/ __| __/ _ \ '__| +%| | | | | | (_) | | | \__ \ || __/ | +%|_| |_| |_|\___/|_| |_|___/\__\___|_| +% +% _ _ +% ___| |_ __ _| |_ ___ +%/ __| __/ _` | __/ __| +%\__ \ || (_| | |_\__ \ +%|___/\__\__,_|\__|___/ +% + +\newtoggle{mind} +\newtoggle{examplecharacter} +\settoggle{examplecharacter}{false} +\newtoggle{debug}\settoggle{debug}{false} +\newcommand{\ent}[1]{\textbf{#1}} +\newcommand{\test}{} +\newcommand{\skills}{} +\newcommand{\equipment}{} +\newcommand{\mods}{} +\newcommand{\printknacks}{} +\newcommand{\weaponknackone}{} +\newcommand{\weaponknacktwo}{} + +\newcommand{\calculatedamage}[1]{% + \setcounter{damagebonus}{#1}% + \setcounter{numberofdice}{1}% +\whileboolexpr{ + test {\ifnumcomp{\value{damagebonus}}{>}{3}} + }% + {\addtocounter{damagebonus}{-4}\addtocounter{numberofdice}{1}}% + {$\arabic{numberofdice}D6\ifnumcomp{\value{damagebonus}}{>}{0}{+\arabic{damagebonus}$}{\ifnumcomp{\value{damagebonus}}{<}{0}{\arabic{damagebonus}$}{$}}}% + } + + +%%%%%%%%%%%%%%%%%%%% Character Generation %%%%%%%%%%%%%%%%%%%% +% +% _ +% ___ ___ _ _ _ __ | |_ ___ _ __ ___ +% / __/ _ \| | | | '_ \| __/ _ \ '__/ __| +%| (_| (_) | |_| | | | | || __/ | \__ \ +% \___\___/ \__,_|_| |_|\__\___|_| |___/ +% +% +% Attributes: str, dex, spd, int, wts, cha +% secondary str, dex and spd +\newcounter{str} +\newcounter{dex} +\newcounter{spd} +\newcounter{int} +\newcounter{wts} +\newcounter{cha} +\newcounter{att} +\newcounter{dam} +\newcounter{dr} +\newcounter{knacks} +\newcounter{foxhop}% set to '1' if the character has fox hop +\setcounter{foxhop}{0} + + +\newcounter{strb} +\newcounter{dexb} +\newcounter{spdb} +\newcounter{attb} +\newcounter{damb} +% +% Extras: MP hp fp +% Derived: dicenumber, dicebonus, +\newcounter{mp} +\newcounter{mpb} +\newcounter{sp} +\newcounter{hp} +\newcounter{fp} +\newcounter{numberofdice} +\newcounter{damagebonus} +\newcounter{xp} +\newcounter{xpbonus} +\newcounter{attackXPtotal} +\newcounter{defenceXPtotal} + +% _ +% ___ ___ _ __ ___ _ __ ___ __ _ _ __ __| |___ +% / __/ _ \| '_ ` _ \| '_ ` _ \ / _` | '_ \ / _` / __| +% | (_| (_) | | | | | | | | | | | (_| | | | | (_| \__ \ +% \___\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|\__,_|___/ +% + + + +% magic +\newcommand{\mana}[1]{\setcounter{mp}{#1}} +\newcommand{\aldaron}{\addtocounter{mp}{2}Aldaron} +\newcommand{\conjuration}{\addtocounter{mp}{2}Conjuration} +\newcommand{\enchantment}{\addtocounter{mp}{2}Enchantment} +\newcommand{\fate}{\addtocounter{mp}{2}Fate} +\newcommand{\force}{\addtocounter{mp}{2}Force} +\newcommand{\invocation}{\addtocounter{mp}{2}Invocation} +\newcommand{\illusion}{\addtocounter{mp}{2}Illusion} +\newcommand{\necromancy}{\addtocounter{mp}{2}Necromancy} +\newcommand{\polymorph}{\addtocounter{mp}{2}Polymorph} +\newcommand{\saurecanta}{\addtocounter{mp}{2}Saurecanta} +\newcommand{\lockedmana}[1]{\setcounter{mpb}{-#1}} +\newcommand{\armourtype}{N} + +\newcommand{\knacks}[1]{ \\ + \ent{Knacks:} & #1 +} + +%%%%%%%%%%%%%%%%%%%%% Knacks +% +\newcommand{\adrenalinesurge}{Adrenaline Surge\addtocounter{strb}{1}\addtocounter{knacks}{1}} +\newcommand{\disarm}{Disarm\addtocounter{knacks}{1}\addtocounter{xpbonus}{1}} +\newcommand{\guardian}{Guardian\addtocounter{knacks}{1}} +\newcommand{\furiousblows}{Furious Blows\addtocounter{knacks}{1}} +\newcommand{\firststrike}{First Strike\addtocounter{spd}{1}\addtocounter{spdb}{2}\addtocounter{knacks}{1}} +\newcommand{\specialist}[1]{Specialist (#1)\addtocounter{knacks}{1}} +\newcommand{\bloodcaster}{Blood Caster\addtocounter{knacks}{1}} +\newcommand{\combatcaster}{Combat Caster\addtocounter{knacks}{1}} +\newcommand{\backtothewall}{Back to the Wall\addtocounter{knacks}{1}} +\newcommand{\laststand}{Last Stand\addtocounter{knacks}{1}} +\newcommand{\perfectsneakattack}{Perfect Sneak Attack\addtocounter{knacks}{1}\addtocounter{strb}{\value{knacks}}\addtocounter{strb}{2}} +\newcommand{\precisestrike}{Precise Strike\addtocounter{knacks}{1}} +\newcommand{\quickshot}{Quick Shot\addtocounter{knacks}{1}} +\newcommand{\stunningstrike}{Stunning Strike\addtocounter{knacks}{1}\addtocounter{xpbonus}{1}} +\newcommand{\charge}{\addtocounter{knacks}{1}\setcounter{track}{\value{knacks}}\addtocounter{track}{1}\divide\value{track} by 2\addtocounter{attb}{\value{track}}\addtocounter{strb}{\value{track}}\addtocounter{spdb}{\value{track}}Extreme Charge} +\newcommand{\snapshot}{Snap Shot\addtocounter{knacks}{1}\addtocounter{strb}{2}} +\newcommand{\defender}{Defender\addtocounter{knacks}{1}\addtocounter{xpbonus}{1}} +\newcommand{\dodger}{Dodger\addtocounter{knacks}{1}} +\newcommand{\foxhop}{Fox Hop\addtocounter{knacks}{1}\setcounter{foxhop}{1}} +\newcommand{\mightydraw}{Mighty Draw\addtocounter{knacks}{1}} +\newcommand{\finishingblow}{Finishing Blow\addtocounter{knacks}{1}} +\newcommand{\unstoppable}{Unstoppable\addtocounter{hp}{2}\addtocounter{knacks}{1}} + +%%%%% Weapons + +\newcommand{\javelin}{Javelin\addtocounter{str}{1}\addtocounter{spd}{2}} +\newcommand{\Dagger}{Dagger\addtocounter{str}{1}} +\newcommand{\shortsword}{Shortsword\addtocounter{str}{1}\addtocounter{spd}{1}\addtocounter{dex}{2}} +\newcommand{\club}{Club\addtocounter{str}{2}\addtocounter{spd}{1}\addtocounter{dex}{1}} +\newcommand{\rapier}{Rapier\addtocounter{str}{1}\addtocounter{spd}{2}\addtocounter{dex}{1}} +\newcommand{\longsword}{Longsword\addtocounter{str}{1}\addtocounter{spd}{1}\addtocounter{dex}{3}} +\newcommand{\greatsword}{Greatsword\addtocounter{str}{2}\addtocounter{spd}{1}\addtocounter{dex}{2}} +\newcommand{\spear}{Spear\addtocounter{str}{1}\addtocounter{spd}{1}\addtocounter{dex}{2}\addtocounter{spdb}{2}} +\newcommand{\quarterstaff}{Quarterstaff\addtocounter{spd}{1}\addtocounter{dex}{2}\addtocounter{spdb}{2}} +\newcommand{\greataxe}{Greataxe\addtocounter{str}{3}\addtocounter{spd}{1}\addtocounter{dex}{1}} +\newcommand{\woodaxe}{Wood axe\addtocounter{str}{2}\addtocounter{dex}{1}} +\newcommand{\greatclub}{Greatclub\addtocounter{str}{4}\addtocounter{spd}{1}\addtocounter{dex}{1}} +\newcommand{\longbow}{Longbow} +\newcommand{\shield}{\addtocounter{dex}{1}shield} +\newcommand{\bucklar}{\addtocounter{dex}{1}bucklar shield} + +% ARMOUR + +\newcommand{\partialelvish}{partial leather armour% + \ifnumcomp{\value{dr}}{>}{2}% + {\addtocounter{dr}{1}}% + {\divide\value{dr} by 2 \addtocounter{dr}{2}}% +} + +\newcommand{\partialleather}{partial leather armour% + \ifnumcomp{\value{dr}}{>}{3}% + {\addtocounter{dr}{2}}% + {\divide\value{dr} by 2 \addtocounter{dr}{3}}% +} + +\newcommand{\completeleather}{full leather armour\gdef\armourtype{C}% + \ifnumcomp{\value{dr}}{>}{3}% + {\addtocounter{dr}{2}}% + {\divide\value{dr} by 2 \addtocounter{dr}{3}}% +} + +\newcommand{\partialchain}{partial chainmail% + \ifnumcomp{\value{dr}}{>}{4}% + {\addtocounter{dr}{2}}% + {\divide\value{dr} by 2 \addtocounter{dr}{4}}% +} + +\newcommand{\completechain}{complete chain armour\gdef\armourtype{C}% + \ifnumcomp{\value{dr}}{>}{4}% + {\addtocounter{dr}{2}}% + {\divide\value{dr} by 2 \addtocounter{dr}{4}}% +} + +\newcommand{\partialplate}{partial plate armour% + \ifnumcomp{\value{dr}}{>}{5}% + {\addtocounter{dr}{3}}% + {\divide\value{dr} by 2 \addtocounter{dr}{5}}% +} + +\newcommand{\completeplate}{complete plate armour\gdef\armourtype{C}% + \ifnumcomp{\value{dr}}{>}{5}% + {\addtocounter{dr}{3}}% + {\divide\value{dr} by 2 \addtocounter{dr}{5}}% +} + +% +% _ __ ___ _ __ ___ ___ _ __ +%| '_ \ / _ \ '__/ __|/ _ \| '_ \ +%| |_) | __/ | \__ \ (_) | | | | +%| .__/ \___|_| |___/\___/|_| |_| +%|_| +% +% +% _ _ +%% ___| |__ __ _ _ __ __ _ ___| |_ ___ _ __ +%% / __| '_ \ / _` | '__/ _` |/ __| __/ _ \ '__| +%%| (__| | | | (_| | | | (_| | (__| || __/ | +%% \___|_| |_|\__,_|_| \__,_|\___|\__\___|_| +%% +%% optional counters, such as mana, are cleaned +%% clear: weaponsknack1 and 2, +%% +% +\newcommand{\mind}[3]{ +\setcounter{int}{#1}\setcounter{wts}{#2}\setcounter{cha}{#3} +} +% + +%%%%%%%%%%% Person +% +\newcommand{\person}[9]{\settoggle{mind}{true} +\setcounter{str}{#1} +\setcounter{dex}{#2} +\setcounter{spd}{#3} +\mind#4 +\setcounter{dr}{#5} +\setcounter{att}{#6} +\renewcommand{\skills}{#7} +\renewcommand{\equipment}{#8} +\renewcommand{\mods}{#9} + +\clean + +\renewcommand{\armourtype}{P} +\gdef\armourtype{P} + +\begin{tcolorbox}[title={\name}, before upper={\parindent0pt}, halign=flush left, left=2mm, watermark text=\npcsymbol] + +\iftoggle{personality}{ + +\textbf{Archetype:} \archetype + +\textbf{Personality:} \personality + +\textbf{Mannerism:} \mannerism + +\vspace{1em} + +\settoggle{personality}{false}}% +{} +\creaturestats + +\derivedstats +\end{tcolorbox} + \settoggle{debug}{false} + \settoggle{examplecharacter}{false} + +} + +\newcommand{\animal}[9]{\settoggle{mind}{false} +\setcounter{str}{#1} +\setcounter{dex}{#2} +\setcounter{spd}{#3} +\setcounter{wts}{#4} +\setcounter{dr}{#5} +\setcounter{att}{#6} +\renewcommand{\skills}{#7} +\renewcommand{\abilities}{#8} +\renewcommand{\mods}{#9} + +\clean + +\renewcommand{\armourtype}{C} + +\begin{tcolorbox}[title={\name},before upper={\parindent0pt},watermark text=\npcsymbol] + +\iftoggle{personality}{ + +\textbf{Personality:} \personality + +\textbf{Mannerism:} \mannerism + +\vspace{1em} + +\settoggle{personality}{false}}% +{} +\creaturestats + +\derivedstats + +\end{tcolorbox} + +} + +\newcommand{\clean}{ + \setcounter{fp}{5} + \setcounter{sp}{0} + \setcounter{knacks}{0} + \renewcommand{\armourtype}{N} + \renewcommand{\weaponknackone}{} + \renewcommand{\weaponknacktwo}{} + \setcounter{mp}{0} + \setcounter{mpb}{0} + \setcounter{xpbonus}{0} + \settoggle{team}{false} + +} + +%% _ _ _ _ _ +%% __ _| |_| |_ _ __(_) |__ _ _| |_ ___ ___ +%% / _` | __| __| '__| | '_ \| | | | __/ _ \/ __| +%%| (_| | |_| |_| | | | |_) | |_| | || __/\__ \ +%% \__,_|\__|\__|_| |_|_.__/ \__,_|\__\___||___/ +%% +%% Print the line, +%% print the attributes. +%% print the skills +%% print the knacks +%% print the equipment +% +\newcommand{\creaturestats}{ + \vspace{.1cm} + +\setcounter{strb}{0} +\setcounter{spdb}{0} +\setcounter{dexb}{0} + +\iftoggle{mind}{ +\begin{tabularx}{\textwidth}{lrlrlr} + Strength & \arabic{str} & Dexterity & \arabic{dex} & Speed & \arabic{spd} \\ + Intelligence & \arabic{int} & Wits & \arabic{wts} & Charisma & \arabic{cha} \\}{% +\begin{tabularx}{\textwidth}{lrlrlr} + Strength & \arabic{str} & Dexterity & \arabic{dex} & Speed & \arabic{spd} \\ + Wits & \arabic{wts} \\ + } + \setcounter{hp}{\value{str}} +\end{tabularx} +\hrule + \addtocounter{hp}{6} + + \iftoggle{examplecharacter}{}{ + \addtocounter{dex}{7} +} +\vspace{.1cm} +\raggedright +\noindent\begin{tabular}{p{.3\textwidth}>{\raggedright\arraybackslash}p{.65\textwidth}} + + \ent{Skills:} & \ifnumcomp{\value{att}}{=}{0}{\setcounter{att}{-1}}{\iftoggle{mind}{Combat \arabic{att}, }{Aggression \arabic{att}, }} \skills \\ + \iftoggle{mind}{\ent{Equipment:} & \equipment \\}{\ent{Abilities:} & \abilities \\} + + \addtocounter{strb}{\value{str}} + \addtocounter{dexb}{\value{dex}} + \addtocounter{spdb}{\value{spd}} + \setcounter{damb}{\value{dam}} + \setcounter{attb}{\value{att}} + + \mods + +\end{tabular} + + \weaponknackone + \weaponknacktwo + +\iftoggle{examplecharacter}{}{ + \addtocounter{att}{8} + \addtocounter{attb}{8} +} + +\vspace{.1cm} + +} + +%% _ _ _ +%% __| | ___ _ __ ___| |_ __ _| |_ ___ +%% / _` |/ _ \ '__/ __| __/ _` | __/ __| +%%| (_| | __/ | \__ \ || (_| | |_\__ \ +%% \__,_|\___|_| |___/\__\__,_|\__|___/ +%% +%% +%% dice instead of Damage +%% print out att, spd, DAM, dex, dr (type), str +%% +% +\newcommand{\derivedstats}{ + \iftoggle{debug}{str is \arabic{str}, strb is \arabic{strb}.}{} + + \hrule + + \vspace{.1cm} + +\noindent Attack \arabic{att}\ifnumcomp{\value{att}}{=}{\value{attb}}{}{ (\arabic{attb})}, + Initiative \arabic{spd}\ifnumcomp{\value{spd}}{=}{\value{spdb}}{}{ (\arabic{spdb})}, + Damage \calculatedamage{\value{str}}\ifnumcomp{\value{str}}{=}{\value{strb}}{}{ (\calculatedamage{\value{strb}})}, + \iftoggle{examplecharacter}{\mbox{Defence \arabic{dex},} }{ + TN \arabic{dex}% + \ifnumcomp{\value{dr}}{>}{0}{\ifnum\pdfstrcmp{\armourtype}{P}=0\addtocounter{dexb}{3} (\arabic{dexb})\fi\ifnum\pdfstrcmp{\armourtype}{C}=0\addtocounter{dexb}{5} (\arabic{dexb})\fi}{}, + }% + \ifnumcomp{\value{dr}}{>}{0}{DR \arabic{dr}~\armourtype, }{}% + \ifnum\value{mp}>0% + \addtocounter{mp}{\value{int}}% + \mbox{ + \ifnum\value{mpb}=0% + \arabic{mp}~MP% + \else% + \addtocounter{mpb}{\value{mp}}% + \arabic{mpb} / \arabic{mp} MP% + \fi + \iftoggle{bestiarychapter}% + {, }% + { \Repeat{\value{mp}}{\ding{111}}, }% + } + \fi + \mbox{\arabic{hp} HP \iftoggle{bestiarychapter}{}{% + \ \Repeat{\value{hp}}{\ding{111}}% + }% + }% + \ifnumcomp{\value{sp}}{>}{0}% + {, \mbox{% + \arabic{sp} SP % + \iftoggle{bestiarychapter}{}{\Repeat{\value{sp}}{\ding{111}}}% + }% + }% + {}% +\iftoggle{examplecharacter}{\addtocounter{fp}{\value{cha}}, \arabic{fp} FP}{} + + + + + \iftoggle{examplecharacter}{}{ + \calculateXP + } + } +% +% +%% __ ______ +%% \ \/ / _ \ +%% \ /| |_) | +%% / \| __/ +%% /_/\_\_| +%% + \newcommand{\calculateXP}{ +%% Sanitize: init+5, dam+5, + \addtocounter{spdb}{5} + \addtocounter{strb}{5} + \addtocounter{dex}{5} + \addtocounter{dr}{2} + + +% Sanitize: dex+5, dr+1, +% attackXPtotal= strb x spdb x damb +\vspace{.1cm} + +\hrule +\vspace{.1cm} + \setcounter{attackXPtotal}{\value{attb}} + + \multiply\value{attackXPtotal} by \value{spdb} + + + \multiply\value{attackXPtotal} by \value{strb} + + \iftoggle{debug}{Attack total: \arabic{attackXPtotal}}{} + +% defenceXPtotal= dex x dr x hp + \setcounter{defenceXPtotal}{\value{dex}} + \multiply\value{defenceXPtotal} by \value{dr} + \multiply\value{defenceXPtotal} by \value{hp} + +\iftoggle{debug}{Defence total: \arabic{defenceXPtotal}}{} + +% XP = attackXPtotal + defenceXPtotal + \setcounter{xp}{\value{attackXPtotal}} + \addtocounter{xp}{\value{defenceXPtotal}} + \addtocounter{xp}{-350} + \multiply\value{mp} by 100 + \addtocounter{xp}{\value{mp}} +\ifnumcomp{\value{xp}}{<}{120}{\ifnumcomp{\value{xp}}{>}{100}{$1/2$ XP}{$1/3$}}{% + \divide\value{xp} by 120% + \addtocounter{xp}{\value{xpbonus}}% +\arabic{xp} XP}% +% if {mind} print fate points. +% +\iftoggle{examplecharacter}{% +}{ + \iftoggle{mind}% + {\addtocounter{fp}{\value{cha}} \arabic{fp} FP % + \iftoggle{bestiarychapter}% + {}% + {\Repeat{\value{fp}}{\ding{111}}} +}{} + \vspace{.1cm} + \hrule +} + + \vspace{.1cm} + + } +% +%%%%%%%%%%%%%%%%%%%% Creature Abilities + +\newcommand{\abilities}[1]{ \\ + \ent{Abilities:} & #1 + } + +\newcommand{\claws}{ + Claws (+1 Damage) \addtocounter{str}{1} + } + +\newcommand{\quadraped}{% + Quadraped (double movement)% +} + +\newcommand{\teeth}{% + Teeth (+1 Damage after grapple)\addtocounter{str}{1}% +} + + \newcommand{\web}{ + \setcounter{track}{6}\addtocounter{track}{\value{str}} + Web (Strength + Athletics, TN \arabic{track} to break free as a movement action) + } + + +%%%%%%%%%%%%%%%%%%%%% Magic Path +\newcommand{\Path}[2]{ \\ + \raggedright \ent{Path of #1:} & #2 + } diff --git a/config/example.tex b/config/test.tex similarity index 64% rename from config/example.tex rename to config/test.tex index e5e8ec0fe3cf3512825d2d4964c6192e3cdd0cb9..48c722b6697b5c581d9e51408cdf794a50a1e085 100644 --- a/config/example.tex +++ b/config/test.tex @@ -1,5 +1,6 @@ \documentclass[a4paper,openany]{book} -\usepackage{bind} +\usepackage{layout} +\usepackage{stats} \usepackage{monsters} \usepackage{lipsum} @@ -7,76 +8,31 @@ \begin{document} -\chapter{How to Make Monsters} +\chapter{Random Stuff} \section{Introduction} \begin{multicols}{2} -\subsection{All about Dragons} +\subsection{This Document} -\begin{boxtext} +This is a test document, to make sure new code works before sticking it in a project. -As you embark upon your first adventure, you summon your first monster with a simple backstroke. You write down {\tt {\tt\textbackslash dragon}}, and behold! - -\end{boxtext} - -\dragon - -Each time you conjure the dragon, it will look a little different. -The next one might look like this: - -\dragon - -If you find it hard to tell the difference between all the dragons, you can give them names in square brackets with the {\tt\textbackslash NPC command}, like this: - -{\tt\textbackslash dragon[\textbackslash npc\{\textbackslash M\}\{Bob the dragon\}] } - -Which then makes a male dragon called ``Bob'': - -\dragon[\npc{\M}{Bob the Dragon}] - -The first field can also indicate a female with an {\tt\textbackslash F} (\F), a team of people with a {\tt\textbackslash T} (\T), or undead with \textbackslash D (\D). - -With a little study, you can summon dozens of monsters, including {\tt\textbackslash human fighter}, {\tt\textbackslash basilisk}, and {\tt \textbackslash ghoul}. - -\subsection{Individual NPCs} - -Individual characters can be created by using the {\tt\textbackslash npc} command then the \textbackslash person command, with its nine arguments: - -\begin{verbatim} - -\npc{\M}{Alice} - -\person{0}% STRENGTH +\npc{\M}{Random Guy} +\person{1}% STRENGTH {1}% DEXTERITY -{-1}% SPEED -{{2}% INTELLIGENCE -{0}% WITS +{1}% SPEED +{{-2}% INTELLIGENCE +{-1}% WITS {0}}% CHARISMA {0}% DR {1}% COMBAT -{Academics 1, Survival 1}% SKILLS -{\longsword, adventuring equipment}% EQUIPMENT +{Academics 1, Survival 1 +\Path{Alchemy}{\illusion~3, \invocation~1} +}% SKILLS +{\Dagger, pieces of string}% EQUIPMENT {} -\end{verbatim} - -\npc{\M}{Alice} -\person{0}% STRENGTH -{1}% DEXTERITY -{-1}% SPEED -{{2}% INTELLIGENCE -{0}% WITS -{0}}% CHARISMA -{0}% DR -{1}% COMBAT -{Academics 1, Survival 1}% SKILLS -{\longsword, adventuring equipment}% EQUIPMENT -{} - -You can add things for these people to say with a {\tt\textbackslash begin\{speechtext\}} command: - \begin{speechtext} ``Would you tell me, please, which way I ought to go from here?'' @@ -87,8 +43,6 @@ You can add things for these people to say with a {\tt\textbackslash begin\{spee \subsection{And now for something completely different} -This is a magical item. - \magicitem{Noodle of Death}% NAME {Extinguish}% SPELL {Divinity (FSM)}% PATH @@ -429,16 +383,6 @@ When using a bestiary chapter, the stats appear as dice rolls, rather than fixed \lipsum -\end{multicols} - -\chapter{Lots More Text} - -\begin{multicols}{2} - -\noindent -\lipsum - - \end{multicols} \end{document}