Skip to content

Featsorting#177

Open
PJBrs wants to merge 10 commits into
canismarko:masterfrom
PJBrs:featsorting
Open

Featsorting#177
PJBrs wants to merge 10 commits into
canismarko:masterfrom
PJBrs:featsorting

Conversation

@PJBrs

@PJBrs PJBrs commented Apr 2, 2025

Copy link
Copy Markdown
Contributor

This PR adds a new character attribute features_by_type that sorts features by type, and then adds additional patches to support features by subtype (e.g., metamagic options immediately after the metamagic feat).

  1. The first patch adds the new character attribute features_by_type and a command-line option. Feats are sorted as Feats, Class feats, Racial feats and then Background feats.
  2. The second patch adds jinja code to detect what feats we're adding and adds associated headers in the latex output.
  3. The third and most complicated patch adds advanced sorting, that is, metamagic options after metamagic, etc. This works by setting feats that are not of type feature apart, and only inserting those back in the list after their parent class has appeared. Unfortunately, this works for metamagic (and I think some other options), but not with Battle Master maneuvers, Trickshots, Eldritch Invocations, Bloodhunter Rites, Blood Curses and Formulas.
  4. The next five patches add a couple of aliases (and sometimes a bit more) to sort 1) Battle Master maneuvers, 2) Trickshots, 3) Arcane Shots, 4) Eldritch Invocations, and 5) Bloodhunter Rites, Blood Curses and Formulas.
  5. The final, ninth patch adds documentation.

@PJBrs

PJBrs commented Aug 31, 2025

Copy link
Copy Markdown
Contributor Author

Finetuned these patches more, added a test, removed one codepath that was never even hit (thanks, coverage).

@PJBrs
PJBrs force-pushed the featsorting branch 3 times, most recently from a84f1e7 to b7e81f6 Compare September 4, 2025 19:09
@PJBrs

PJBrs commented Sep 4, 2025

Copy link
Copy Markdown
Contributor Author

I suddenly realised that I could do the setting of the headers much more simply.

This patch gives the option to sort feats by type
instead of alphabetically. Basically, it just adds
the feats in the same order that dungeonsheets finds
them, which goes from character feat to class feats
to racial feats to background feats.

The patch implements this feature using a command-line
option. The user can specify --feats-by-type or -N to
order feats by type. Default is alphabetical order.
If the user has selected to order feats by type, this patch
adds headers for each feat type instead of one Features heading.
Headers include Feats (if applicable), Class Features, Racial
Features and Background Features.
This patch enables additional sorting for features
that are classes of other features. This works
as is for metamagic, in the sense that it sorts
all metamagic options under the metamagic feature,
by checking whether a metamagic option is the direct
child of the Metamagic class.

The same is intended for other feature options. The
intended relations are:
Bloodhunter:   Rites --> CrimsonRites
               BloodCurses --> BloodMaledict
               Formulas --> Formulas
Fighter:       Maneuver --> CombatSuperiority
               TrickShot --> AdeptMarksman
Warlock:       Invocation --> EldritchInvocation

However, these need some additional work to lay the
right class relations.
Make the Maneuver class an alias to CombatSuperiority, so
that Battle Master Maneuvers can be easily sorted as instances
of CombatSuperiority.
Allow the player choices for Trick Shots of the Gunslinger
Fighter subclass to be sorted as instances of AdeptMarksman,
by aliasing AdeptMarksman as TrickShot and by making all
Trick Shot features an instance of TrickShot
Make all Arcane Shot options a subclass of ArcaneShot, so
that they all get sorted directly after the Arcane Shot
feature text.
Allow Invocations to be sorted under the Eldritch
Invocations feature by aliasing the EldritchInvocation
class as Invocation.
This patch aliases Rites to CrimsonRites and BloodCurses to
BloodMaledict, so that all rites can be sorted under the
Crimson Rites feat, and all the blood curses under the
Blood Maledict feat.

Furthermore, it integrates the two Formulas classes.
Document the makesheets commandline option
to sort features by type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant