canismarko / dungeon-sheets

A tool to create character sheets and GM session notes for Dungeons and Dragons fifth edition (D&D 5e).
https://dungeon-sheets.readthedocs.io/en/latest/
GNU General Public License v3.0
161 stars 66 forks source link

Render half-caster spell sheets, cleanup existing spell sheet generation #142

Closed meson800 closed 1 year ago

meson800 commented 1 year ago

For half-casters like warlocks and paladins, all of the available spells do not fit on the current spell sheet that is generated. However, if we could use the half-caster sheet in these cases (which stops at spell level 5), we could show all of the spells. In other cases, it may be preferred to show all available spells on multiple pages. Luckily, @agrgordon sat down and made PDF-fillable versions of the official half-caster sheet.

This PR adds/modifies the following:

  1. Simplifies the PDF field labeling on the full- and half-caster sheets. Instead of the fields being named weird field numbers, the spell name fields are now uniformly named Spells 1xii (e.g. the 5th fourth-level spell is Spells 1504). The prepared checkbox is named prepared xii. This greatly simplifies the field assignment, as we don't need lookup tables anymore.
  2. If the character has only fifth-level spells and lower and their spell list would not fit on the full-caster sheet, this generates and uses the half-caster sheet template.
  3. If the character still exceeds the spell limit (crazy multiclassing?), this generates extra spell pages to contain the overflow spells. This is the speculative part of the PR; do you want this behavior, or the old behavior of just showing the prepared spells in this case?
meson800 commented 1 year ago

(something funky looks like it happened with the setup-python action and Python 3.6, added a commit to fix it)

meson800 commented 1 year ago

Example of what the new half-caster sheet looks like: half_caster_example

canismarko commented 1 year ago

Thanks @meson800. Since the tests seem previously broken, I need to take some time and clean everything up, so I will make sure the examples build properly when I do that.

canismarko commented 1 year ago

@meson800 Are there any character source files in the examples/ directory that use this behavior? Your example above is for paladin3, but there's no paladin3.py included in the PR. Would you mind including an example in a new PR?

meson800 commented 1 year ago

I can add a cleaned-up example in a new PR. The given one is from an actual campaign sheet.

canismarko commented 1 year ago

Much appreciated!