diff --git a/app/GameMissions/BattleEngine/BattleEngine.php b/app/GameMissions/BattleEngine/BattleEngine.php index 9575dbde..48648420 100644 --- a/app/GameMissions/BattleEngine/BattleEngine.php +++ b/app/GameMissions/BattleEngine/BattleEngine.php @@ -401,7 +401,8 @@ private function calculateDebris(UnitCollection $attackerUnitsLost, UnitCollecti * @param Resources $debris * @return int */ - private function calculateMoonChance(Resources $debris): int { + private function calculateMoonChance(Resources $debris): int + { $max_moon_chance = $this->settings->maximumMoonChance(); // Every 100k debris results in 1% moon chance, up to a maximum @@ -420,7 +421,8 @@ private function calculateMoonChance(Resources $debris): int { * @param int $moonChance * @return bool */ - private function rollMoonCreation($moonChance): bool { + private function rollMoonCreation($moonChance): bool + { $dice = rand(1, 100); return $dice <= $moonChance; } diff --git a/app/Services/PlayerService.php b/app/Services/PlayerService.php index 35173c2b..e4b02da2 100644 --- a/app/Services/PlayerService.php +++ b/app/Services/PlayerService.php @@ -3,7 +3,6 @@ namespace OGame\Services; use Exception; -use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; @@ -56,8 +55,7 @@ public function __construct(int $player_id) // Load the player object if a positive player ID is given. if ($player_id !== 0) { $this->load($player_id); - } - else { + } else { // If no player ID is given then an actual player context will not be available. // This is expected for unittests, that's why we create a dummy user object here. $this->user = new User();