feat: quest hints name the client screen to open

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Fabian @ Blax Software 2026-10-29 10:08:23 +01:00
parent 17c448ca0c
commit 222cd2e797
3 changed files with 10 additions and 10 deletions

View File

@ -8,7 +8,7 @@ final class Facts
/**
* @param array<string, int> $levels highest level per building type
* @param array<string, int> $instances most buildings of a type in one village
* @param array<string, int> $counters action counters (Counters::bump keys)
* @param array<string, int> $counters action counters (Quests::bump keys)
*/
public function __construct(
public readonly array $levels = [],

View File

@ -8,8 +8,8 @@
* Goals:
* ['building', type, level] a building of that type at that level in any village
* ['instances', type, count] that many buildings of one type in one village
* ['counter', key, count, hint] something done that often (Counters::bump keys);
* hint names the screen the client points at
* ['counter', key, count, hint] something done that often (Quests::bump keys);
* hint names the client screen it points at: overview, recruit, rally, workforce, map, reports
*
* Titles and story texts live in the client's i18n (quests.<key>.title|text).
*/
@ -61,7 +61,7 @@ return [
'reward' => ['wood' => 250, 'clay' => 220, 'iron' => 120],
],
'first_spears' => [
'goals' => [['counter', 'recruited.spear', 5, 'barracks']],
'goals' => [['counter', 'recruited.spear', 5, 'recruit']],
'reward' => ['wood' => 250, 'clay' => 150, 'iron' => 50],
],
'rally_point' => [
@ -69,7 +69,7 @@ return [
'reward' => ['wood' => 100, 'clay' => 100, 'iron' => 100],
],
'first_raid' => [
'goals' => [['counter', 'attacks.barbarian', 1, 'rally_point']],
'goals' => [['counter', 'attacks.barbarian', 1, 'rally']],
'reward' => ['wood' => 300, 'clay' => 300, 'iron' => 300],
],
'wall_3' => [
@ -85,7 +85,7 @@ return [
'reward' => ['wood' => 700, 'clay' => 600, 'iron' => 600],
],
'first_scouts' => [
'goals' => [['counter', 'scouts.sent', 1, 'rally_point']],
'goals' => [['counter', 'scouts.sent', 1, 'rally']],
'reward' => ['wood' => 500, 'clay' => 500, 'iron' => 500],
],
],
@ -94,11 +94,11 @@ return [
// instance of a building, the levy.
'village' => [
'rename' => [
'goals' => [['counter', 'village.renamed', 1, 'village']],
'goals' => [['counter', 'village.renamed', 1, 'overview']],
'reward' => ['wood' => 60, 'clay' => 60, 'iron' => 60],
],
'priority' => [
'goals' => [['counter', 'priority.set', 1, 'headquarters']],
'goals' => [['counter', 'priority.set', 1, 'workforce']],
'reward' => ['wood' => 100, 'clay' => 100, 'iron' => 100],
],
'look_around' => [
@ -118,7 +118,7 @@ return [
'reward' => ['wood' => 150, 'clay' => 150, 'iron' => 150],
],
'levy' => [
'goals' => [['counter', 'levy.called', 1, 'village']],
'goals' => [['counter', 'levy.called', 1, 'recruit']],
'reward' => ['wood' => 200, 'clay' => 200, 'iron' => 200],
],
'second_farm' => [

View File

@ -40,7 +40,7 @@ it('measures counters and instances, capping progress at the goal', function ()
$army = line(book()->progress(['barracks'], $facts), 'army');
$village = line(book()->progress(['rename', 'priority', 'look_around', 'hiding_place'], $facts), 'village');
expect($army['quest']['goals'][0])->toMatchArray(['have' => 5, 'need' => 5, 'met' => true, 'hint' => 'barracks'])
expect($army['quest']['goals'][0])->toMatchArray(['have' => 5, 'need' => 5, 'met' => true, 'hint' => 'recruit'])
->and($village['quest']['goals'][0])->toMatchArray(['kind' => 'instances', 'have' => 1, 'need' => 2, 'met' => false]);
});