From e9b8cff4100748301591c3976fb216b511e22f93 Mon Sep 17 00:00:00 2001 From: Spitfire Date: Thu, 9 Jan 2025 11:39:09 -0600 Subject: [PATCH 1/3] Organisations achievements --- app/Services/Campaign/AchievementService.php | 9 +++++++++ lang/en/campaigns/achievements.php | 1 + 2 files changed, 10 insertions(+) diff --git a/app/Services/Campaign/AchievementService.php b/app/Services/Campaign/AchievementService.php index 61accba63..c12838e73 100644 --- a/app/Services/Campaign/AchievementService.php +++ b/app/Services/Campaign/AchievementService.php @@ -45,6 +45,8 @@ public function stats(): array|false // @phpstan-ignore-next-line $families = $this->campaign->families()->withInvisible()->count() + $this->random(); // @phpstan-ignore-next-line + $organisations = $this->campaign->organisations()->withInvisible()->count() + $this->random(); + // @phpstan-ignore-next-line $dead = $this->campaign->characters()->withInvisible()->where('is_dead', true)->count() + $this->random(10, 30); // @phpstan-ignore-next-line $calendars = $this->campaign->calendars()->withInvisible()->count() + $this->random(5, 15); @@ -85,6 +87,13 @@ public function stats(): array|false 'level' => $this->level($families, 2), 'module' => $this->moduleName('family', 'families'), ], + 'organisations' => [ + 'icon' => config('entities.icons.organisation'), + 'amount' => $organisations, + 'target' => $this->target($organisations, 2), + 'level' => $this->level($families, 2), + 'module' => $this->moduleName('organisation', 'organisations'), + ], 'calendars' => [ 'icon' => config('entities.icons.calendar'), 'amount' => $calendars, diff --git a/lang/en/campaigns/achievements.php b/lang/en/campaigns/achievements.php index 293dae5c1..69fe0ef6d 100644 --- a/lang/en/campaigns/achievements.php +++ b/lang/en/campaigns/achievements.php @@ -25,6 +25,7 @@ 'families' => 'Family planning', 'locations' => 'Builder', 'markers' => 'Cartographer', + 'organisations' => 'Merges and acquisitions', 'plugins' => 'Plugin connoisseur', 'quests' => 'Mastermind', 'tags' => 'Under control', From 8690e4126af879b3bb51b1ad54b52917ee6f046e Mon Sep 17 00:00:00 2001 From: spitfire305 Date: Thu, 9 Jan 2025 17:40:27 +0000 Subject: [PATCH 2/3] Fix styling --- app/View/Components/InfoBox.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/View/Components/InfoBox.php b/app/View/Components/InfoBox.php index a073e0fda..641354c74 100644 --- a/app/View/Components/InfoBox.php +++ b/app/View/Components/InfoBox.php @@ -26,9 +26,8 @@ public function __construct( public string $urlIcon = 'fa-solid fa-angle-right', public bool $ajax = false, public bool $premium = false, - ) - { - // + ) { + } /** From 214aa1473344ac2c4428b2b2eedb17760ed51cfd Mon Sep 17 00:00:00 2001 From: Spitfire Date: Thu, 9 Jan 2025 11:51:34 -0600 Subject: [PATCH 3/3] Organisations achievement fix --- app/Services/Campaign/AchievementService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Campaign/AchievementService.php b/app/Services/Campaign/AchievementService.php index c12838e73..5737a70d7 100644 --- a/app/Services/Campaign/AchievementService.php +++ b/app/Services/Campaign/AchievementService.php @@ -91,7 +91,7 @@ public function stats(): array|false 'icon' => config('entities.icons.organisation'), 'amount' => $organisations, 'target' => $this->target($organisations, 2), - 'level' => $this->level($families, 2), + 'level' => $this->level($organisations, 2), 'module' => $this->moduleName('organisation', 'organisations'), ], 'calendars' => [