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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user