Spell Preparation System
Tracks per-class spell preparation, including multiclass, granted, always-prepared, and ritual spells, and surfaces notifications when limits are exceeded.

Core mechanics
Section titled “Core mechanics”Preparation limits
Section titled “Preparation limits”Preparation limits come from the system, based on each class’s spellcasting ability modifier and class level. The tab footer shows the current prepared count next to the max (current/max Spells and current/max Cantrips).
Limits are informational, and preparation checkboxes stay enabled at, under, or over the max. When the current count reaches the printed max, the counter gets an at-max highlight. Going over the max triggers a notification, not a block. See Notifications.
Live checkbox state
Section titled “Live checkbox state”The Spell Book UI tracks preparation state from live checkbox state, not from saved actor data. Toggling a checkbox updates the tab’s counters immediately and stages the change in an in-memory map keyed by tab and spell. Pending changes persist across tab switches.
Save collects every checkbox across every loaded tab, reapplying pending changes from tabs not currently open, and writes the per-class prepared spell sets to the actor in one update. Nothing is persisted until Save is pressed.
Reset button interaction
Section titled “Reset button interaction”Reset, in the sidebar controls, clears filters. Shift-clicking Reset also unchecks every non-disabled preparation checkbox across every prepare tab. Those unchecks are staged like any other change and persist on Save.
Class Rules and spell lists
Section titled “Class Rules and spell lists”Each spellcasting class needs a spell list assigned via Class Rules before preparation can happen. The class’s assigned spell list determines which spells appear in the prepare tab; nothing loads automatically, and there is no subclass-registry fallback. Without an assigned list, the tab shows a “No spell list assigned” notice.
Rule sets
Section titled “Rule sets”Two rule sets control swap and cantrip defaults:
| Rule Set | Description |
|---|---|
| Legacy (2014) | No cantrip swapping by default. |
| Modern (2024) | Cantrip swapping on level-up or long rest, depending on class. |
Each class can override the world default. See Ruleset Types and What They Mean for the class-specific defaults table.
Preparation process
Section titled “Preparation process”Preparing spells
Section titled “Preparing spells”The player opens the character’s Spell Book to a class-specific preparation tab. Toggling spell checkboxes updates the footer counters live, and switching tabs preserves pending changes. Save, in the sidebar, commits all pending changes to the actor.
Changing prepared spells
Section titled “Changing prepared spells”The player unchecks spells to remove, checks new spells to add, and saves. Swap modes do not gate these edits: a player can add or remove any available spell at any time. The counters are informational.
Long rest swapping
Section titled “Long rest swapping”After a long rest, a prompt can appear offering to open the Spell Book to manage spell changes. Disabling the prompt (DISABLE_LONG_REST_SWAP_PROMPT) replaces the dialog with a passive notification naming the classes with swaps available; it does not suppress the notice entirely. The preparation UI itself behaves the same regardless of rest state.
Cantrip rules
Section titled “Cantrip rules”Cantrip limits
Section titled “Cantrip limits”Each class has a cantrip limit derived from system scale values. CANTRIP_SCALE_VALUES is a comma-separated list of scale keys checked in order, with the first match winning.
Cantrip counts appear in the tab footer next to the max. Like spell limits, the max is informational; exceeding it only fires a notification.
Cantrip swapping
Section titled “Cantrip swapping”Per-class swap settings accept three modes:
| Mode | Value |
|---|---|
| None | none |
| Level-Up | levelUp |
| Long Rest | longRest |
These informational per-class settings do not gate preparation changes, and swap modes generate no notification of their own. They feed the tracking flags the long-rest prompt uses. When GM notifications are enabled and a player checks a cantrip beyond the class max, the module still notifies. See Notifications.
Preparation bonuses
Section titled “Preparation bonuses”Per-class preparation bonuses add to a class’s calculated spell and cantrip max. Configure them via Class Rules. The bonus is added to the printed maximum shown in the footer counter.
Ritual casting
Section titled “Ritual casting”Three ritual casting modes are available per class:
| Mode | Value | Behavior |
|---|---|---|
| None | none | Rituals require preparation like any other spell. |
| Prepared | prepared | Prepared spells with the ritual property can also be cast as rituals. |
| Always | always | The class can cast any ritual spell from its spellbook without preparing it. Primarily wizard-focused. |
Under Always, saving injects ritual copies of eligible rituals from the wizard’s spellbook onto the actor. When a class’s ritual mode is not Always, stale module-created ritual items are cleaned up on save.
Always-prepared spells
Section titled “Always-prepared spells”Spells granted by class features, subclass grants, or racial traits render with a tag and a tooltip naming the source. The checkbox is not disabled: a player can still check an always-prepared or granted spell, which adds it to that class’s saved prepared set and counts it toward the footer counters like any other spell.
Multiclass preparation
Section titled “Multiclass preparation”Multiclass characters get a separate preparation tab per class. Limits, swap settings, ritual mode, preparation bonuses, and spell lists are resolved independently per class. Pending changes are tracked per tab, and Save writes all tabs in one operation.
Notifications
Section titled “Notifications”The preparation system never blocks a player. Over-limit situations are surfaced as notifications only, controlled by the Notify GM on Spell Changes world setting.
Each actor can override this via Class Rules. The override is a single flat flag on the actor: it applies to every class on that actor and falls back to the world setting when unset.
- During editing: when GM notification is effectively on, checking a cantrip or spell beyond the class’s max notifies the current user with the over-limit counts.
- On save: a whispered chat message goes to all GMs summarizing per-class additions and removals, including any over-limit state. Classes with no changes are omitted.
Both layers follow the same notification setting. Disabling it silences both.