GM notes now have a monster summary table.

This commit is contained in:
Mark Wolfman
2022-07-30 20:57:36 -05:00
parent 1d74ef8f80
commit 50d212e3d0
4 changed files with 40 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
0.17.1 0.18.0
@@ -1,5 +1,23 @@
<h1 id="gm-monsters">Monsters</h1> <h1 id="gm-monsters">Monsters</h1>
<!-- Monster summary table -->
<table class="monster-table">
<tr>
<th>Monster</th>
<th>HP</th>
<th>AC</th>
<th>Init.</th>
</tr>
[% for monster in monsters|sort(attribute='name') %]
<tr>
<td>[[ monster.name ]]</td>
<td>[[ monster.hp_max ]]</td>
<td>[[ monster.armor_class ]]</td>
<td>[[ monster.initiative ]]</td>
</tr>
[% endfor %]
</table>
[% for monster in monsters|sort(attribute='name') %] [% for monster in monsters|sort(attribute='name') %]
<div class="stat-block"> <div class="stat-block">
<h2 id="gm-monsters-[[ monster.name|to_heading_id ]]">[[ monster.name ]]</h2> <h2 id="gm-monsters-[[ monster.name|to_heading_id ]]">[[ monster.name ]]</h2>
+15
View File
@@ -2,6 +2,13 @@
\section*{Monsters} \section*{Monsters}
[% if use_dnd_decorations %] [% if use_dnd_decorations %]
\begin{DndTable}{r c c c}
Name & HP & AC & Init. \\
[% for monster in monsters|sort(attribute='name') %]
[[ monster.name ]] & [[ monster.hp_max ]] & [[ monster.armor_class ]] & [[ monster.initiative ]] \\
[% endfor %]
\end{DndTable}
[% for monster in monsters|sort(attribute='name') %] [% for monster in monsters|sort(attribute='name') %]
\pdfbookmark[1]{[[ monster.name ]]}{Monsters - [[ monster.name ]]} \pdfbookmark[1]{[[ monster.name ]]}{Monsters - [[ monster.name ]]}
\begin{DndMonster}{[[ monster.name ]]} \begin{DndMonster}{[[ monster.name ]]}
@@ -40,6 +47,14 @@
[% endfor %] [% endfor %]
[% else %] [% else %]
\begin{tabular}{r | c c c}
Name & HP & AC & Init. \\
\hline\hline
[% for monster in monsters|sort(attribute='name') %]
[[ monster.name ]] & [[ monster.hp_max ]] & [[ monster.armor_class ]] & [[ monster.initiative ]] \\
[% endfor %]
\end{tabular}
[% for monster in monsters|sort(attribute='name') %] [% for monster in monsters|sort(attribute='name') %]
{ {
\pdfbookmark[1]{[[ monster.name ]]}{Monsters - [[ monster.name ]]} \pdfbookmark[1]{[[ monster.name ]]}{Monsters - [[ monster.name ]]}
+6 -2
View File
@@ -157,9 +157,11 @@ class HtmlCreatorTestCase(unittest.TestCase):
monsters_ = [monsters.Priest()] monsters_ = [monsters.Priest()]
html = make_sheets.create_monsters_content(monsters=monsters_, suffix="html") html = make_sheets.create_monsters_content(monsters=monsters_, suffix="html")
self.assertIn(r"Priest", html) self.assertIn(r"Priest", html)
# Check extended properties
monsters_ = [VashtaNerada()] monsters_ = [VashtaNerada()]
html = make_sheets.create_monsters_content(monsters=monsters_, suffix="html") html = make_sheets.create_monsters_content(monsters=monsters_, suffix="html")
# Check summary table
self.assertIn("monster-table", html)
# Check extended properties
self.assertIn(r"Vashta Nerada", html) self.assertIn(r"Vashta Nerada", html)
self.assertIn(r"35", html) self.assertIn(r"35", html)
self.assertIn(r"45 fly", html) self.assertIn(r"45 fly", html)
@@ -264,9 +266,11 @@ class TexCreatorTestCase(unittest.TestCase):
monsters_ = [monsters.GiantEagle()] monsters_ = [monsters.GiantEagle()]
tex = make_sheets.create_monsters_content(monsters=monsters_, suffix="tex") tex = make_sheets.create_monsters_content(monsters=monsters_, suffix="tex")
self.assertIn(r"Giant Eagle", tex) self.assertIn(r"Giant Eagle", tex)
# Check extended properties
monsters_ = [VashtaNerada()] monsters_ = [VashtaNerada()]
tex = make_sheets.create_monsters_content(monsters=monsters_, suffix="tex") tex = make_sheets.create_monsters_content(monsters=monsters_, suffix="tex")
# Check that the monster summary table exists
self.assertIn(r"Vashta Nerada & 10 & 10 & +0", tex)
# Check extended properties
self.assertIn(r"Vashta Nerada", tex) self.assertIn(r"Vashta Nerada", tex)
self.assertIn(r"35", tex) self.assertIn(r"35", tex)
self.assertIn(r"45 fly", tex) self.assertIn(r"45 fly", tex)