fix: add PHPDoc blocks and remove unused import in nerve service/commands
This commit is contained in:
@@ -10,6 +10,9 @@ class NerveMidnightRefill extends Command
|
|||||||
protected $signature = 'game:nerve-midnight-refill';
|
protected $signature = 'game:nerve-midnight-refill';
|
||||||
protected $description = 'Refill nerve to max for all active characters at midnight';
|
protected $description = 'Refill nerve to max for all active characters at midnight';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refill nerve to max_nerve for all active characters
|
||||||
|
*/
|
||||||
public function handle(NerveService $nerveService): void
|
public function handle(NerveService $nerveService): void
|
||||||
{
|
{
|
||||||
$this->info('Running midnight nerve refill...');
|
$this->info('Running midnight nerve refill...');
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ use App\Models\Character;
|
|||||||
|
|
||||||
class NerveService
|
class NerveService
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Consume nerve if character can act
|
||||||
|
*/
|
||||||
public function consume(Character $character, int $amount): bool
|
public function consume(Character $character, int $amount): bool
|
||||||
{
|
{
|
||||||
if (!$character->canAct()) {
|
if (!$character->canAct()) {
|
||||||
@@ -15,6 +18,9 @@ class NerveService
|
|||||||
return $character->consumeNerve($amount);
|
return $character->consumeNerve($amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regenerate nerve for a character
|
||||||
|
*/
|
||||||
public function regenerate(Character $character): void
|
public function regenerate(Character $character): void
|
||||||
{
|
{
|
||||||
$regenRate = config('game.nerve.regen_rate', 1);
|
$regenRate = config('game.nerve.regen_rate', 1);
|
||||||
@@ -26,6 +32,9 @@ class NerveService
|
|||||||
$character->addNerve($regenRate);
|
$character->addNerve($regenRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refill nerve to max for all active characters
|
||||||
|
*/
|
||||||
public function refillAll(): int
|
public function refillAll(): int
|
||||||
{
|
{
|
||||||
return Character::where('nerve', '<', \DB::raw('max_nerve'))
|
return Character::where('nerve', '<', \DB::raw('max_nerve'))
|
||||||
|
|||||||
Reference in New Issue
Block a user