first commit
This commit is contained in:
@@ -0,0 +1,159 @@
|
||||
@extends('layouts.game')
|
||||
|
||||
@section('title', 'Create Character')
|
||||
|
||||
@section('game-content')
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg p-8">
|
||||
<h1 class="text-2xl font-bold text-gray-800 dark:text-gray-200 mb-6">
|
||||
Create Your Character
|
||||
</h1>
|
||||
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-8">
|
||||
Welcome to {{ config('game.name', 'The Crime Syndicate') }}!
|
||||
Create your character to start your criminal career.
|
||||
</p>
|
||||
|
||||
<form method="POST" action="{{ route('game.character.store') }}">
|
||||
@csrf
|
||||
|
||||
<!-- Name -->
|
||||
<div class="mb-6">
|
||||
<label for="name" class="block font-medium text-sm text-gray-700 dark:text-gray-300 mb-2">
|
||||
Character Name
|
||||
</label>
|
||||
<input
|
||||
id="name"
|
||||
type="text"
|
||||
name="name"
|
||||
value="{{ old('name') }}"
|
||||
required
|
||||
autofocus
|
||||
autocomplete="name"
|
||||
class="w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300 rounded-md shadow-sm @error('name') border-red-500 @enderror"
|
||||
placeholder="Enter your character name"
|
||||
maxlength="50"
|
||||
>
|
||||
@error('name')
|
||||
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
||||
@enderror
|
||||
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">
|
||||
Choose a unique name for your character (max 50 characters).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Gender -->
|
||||
<div class="mb-6">
|
||||
<label class="block font-medium text-sm text-gray-700 dark:text-gray-300 mb-2">
|
||||
Gender
|
||||
</label>
|
||||
<div class="space-y-2">
|
||||
@foreach($genders as $gender)
|
||||
<div class="flex items-center">
|
||||
<input
|
||||
id="gender-{{ $gender }}"
|
||||
type="radio"
|
||||
name="gender"
|
||||
value="{{ $gender }}"
|
||||
{{ old('gender') === $gender ? 'checked' : ($loop->first ? 'checked' : '') }}
|
||||
class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600"
|
||||
>
|
||||
<label
|
||||
for="gender-{{ $gender }}"
|
||||
class="ml-2 block text-sm text-gray-700 dark:text-gray-300"
|
||||
>
|
||||
{{ ucfirst($gender) }}
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@error('gender')
|
||||
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<!-- Location -->
|
||||
<div class="mb-6">
|
||||
<label for="location_id" class="block font-medium text-sm text-gray-700 dark:text-gray-300 mb-2">
|
||||
Starting Location
|
||||
</label>
|
||||
<select
|
||||
id="location_id"
|
||||
name="location_id"
|
||||
required
|
||||
class="w-full border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-300 rounded-md shadow-sm @error('location_id') border-red-500 @enderror"
|
||||
>
|
||||
@foreach($locations as $location)
|
||||
<option
|
||||
value="{{ $location->id }}"
|
||||
{{ old('location_id') == $location->id ? 'selected' : ($loop->first ? 'selected' : '') }}
|
||||
>
|
||||
{{ $location->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('location_id')
|
||||
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
||||
@enderror
|
||||
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">
|
||||
Choose where your character will start their journey.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Starting Stats Preview -->
|
||||
<div class="mb-6 bg-gray-50 dark:bg-gray-700 p-4 rounded-lg">
|
||||
<h3 class="font-medium text-sm text-gray-700 dark:text-gray-300 mb-3">
|
||||
Starting Stats
|
||||
</h3>
|
||||
<div class="grid grid-cols-2 gap-3 text-sm">
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Health</span>
|
||||
<span>{{ config('game.health.start_amount', 100) }}/{{ config('game.health.max', 100) }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Energy</span>
|
||||
<span>{{ config('game.energy.start_amount', 100) }}/{{ config('game.energy.max', 100) }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Money</span>
|
||||
<span>${{ number_format(config('game.economy.start_money', 5000)) }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Bank</span>
|
||||
<span>${{ number_format(config('game.economy.start_bank', 0)) }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Strength</span>
|
||||
<span>5</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Defense</span>
|
||||
<span>5</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Speed</span>
|
||||
<span>5</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Dexterity</span>
|
||||
<span>5</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="flex justify-end">
|
||||
<button
|
||||
type="submit"
|
||||
class="inline-flex items-center px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition"
|
||||
>
|
||||
Create Character
|
||||
<svg class="ml-2 w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5l7 7-7 7M5 12h14" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,139 @@
|
||||
@extends('layouts.game')
|
||||
|
||||
@section('title', 'Crimes')
|
||||
|
||||
@section('game-content')
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
|
||||
<div class="p-6 border-b border-gray-200 dark:border-gray-700">
|
||||
<div class="flex justify-between items-center">
|
||||
<h1 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Available Crimes</h1>
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
Energy: {{ $character->energy }}/{{ $character->max_energy }}
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
Commit crimes to earn money and experience. Each crime costs energy and has a chance of success or failure.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="p-6">
|
||||
@if($availableCrimes->isEmpty())
|
||||
<p class="text-center text-gray-500 dark:text-gray-400 py-8">
|
||||
No crimes available. Try leveling up or restoring your energy.
|
||||
</p>
|
||||
@else
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@foreach($availableCrimes as $crime)
|
||||
@php
|
||||
$onCooldown = $crimeService->isOnCooldown($character, $crime);
|
||||
$cooldownRemaining = $onCooldown ? $crimeService->getCooldownRemaining($character, $crime) : 0;
|
||||
$successRate = $crime->calculateSuccessRate($character);
|
||||
@endphp
|
||||
|
||||
<div class="bg-gray-50 dark:bg-gray-700 rounded-lg p-4 border border-gray-200 dark:border-gray-600">
|
||||
<div class="flex justify-between items-start mb-2">
|
||||
<div>
|
||||
<h3 class="font-medium text-gray-800 dark:text-gray-200">{{ $crime->name }}</h3>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">
|
||||
{{ $crime->difficulty_label }} Difficulty
|
||||
</p>
|
||||
</div>
|
||||
<span class="text-xs px-2 py-1 rounded-full {{ $crime->difficulty_color }} text-white">
|
||||
{{ number_format($successRate * 100, 1) }}% Success
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 mb-3">
|
||||
{{ Str::limit($crime->description, 100) }}
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-2 gap-2 text-xs">
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-500 mr-1">⚡</span>
|
||||
<span>{{ $crime->energy_cost }} Energy</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="text-green-500 mr-1">💰</span>
|
||||
<span>${{ $crime->reward_min }}-{{ $crime->reward_max }}</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="text-blue-500 mr-1">📈</span>
|
||||
<span>{{ $crime->experience }} EXP</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="text-gray-500 mr-1">⏱️</span>
|
||||
<span>{{ $crime->cooldown }}s Cooldown</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($onCooldown)
|
||||
<button
|
||||
disabled
|
||||
class="w-full mt-3 py-2 px-4 text-sm text-center bg-gray-300 dark:bg-gray-600 text-gray-500 dark:text-gray-400 rounded-lg cursor-not-allowed"
|
||||
>
|
||||
On Cooldown ({{ ceil($cooldownRemaining / 60) }}m)
|
||||
</button>
|
||||
@else
|
||||
<form action="{{ route('game.crimes.attempt', $crime) }}" method="POST" class="mt-3">
|
||||
@csrf
|
||||
<button
|
||||
type="submit"
|
||||
class="w-full py-2 px-4 text-sm text-center bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition"
|
||||
>
|
||||
Attempt Crime
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
@if($crime->requires_level)
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 mt-2">
|
||||
Requires Level {{ $crime->requires_level }}+
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="p-6 border-t border-gray-200 dark:border-gray-700">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-3">Recent Attempts</h3>
|
||||
|
||||
@if($recentAttempts->isEmpty())
|
||||
<p class="text-center text-gray-500 dark:text-gray-400 py-4">
|
||||
No recent crime attempts.
|
||||
</p>
|
||||
@else
|
||||
<div class="space-y-2">
|
||||
@foreach($recentAttempts as $attempt)
|
||||
<div class="flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-700 rounded-lg">
|
||||
<div class="flex items-center">
|
||||
<span class="mr-3">
|
||||
@if($attempt->success)
|
||||
<span class="text-green-500">✅</span>
|
||||
@else
|
||||
<span class="text-red-500">❌</span>
|
||||
@endif
|
||||
</span>
|
||||
<div>
|
||||
<p class="font-medium text-gray-800 dark:text-gray-200">{{ $attempt->crime->name }}</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400">{{ $attempt->attempted_at->diffForHumans() }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
@if($attempt->success)
|
||||
<p class="text-sm text-green-600 dark:text-green-400">+${{ number_format($attempt->reward) }}</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400">+{{ $attempt->experience_gained }} EXP</p>
|
||||
@else
|
||||
<p class="text-sm text-red-600 dark:text-red-400">Failed</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,195 @@
|
||||
@extends('layouts.game')
|
||||
|
||||
@section('title', 'Dashboard')
|
||||
|
||||
@section('game-content')
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
<!-- Welcome Card -->
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg p-6">
|
||||
<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200 mb-4">
|
||||
Welcome, {{ $character->name }}!
|
||||
</h2>
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
You are in <strong>{{ $character->location->name ?? 'Unknown Location' }}</strong>.
|
||||
</p>
|
||||
<p class="text-gray-600 dark:text-gray-400 mt-2">
|
||||
Level: {{ $character->level }} ({{ number_format($character->experience) }} / {{ number_format($character->experience_for_next_level) }} EXP)
|
||||
</p>
|
||||
<div class="w-full bg-gray-200 rounded-full h-2 mt-3">
|
||||
<div
|
||||
class="bg-blue-600 h-2 rounded-full"
|
||||
style="width: {{ $character->experience_progress }}%"
|
||||
></div>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 mt-1">EXP Progress: {{ number_format($character->experience_progress, 1) }}%</p>
|
||||
</div>
|
||||
|
||||
<!-- Quick Stats -->
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg p-6">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-4">Quick Stats</h3>
|
||||
<div class="space-y-2">
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Strength</span>
|
||||
<span class="font-medium">{{ $character->strength }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Defense</span>
|
||||
<span class="font-medium">{{ $character->defense }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Speed</span>
|
||||
<span class="font-medium">{{ $character->speed }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Dexterity</span>
|
||||
<span class="font-medium">{{ $character->dexterity }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between pt-2 border-t border-gray-200 dark:border-gray-700">
|
||||
<span class="text-gray-600 dark:text-gray-400">Attack Power</span>
|
||||
<span class="font-medium text-green-600 dark:text-green-400">{{ $character->attack_power }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span class="text-gray-600 dark:text-gray-400">Defense</span>
|
||||
<span class="font-medium text-blue-600 dark:text-blue-400">{{ $character->defense }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Money & Bank -->
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg p-6">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-4">Finances</h3>
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<span class="text-green-500 mr-2">💰</span>
|
||||
<span class="text-gray-600 dark:text-gray-400">Cash</span>
|
||||
</div>
|
||||
<span class="font-medium">${{ number_format($character->money) }}</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<span class="text-blue-500 mr-2">🏦</span>
|
||||
<span class="text-gray-600 dark:text-gray-400">Bank</span>
|
||||
</div>
|
||||
<span class="font-medium">${{ number_format($character->bank) }}</span>
|
||||
</div>
|
||||
<div class="pt-2 border-t border-gray-200 dark:border-gray-700 space-y-2">
|
||||
<a
|
||||
href="#"
|
||||
onclick="event.preventDefault(); document.getElementById('deposit-form').submit();"
|
||||
class="block w-full text-center bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded text-sm transition"
|
||||
>
|
||||
Deposit to Bank
|
||||
</a>
|
||||
<form id="deposit-form" action="{{ route('game.character.deposit') }}" method="POST" class="hidden">
|
||||
@csrf
|
||||
<input type="number" name="amount" value="1000" min="1" max="{{ $character->money }}">
|
||||
</form>
|
||||
|
||||
<a
|
||||
href="#"
|
||||
onclick="event.preventDefault(); document.getElementById('withdraw-form').submit();"
|
||||
class="block w-full text-center bg-gray-600 hover:bg-gray-700 text-white py-2 px-4 rounded text-sm transition"
|
||||
>
|
||||
Withdraw from Bank
|
||||
</a>
|
||||
<form id="withdraw-form" action="{{ route('game.character.withdraw') }}" method="POST" class="hidden">
|
||||
@csrf
|
||||
<input type="number" name="amount" value="1000" min="1" max="{{ $character->bank }}">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg p-6 lg:col-span-2">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-4">Quick Actions</h3>
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-3">
|
||||
<a
|
||||
href="{{ route('game.crimes.index') }}"
|
||||
class="flex flex-col items-center justify-center bg-blue-500 hover:bg-blue-600 text-white py-4 px-2 rounded-lg transition group"
|
||||
>
|
||||
<span class="text-2xl mb-1">🎯</span>
|
||||
<span class="text-sm font-medium">Crimes</span>
|
||||
<span class="text-xs opacity-75">Commit crimes</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="{{ route('game.inventory.index') }}"
|
||||
class="flex flex-col items-center justify-center bg-green-500 hover:bg-green-600 text-white py-4 px-2 rounded-lg transition group"
|
||||
>
|
||||
<span class="text-2xl mb-1">🎒</span>
|
||||
<span class="text-sm font-medium">Inventory</span>
|
||||
<span class="text-xs opacity-75">Manage items</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="{{ route('game.character.show') }}"
|
||||
class="flex flex-col items-center justify-center bg-purple-500 hover:bg-purple-600 text-white py-4 px-2 rounded-lg transition group"
|
||||
>
|
||||
<span class="text-2xl mb-1">👤</span>
|
||||
<span class="text-sm font-medium">Profile</span>
|
||||
<span class="text-xs opacity-75">View profile</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="{{ route('profile.edit') }}"
|
||||
class="flex flex-col items-center justify-center bg-gray-500 hover:bg-gray-600 text-white py-4 px-2 rounded-lg transition group"
|
||||
>
|
||||
<span class="text-2xl mb-1">⚙️</span>
|
||||
<span class="text-sm font-medium">Settings</span>
|
||||
<span class="text-xs opacity-75">Account settings</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Recent Activity -->
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg p-6 lg:col-span-3">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-4">Recent Activity</h3>
|
||||
|
||||
@if($recentActivity->isEmpty())
|
||||
<p class="text-gray-500 dark:text-gray-400 text-center py-4">No recent activity.</p>
|
||||
@else
|
||||
<div class="space-y-3">
|
||||
@foreach($recentActivity as $activity)
|
||||
<div class="flex items-start space-x-3 p-3 bg-gray-50 dark:bg-gray-700 rounded-lg">
|
||||
<span class="text-gray-400 dark:text-gray-500">
|
||||
@switch($activity->action)
|
||||
@case('crime_attempt')
|
||||
@if(str_contains($activity->description, 'success'))
|
||||
✅
|
||||
@else
|
||||
❌
|
||||
@endif
|
||||
@break
|
||||
@case('money_earned')
|
||||
💰
|
||||
@break
|
||||
@case('money_spent')
|
||||
💸
|
||||
@break
|
||||
@case('character_created')
|
||||
🎉
|
||||
@break
|
||||
@default
|
||||
📝
|
||||
@endswitch
|
||||
</span>
|
||||
<div class="flex-1">
|
||||
<p class="text-sm font-medium text-gray-800 dark:text-gray-200">
|
||||
{{ ucfirst(str_replace('_', ' ', $activity->action)) }}
|
||||
</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ $activity->description }}
|
||||
</p>
|
||||
<p class="text-xs text-gray-400 dark:text-gray-500 mt-1">
|
||||
{{ $activity->created_at->diffForHumans() }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,72 @@
|
||||
@extends('layouts.game')
|
||||
|
||||
@section('title', 'Hospital')
|
||||
|
||||
@section('game-content')
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
|
||||
<div class="p-8 text-center">
|
||||
<div class="mb-6">
|
||||
<span class="text-6xl text-red-500">🏥</span>
|
||||
</div>
|
||||
|
||||
<h1 class="text-2xl font-bold text-gray-800 dark:text-gray-200 mb-4">
|
||||
You're in the Hospital
|
||||
</h1>
|
||||
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-6">
|
||||
Your character has been injured and is currently recovering in the hospital.
|
||||
</p>
|
||||
|
||||
<div class="bg-red-50 dark:bg-red-900/30 rounded-lg p-6 mb-6">
|
||||
<h3 class="text-lg font-medium text-red-800 dark:text-red-200 mb-3">
|
||||
Your Status
|
||||
</h3>
|
||||
<div class="space-y-2">
|
||||
<div class="flex justify-between text-sm">
|
||||
<span class="text-gray-600 dark:text-gray-400">Health</span>
|
||||
<span class="font-medium">{{ $character->health }}/{{ $character->max_health }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between text-sm">
|
||||
<span class="text-gray-600 dark:text-gray-400">Status</span>
|
||||
<span class="font-medium text-red-600 dark:text-red-400">
|
||||
@if($character->health <= 0) Dead @else In Hospital @endif
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex justify-between text-sm">
|
||||
<span class="text-gray-600 dark:text-gray-400">Release Time</span>
|
||||
<span class="font-medium">{{ $releaseTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
<form action="{{ route('game.character.revive') }}" method="POST">
|
||||
@csrf
|
||||
<button
|
||||
type="submit"
|
||||
class="w-full flex items-center justify-center px-6 py-4 bg-green-500 hover:bg-green-600 text-white font-medium rounded-lg transition"
|
||||
>
|
||||
<span class="mr-2">💵</span>
|
||||
Revive Now for ${{ number_format($reviveCost) }}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">
|
||||
Or wait to be automatically released when your health regenerates.
|
||||
</p>
|
||||
|
||||
<a
|
||||
href="{{ route('game.dashboard') }}"
|
||||
class="inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 transition"
|
||||
>
|
||||
<svg class="w-5 h-5 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
Back to Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,133 @@
|
||||
@extends('layouts.game')
|
||||
|
||||
@section('title', 'Inventory')
|
||||
|
||||
@section('game-content')
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
|
||||
<div class="p-6 border-b border-gray-200 dark:border-gray-700">
|
||||
<h1 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Inventory</h1>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
Manage your items. Equip weapons and armor, or use consumables.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="p-6">
|
||||
@if($inventory->isEmpty())
|
||||
<p class="text-center text-gray-500 dark:text-gray-400 py-8">
|
||||
Your inventory is empty.
|
||||
</p>
|
||||
@else
|
||||
<div class="space-y-4">
|
||||
@foreach($inventory->groupBy('item.type') as $type => $items)
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-800 dark:text-gray-200 capitalizes mb-3">
|
||||
{{ ucfirst($type) }}s ({{ $items->sum('quantity') }})
|
||||
</h3>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
@foreach($items as $item)
|
||||
<div class="bg-gray-50 dark:bg-gray-700 rounded-lg p-4 border border-gray-200 dark:border-gray-600">
|
||||
<div class="flex justify-between items-start mb-2">
|
||||
<div>
|
||||
<h4 class="font-medium text-gray-800 dark:text-gray-200">{{ $item->item->name }}</h4>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400">
|
||||
x{{ $item->quantity }}
|
||||
</p>
|
||||
</div>
|
||||
@if($item->equipped)
|
||||
<span class="text-xs px-2 py-1 bg-green-500 text-white rounded-full">Equipped</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if($item->item->description)
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 mb-3">
|
||||
{{ Str::limit($item->item->description, 80) }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<div class="grid grid-cols-2 gap-2 text-xs mb-3">
|
||||
@if($item->item->attack_bonus > 0)
|
||||
<div class="flex items-center">
|
||||
<span class="text-red-500 mr-1">⚔️</span>
|
||||
<span>+{{ $item->item->attack_bonus }} Attack</span>
|
||||
</div>
|
||||
@endif
|
||||
@if($item->item->defense_bonus > 0)
|
||||
<div class="flex items-center">
|
||||
<span class="text-blue-500 mr-1">🛡️</span>
|
||||
<span>+{{ $item->item->defense_bonus }} Defense</span>
|
||||
</div>
|
||||
@endif
|
||||
@if($item->item->health_bonus > 0)
|
||||
<div class="flex items-center">
|
||||
<span class="text-green-500 mr-1">❤️</span>
|
||||
<span>+{{ $item->item->health_bonus }} Health</span>
|
||||
</div>
|
||||
@endif
|
||||
@if($item->item->energy_bonus > 0)
|
||||
<div class="flex items-center">
|
||||
<span class="text-yellow-500 mr-1">⚡</span>
|
||||
<span>+{{ $item->item->energy_bonus }} Energy</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="flex space-x-2">
|
||||
@if($item->item->canEquip())
|
||||
@if($item->equipped)
|
||||
<form action="{{ route('game.inventory.unequip', $item) }}" method="POST">
|
||||
@csrf
|
||||
<button
|
||||
type="submit"
|
||||
class="px-3 py-1 text-xs bg-gray-400 hover:bg-gray-500 text-white rounded transition"
|
||||
>
|
||||
Unequip
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<form action="{{ route('game.inventory.equip', $item) }}" method="POST">
|
||||
@csrf
|
||||
<button
|
||||
type="submit"
|
||||
class="px-3 py-1 text-xs bg-blue-500 hover:bg-blue-600 text-white rounded transition"
|
||||
>
|
||||
Equip
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if($item->item->canUse())
|
||||
<form action="{{ route('game.inventory.use', $item) }}" method="POST">
|
||||
@csrf
|
||||
<button
|
||||
type="submit"
|
||||
class="px-3 py-1 text-xs bg-green-500 hover:bg-green-600 text-white rounded transition"
|
||||
>
|
||||
Use
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
<form action="{{ route('game.inventory.drop', $item) }}" method="POST">
|
||||
@csrf
|
||||
<input type="number" name="quantity" value="1" min="1" max="{{ $item->quantity }}" class="hidden">
|
||||
<button
|
||||
type="submit"
|
||||
class="px-3 py-1 text-xs bg-red-500 hover:bg-red-600 text-white rounded transition"
|
||||
>
|
||||
Drop
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,55 @@
|
||||
@extends('layouts.game')
|
||||
|
||||
@section('title', 'Jail')
|
||||
|
||||
@section('game-content')
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
|
||||
<div class="p-8 text-center">
|
||||
<div class="mb-6">
|
||||
<span class="text-6xl text-yellow-500">🚔</span>
|
||||
</div>
|
||||
|
||||
<h1 class="text-2xl font-bold text-gray-800 dark:text-gray-200 mb-4">
|
||||
You're in Jail
|
||||
</h1>
|
||||
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-6">
|
||||
Your character has been arrested and is currently serving time in jail.
|
||||
</p>
|
||||
|
||||
<div class="bg-yellow-50 dark:bg-yellow-900/30 rounded-lg p-6 mb-6">
|
||||
<h3 class="text-lg font-medium text-yellow-800 dark:text-yellow-200 mb-3">
|
||||
Your Status
|
||||
</h3>
|
||||
<div class="space-y-2">
|
||||
<div class="flex justify-between text-sm">
|
||||
<span class="text-gray-600 dark:text-gray-400">Status</span>
|
||||
<span class="font-medium text-yellow-600 dark:text-yellow-400">In Jail</span>
|
||||
</div>
|
||||
<div class="flex justify-between text-sm">
|
||||
<span class="text-gray-600 dark:text-gray-400">Release Time</span>
|
||||
<span class="font-medium">{{ $releaseTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">
|
||||
You must wait for your sentence to complete. There is no way to reduce your jail time.
|
||||
</p>
|
||||
|
||||
<a
|
||||
href="{{ route('game.dashboard') }}"
|
||||
class="inline-flex items-center text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 transition"
|
||||
>
|
||||
<svg class="w-5 h-5 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
Back to Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,48 @@
|
||||
@php
|
||||
$character = auth()->user()->character;
|
||||
@endphp
|
||||
|
||||
<div class="flex items-center space-x-4 text-sm">
|
||||
<!-- Energy Bar -->
|
||||
<div class="flex items-center space-x-2">
|
||||
<span class="text-yellow-400">⚡</span>
|
||||
<div class="w-20 bg-gray-600 rounded-full h-2">
|
||||
<div
|
||||
class="bg-yellow-400 h-2 rounded-full transition-all duration-300"
|
||||
style="width: {{ $character->energy_percentage }}%"
|
||||
></div>
|
||||
</div>
|
||||
<span>{{ $character->energy }}/{{ $character->max_energy }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Health Bar -->
|
||||
<div class="flex items-center space-x-2">
|
||||
<span class="text-red-400">❤️</span>
|
||||
<div class="w-20 bg-gray-600 rounded-full h-2">
|
||||
<div
|
||||
class="bg-red-400 h-2 rounded-full transition-all duration-300"
|
||||
style="width: {{ $character->health_percentage }}%"
|
||||
></div>
|
||||
</div>
|
||||
<span>{{ $character->health }}/{{ $character->max_health }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Money -->
|
||||
<div class="flex items-center space-x-1">
|
||||
<span class="text-green-400">💰</span>
|
||||
<span>${{ number_format($character->money) }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Level -->
|
||||
<div class="flex items-center space-x-1">
|
||||
<span class="text-blue-400">📈</span>
|
||||
<span>Lv. {{ $character->level }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Status -->
|
||||
@if($character->status !== 'active')
|
||||
<span class="px-2 py-1 text-xs rounded {{ $character->status === 'in_hospital' ? 'bg-red-500' : 'bg-yellow-500' }}">
|
||||
{{ ucfirst(str_replace('_', ' ', $character->status)) }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
Reference in New Issue
Block a user