Files
thecrimesynticate/app/Console/Commands/Game/ProcessNerveRegen.php
T

32 lines
846 B
PHP
Raw Normal View History

<?php
namespace App\Console\Commands\Game;
use App\Models\Character;
use App\Services\Game\NerveService;
use Illuminate\Console\Command;
class ProcessNerveRegen extends Command
{
protected $signature = 'game:nerve-regen';
protected $description = 'Regenerate nerve for all active characters';
public function handle(NerveService $nerveService): void
{
$this->info('Starting nerve regeneration...');
$characters = Character::where('nerve', '<', \DB::raw('max_nerve'))
->where('status', 'active')
->get();
$count = $characters->count();
$this->info("Regenerating nerve for {$count} characters...");
foreach ($characters as $character) {
$nerveService->regenerate($character);
}
$this->info('Nerve regeneration completed!');
}
}