feat(city): add player marketplace, mission journal, character customization and presence
- Player-to-player marketplace with listings, buying and selling - Mission system with progress tracking and money rewards - Character appearance customization (skin, hair, face, beard, accessory) - Multiplayer presence feed showing nearby citizens in near-real-time - Admin world dashboard with live platform metrics - Bus and train transportation with temporary ride state - Mobile joystick controls and minimap HUD - Education bonus applied to work salary
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Player-to-player marketplace listings.
|
||||
*
|
||||
* A character lists inventory items for a fixed price; buyers purchase
|
||||
* through the city market endpoint with an atomic money transfer.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('market_listings', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('seller_character_id')->constrained('characters')->cascadeOnDelete();
|
||||
$table->foreignId('city_id')->constrained('cities')->cascadeOnDelete();
|
||||
$table->string('item', 40);
|
||||
$table->unsignedInteger('qty')->default(1);
|
||||
$table->decimal('unit_price', 10, 2);
|
||||
$table->boolean('is_active')->default(true)->index();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['city_id', 'is_active']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('market_listings');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Lightweight citizen missions (daily journal goals).
|
||||
*
|
||||
* Tracks progress per character and pays a money reward on completion.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('missions', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('city_id')->constrained('cities')->cascadeOnDelete();
|
||||
$table->string('code', 60)->unique();
|
||||
$table->string('title', 160);
|
||||
$table->string('description', 400);
|
||||
$table->string('metric', 40); // exercise_count|buildings|transactions|education
|
||||
$table->unsignedInteger('target')->default(1);
|
||||
$table->decimal('reward', 10, 2)->default(20);
|
||||
$table->boolean('is_active')->default(true)->index();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('character_missions', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('character_id')->constrained('characters')->cascadeOnDelete();
|
||||
$table->foreignId('mission_id')->constrained('missions')->cascadeOnDelete();
|
||||
$table->unsignedInteger('progress')->default(0);
|
||||
$table->boolean('is_completed')->default(false)->index();
|
||||
$table->timestamp('completed_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['character_id', 'mission_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('character_missions');
|
||||
Schema::dropIfExists('missions');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Adds cosmetic slots and ride state to characters.
|
||||
*
|
||||
* face/beard/accessory drive the 3D look; ride_kind/ride_until power
|
||||
* temporary bus/train boarding.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('characters', function (Blueprint $table): void {
|
||||
$table->unsignedTinyInteger('face')->default(1)->after('shirt');
|
||||
$table->unsignedTinyInteger('beard')->default(0)->after('face');
|
||||
$table->unsignedTinyInteger('accessory')->default(0)->after('beard');
|
||||
$table->string('ride_kind', 20)->nullable()->after('state');
|
||||
$table->timestamp('ride_until')->nullable()->after('ride_kind');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('characters', function (Blueprint $table): void {
|
||||
$table->dropColumn(['face', 'beard', 'accessory', 'ride_kind', 'ride_until']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user