V1.24.0: multiclassing, by each class's own level

- With the campaign setting on, the level-up checklist asks which class gains
  the level; a new class needs both classes' ability requirements (2014 rules)
- HP, Hit Dice, features, Boons, subclasses and counters go by each class's
  own level; spell slots add up to a caster level, pact slots apart
- A first level in a new class writes its level-1 gifts and what it teaches
- Eldritch Knight and Arcane Trickster cast from level 3 with real slots
- The sheet shows each class's road to 20 and suggested multiclass routes
  (Hexadin, Sorlock, fighter dip...) with the character's progress and scores

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 16:14:57 +02:00
co-authored by Claude Opus 5.5
parent 18d9e7301c
commit 86ef106969
27 changed files with 1098 additions and 78 deletions
+17 -4
View File
@@ -18,6 +18,7 @@ import type {
Item,
LevelUpPlan,
Location,
MulticlassReference,
Monster,
Note,
Npc,
@@ -252,12 +253,14 @@ export function useCharacterState(characterId: string) {
}
// What a character's next level brings. DM only.
export function useLevelUpPlan(characterId: string, enabled: boolean) {
// `toClass`: the plan for a level in that class (multiclassing); the first class when null.
export function useLevelUpPlan(characterId: string, enabled: boolean, toClass: CharacterClass | null = null) {
return useQuery({
queryKey: ['character', characterId, 'level-up'],
queryKey: ['character', characterId, 'level-up', toClass],
enabled,
gcTime: 0, // never open on the plan for a level the character has already reached
queryFn: async () => (await apiClient.get<{ plan: LevelUpPlan }>(`/characters/${characterId}/level-up`)).data.plan,
queryFn: async () =>
(await apiClient.get<{ plan: LevelUpPlan }>(`/characters/${characterId}/level-up`, { params: toClass ? { class: toClass } : {} })).data.plan,
});
}
@@ -265,7 +268,7 @@ export function useLevelUpPlan(characterId: string, enabled: boolean) {
export function useLevelUp(characterId: string) {
const qc = useQueryClient();
return useMutation({
mutationFn: async (data: { subclass?: string; boon?: string; weaponId?: string | null; spellIds?: string[] }) =>
mutationFn: async (data: { characterClass?: CharacterClass; subclass?: string; boon?: string; weaponId?: string | null; spellIds?: string[] }) =>
(await apiClient.post<{ character: CharacterDetail }>(`/characters/${characterId}/level-up`, data)).data.character,
onSuccess: (character) => {
invalidateCharacter(qc, characterId);
@@ -362,6 +365,16 @@ export function useBuildOptions() {
});
}
// Multiclassing requirements and the suggested routes.
export function useMulticlassReference(enabled: boolean) {
return useQuery({
queryKey: ['multiclass-reference'],
enabled,
staleTime: Infinity,
queryFn: async () => (await apiClient.get<MulticlassReference>('/reference/multiclass')).data,
});
}
// What each level from 1 to 20 gives a class, with a subclass's lines when one is given.
export function useProgression(characterClass: CharacterClass | null | undefined, subclass?: string | null) {
return useQuery({