**The Goth Cardgame Collection** ist eine modulare Desktop-Kartenspiel-Sammlung in dunkler Gothic-Ästhetik, entwickelt mit **Python 3.11+**, **Tkinter**, **Pillow (PIL)**, **Pygame (Audio)** und **SQLite3**.
Jedes Spiel arbeitet als vollständig gekapseltes Modul mit **eigener Erfahrungskurve (XP & Ränge)**, eigenen Statistiken und – bei Glücksspielen – einer komplett autarken Gold-Wirtschaft samt harten Konsequenzen.
* **Online (`online`):** Mehrspieler-Tische & entfesselte Bots auf *Gottheit*-Niveau ohne Welpenschutz (in Vorbereitung).
* **Spielgebundenes Prestige- & Rangsystem:**
* **260 Ränge** (0–258 in römischen Stufen `I–V`, ab Rang 259 unendliche **Gottheit**-Stufen).
* Jedes Spiel verwaltet seinen eigenen Level- und XP-Stand (`game_progress`), sodass Fortschritte zwischen einzelnen Spielen niemals vermischt werden.
* **Autarke Glücksspiel-Ökonomie, Divine Punishment & The Devil's Deal:**
* Bis zu **5 eigene Goldbeutel** pro Glücksspiel und Profil (je `1.000 Gold` Startkapital).
* **XP-gegen-Gold-Tausch:** Regulär `10.000 XP` für `+10 Gold` (ausschließlich aus dem XP-Pool des jeweiligen Spiels).
* **Divine Punishment:** Wer im jeweiligen Spiel einmal den Rang *Gottheit* erreicht hat, zahlt für Gold-Tausche das $10$-fache der Durchschnitts-XP des Vorlevels und kann maximal bis auf die Untergrenze von *Schöpfergeist V* zurückfallen.
* **The Devil's Deal:** Ist die Untergrenze von *Schöpfergeist V* erreicht, kann ein anderes Seelen-Profil geopfert werden (sofern dieses **im selben Spiel** mindestens den Rang **Stütze I** hält), um `+10 Gold` zu erhalten. Während eines aktiven Pakts sind alle anderen Menüs und Spiele gesperrt (*Auto-Save & Resume-Zwang*), bis die Runde entschieden ist.
* **Zentralisierte Leisten (`GothTopbar` &`SolitaireBottomBar`):** Einheitliche, schlanke Kopfleiste (mit verzögerungsfreiem Level/XP-Badge-Update ohne Layout-Redraw) sowie eine gerahmte untere HUD- und Aktionsleiste mit dynamischen Links-/Rechts-Overflow-Flügeln für kompakte Auflösungen (z. B. `1366×768`).
* **Zentrale Einheits-Statistik (`UnifiedStatsView`):** Spielübergreifendes Vollbild-Overlay (direkt aus jedem laufenden Tisch ohne Zerstörung des Spielstands aufrufbar) mit Umschaltern für Gesamtprofil, Einzelspiele, Spielvarianten sowie Blackjack-/Poker-Goldbeutel.
* **Kombinierter Einstellungs-Dialog, `GothSwitch`& Hover-Hilfe:** Vereint Live-Sprachwechsel (**DE / EN**), zweikanalige Audio-Regler (Ambiance/Musik & Soundeffekte) und einen weich animierten Toggle-Switch (`GothSwitch`), über den kontextsensitive Hover-Tooltips (`Helvetica` für optimale Lesbarkeit) auf Aktions-Buttons global ein- oder ausgeschaltet werden können.
* **Garantiert lösbare Deals & 4 Schwierigkeitsstufen:** Vorab-Prüfung durch spielspezifische Solver und konstruktive Deal-Generatoren von *Stufe 1 – Akolyth (Leicht)* bis *Stufe 4 – Gottheit (Gnadenlos)*.
* **Flüssige 60-FPS-Animationen (`CardFlightAnimator`):** Nicht-blockierender Kartenflug mit kubischem Ease-Out, Snap-Back bei ungültigen Drops und verzögerungsfreiem `flush()` bei schnellen Klickserien.
* **Komfort, Auto-Save & Fairness:** Spielzeit startet erst bei der ersten echten Karten-/Tipp-Interaktion, pausiert automatisch bei Fokusverlust, speichert jeden Zug persistent inkl. unbegrenztem `Strg+Z` bis Zug $0$ sowie `⟲ Anfang` (`Strg+Shift+Z`) und erkennt Sackgassen automatisch. Das Aufgeben einer begonnenen Partie zieht $40\,\%$ der regulären Sieg-XP ab (geschützt durch das *Schöpfergeist V*-Minimum).
* Eigene hochauflösende Spiel-Icons (`resources/images/game_icons/*.ico`) auf den Hauptmenü-Kacheln mit automatischer Freistellung und abgerundeter Maskierung, freigestellte RGBA-Tische (`poker_table.png`) mit dynamischer Rahmenbreiten-Anpassung (`box_background.png`) sowie nahtloses Hintergrund-Slicing.
* Dynamischer Laufzeit-Font-Loader (`view/font_loader.py`) für mitgelieferte `.ttf`-Schriften (`OldLondon.ttf` &`OldLondonAlternate.ttf`) komplett ohne Systeminstallation unter **Windows**, **Linux**, **ChromeOS (Crostini)** und **macOS**.
Für normale Spieler ist **keine** Python-Installation erforderlich:
1. Lade das passende Archiv für dein Betriebssystem (**Windows**, **Linux / ChromeOS** oder **macOS**) direkt unter [**Releases**](../../releases) herunter.
2. Entpacke das Archiv in einen beliebigen Ordner und starte die ausführbare Datei. Spielstände (`user_data.db`) werden automatisch lokal angelegt.
#### B. Direkt aus dem Quellcode starten (Entwicklung)
Voraussetzung ist **Python 3.11+** (inkl. `tkinter`):
~~~bash
pip install pillow pygame
python3 main.py
~~~
#### C. Lokales Build-Skript (Einzel-OS & Cross-Platform)
Über das mitgelieferte Build-Skript lassen sich eigenständige Pakete inkl. aller Ressourcen (`resources/`) erzeugen. Über Parameter kann gesteuert werden, ob nur für das aktuell laufende System oder für alle Zielplattformen gebaut wird:
~~~bash
# Nur für das aktuell genutzte Betriebssystem bauen:
python3 build.py --target current
# Für alle unterstützten Zielsysteme bauen (Windows, Linux/ChromeOS, macOS):
#### D. Stammdatenbank (`internal_base.db`) & Qualitätsprüfung
Die Datei `resources/code_res/internal_base.db` wird **komplett fertig und einsatzbereit mitgeliefert**.
Werden während der Entwicklung Übersetzungen oder Spielvarianten in `resources/code_res/sql/*.sql` geändert, lässt sich die Datenbank jederzeit neu erzeugen und statisch gegen alle `t(...)`-Aufrufe sowie Architektur-Regeln prüfen:
~~~powershell
# Stammdatenbank neu aufbauen & alle i18n-Keys (inkl. verschachtelter Konstanten) prüfen:
.\build_scripts\check_i18n.ps1 -RebuildDb
# Projektweit prüfen, dass jede Python-Datei maximal eine Klasse enthält:
1.**Striktes 1-Klasse-pro-Datei-Prinzip** für klare Zuständigkeiten (automatisiert prüfbar via `check_multi_class_files.ps1`).
2.**Keine Hardcodings:** Alle UI-Texte (`DE`/`EN`) liegen in `base_i18n` (`resources/code_res/sql/`), SQL-Abfragen in `sql_queries.py`, Konstanten in `game_constants.py`.
3.**Plugin-Einstiegspunkt:** Jedes Spielmodul besitzt eine `start.py` mit `GAME_TITLE_KEY`, `GAME_FOLDER_ID`, `GAME_CATEGORY` und `start_game(context)` und wird automatisch vom `GameLoader` eingebunden.
**The Goth Cardgame Collection** is a modular desktop card game suite crafted in a dark Gothic aesthetic using **Python 3.11+**, **Tkinter**, **Pillow (PIL)**, **Pygame (Audio)**, and **SQLite3**.
Every game runs as a self-contained module with **strictly isolated progression (XP & Prestige Ranks)**, dedicated statistics, and—for gambling titles—an independent Gold pouch economy with lasting consequences.
---
### 2. Core Features & Architecture
* **Flat 4-Category Navigation (no nested subcategories):**
* **Luck (`luck`):** High-consequence table games with dedicated Gold pouches, *Divine Punishment*, and *The Devil's Deal* (**Blackjack**, **Texas Hold'em**).
* **260 Prestige Ranks** (0–258 across Roman tiers `I–V`, followed by uncapped **Deity** levels from rank 259 onward), tracked independently per game (`game_progress`).
* **Isolated Gold Economy, Divine Punishment & The Devil's Deal:**
* Up to **5 dedicated Gold Pouches** per gambling game and profile (`1,000 Gold` starting bankroll each).
* **XP-to-Gold Exchange:** Base rate of `10,000 XP` for `+10 Gold` drawn strictly from that specific game's XP pool.
* **Divine Punishment:** Once a profile has ever reached *Deity* in a game, exchanging XP costs $10\times$ the average XP of the previous level, dropping no lower than the floor of *Creator Spirit V*.
* **The Devil's Deal:** At the *Creator Spirit V* floor, players may permanently sacrifice another soul profile (holding at least **Support I** in that **exact same game**) for `+10 Gold`. Active pacts lock navigation and enforce auto-save/resume until the hand is resolved.
* **Centralized Bars (`GothTopbar` &`SolitaireBottomBar`):** Streamlined universal topbar (featuring zero-relayout Level/XP badge updates) paired with a framed bottom HUD & action bar with dynamic left/right overflow wings for compact screens (such as `1366×768`).
* **Unified Statistics Overlay (`UnifiedStatsView`):** Single full-screen overlay accessible from any active table without destroying the underlying game state, featuring filters for overall profile stats, individual games, variants, and Blackjack/Poker Gold pouches.
* **Combined Settings Dialog, `GothSwitch`& Hover Tooltips:** Combines live **DE / EN** language switching, dual-channel audio sliders (Ambiance/Music & SFX), and a custom-animated toggle switch (`GothSwitch`) that globally enables or disables clean `Helvetica` hover tooltips across action buttons.
* **Guaranteed Solvable Deals & 4 Difficulty Tiers:** Pre-verified deals via dedicated solvers and constructive reverse generators ranging from *Tier 1 – Acolyte (Easy)* to *Tier 4 – Deity (Merciless)*.
* **Smooth 60fps Animations (`CardFlightAnimator`):** Non-blocking cubic ease-out card flights, invalid-drop snap-back, and zero-lag `flush()` during rapid click sequences.
* **UX, Persistence & Fair Consequences:** Game timer waits until the first actual card/stock/hint interaction, auto-pauses when the window loses focus, saves every step with unlimited `Ctrl+Z` back to move $0$ plus `⟲ Reset Deal` (`Ctrl+Shift+Z`), and detects deadlocks automatically. Forfeiting an active deal deducts $40\,\%$ of a standard win's XP (protected by the *Creator Spirit V* floor).
* Custom per-game icons (`resources/images/game_icons/*.ico`) rendered on main menu tiles with automatic badge cropping and rounded supersampled corners, transparent RGBA tables (`poker_table.png`) with dynamic box sizing (`box_background.png`), and seamless background slicing.
* Runtime `.ttf` font loader (`OldLondon.ttf`, `OldLondonAlternate.ttf`) requiring zero OS-level font installation on **Windows**, **Linux**, **ChromeOS (Crostini)**, and **macOS**.
* Cross-platform window & taskbar icon support (`game_icon.ico`) plus automatic window size, position, and maximized/fullscreen persistence (`WindowStatePersistence`).
---
### 3. Included & Planned Modules
| Category | Game | Status | Variants & Highlights | Module Docs |
1. Download the pre-built release archive for your platform (**Windows**, **Linux / ChromeOS**, or **macOS**) from [**Releases**](../../releases).
2. Extract the archive and launch the executable. Save data (`user_data.db`) is created automatically in the local directory.
#### B. Running from Source (Development)
Requires **Python 3.11+** (with `tkinter`):
~~~bash
pip install pillow pygame
python3 main.py
~~~
#### C. Local & Cross-Platform Build Script
The repository includes a build script capable of packaging standalone builds either quickly for your active host OS or across all supported target platforms via CLI flags:
~~~bash
# Build only for the currently running OS:
python3 build.py --target current
# Build release packages for all target platforms:
#### D. Static Core Database (`internal_base.db`) & QA Scripts
`resources/code_res/internal_base.db` is **shipped ready-to-use** out of the box—no database setup step is needed to play.
When modifying localization keys or variants inside `resources/code_res/sql/*.sql`, you can rebuild the database and run full static verification via PowerShell:
# Enforce the strict one-class-per-file rule across the entire codebase:
.\build_scripts\check_multi_class_files.ps1
~~~
---
### 5. Architecture Guidelines
1.**Strict One-Class-Per-File Rule** for clean separation of concerns (verifiable via `check_multi_class_files.ps1`).
2.**Zero Hardcoding:** All localized strings (`DE`/`EN`) live in `base_i18n` (`resources/code_res/sql/`), SQL statements in `sql_queries.py`, and constants in `game_constants.py`.
3.**Plugin Entry Point:** Every game module exposes a `start.py` defining `GAME_TITLE_KEY`, `GAME_FOLDER_ID`, `GAME_CATEGORY`, and `start_game(context)` for automatic discovery by `GameLoader`.
4.**Line Endings:**`.gitattributes` enforces clean `LF` line endings across source and SQL files on all platforms.