-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomated.tex
140 lines (135 loc) · 5.26 KB
/
automated.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
% include this file in your preamble to use these handy functions!
\ExplSyntaxOn
\newcommand{\rounddown}[1]
{\fp_eval:n { trunc(#1,0) } }
% always use a simple value first (default 0)
\newcommand{\summe}[2]
{\int_eval:n { #1 + #2 } }
% always use a simple value first (default 1)
\newcommand{\produkt}[2]
{\int_eval:n { #1 * #2 } }
\newcommand{\fix}[1]
{\int_eval:n {#1} }
\ExplSyntaxOff
\newcommand{\mod}[1]
{%
\ifnum0<#1%
+#1%
\else%
#1%
\fi%
}
\newcommand{\rawattrmod}[1]
{\rounddown{(#1-10)/2}}
\newcommand{\attrmod}[1]
{\mod{\rawattrmod{#1}}}
\newrgbcolor{testblack}{0 0 0}
%\newrgbcolor{testwhite}{255 255 255}
% test for the color set in the proficiency radio buttons
\newcommand{\ifproficientelse}[3]
{%
\extractcolorspec{#1}{\test}%
\extractcolorspec{testblack}{\fulfilled}%
\ifx\test\fulfilled
#2%
\else
#3%
\fi
}
% =============AUTOMATED=============
\Proficiency{\mod{\ProficiencyBonus}} % display value
% Ability modifiers - display values
\StrengthModifier{ \attrmod{\StrengthScoreValue} }
\DexterityModifier{ \attrmod{\DexterityScoreValue} }
\ConstitutionModifier{ \attrmod{\ConstitutionScoreValue} }
\IntelligenceModifier{ \attrmod{\IntelligenceScoreValue} }
\WisdomModifier{ \attrmod{\WisdomScoreValue} }
\CharismaModifier{ \attrmod{\CharismaScoreValue} }
% ability bonus/malus - raw
\def\StrMod{ \rawattrmod{\StrengthScoreValue} }
\def\DexMod{ \rawattrmod{\DexterityScoreValue} }
\def\ConMod{ \rawattrmod{\ConstitutionScoreValue} }
\def\IntMod{ \rawattrmod{\IntelligenceScoreValue} }
\def\WisMod{ \rawattrmod{\WisdomScoreValue} }
\def\ChaMod{ \rawattrmod{\CharismaScoreValue} }
% passive Perception
\Perception{ \summe{10}{\WisMod} } %TODO: add proficiency too?
%HP
\MaxHitDice{\Level{}d\LvlOneHP}
\MaxHitPoints{%(base+CON)+(Lvl-1)*(rounddown(base)+1+CON)
\summe{ \summe{\LvlOneHP}{\ConMod} }{ \produkt{\summe{\Level}{-1}}{\summe{1}{ \summe{\ConMod}{ \rounddown{\LvlOneHP / 2} } }} }%
}
% Values Saving Throws
\StrengthSavingThrowModifier{%
\ifproficientelse{strengthproficiency}{ \mod{\summe{\ProficiencyBonus}{\StrMod}} }{ \mod{\fix{\StrMod}} }%
}
\DexteritySavingThrowModifier{%
\ifproficientelse{dexterityproficiency}{ \mod{\summe{\ProficiencyBonus}{\DexMod}} }{ \mod{\fix{\DexMod}} }%
}
\ConstitutionSavingThrowModifier{%
\ifproficientelse{constitutionproficiency}{ \mod{\summe{\ProficiencyBonus}{\ConMod}} }{ \mod{\fix{\ConMod}} }%
}
\IntelligenceSavingThrowModifier{%
\ifproficientelse{intelligenceproficiency}{ \mod{\summe{\ProficiencyBonus}{\IntMod}} }{ \mod{\fix{\IntMod}} }%
}
\WisdomSavingThrowModifier{%
\ifproficientelse{wisdomproficiency}{ \mod{\summe{\ProficiencyBonus}{\WisMod}} }{ \mod{\fix{\WisMod}} }%
}
\CharismaSavingThrowModifier{%
\ifproficientelse{charismaproficiency}{ \mod{\summe{\ProficiencyBonus}{\ChaMod}} }{ \mod{\fix{\ChaMod}} }%
}
% Skills
\AcrobaticsSkillModifier{%
\ifproficientelse{acrobaticsproficiency}{ \mod{\summe{\ProficiencyBonus}{\DexMod}} }{ \mod{\fix{\DexMod}} }%
}
\AnimalHandlingSkillModifier{%
\ifproficientelse{animalhandlingproficiency}{ \mod{\summe{\ProficiencyBonus}{\WisMod}} }{ \mod{\fix{\WisMod}} }%
}
\ArcanaSkillModifier{%
\ifproficientelse{arcanaproficiency}{ \mod{\summe{\ProficiencyBonus}{\IntMod}} }{ \mod{\fix{\IntMod}} }%
}
\AthleticsSkillModifier{%\StrMod
\ifproficientelse{athleticsproficiency}{ \mod{\summe{\ProficiencyBonus}{\StrMod}} }{ \mod{\fix{\StrMod}} }%
}
\DeceptionSkillModifier{%\ChaMod
\ifproficientelse{deceptionproficiency}{ \mod{\summe{\ProficiencyBonus}{\ChaMod}} }{ \mod{\fix{\ChaMod}} }%
}
\HistorySkillModifier{%
\ifproficientelse{historyproficiency}{ \mod{\summe{\ProficiencyBonus}{\IntMod}} }{ \mod{\fix{\IntMod}} }%
}
\InsightSkillModifier{%
\ifproficientelse{insightproficiency}{ \mod{\summe{\ProficiencyBonus}{\WisMod}} }{ \mod{\fix{\WisMod}} }%
}
\IntimidationSkillModifier{%\ChaMod}
\ifproficientelse{intimidationproficiency}{ \mod{\summe{\ProficiencyBonus}{\ChaMod}} }{ \mod{\fix{\ChaMod}} }%
}
\InvestigationSkillModifier{%\IntMod}
\ifproficientelse{investigationproficiency}{ \mod{\summe{\ProficiencyBonus}{\IntMod}} }{ \mod{\fix{\IntMod}} }%
}
\MedicineSkillModifier{
\ifproficientelse{medicineproficiency}{ \mod{\summe{\ProficiencyBonus}{\WisMod}} }{ \mod{\fix{\WisMod}} }%
}
\NatureSkillModifier{%\IntMod}
\ifproficientelse{natureproficiency}{ \mod{\summe{\ProficiencyBonus}{\IntMod}} }{ \mod{\fix{\IntMod}} }%
}
\PerceptionSkillModifier{%\WisMod}
\ifproficientelse{perceptionproficiency}{ \mod{\summe{\ProficiencyBonus}{\WisMod}} }{ \mod{\fix{\WisMod}} }%
}
\PerformanceSkillModifier{%
\ifproficientelse{performanceproficiency}{ \mod{\summe{\ProficiencyBonus}{\ChaMod}} }{ \mod{\fix{\ChaMod}} }%
}
\PersuasionSkillModifier{%
\ifproficientelse{persuationproficiency}{ \mod{\summe{\ProficiencyBonus}{\ChaMod}} }{ \mod{\fix{\ChaMod}} }%
}
\ReligionSkillModifier{%
\ifproficientelse{religionproficiency}{ \mod{\summe{\ProficiencyBonus}{\IntMod}} }{ \mod{\fix{\IntMod}} }%
}
\SleightOfHandSkillModifier{%\DexMod
\ifproficientelse{sleightofhandproficiency}{ \mod{\summe{\ProficiencyBonus}{\DexMod}} }{ \mod{\fix{\DexMod}} }%
}
\StealthSkillModifier{%\DexMod
\ifproficientelse{stealthproficiency}{ \mod{\summe{\ProficiencyBonus}{\DexMod}} }{ \mod{\fix{\DexMod}} }%
}
\SurvivalSkillModifier{%\WisMod
\ifproficientelse{survivalproficiency}{ \mod{\summe{\ProficiencyBonus}{\WisMod}} }{ \mod{\fix{\WisMod}} }%
}