feat(city): add plaza exercise system with health tracking

- Adds CityPlazas support class for deterministic public plaza generation with outdoor gym equipment
- Implements exercise and stop-exercise actions with proximity validation to equipment
- Introduces health (0-100) and exercise_count attributes to Character model
- Reduces hospital stay duration from two game days to one game hour
- Adds 3D gym equipment rendering (bench, bars, bike, treadmill) in city viewer
- Includes exercise state machine handling in world ticker with energy drain
- Adds comprehensive PlazaExerciseTest and updates HospitalAdmissionTest
- Provides localized UI strings for health HUD and exercise prompts
This commit is contained in:
2026-10-17 22:10:50 -03:00
parent 79ce2a1825
commit 090b530481
18 changed files with 848 additions and 21 deletions
@@ -7,7 +7,7 @@ use Illuminate\Support\Facades\Schema;
/**
* Adds hospital admission tracking to characters.
*
* When a character is hit by a vehicle they are admitted for two game days
* When a character is hit by a vehicle they are admitted for one game hour
* (hospitalized_until). The world ticker releases them automatically.
*/
return new class extends Migration
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Adds fitness tracking to characters.
*
* health is 0-100 and rises while the character exercises on public plaza
* equipment; exercise_count is a lifetime counter for progress display.
*/
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('characters', function (Blueprint $table): void {
$table->unsignedTinyInteger('health')->default(100)->after('thirst');
$table->unsignedInteger('exercise_count')->default(0)->after('education');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('characters', function (Blueprint $table): void {
$table->dropColumn(['health', 'exercise_count']);
});
}
};