Newer
Older
%
% __ __ _
% | \/ | __ _ __ _(_) ___
% | |\/| |/ _` |/ _` | |/ __|
% | | | | (_| | (_| | | (__
% |_| |_|\__,_|\__, |_|\___|
% |___/
% 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%
\addtocounter{spellResTN}{\value{Earth}}
\fi%
}
\newcommand\mAir{%
Air%
\global\settoggle{insubstantial}{true}%
\ifnum\value{spellResTN}<8%
\addtocounter{spellResTN}{\value{Air}}
\fi%
}
\newcommand\mFire{%
Fire%
\ifnum\value{spellResTN}<8%
\addtocounter{spellResTN}{\value{Fire}}
\fi%
}
\newcommand\mWater{%
Water%
\ifnum\value{spellResTN}<8%
\addtocounter{spellResTN}{\value{Water}}
\fi%
}
% 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
#2)}
Cost:~\arabic{spelllevel},
\setRange%
\setArea%
\iftoggle{duplicated}{%
\ifdefparam{#5}{
The \glsentrytext{tn} equals 7 plus the target's #5.
}{
The \glsentrytext{tn} equals 7, with modifiers for #5.
}
\index[spells]{\textbf{#1}: #6 (Cost: \arabic{spelllevel}, Range:~\spellRange\iftoggle{duplicated}{, Targets: \spellArea}{})}
\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%
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
\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}
\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}
}
\newcommand\creatureSpells[1]{
\settoggle{genExamples}{false}
\foreach \s in {#1}{
\input{config/spells/\s.tex}
}
\end{description}
}
\newcommand\showSpells[1]{
\needspace{3em}\bigLine
\settoggle{genExamples}{true}
\foreach \s in {#1}{
\input{config/spells/\s.tex}
}