Quests
tilttek/reading-questsThe quests of tilttek/quests read the activities the library records. ReadingSteps builds their steps; a
configuration writes the same steps with the verbs.
Steps
use Tilttek\ReadingQuests\ReadingSteps;
use Tilttek\ReadingQuests\ReadingUnit;
ReadingSteps::start('open-a-supplement', ['supplement' => true]); // open a book
ReadingSteps::finish('three-local-authors', 3, ['author_region' => 'qc']); // finish books
ReadingSteps::read('read-300-pages', 300, ReadingUnit::Pages, ['system' => 'dnd5e']); // read an amount
| Method | Verb | Measure | Target |
|---|---|---|---|
start() | book.started | Count | 1 |
finish() | book.finished | Count | The number of books, 1 by default |
read() | book.read | Total | The pages or minutes; only the activities of that unit count |
The facts are those the book must hold, compared strictly: true is not 1. A step without facts accepts every book.
A book read again counts again for finish().
In a configuration
The same quests, read by the QuestReader of tilttek/quests:
winter-reading:
opens: '2026-12-21'
closes: '2027-03-20'
steps:
- { code: rulebook, verbs: ['book.finished'], context: { system: dnd5e, supplement: false } }
- { code: pages, verbs: ['book.read'], total: 300, context: { unit: pages } }
rewards: [{ kind: badge, code: winter-reader }]
local-authors:
kind: community
steps:
- { verbs: ['book.finished'], count: 100, context: { author_region: qc } }
A step of book.read names its unit in its context, so that pages and minutes are never added together.
Thematic challenges
A challenge is a quest whose steps select books by their facts: read a book by a local author, a rules supplement, a book of another game system, a book of more than 400 pages. The facts are the application's: it puts on each book the facts its challenges read, and adds a fact when a new challenge needs one.
What the quests do with it
Everything else is tilttek/quests: schedules, chains, team and community challenges, duels, rewards declared. The
quests replay the journal when a definition changes, so a step added to a running challenge counts the books already
read.