Newer
Older
%
% __ __ _
% | \/ | __ _ __ _(_) ___
% | |\/| |/ _` |/ _` | |/ __|
% | | | | (_| | (_| | | (__
% |_| |_|\__,_|\__, |_|\___|
% |___/
\newcounter{spellCost}
\setcounter{spellCost}{1}
\newcommand\spellName{}
\newcommand\spellEnhancements{}
\newcommand\spellAction{}
\newcommand\spellSphere{}
\newcommand\spellResistance{}
\newcommand\spellSum{}
\newcommand\spellNotes{}
\newcommand\calcSpell[7]{%
\renewcommand\spellName{#1}%
\setcounter{spellCost}{1}%
\foreach \d in {#2}{%
\stepcounter{spellCost}%
}%
\renewcommand\spellEnhancements{#2}%
\renewcommand\spellAction{#3}%
\renewcommand\spellSphere{#4}%
\renewcommand\spellResistance{#5}
\renewcommand\spellSum{#6}
\renewcommand\spellNotes{#7}
}
\paragraph{\spellName}
Cost: \arabic{spellCost},
\spellEnhancements,
\spellAction~
\spellSphere
Resisted by: \spellResistance
\spellSum \
\spellNotes
}
\newcommand\spellIndex{\index[spells]{\textbf{\spellName} Cost: \arabic{spellCost}, \spellEnhancements, \spellAction~\spellSphere Resisted by: \detokenize{\spellResistance} \spellSum \spellNotes }}
\newcommand\shortSpell{%
\paragraph{\spellName}
Cost: \arabic{spellCost},
\spellEnhancements,
\spellAction~
\spellSphere
Resisted by: \spellResistance
\spellSum \
\spellNotes
}
% We use spellPotency to track spell effects which are typically larger than the spell's level.
\newcounter{spellPotency}
% spellResTN is the TN to resist spells, used only in specified spells beneath creatures. For example, if someone had Air 2, resisting their spells would be TN (7 + 2) 9.
\newcounter{spellResTN}
\newcommand\mFate{%
Fate%
\global\settoggle{insubstantial}{true}%
\ifnum\value{spellResTN}<8%
\addtocounter{spellResTN}{\value{Fate}}%
\fi%
}
\newcommand\mEarth{%
Earth%
\ifnum\value{spellResTN}<8%
\fi%
}
\newcommand\mAir{%
Air%
\global\settoggle{insubstantial}{true}%
\ifnum\value{spellResTN}<8%
\fi%
}
\newcommand\mFire{%
Fire%
\ifnum\value{spellResTN}<8%
}
\newcommand\mWater{%
Water%
\ifnum\value{spellResTN}<8%
% 1 = Name
% 2 = Spheres
% 3 = Action
% 4 = Enhancements
\global\settoggle{distant}{false}%
\global\settoggle{duplicated}{false}%
\setcounter{spelllevel}{1}%
\foreach \s in {#4}{%
\stepcounter{spelllevel}%
}%
\setcounter{spellPotency}{\value{spelllevel}}%
\subsubsection{#1}%
\label{#1}%
{\sffamily(#4%
\ifnum\value{spelllevel}>1~\fi #3
\setArea%
\iftoggle{duplicated}{%
\index[spells]{\textbf{#1}: #6 (Cost: \arabic{spelllevel}, Range:~\spellRange, Resisted by: #5\iftoggle{duplicated}{, Targets: \spellArea}{})|needspace{2em} --- Page }
\ifdefparam{#5}{%
Roll #5, \tn[\arabic{spellResTN}], or #6.
(Spheres:~#2, Cost:~\arabic{spelllevel}, Range:~\spellRange\iftoggle{duplicated}{, Targets:~\spellArea}{})
}
\newcommand\spellRange{}
\newcommand\setRange{%
\iftoggle{distant}%
{%
\ifcase\value{spelllevel}\relax%
\renewcommand\spellRange{Error}%
\or%
\renewcommand\spellRange{Error}%
\or%
\renewcommand\spellRange{throwing distance}%
\or%
\renewcommand\spellRange{shouting distance}%
\or%
\renewcommand\spellRange{horizon}%
\else%
\renewcommand\spellRange{line of sight}%
\fi%
}%
{%
\setcounter{track}{20}%
\Repeat{\arabic{spelllevel}}{\addtocounter{track}{-4}}%
\ifnum\value{track}<1%
\renewcommand\spellRange{touch}%
\else%
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
\fi%
}%
}
%%%
\newcommand\spellArea{}
\newcounter{spellArea}
\newcommand\setArea{%
\setcounter{spellArea}{\value{spelllevel}}%
\multiply\value{spellArea} by \value{spelllevel}%
\iftoggle{insubstantial}{%
\multiply\value{spellArea} by \value{spelllevel}%
\addtocounter{spellArea}{0}%
}{}%
\renewcommand\spellArea{%
\arabic{spellArea}%
}%
}
%%%
\newtoggle{insubstantial}
\settoggle{insubstantial}{false}
\newtoggle{distant}
\settoggle{distant}{false}
\newtoggle{duplicated}
\settoggle{duplicated}{false}
\newcommand\detailed{Detailed}
\newcommand\duplicated{%
Duplicated%
}
\newcommand\divergent{Divergent}
\newcommand\distant{%
\newcommand\rollConv{\arabic{numberofdice}D6\ifnum\value{damagebonus}<0\arabic{damagebonus}\else\ifnum\value{damagebonus}>0+\arabic{damagebonus}\fi\fi}
\global\settoggle{distant}{false}%
\global\settoggle{duplicated}{false}%
\global\settoggle{insubstantial}{false}%
\setcounter{spelllevel}{1}%
\stepcounter{spelllevel}%
}%
\setcounter{spellPotency}{\value{spelllevel}}%
\addtocounter{spellPotency}{3}%
\setcounter{spellResTN}{7}%
\vphantom{\dmg{spellPotency}}%
\setArea%
\setRange%
\needspace{3em}
{\center\decoone~\textbf{\large #1}~\decoone}
\noindent
\begin{description}
Potence:~\arabic{spelllevel}, Range: \spellRange\iftoggle{duplicated}{, Targets: \spellArea}{}
\item[Resisted~by:]
#4
\newcommand{\magicitem}[7]{%
\vspace{1em}\needspace{1em}\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}
}
\settoggle{genExamples}{false}
#1
\foreach \s in {#2}{
\IfFileExists{config/spells/\s.tex}{
\input{config/spells/\s.tex}
}{}
}
\end{description}
}
\newcommand\showStdSpells{
\setcounter{enc}{0}
\begin{description}
\settoggle{genExamples}{false}
\foreach\n in {3,2,1}{
\ifnum\value{enc}<3
\foreach \s in {Earth,Air,Fire,Water,Fate}{
\ifnumcomp{\value{\s}}{=}{\n}{
\input{config/spells/\s\n.tex}
\stepcounter{enc}
}{}
}
\fi
\textcolor{\pageSideColor}{\hrulefill\raisebox{-3pt}{\npcsymbol}}
\settoggle{genExamples}{true}
\foreach \s in {#1}{
\input{config/spells/\s.tex}
}