splits out features to multiple templates and added DnD styling

This commit is contained in:
matsavage
2021-05-05 18:02:04 +01:00
parent 96a6f0cc2e
commit 631a320d84
11 changed files with 111 additions and 61 deletions
@@ -1,10 +1,9 @@
\newpage
\section*{Known Beasts}
[% if use_dnd_decorations %]
[% for shape in character.all_wild_shapes|sort(attribute='challenge_rating') %]
[% if not character.can_assume_shape(shape) %]
\subsection*{Cannot assume form}
\subsection*{Cannot assume form}
[% endif %]
\begin{DndMonster}{[[ shape.name ]]}
\DndMonsterType{[[ shape.description ]]}
+18 -39
View File
@@ -1,44 +1,23 @@
\section*{Subclasses}
[% for sc in character.subclasses if sc not in ['', None, 'None', 'none']%]
\section*{Features}
[% if use_dnd_decorations %]
[% for feat in character.features %]
\DndFeatHeader{[[ feat.name ]]}[Source: [[ feat.source ]]]
\subsection*{Subclass: [[ sc.name ]]}
[[ feat.__doc__|rst_to_latex ]]
[% endfor %]
[% else %]
[% for feat in character.features %]
[[ sc.__doc__ | rst_to_latex(top_heading_level=2) ]]
\subsection*{[[ feat.name ]]}
[% endfor %]
\section*{Features}
\noindent
\textbf{Source:} [[ feat.source ]] \\
[% for feat in character.features %]
[% if feat.needs_implementation %] %
\textbf{**Not included in stats on Character Sheet} %
[% endif %] %
[[ feat.__doc__|rst_to_latex ]]
\subsection*{[[ feat.name ]]}
\noindent
\textbf{Source:} [[ feat.source ]] \\
[% if feat.needs_implementation %] %
\textbf{**Not included in stats on Character Sheet} %
[% endif %] %
[[ feat.__doc__|rst_to_latex ]]
[% endfor %]
\section*{Magic Items}
[% for mitem in character.magic_items %]
\subsection*{[[ mitem.name ]]}
\noindent
\textbf{Requires Attunement:} [[ mitem.requires_attunement ]] \\
\textbf{Rarity:} [[ mitem.rarity ]] \\
[% if mitem.needs_implementation %] %
\textbf{**Not included in stats on Character Sheet} %
[% endif %] %
[[ mitem.__doc__|rst_to_latex ]]
[% endfor %]
[% endfor %]
[% endif %]
@@ -0,0 +1,28 @@
\section*{Magic Items}
[% if use_dnd_decorations %]
[% for mitem in character.magic_items %]
\DndItemHeader{[[ mitem.name ]]}{[% if mitem.item_type %][[ mitem.item_type ]], [[ mitem.rarity.lower() ]][% else %][[ mitem.rarity ]] item[% endif %][% if mitem.requires_attunement %] (requires attunement)[% endif %]}
[% if mitem.needs_implementation %] %
\textbf{**Not included in stats on Character Sheet} %
[% endif %] %
[[ mitem.__doc__|rst_to_latex ]]
[% endfor %]
[% else %]
[% for mitem in character.magic_items %]
\subsection*{[[ mitem.name ]]}
\noindent
\textbf{Requires Attunement:} [[ mitem.requires_attunement ]] \\
\textbf{Rarity:} [[ mitem.rarity ]] \\
[% if mitem.needs_implementation %] %
\textbf{**Not included in stats on Character Sheet} %
[% endif %] %
[[ mitem.__doc__|rst_to_latex ]]
[% endfor %]
[% endif %]
+3 -2
View File
@@ -1,4 +1,4 @@
\documentclass[10pt,twocolumn,lettersize]{article}
\documentclass[10pt,twocolumn,lettersize]{book}
% For parsed docstrings
\usepackage[T1]{fontenc}
@@ -50,4 +50,5 @@
}
[% endraw %]
\begin{document}
\begin{document}
\chapter*{Features, Magical Items and Spells}
@@ -0,0 +1,17 @@
\section*{Subclasses}
[% if use_dnd_decorations %]
[% for sc in character.subclasses if sc not in ['', None, 'None', 'none']%]
\DndFeatHeader{[[ sc.name ]]}
[[ sc.__doc__ | rst_to_latex(top_heading_level=2) ]]
[% endfor %]
[% else %]
[% for sc in character.subclasses if sc not in ['', None, 'None', 'none']%]
\subsection*{[[ sc.name ]]}
[[ sc.__doc__ | rst_to_latex(top_heading_level=2) ]]
[% endfor %]
[% endif %]