V1.6.0: targets and an attack bar in encounters

- One combatant at a time can be marked as the target with the Target
  button on its card. The DM can mark anyone at any time; a player can
  while their own character is on turn in a battle.
- The target's card is outlined for everyone and names who is going for it.
- While a target is marked the DM gets an attack bar above the list: who is
  attacking whom, the target's AC and HP, the attacker's weapons, spells or
  monster attack, and a box to apply damage or healing straight away.
- The target is cleared when the turn or round moves on, when the encounter
  begins, ends or is reopened, or when the target is removed.
- All packages at version 1.6.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 12:53:18 +02:00
co-authored by Claude Opus 5.5
parent ec48b65481
commit e4456b0df2
13 changed files with 316 additions and 11 deletions
+10
View File
@@ -750,6 +750,16 @@ export function usePatchEncounter(encounterId: string) {
}
type EncounterStatusInput = 'PLANNING' | 'ACTIVE' | 'COMPLETE';
// Marks a combatant as the target (null clears it). The DM at any time; a
// player while their own character is on turn.
export function useSetTarget(encounterId: string) {
const qc = useQueryClient();
return useMutation({
mutationFn: async (participantId: string | null) => (await apiClient.put(`/encounters/${encounterId}/target`, { participantId })).data,
onSuccess: () => qc.invalidateQueries({ queryKey: ['encounter', encounterId] }),
});
}
export function useNextTurn(encounterId: string) {
const qc = useQueryClient();
return useMutation({
+2
View File
@@ -447,6 +447,8 @@ export interface Encounter {
status: EncounterStatus;
currentRound: number;
activeParticipantId: string | null;
// The combatant marked as the target right now, for everyone to see.
targetParticipantId: string | null;
description: string | null;
dmNotes?: string | null; // DM only
// Where the scene is. A player is only told once their character has been there.