test: the map relations test places its barbarian on a free field, so a random spawn can't take it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b20de08ba1
commit
8f762120ec
|
|
@ -26,7 +26,9 @@ it('colours villages by what their owner is to the viewer', function () {
|
||||||
$ally = startVillage();
|
$ally = startVillage();
|
||||||
$foe = startVillage();
|
$foe = startVillage();
|
||||||
$stranger = startVillage();
|
$stranger = startVillage();
|
||||||
$barbarian = app(VillageFactory::class)->create($me->world, null, 'Barbarian village', $me->x + 2, $me->y + 2, ['headquarters' => 1]);
|
// A free field near me: the other players settle at random and may take any given one.
|
||||||
|
$spot = collect(range(2, 10))->first(fn (int $d) => ! Village::where('world_id', $me->world_id)->where('x', $me->x + $d)->where('y', $me->y + 2)->exists());
|
||||||
|
$barbarian = app(VillageFactory::class)->create($me->world, null, 'Barbarian village', $me->x + $spot, $me->y + 2, ['headquarters' => 1]);
|
||||||
foreach ([[$me, 'AAA'], [$ally, 'BBB'], [$foe, 'CCC']] as [$v, $tag]) {
|
foreach ([[$me, 'AAA'], [$ally, 'BBB'], [$foe, 'CCC']] as [$v, $tag]) {
|
||||||
app(Tribes::class)->found(owner($v), $v->world_id, "Tribe $tag", $tag);
|
app(Tribes::class)->found(owner($v), $v->world_id, "Tribe $tag", $tag);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue