feat(city): add east shore beach leisure activity

Characters can now relax on the beach sand to recover energy and
health. The server clamps position to the shoreline, exposes beach
geometry in the city payload, and the client renders animated waves,
sand, stalls, chairs, and ambient NPCs.

Includes Beach support class, new beach action endpoint, localization
strings, and feature tests.
This commit is contained in:
2026-10-31 20:35:22 -03:00
parent 4b71a9d0ff
commit b8c31e7be4
12 changed files with 827 additions and 5 deletions
+4 -2
View File
@@ -8,6 +8,7 @@ use App\Models\InventoryItem;
use App\Models\Job;
use App\Models\Transaction;
use App\Models\User;
use App\Support\Beach;
use Database\Seeders\CityWorldSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
@@ -56,7 +57,8 @@ class CityActionsTest extends TestCase
}
/**
* Position updates clamp inside city bounds and persist.
* Position updates clamp to the beach shoreline (past the road grid)
* and persist; other axes clamp to the city bounds.
*/
public function test_position_persists_and_clamps(): void
{
@@ -65,7 +67,7 @@ class CityActionsTest extends TestCase
$this->character->refresh();
$city = $this->character->city;
$this->assertSame((float) $city->bounds_max_x, $this->character->pos_x);
$this->assertSame(Beach::sandTo($city) + 2, $this->character->pos_x);
$this->assertSame((float) $city->bounds_min_z, $this->character->pos_z);
}