Newer
Older
%
% __ __ _
% | \/ | __ _ __ _(_) ___
% | |\/| |/ _` |/ _` | |/ __|
% | | | | (_| | (_| | | (__
% |_| |_|\__,_|\__, |_|\___|
% |___/
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
\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}
}
\newcommand\displaySpell{%
\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%
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
\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}
}