diff --git a/config/__pycache__/__init__.cpython-311.pyc b/config/__pycache__/__init__.cpython-311.pyc index 896bb4f..78a4919 100644 Binary files a/config/__pycache__/__init__.cpython-311.pyc and b/config/__pycache__/__init__.cpython-311.pyc differ diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index d79d6a7..e0c05e2 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/__pycache__/urls.cpython-311.pyc b/config/__pycache__/urls.cpython-311.pyc index 8cf22af..99f208a 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/__pycache__/wsgi.cpython-311.pyc b/config/__pycache__/wsgi.cpython-311.pyc index a1b4aa7..cc933db 100644 Binary files a/config/__pycache__/wsgi.cpython-311.pyc and b/config/__pycache__/wsgi.cpython-311.pyc differ diff --git a/config/urls.py b/config/urls.py index bcfc074..a379960 100644 --- a/config/urls.py +++ b/config/urls.py @@ -20,7 +20,8 @@ from django.conf import settings from django.conf.urls.static import static urlpatterns = [ - path("admin/", admin.site.urls), + path('admin/', admin.site.urls), + path('accounts/', include('django.contrib.auth.urls')), path("", include("core.urls")), ] diff --git a/core/__pycache__/__init__.cpython-311.pyc b/core/__pycache__/__init__.cpython-311.pyc index 3f553f6..6ded480 100644 Binary files a/core/__pycache__/__init__.cpython-311.pyc and b/core/__pycache__/__init__.cpython-311.pyc differ diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index 5e8987a..9b8bdc2 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/apps.cpython-311.pyc b/core/__pycache__/apps.cpython-311.pyc index 2fa4a49..dd90d79 100644 Binary files a/core/__pycache__/apps.cpython-311.pyc and b/core/__pycache__/apps.cpython-311.pyc differ diff --git a/core/__pycache__/context_processors.cpython-311.pyc b/core/__pycache__/context_processors.cpython-311.pyc index 75bf223..c2cf1ad 100644 Binary files a/core/__pycache__/context_processors.cpython-311.pyc and b/core/__pycache__/context_processors.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index a251b5f..6752a44 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index f705988..e7a878d 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 2f0989c..d110221 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..324432c --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,63 @@ +# Generated by Django 5.2.7 on 2026-03-05 10:42 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Item', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ('description', models.TextField()), + ], + ), + migrations.CreateModel( + name='Quest', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=100)), + ('description', models.TextField()), + ('is_active', models.BooleanField(default=False)), + ('is_completed', models.BooleanField(default=False)), + ], + ), + migrations.CreateModel( + name='Scene', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('content', models.TextField()), + ], + ), + migrations.CreateModel( + name='PlayerProfile', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('level', models.IntegerField(default=1)), + ('inventory', models.ManyToManyField(blank=True, to='core.item')), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('quests', models.ManyToManyField(blank=True, to='core.quest')), + ('current_scene', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.scene')), + ], + ), + migrations.CreateModel( + name='Choice', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('text', models.CharField(max_length=200)), + ('next_scene', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='incoming_choices', to='core.scene')), + ('scene', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='choices', to='core.scene')), + ], + ), + ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..990aa80 Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/migrations/__pycache__/__init__.cpython-311.pyc b/core/migrations/__pycache__/__init__.cpython-311.pyc index 7995815..f0424f9 100644 Binary files a/core/migrations/__pycache__/__init__.cpython-311.pyc and b/core/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..825aa53 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,43 @@ from django.db import models +from django.contrib.auth.models import User -# Create your models here. +class Item(models.Model): + name = models.CharField(max_length=100) + description = models.TextField() + + def __str__(self): + return self.name + +class Quest(models.Model): + title = models.CharField(max_length=100) + description = models.TextField() + is_active = models.BooleanField(default=False) + is_completed = models.BooleanField(default=False) + + def __str__(self): + return self.title + +class Scene(models.Model): + title = models.CharField(max_length=200) + content = models.TextField() + + def __str__(self): + return self.title + +class Choice(models.Model): + scene = models.ForeignKey(Scene, related_name='choices', on_delete=models.CASCADE) + text = models.CharField(max_length=200) + next_scene = models.ForeignKey(Scene, related_name='incoming_choices', on_delete=models.SET_NULL, null=True, blank=True) + + def __str__(self): + return self.text + +class PlayerProfile(models.Model): + user = models.OneToOneField(User, on_delete=models.CASCADE) + current_scene = models.ForeignKey(Scene, on_delete=models.SET_NULL, null=True, blank=True) + inventory = models.ManyToManyField(Item, blank=True) + quests = models.ManyToManyField(Quest, blank=True) + level = models.IntegerField(default=1) + + def __str__(self): + return self.user.username \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..0767493 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -3,23 +3,33 @@ - {% block title %}Knowledge Base{% endblock %} - {% if project_description %} - - - - {% endif %} - {% if project_image_url %} - - - {% endif %} + + {% block title %}Witcher RPG{% endblock %} {% load static %} - + + + {% block head %}{% endblock %} - - {% block content %}{% endblock %} + + +
+

