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> $levels highest level per building type
* @param array<string, int> $instances most buildings of a type in one village * @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 function __construct(
public readonly array $levels = [], public readonly array $levels = [],

View File

@ -8,8 +8,8 @@
* Goals: * Goals:
* ['building', type, level] a building of that type at that level in any village * ['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 * ['instances', type, count] that many buildings of one type in one village
* ['counter', key, count, hint] something done that often (Counters::bump keys); * ['counter', key, count, hint] something done that often (Quests::bump keys);
* hint names the screen the client points at * 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). * 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], 'reward' => ['wood' => 250, 'clay' => 220, 'iron' => 120],
], ],
'first_spears' => [ 'first_spears' => [
'goals' => [['counter', 'recruited.spear', 5, 'barracks']], 'goals' => [['counter', 'recruited.spear', 5, 'recruit']],
'reward' => ['wood' => 250, 'clay' => 150, 'iron' => 50], 'reward' => ['wood' => 250, 'clay' => 150, 'iron' => 50],
], ],
'rally_point' => [ 'rally_point' => [
@ -69,7 +69,7 @@ return [
'reward' => ['wood' => 100, 'clay' => 100, 'iron' => 100], 'reward' => ['wood' => 100, 'clay' => 100, 'iron' => 100],
], ],
'first_raid' => [ 'first_raid' => [
'goals' => [['counter', 'attacks.barbarian', 1, 'rally_point']], 'goals' => [['counter', 'attacks.barbarian', 1, 'rally']],
'reward' => ['wood' => 300, 'clay' => 300, 'iron' => 300], 'reward' => ['wood' => 300, 'clay' => 300, 'iron' => 300],
], ],
'wall_3' => [ 'wall_3' => [
@ -85,7 +85,7 @@ return [
'reward' => ['wood' => 700, 'clay' => 600, 'iron' => 600], 'reward' => ['wood' => 700, 'clay' => 600, 'iron' => 600],
], ],
'first_scouts' => [ 'first_scouts' => [
'goals' => [['counter', 'scouts.sent', 1, 'rally_point']], 'goals' => [['counter', 'scouts.sent', 1, 'rally']],
'reward' => ['wood' => 500, 'clay' => 500, 'iron' => 500], 'reward' => ['wood' => 500, 'clay' => 500, 'iron' => 500],
], ],
], ],
@ -94,11 +94,11 @@ return [
// instance of a building, the levy. // instance of a building, the levy.
'village' => [ 'village' => [
'rename' => [ 'rename' => [
'goals' => [['counter', 'village.renamed', 1, 'village']], 'goals' => [['counter', 'village.renamed', 1, 'overview']],
'reward' => ['wood' => 60, 'clay' => 60, 'iron' => 60], 'reward' => ['wood' => 60, 'clay' => 60, 'iron' => 60],
], ],
'priority' => [ 'priority' => [
'goals' => [['counter', 'priority.set', 1, 'headquarters']], 'goals' => [['counter', 'priority.set', 1, 'workforce']],
'reward' => ['wood' => 100, 'clay' => 100, 'iron' => 100], 'reward' => ['wood' => 100, 'clay' => 100, 'iron' => 100],
], ],
'look_around' => [ 'look_around' => [
@ -118,7 +118,7 @@ return [
'reward' => ['wood' => 150, 'clay' => 150, 'iron' => 150], 'reward' => ['wood' => 150, 'clay' => 150, 'iron' => 150],
], ],
'levy' => [ 'levy' => [
'goals' => [['counter', 'levy.called', 1, 'village']], 'goals' => [['counter', 'levy.called', 1, 'recruit']],
'reward' => ['wood' => 200, 'clay' => 200, 'iron' => 200], 'reward' => ['wood' => 200, 'clay' => 200, 'iron' => 200],
], ],
'second_farm' => [ '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'); $army = line(book()->progress(['barracks'], $facts), 'army');
$village = line(book()->progress(['rename', 'priority', 'look_around', 'hiding_place'], $facts), 'village'); $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]); ->and($village['quest']['goals'][0])->toMatchArray(['kind' => 'instances', 'have' => 1, 'need' => 2, 'met' => false]);
}); });