Included gm_spellbook and updated MSavage form

This commit is contained in:
bw-mutley
2022-03-19 12:37:28 -03:00
committed by GitHub
parent fb0f66aa10
commit 062adafe6a
5 changed files with 248 additions and 7 deletions
+7 -7
View File
@@ -101,16 +101,16 @@
\Initiative{[[ char.initiative ]]} \Initiative{[[ char.initiative ]]}
\Speed{[[ char.speed ]]} \Speed{[[ char.speed ]]}
\MaxHitPoints{[[ char.hp_max ]]} \MaxHitPoints{[[ char.hp_max ]]}
\CurrentHitPoints{[[ char.hp_current ]]} [% if char.hp_current %]\CurrentHitPoints{[[ char.hp_current ]]}[% endif %]
\TemporaryHitPoints{[[ char.hp_temp ]]} [% if char.hp_temp %]\TemporaryHitPoints{[[ char.hp_temp ]]}[% endif %]
\MaxHitDice{[[ char.hit_dice.replace(" ","") ]]} \MaxHitDice{[[ char.hit_dice.replace(" ","") ]]}
\CurrentHitDice{[[ char.hit_dice_current.replace(" ", "") ]]} \CurrentHitDice{[[ char.hit_dice_current.replace(" ", "") ]]}
\CP{[[ char.cp ]]} \CP{[% if char.cp > 0 %][[ char.cp ]][% endif %]}
\SP{[[ char.sp ]]} \SP{[% if char.sp > 0 %][[ char.sp ]][% endif %]}
\GP{[[ char.gp ]]} \GP{[% if char.ep > 0 %][[ char.ep ]][% endif %]}
\EP{[[ char.ep ]]} \EP{[% if char.gp > 0 %][[ char.gp ]][% endif %]}
\PP{[[ char.pp ]]} \PP{[% if char.pp > 0 %][[ char.pp ]][% endif %]}
[% for w in char.weapons %] [% for w in char.weapons %]
\AddWeapon{[[ w.name ]]}{[[ "{:+d}".format(w.attack_modifier) ]]}{[[ "{}/{}".format(w.damage, w.damage_type) ]]} \AddWeapon{[[ w.name ]]}{[[ "{:+d}".format(w.attack_modifier) ]]}{[[ "{}/{}".format(w.damage, w.damage_type) ]]}
@@ -0,0 +1,91 @@
<h1 id="character-companions">Companions</h1>
[% for monster in monsters|sort(attribute='name') %]
<div class="stat-block">
<h2 id="character-companions-[[ monster.name|to_heading_id ]]">[[ monster.name ]]</h2>
[% if monster.description %]
<p class="creature-description">[[ monster.description ]]</p>
[% endif %]
<!-- Basic properties -->
<table class="details">
<tr>
<th>Armor Class</th>
<th>Hit Points</th>
<th>Speed</th>
</tr>
<tr>
<td>[[ monster.armor_class ]]</td>
<td>[[ monster.hp_max ]] ([[ monster.hit_dice ]])</td>
<td>[[ monster.speed ]][% if monster.swim_speed %],
[[ monster.swim_speed ]] swim[% endif %][% if monster.fly_speed %],
[[ monster.fly_speed ]] fly[% endif %][% if monster.burrow_speed %],
[[ monster.burrow_speed ]] burrow[% endif %]</td>
</tr>
</table>
<!-- Attributes -->
<table class="details">
<tr>
<th>STR</th>
<th>DEX</th>
<th>CON</th>
<th>INT</th>
<th>WIS</th>
<th>CHA</th>
</tr>
<tr>
<td>[[ monster.strength.value ]]</td>
<td>[[ monster.dexterity.value ]]</td>
<td>[[ monster.constitution.value ]]</td>
<td>[[ monster.intelligence.value ]]</td>
<td>[[ monster.wisdom.value ]]</td>
<td>[[ monster.charisma.value ]]</td>
</tr>
<tr>
<td>([[ monster.strength.modifier|mod_str ]])</td>
<td>([[ monster.dexterity.modifier|mod_str ]])</td>
<td>([[ monster.constitution.modifier|mod_str ]])</td>
<td>([[ monster.intelligence.modifier|mod_str ]])</td>
<td>([[ monster.wisdom.modifier|mod_str ]])</td>
<td>([[ monster.charisma.modifier|mod_str ]])</td>
</tr>
</table>
<dl class="monster-details details">
[% if monster.skills != "" %]<dt>Skills</dt><dd>[[ monster.skills ]]</dd>[% endif %]
<dt>Senses</dt><dd>[% if monster.senses != "" %][[ monster.senses ]][% else %]--[% endif %]</dd>
<dt>Languages</dt><dd>[% if monster.languages != "" %][[ monster.languages ]][% else %]--[% endif %]</dd>
[% if monster.damage_resistances != "" %]<dt>Damage Resistances</dt><dd>[[ monster.damage_resistances ]]</dd>[% endif %]
[% if monster.damage_immunities != "" %]<dt>Damage Immunities</dt><dd>[[ monster.damage_immunities ]]</dd>[% endif %]
[% if monster.damage_vulnerabilities != "" %]<dt>Damage Vulnerabilities</dt><dd>[[ monster.damage_vulnerabilities ]]</dd>[% endif %]
[% if monster.condition_immunities != "" %]<dt>Condition Immunuties</dt><dd>[[ monster.condition_immunities ]]</dd>[% endif %]
[% if monster.saving_throws != "" %]<dt>Saving Throws</dt><dd>[[ monster.saving_throws ]]</dd>[% endif %]
<dt>Challenge<dd>[[ monster.challenge_rating ]] ([[ monster.challenge_rating | challenge_rating_to_xp ]] XP)</dd>
</dl>
[% if monster.spells | length > 0 %]
<dl class="monster-spell-list">
[% for level, spells in monster.spells | groupby('level') %]
<dt>[% if level == 0 %]Cantrips[% else %]Level [[ level ]][% endif %]</dt>
<dd>
[% for spell in spells %][% if not loop.first %], [% endif %]
<a href="#monster-spells-[[ spell.name | to_heading_id ]]">[[ spell.name ]]</a>[% endfor %]
</dd>
[% endfor %]
</dl>
[% endif %]
[[ monster.__doc__ | rst_to_html(top_heading_level=2) ]]
</div>
[% endfor %]
<h1 id="monster-spells">Monster Spells</h1>
[% from "spellblock.html" import spellblock %]
[% for spell in spell_list | sort(attribute="name") %]
[[ spellblock(spell, id_base="monster-spells") ]]
[% endfor %]
+100
View File
@@ -0,0 +1,100 @@
\pdfbookmark[0]{Companions}{Companions}
\section*{Companions}
[% if use_dnd_decorations %]
[% for monster in monsters|sort(attribute='name') %]
\pdfbookmark[1]{[[ monster.name ]]}{Companions - [[ monster.name ]]}
\begin{DndMonster}{[[ monster.name ]]}
\DndMonsterType{[[ monster.description ]]}
% If you want to use commas in the key values, enclose the values in braces.
\DndMonsterBasics[
armor-class = {[[ monster.armor_class ]]},
hit-points = {[[ monster.hp_max ]] ([[ monster.hit_dice ]])},
speed = {[[ monster.speed ]] ft.[% if monster.swim_speed %], [[ monster.swim_speed ]] ft. swim[% endif %][% if monster.fly_speed %], [[ monster.fly_speed ]] ft. fly[% endif %][% if monster.burrow_speed %], [[ monster.burrow_speed ]] ft. burrow[% endif %]},
]
\DndMonsterAbilityScores[
str = [[ monster.strength.value ]],
dex = [[ monster.dexterity.value ]],
con = [[ monster.constitution.value ]],
int = [[ monster.intelligence.value ]],
wis = [[ monster.wisdom.value ]],
cha = [[ monster.charisma.value ]],
]
\DndMonsterDetails[
saving-throws = {[[ monster.saving_throws ]]},
skills = {[[ monster.skills ]]},
damage-vulnerabilities = {[[ monster.damage_vulnerabilities ]]},
damage-resistances = {[[ monster.damage_resistances ]]},
damage-immunities = {[[ monster.damage_immunities ]]},
condition-immunities = {[[ monster.condition_immunities ]]},
senses = {[[ monster.senses ]]},
languages = {[% if monster.languages %][[ monster.languages ]][% else %] --- [% endif %]},
challenge = {[[ monster.challenge_rating ]] ([[ monster.challenge_rating | challenge_rating_to_xp ]] XP)},
]
%\DndMonsterSection{Actions}
[[ monster.__doc__ | rst_to_latex(top_heading_level=2) ]]
\end{DndMonster}
[% endfor %]
[% else %]
[% for monster in monsters|sort(attribute='name') %]
{
\pdfbookmark[1]{[[ monster.name ]]}{Companions - [[ monster.name ]]}
\section*{[[ monster.name ]]}
[% if monster.description %]
\subsection*{[[ monster.description ]]}
[% endif %]
\begin{tabular}{c c c}
Armor Class & Hit Points & Speed \\
\hline
[[ monster.armor_class ]] &
[[ monster.hp_max ]] ([[ monster.hit_dice ]]) &
[[ monster.speed ]] \\
[% if monster.swim_speed %]
& & [[ monster.swim_speed ]] swim \\
[% endif %]
[% if monster.fly_speed %]
& & [[ monster.fly_speed ]] fly \\
[% endif %]
[% if monster.burrow_speed %]
& & [[ monster.burrow_speed ]] burrow \\
[% endif %]
\end{tabular}
\vspace{0.2cm}
\begin{tabular}{c c c c c c}
STR & DEX & CON & INT & WIS & CHA \\
\hline
[[ monster.strength.value ]] & [[ monster.dexterity.value ]] & [[ monster.constitution.value ]] &
[[ monster.intelligence.value ]] & [[ monster.wisdom.value ]] & [[ monster.charisma.value ]] \\
([[ monster.strength.modifier|mod_str ]]) & ([[ monster.dexterity.modifier|mod_str ]]) &
([[ monster.constitution.modifier|mod_str ]]) & ([[ monster.intelligence.modifier|mod_str ]]) &
([[ monster.wisdom.modifier|mod_str ]]) & ([[ monster.charisma.modifier|mod_str ]]) \\
\end{tabular}
\vspace{0.2cm}
\begin{description}
[% if monster.skills != "" %]\item [Skills:] [[ monster.skills ]][% endif %]
\item [Senses:] [% if monster.senses != "" %][[ monster.senses ]][% else %]--[% endif %]
\item [Languages:] [% if monster.languages != "" %][[ monster.languages ]][% else %]--[% endif %]
[% if monster.damage_resistances != "" %]\item [Damage Resistances:] [[ monster.damage_resistances ]][% endif %]
[% if monster.damage_immunities != "" %]\item [Damage Immunities:] [[ monster.damage_immunities ]][% endif %]
[% if monster.damage_vulnerabilities != "" %]\item [Damage Vulnerabilities:] [[ monster.damage_vulnerabilities ]][% endif %]
[% if monster.condition_immunities != "" %]\item [Condition Immunuties:] [[ monster.condition_immunities ]][% endif %]
[% if monster.saving_throws != "" %]\item [Saving Throws:] [[ monster.saving_throws ]][% endif %]
\item [Challenge:] [[ monster.challenge_rating ]] ([[ monster.challenge_rating | challenge_rating_to_xp ]] XP)
\end{description}
\vspace{0.2cm}
[[ monster.__doc__ | rst_to_latex(top_heading_level=2) ]]
} %\color
[% endfor %]
[% endif %]
@@ -0,0 +1,9 @@
<h1 id="spells">Spells</h1>
<!-- Spell descriptions -->
[% from "spellblock.html" import spellblock %]
[% for spl in spells %]
[[ spellblock(spl, id_base="spells") ]]
[% endfor %]
@@ -0,0 +1,41 @@
\pdfbookmark[0]{Spells}{Spells}
\section*{Spells}
[% for spl in spells %]
\pdfbookmark[1]{[[ spl.name ]]}{Spells - [[ spl.name ]]}
[% if use_dnd_decorations %]
\DndSpellHeader
{[[ spl.name ]]}
{[% if spl.level > 0 %][[ ordinals[spl.level] ]]-level [[ spl.magic_school ]][% else %][[ spl.magic_school ]] Cantrip[% endif %] [% if spl.ritual %](\textit{ritual})[% endif %]}
{[[ spl.casting_time ]]}
{[[ spl.casting_range ]]}
{[[ spl.component_string ]]}
{[[ spl.duration ]]}
[% else %]
\section*{[[ spl.name ]]}
[% if spl.level > 0 %] %
\textit{[[ spl.magic_school ]] Level [[ spl.level ]]} %
[% else %] %
\textit{[[ spl.magic_school ]] Cantrip} %
[% endif %] %
[% if spl.ritual and spl.concentration %]%
(\textit{ritual}, \textit{concentration})%
[% elif spl.ritual %]%
(\textit{ritual})%
[% elif spl.concentration %]%
(\textit{concentration})%
[% endif %]%
%% \noindent
\begin{description}
\setlength{\itemsep}{\zerosep}%
\setlength{\parskip}{0pt}%
\item [Casting Time:] [[ spl.casting_time ]] \\
\item [Duration:] [[ spl.duration ]] \\
\item [Range:] [[ spl.casting_range ]] \\
\item [Components:] [[ spl.component_string ]]
\end{description}
% \vspace{\zerosep}
[% endif %]
[[ spl.__doc__ | rst_to_latex(top_heading_level=1) ]]
[% endfor %]