Witcher RPG

+ +
+ +
+ {% block content %}{% endblock %} +
+ + + - + \ No newline at end of file diff --git a/core/templates/core/scene_detail.html b/core/templates/core/scene_detail.html new file mode 100644 index 0000000..3252b29 --- /dev/null +++ b/core/templates/core/scene_detail.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} +{% load static %} +{% block content %} +
+
+
+

{{ scene.title }}

+

{{ scene.content }}

+
+ +
+ {% for choice in scene.choices.all %} + {{ choice.text }} + {% endfor %} +
+
+
+
+

Character Status

+

Level: {{ player.level }}

+

Quests

+
    + {% for quest in player.quests.all %} +
  • {{ quest.title }} - {{ quest.is_completed|yesno:"Completed,Active" }}
  • + {% endfor %} +
+

Inventory

+
    + {% for item in player.inventory.all %} +
  • {{ item.name }}
  • + {% endfor %} +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/login.html b/core/templates/registration/login.html new file mode 100644 index 0000000..3242471 --- /dev/null +++ b/core/templates/registration/login.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} + +{% block title %}Sign In | Witcher RPG{% endblock %} + +{% block content %} +
+

Sign in to continue

+

Enter your credentials to resume your journey.

+ + {% if form.non_field_errors %} +
+ {{ form.non_field_errors }} +
+ {% endif %} + +
+ {% csrf_token %} + + + + + + +
+
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..e39ce96 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,11 @@ from django.urls import path +from . import views -from .views import home +app_name = 'core' urlpatterns = [ - path("", home, name="home"), -] + path('', views.home, name='home'), + path('scene//', views.scene_view, name='scene_detail'), + path('scene/', views.scene_view, name='current_scene'), + path('choose//', views.choose_action, name='choose_action'), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..bdfae89 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,36 @@ -import os -import platform - -from django import get_version as django_version -from django.shortcuts import render -from django.utils import timezone - +from django.shortcuts import render, get_object_or_404, redirect +from .models import Scene, Choice, PlayerProfile +from django.contrib.auth.decorators import login_required def home(request): - """Render the landing screen with loader and environment details.""" - host_name = request.get_host().lower() - agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" - now = timezone.now() + return render(request, "core/index.html") - context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), - "current_time": now, - "host_name": host_name, - "project_description": os.getenv("PROJECT_DESCRIPTION", ""), - "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), - } - return render(request, "core/index.html", context) +@login_required +def scene_view(request, scene_id=None): + player = request.user.playerprofile + if scene_id: + scene = get_object_or_404(Scene, id=scene_id) + player.current_scene = scene + player.save() + else: + scene = player.current_scene + if not scene: + first_scene = Scene.objects.first() + if first_scene: + player.current_scene = first_scene + player.save() + scene = first_scene + else: + return render(request, "core/empty.html") + + return render(request, "core/scene_detail.html", {"scene": scene, "player": player}) + +@login_required +def choose_action(request, choice_id): + choice = get_object_or_404(Choice, id=choice_id) + player = request.user.playerprofile + if choice.next_scene: + player.current_scene = choice.next_scene + player.save() + return redirect('core:scene_detail', scene_id=choice.next_scene.id) + return redirect('core:current_scene') \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..82eaa95 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,26 @@ -/* Custom styles for the application */ body { - font-family: system-ui, -apple-system, sans-serif; + background-color: #0F1310; + color: #E0E0E0; + font-family: 'Inter', sans-serif; } + +h1, h2, h3 { + font-family: 'Cinzel', serif; + color: #B68D4C; +} + +.btn-accent { + background-color: #B68D4C; + color: #0F1310; + border: none; + padding: 10px 20px; + text-transform: uppercase; + font-weight: bold; +} + +.card { + background-color: #1C2320; + border: 1px solid #333; + padding: 20px; + margin-bottom: 20px; +} \ No newline at end of file