a bit of progress

This commit is contained in:
2026-07-04 17:09:55 +03:00
parent f6e7d37428
commit 082b532d52
29 changed files with 2734 additions and 47 deletions
+13 -9
View File
@@ -5,21 +5,25 @@ namespace App\Services\Game;
use App\Models\Character;
use App\Models\Crime;
use App\Models\CrimeAttempt;
use App\Models\ActivityLog;
use App\Enums\CharacterStatus;
use App\Services\Game\NerveService;
class CrimeService
{
protected EnergyService $energyService;
protected EconomyService $economyService;
protected NerveService $nerveService;
protected ActivityLogService $activityLogService;
public function __construct()
{
$this->energyService = new EnergyService();
$this->economyService = new EconomyService();
$this->nerveService = new NerveService();
public function __construct(
EnergyService $energyService,
EconomyService $economyService,
NerveService $nerveService,
ActivityLogService $activityLogService
) {
$this->energyService = $energyService;
$this->economyService = $economyService;
$this->nerveService = $nerveService;
$this->activityLogService = $activityLogService;
}
/**
@@ -63,7 +67,7 @@ class CrimeService
$character->addExperience($experience);
// Log success
ActivityLog::logCrimeAttempt($character, $crime, true, $reward);
$this->activityLogService->logCrimeAttempt($character, $crime, true, $reward);
} else {
// Failed crime - take health penalty
$healthPenalty = (int) ($character->max_health * config('game.crime.failure_penalty', 0.10));
@@ -75,7 +79,7 @@ class CrimeService
}
// Log failure
ActivityLog::logCrimeAttempt($character, $crime, false, 0);
$this->activityLogService->logCrimeAttempt($character, $crime, false, 0);
}
// Create crime attempt record