first commit

This commit is contained in:
Doar Mihai
2026-06-27 14:38:18 +03:00
commit 96d317480b
165 changed files with 20061 additions and 0 deletions
@@ -0,0 +1,47 @@
<?php
namespace App\Console\Commands\Game;
use App\Models\Character;
use App\Services\Game\HealthService;
use Illuminate\Console\Command;
class ProcessHealthRegen extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'game:regen-health';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Regenerate health for all characters';
/**
* Execute the console command.
*/
public function handle(HealthService $healthService): void
{
$this->info('Starting health regeneration...');
$characters = Character::where('health', '<', \DB::raw('max_health'))
->where('status', 'active')
->where('health', '>', 0)
->get();
$count = $characters->count();
$this->info("Regenerating health for {$count} characters...");
foreach ($characters as $character) {
$healthService->regenerate($character);
}
$this->info('Health regeneration completed!');
}
}