From 7887145b9b355e1fee7d9ea6948cffd4f87a2ee7 Mon Sep 17 00:00:00 2001 From: Vari Date: Sat, 23 Mar 2024 05:08:41 +0100 Subject: [PATCH] Added Default Characters to a newly created player data and changed the default currencies and hunter/runner selection. --- dist/app/Models/User/PlayerData.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/dist/app/Models/User/PlayerData.php b/dist/app/Models/User/PlayerData.php index d699373..6ee302f 100644 --- a/dist/app/Models/User/PlayerData.php +++ b/dist/app/Models/User/PlayerData.php @@ -18,6 +18,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\QueryException; +use Illuminate\Support\Facades\Artisan; /** @@ -29,12 +30,12 @@ class PlayerData extends Model protected $attributes = [ 'has_played_tutorial' => false, - 'has_played_dg_1' => true, - 'currency_a' => 0, - 'currency_b' => 0, - 'currency_c' => 0, + 'has_played_dg_1' => false, + 'currency_a' => 1000, + 'currency_b' => 500, + 'currency_c' => 500, 'last_faction' => Faction::Runner, - 'last_hunter' => Hunter::Poacher, + 'last_hunter' => Hunter::Inquisitor, 'last_runner' => Runner::Smoke, 'readout_version' => 1, 'runner_faction_level' => 1, @@ -93,6 +94,18 @@ protected static function booted(): void } $playerData->quitterState()->create(); + + // Add Default Characters + Artisan::call('game:add-characters-to-user', [ + 'user' => $playerData->user_id, + 'characters' => [ + Characters::Smoke->value, + Characters::Ghost->value, + Characters::Sawbones->value, + Characters::Inquisitor->value, + Characters::Mass->value, + ] + ]); }); }