Quest Objectives

The key words MUST, MUST NOT, and MAY below are used as in RFC 2119.

Objectives are the win condition of a quest. They are authored in the quest JSON and tracked at runtime by SessionManager; meeting them flips the quest to Completed, which is what unlocks the report action at the guild counter (see Story Progression).

Schema

A quest's objectives is an array of objects, each with item_id, label, and target:

FieldMeaning
item_idthe count key — what the player collects / clears
labeldisplay text for the HUD / log
targethow many are needed (defaults to 1)

A quest MAY declare multiple objectives; the quest is complete only when every objective's count reaches its target. Free-roam field quests carry no objectives key (see Quest vs Field) and therefore never enter the Completed state.

Runtime tracking

When the quest session starts (SessionManager.enter_quest, not at accept time), it loads the objective array and seeds a per-item_id count at zero. collect_quest_item(item_id) is the single increment path: it bumps the count, emits quest_item_collected (for the HUD), and — when are_objectives_complete() first returns true — calls mark_quest_complete(), which records the completion and emits the quest_completed signal.

Counts and objectives are part of the suspendable session state, so they survive a telepipe round-trip to the city and back.

What ticks an objective

From complete to cleared

mark_quest_complete() stashes the run summary and flips state to Completed (guild tag REPORT). Reporting at the guild counter calls report_quest() then GameState.complete_mission(quest_id), which appends to the persisted completed_missions set (saved per character) — from then on is_mission_completed(id) is true and the counter shows CLEAR. Completion is not persisted until reported.

Implemented by

← States