Skip to content

Quests

import { Aside } from ‘@astrojs/starlight/components’;

A “Clear the harbor” quest has three objectives: defeat 5 bandits, deliver 3 crates to the tavern, talk to the harbormaster. The quest tracks each objective independently + fires a completion event when all three resolve.

import { GameboardQuest } from 'declarative-hex-worlds/quests';
world.spawn(GameboardQuest({
id: 'quest:clear-harbor',
title: 'Clear the harbor',
objectives: [
{ id: 'defeat-bandits', kind: 'defeat-count', target: 5, current: 0 },
{ id: 'deliver-crates', kind: 'deliver-count', target: 3, current: 0 },
{ id: 'talk-harbormaster', kind: 'interact-actor', target: 'npc:harbormaster' },
],
rewards: { gold: 100, xp: 250 },
}));
  • Objective tracking. Each kind has its own update hook that runs during the simulation tick.
  • Completion semantics. A quest completes when every objective’s status === 'satisfied'.
  • Event records. GameboardQuestAdvancedEvent / GameboardQuestCompletedEvent / GameboardQuestBlockedEvent for downstream UIs.