diff --git a/docs.tex b/docs.tex index 102b5efab5a902a7c653a36a0a80b333f9f289ed..b480d7eb932644eb86a96245ad90e8950504282c 100644 --- a/docs.tex +++ b/docs.tex @@ -3,6 +3,8 @@ \date{\today} +\makeindex[name=spells,title={Spell Summaries},columns=2] + \begin{document} \chapter{How to Make Monsters} @@ -138,12 +140,29 @@ And you can list dice, with results, with the `\texttt{dlist}' environment. \subsubsection{Spells} Spells automatically calculate everything they can. +They also compile an optional index (this requires one spell index command). + +\begin{verbatim} +\makeindex[name=spells, +title={Spell Summaries},columns=2] + + +\spell{Quake}% Name + {Earth}% Spheres + {\ranged, Twisted}% Enhancements + {Caving}% Skill + {Ground shakes}% Description + +\printindex[spells] +\end{verbatim} + +After inputting that, you can get the spell, and the `printindex' command will create a spell-list by using a special index, just for spells. \spell{Quake}% Name {Earth}% Spheres - {Large, Twisted, Ranged}% Enhancements + {\ranged, Twisted}% Enhancements {Caving}% Skill - {GrrrrrrrrglllllllllllbrrrrrrrrrrrrrrBBBBBBB}% Description + {Ground shakes}% Description \subsubsection{Magical Items} diff --git a/layout.sty b/layout.sty index 627fc45408d1b08892f6c35b322bad151beb7bf2..859c3006c9de2b8f678feaa0553b883c21d147fc 100644 --- a/layout.sty +++ b/layout.sty @@ -823,16 +823,61 @@ interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west) % 4 = Skill % 5 = Description + \newcommand{\spell}[5]{ \setcounter{spelllevel}{1} \foreach \s in {#3}{ \stepcounter{spelllevel} } \subsubsection[\textbf{#1}: #5. (\textit{#4})]{#1} - \index[spells]{\textbf{#1}: #5. (Cost: \arabic{spelllevel}, Spheres: #2, Skill: #4)} - {\small\it Spheres: #2, \glsentrytext{mp} Cost: \arabic{spelllevel}, Enhancements: #3, \underline{Skill: #4}} + Spheres: #2, + Enhancements: #3, + \glsentrytext{mp} Cost: \arabic{spelllevel}, + \showRange, + \underline{Skill: #4} \vspace{.5em}\afterparnoindent + \index[spells]{\textbf{#1}: #5. (Cost: \arabic{spelllevel}, Spheres: #2, Skill: #4, \showRange)} + \settoggle{ranged}{false}% +} + +\newcounter{spellRange} + +\newcommand\showRange{% + Range: + \iftoggle{ranged}% + {% + \ifcase\value{spelllevel}\relax% + Error% + \or% + Error% + \or% + throwing distance% + \or% + shouting distance% + \or% + horizon% + \else% + line of sight% + \fi% + }% + {% + \setcounter{track}{6}% + \addtocounter{track}{-\value{spelllevel}}% + \ifnum\value{track}<1% + touch% + \else% + \arabic{track} steps% + \fi% + }% +} + +\newtoggle{ranged} +\settoggle{ranged}{false} + +\newcommand\ranged{% + Ranged% + \settoggle{ranged}{true}% } \newcommand{\magicitem}[7]{%