feat: add JailController and bust-out route
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
799f46a5f2
commit
f84a303c76
+8
-2
@@ -5,6 +5,7 @@ use App\Http\Controllers\Game\CrimeController;
|
||||
use App\Http\Controllers\Game\DashboardController;
|
||||
use App\Http\Controllers\Game\GymController;
|
||||
use App\Http\Controllers\Game\InventoryController;
|
||||
use App\Http\Controllers\Game\JailController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
@@ -85,7 +86,12 @@ Route::middleware(['auth'])->group(function () {
|
||||
if (!$character || !$character->isInJail()) {
|
||||
return redirect()->route('game.dashboard');
|
||||
}
|
||||
$releaseTime = $character->in_jail_until ? $character->in_jail_until->diffForHumans() : 'unknown';
|
||||
return view('game.jail', compact('character', 'releaseTime'));
|
||||
$releaseTime = $character->in_jail_until ? $character->in_jail_until->diffForHumans() : 'unknown';
|
||||
$bustOutChance = (int) round((new \App\Services\Game\JailService())->calculateBustOutChance($character) * 100);
|
||||
$bustOutCost = config('game.jail.breakout_cost', 1000);
|
||||
return view('game.jail', compact('character', 'releaseTime', 'bustOutChance', 'bustOutCost'));
|
||||
})->name('game.jail');
|
||||
|
||||
Route::post('/game/jail/bust-out', [JailController::class, 'bustOut'])
|
||||
->name('game.jail.bust-out');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user