-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspellbook.tex
398 lines (360 loc) · 15.5 KB
/
spellbook.tex
1
2
3
4
5
6
7
8
9
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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
170
171
172
173
174
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
%TeX
\documentclass{amsbook}
\usepackage[top=0.25in,bottom=0.25in,left=0.125in,right=0.125in]{geometry}
\usepackage[letterspace=150]{microtype}
\usepackage[utf8]{inputenc}
\usepackage[overload]{textcase}
\usepackage{mdframed}
\usepackage{setspace}
\usepackage{xspace}
\usepackage{pgfkeys}
\usepackage{etoolbox}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{ifoddpage}
\usepackage[none]{hyphenat}
\usepackage{luacode}
\usepackage{wizpen}
\makeatletter
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother
\geometry{
paperheight=9.75in,
paperwidth=7.5in,
}
\setlength\parindent{0pt}
\newcommand{\LuaSpellbook}{require('lua/spellbook')}
\luadirect{tex.print(table.concat(\LuaSpellbook.preamble(), ''))}
\newcommand{\SpellbookMatch}[4]{%
\luadirect{tex.print(\LuaSpellbook.match(\luastring{#1}, \luastring{#2}, \luastringN{#3}, \luastringN{#4}))}%
}
\newcommand{\SpellbookCleanup}[1]{%
\luadirect{tex.print(\LuaSpellbook.cleanup(\luastringN{#1}))}%
}
\newcommand{\SpellbookDice}[1]{%
\luadirect{tex.print(\LuaSpellbook.dice(\luastring{#1}))}%
}
\newcommand{\SpellbookDiceTwoArg}[2]{%
\textcolor{red}{#1d#2}\xspace%
}
\newcommand{\SpellbookDiceFourArg}[4]{%
\textcolor{red}{%
#1d#2\enspace{\normalfont\textcolor{black}{\raisebox{3pt}{#3}}\enspace}#4%
}\xspace%
}
\newcommand{\SpellbookDistanceOneArg}[1]{%
\textcolor{cyan}{#1 foot}\xspace%
}
\newcommand{\SpellbookRangeTwoArg}[2]{%
\textcolor{ForestGreen}{#1}%
\enspace{\normalfont\raisebox{3pt}{/}}\enspace%
\textcolor{ForestGreen}{#2}\xspace%
}
\newcommand{\SpellTimeColor}[2]{%
\SpellbookMatch{#1}{action}{\textcolor{purple}}{%
\SpellbookMatch{#1}{bonus}{\textcolor{cyan}}{%
\SpellbookMatch{#1}{reaction}{\textcolor{red}}{%
\textcolor{black}%
}%
}%
}%
#2%
}
\newcommand{\SpellEffortColor}[2]{%
\SpellbookMatch{#1}{ritual}{\textcolor{cyan}}{%
\SpellbookMatch{#1}{concentration}{\textcolor{red}}{%
\textcolor{black}%
}%
}%
#2%
}
\newcommand{\SpellRangeColor}[2]{%
\SpellbookMatch{#1}{self}{\textcolor{purple}}{%
\SpellbookMatch{#1}{touch}{\textcolor{cyan}}{%
\textcolor{black}%
}%
}%
#2%
}
\newcommand{\SpellDurationColor}[2]{%
\SpellbookMatch{#1}{instant}{\textcolor{purple}}{%
\SpellbookMatch{#1}{round}{\textcolor{cyan}}{%
\SpellbookMatch{#1}{minute}{\textcolor{red}}{%
\textcolor{black}%
}%
}%
}%
#2%
}
\newcommand{\SpellMakeType}[3]{%
% type, save, damage
\SpellbookMatch{#1}{save}{%
\textcolor{cyan}{\MakeTextUppercase{#2} \SpellbookDice{#3}} ~\\ ~\\ %
}{%
\SpellbookMatch{#1}{attack}{%
\ifdefempty{#3}{ }{\textcolor{red}{\SpellbookDice{#3}} ~\\ ~\\} %
}{%
\ifdefempty{#3}{ }{\SpellbookDice{#3} ~\\ ~\\}%
}%
}%
}
\newcommand{\SpellMakeMaterials}[2]{%
\SpellbookMatch{#1}{m}{%
\begin{mdframed}%
\begin{centering}%
\textcolor{red}{Components required} \\%
\hrulefill ~\\ ~\\%
\end{centering}%
\begin{centering}%
\begin{sloppypar}%
\SpellbookCleanup{#2}%
\end{sloppypar}%
\end{centering}%
\end{mdframed}%
}{ }%
}
\pgfkeys{
/Spell/.is family, /Spell,
level/.estore in = \SpellLevel,
components/.estore in = \SpellComponents, % v/s/m combinations
effort/.estore in = \SpellEffort, % spell/ritual/concentration
effort/.default = spell,
duration/.estore in = \SpellDuration, % instant/n rounds/n minutes
time/.estore in = \SpellTime, % action/bonus/reaction/something else
school/.estore in = \SpellSchool,
range/.estore in = \SpellRange, % self/touch/something else
type/.estore in = \SpellType, % automatic/save/attack
type/.default = auto,
save/.estore in = \SpellSave, % dex/wis/con/etc
save/.default = ,
damage/.estore in = \SpellDamage, % damage dice
damage/.default = ,
materials/.estore in = \SpellMaterials, % description, sadly w/o commas
materials/.default = ,
text/.store in = \SpellTextPrefix, % anything to prefix text with
text/.default = \empty,
}
\newcommand{\Spell}[3][] {%
\pgfkeys{/Spell, effort, type, save, damage, materials, text, #1}%
\checkoddpage%
\ifoddpage%
{%
\huge \renewcommand{\baselinestretch}{1.5}%
{\wizpenfont #2} \hfill%
{\wizpenfont \SpellEffortColor{\SpellEffort}{\SpellComponents}}%
{\Huge \enspace \raisebox{3pt}{\rom{\SpellLevel}}} \\ \\%
{\wizpenfont \SpellDurationColor{\SpellDuration}{\SpellDuration}} \hfill%
{\wizpenfont \SpellTimeColor{\SpellTime}{\SpellTime}} \\ \\%
{\wizpenfont \SpellSchool} \hfill%
{\wizpenfont \SpellRangeColor{\SpellRange}{\SpellRange}} \\%
}%
\else%
{%
\huge \renewcommand{\baselinestretch}{1.5}%
{\Huge \raisebox{3pt}{\rom{\SpellLevel}} \enspace}%
{\wizpenfont \SpellEffortColor{\SpellEffort}{\SpellComponents}} \hfill%
{\wizpenfont #2} \\ \\%
{\wizpenfont \SpellTimeColor{\SpellTime}{\SpellTime}} \hfill%
{\wizpenfont \SpellDurationColor{\SpellDuration}{\SpellDuration}} \\ \\%
{\wizpenfont \SpellRangeColor{\SpellRange}{\SpellRange}} \hfill%
{\wizpenfont \SpellSchool} \\%
}%
\fi%
{%
\huge%
\begin{center}%
{\wizpenfont \SpellMakeType{\SpellType}{\SpellSave}{\SpellDamage}}
\end{center}%
}%
{%
\LARGE \renewcommand{\baselinestretch}{1}%
{%
\wizpenfont%
\begin{sloppypar}%
\SpellTextPrefix%
\SpellbookCleanup{#3}%
\end{sloppypar}%
} ~\\%
}%
{%
\LARGE%
{\wizpenfont \SpellMakeMaterials{\SpellComponents}{\SpellMaterials}}%
}%
\clearpage
}
\begin{document}
\pagenumbering{gobble}
{
\Spell[%
level=1, school=evocation, type=save, save=dex, damage=3d6, time=action,
range=self, components=vs, duration=instant
]{Burning Hands}{
As you hold your hands with thumbs touching and fingers spread, a thin
sheet of flames shoots forth from your outstretched fingertips. Each
creature in a 15-foot cone must make a Dexterity saving throw. A
creature takes 3d6 fire damage on a failed save, or half as much damage
on a successful one. The fire ignites any flammable objects in the area
that aren't being worn or carried.
At Higher Levels. When you cast this spell using a spell slot of 2nd
level or higher, the damage increases by 1d6 for each slot level above
1st.
}
\Spell[%
level=1, school=enchantment, type=save, save=wis, time=action,
range=30 feet, components=vs, duration=1 hour
]{Charm Person}{
You attempt to charm a humanoid you can see within range. It must make a
Wisdom saving throw, and does so with advantage if you or your
companions are fighting it. If it fails the saving throw, it is charmed
by you until the spell ends or until you or your companions do anything
harmful to it. The charmed creature regards you as a friendly
acquaintance. When the spell ends, the creature knows it was charmed by
you.
When you cast this spell using a spell slot of 2nd
level or higher, you can target one additional creature for each slot
level above 1st. The creatures must be within 30 feet of each other when
you target them.
}
\Spell[%
level=1, school=abjuration, time=action, range=touch,
components=vsm, materials=a piece of cured leather, duration=8 hours
]{Mage Armor}{
You touch a willing creature who isn't wearing armor, and a protective
magical force surrounds it until the spell ends. The target's base AC
becomes 13 + its Dexterity modifier. The spell ends if the target dons
armor or if you dismiss the spell as an action.
}
\Spell[%
level=1, school=evocation, damage=1d4+1, time=action,
range=120 feet, components=vs, duration=instant
]{Magic Missile}{
You create three glowing darts of magical force. Each dart hits a
creature of your choice that you can see within range. A dart deals 1d4
+ 1 force damage to its target. The darts all strike simultaneously, and
you can direct them to hit one creature or several.
At Higher Levels. When you cast this spell using a spell slot of 2nd
level or higher, the spell creates one more dart for each slot level
above 1st.
}
\Spell[%
level=1, school=abjuration, time=reaction, range=self,
components=vs, duration=1 round
]{Shield}{
An invisible barrier of magical force appears and protects you. Until
the start of your next turn, you have a +5 bonus to AC, including
against the triggering attack, and you take no damage from magic
missile.
Reaction: take when you are hit by an attack or targeted by the magic
missile spell
}
\Spell[%
level=1, school=conjuration, time=1 hour, range=10 feet,
components=vsm, materials=10 gp worth of charcoal; incense; and herbs
that must be consumed by fire in a brass brazier,
duration=instant, effort=ritual, text=\small
]{Find Familiar}{
You gain the service of a familiar, a spirit that takes an animal form
you choose: bat, cat, crab, frog (toad), hawk, lizard, octopus, owl,
poisonous snake, fish (quipper), rat, raven, sea horse, spider, or
weasel. Appearing in an unoccupied space within range, the familiar has
the statistics of the chosen form, though it is a celestial, fey, or
fiend (your choice) instead of a beast.
Your familiar acts independently of you, but it always obeys your
commands. In combat, it rolls its own initiative and acts on its own
turn. A familiar can't attack, but it can take other actions as normal.
When the familiar drops to 0 hit points, it disappears, leaving behind
no physical form. It reappears after you cast this spell again. While
your familiar is within 100 feet of you, you can communicate with it
telepathically. Additionally, as an action, you can see through your
familiar's eyes and hear what it hears until the start of your next
turn, gaining the benefits of any special senses that the familiar has.
During this time, you are deaf and blind with regard to your own senses.
As an action, you can temporarily dismiss your familiar. It disappears
into a pocket dimension where it awaits your summons. Alternatively, you
can dismiss it forever. As an action while it is temporarily dismissed,
you can cause it to reappear in any unoccupied space within 30 feet of
you. You can't have more than one familiar at a time. If you cast this
spell while you already have a familiar, you instead cause it to adopt a
new form. Choose one of the forms from the above list. Your familiar
transforms into the chosen creature.
%Finally, when you cast a spell with a range of touch, your familiar can
%deliver the spell as if it had cast the spell. Your familiar must be
%within 100 feet of you, and it must use its reaction to deliver the
%spell when you cast it. If the spell requires an attack roll, you use
%your attack modifier for the roll.
}
\Spell[%
level=1, school=illusion, time=1 minute, range=touch,
components=sm, materials=lead ink worth at least 10 gp,
duration=10 days, effort=ritual, text=\large
]{Illusory Script}{
You write on parchment, paper, or some other suitable writing material
and imbue it with a potent illusion that lasts for the duration. To you
and any creatures you designate when you cast the spell, the writing
appears normal, written in your hand, and conveys whatever meaning you
intended when you wrote the text. To all others, the writing appears as
if it were written in an unknown or magical script that is
unintelligible. Alternatively, you can cause the writing to appear to be
an entirely different message, written in a different hand and language,
though the language must be one you know.
Should the spell be dispelled, the original script and the illusion both
disappear. A creature with truesight can read the hidden message.
}
\Spell[%
level=2, school=conjuration, time=bonus, range=self,
components=v, duration=instant
]{Misty Step}{
Briefly surrounded by silvery mist, you teleport up to 30 feet to an
unoccupied space that you can see.
}
\Spell[%
level=2, school=necromancy, type=attack, time=action, range=60 feet,
components=vs, duration=1 minute, effort=concentration
]{Ray of Enfeeblement}{
A black beam of enervating energy springs from your finger toward a
creature within range. Make a ranged spell attack against the target. On
a hit, the target deals only half damage with weapon attacks that use
Strength until the spell ends.
At the end of each of the target's turns, it can make a Constitution
saving throw against the spell. On a success, the spell ends.
}
\Spell[%
level=2, school=illusion, time=action, range=touch,
components=vsm, materials=an eyelash encased in gum arabic,
duration=1 hour, effort=concentration
]{Invisibility}{
A creature you touch becomes invisible until the spell ends. Anything
the target is wearing or carrying is invisible as long as it is on the
target's person. The spell ends for a target that attacks or casts a
spell.
At Higher Levels. When you cast this spell using a spell slot of 3rd
level or higher, you can target one additional creature for each slot
level above 2nd.
}
\Spell[%
level=2, school=conjuration, damage=3d6, time=bonus, range=touch,
components=vsm, materials=hot pepper, duration=1 minute,
effort=concentration
]{Dragon's Breath}{
Touch a willing creature. Choose acid, cold, fire, lightning, or poison.
Until the spell ends, the creature can use an action to exhale energy of
the chosen type in a 15 foot cone. Each creature in that area must make
a Dexterity save, taking 3d6 damage on a failed save, or half as much on
a success.
}
\Spell[%
level=2, school=illusion, damage=2d8, time=bonus, range=self,
components=vs, duration=1 minute, effort=concentration
]{Shadow Blade}{
You create a magic sword that lasts until the spell ends. It counts as a
simple melee weapon that you're proficient with. It deals 2d8 psychic
damage, and has the finesse, light, and thrown properties (range 20/60).
When you attack in dim light or darkness, you have advantage.
If you drop the weapon or throw it, it disappears at the end of the
turn. While the spell lasts, you can use a bonus action to make the
sword reappear in your hand.
At Higher Levels: When you cast this spell using a 3rd or 4th level
slot, the damage is 3d8. At 5th or 6th level, it's 4d8. At 7th level or
higher, it's 5d8.
}
}
\end{document}