Enhance Falukant family and production dynamics: Updated FalukantFamilyWorker to include public stability and household tension calculations, integrating new SQL queries for managing marriage states and household attributes. Added FalukantCertificateWorker for production certificate management, enhancing overall family interaction and production tracking.
This commit is contained in:
41
docs/FALUKANT_PRODUCTION_CERTIFICATE.md
Normal file
41
docs/FALUKANT_PRODUCTION_CERTIFICATE.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Falukant: Produktionszertifikate (Daemon)
|
||||
|
||||
Der **`FalukantCertificateWorker`** berechnet einmal täglich die Zielstufe und schreibt `falukant_user.certificate` fort (max. **+1** pro Tag, keine normale Herabstufung).
|
||||
|
||||
## SQL
|
||||
|
||||
- `QUERY_GET_PRODUCTION_CERTIFICATE_INPUT_ROWS` – Eingangsdaten je Falukant-User (Spielercharakter, Wissen, Produktionen, Ämter, Haus …)
|
||||
- `QUERY_UPDATE_FALUKANT_USER_CERTIFICATE` – Update der Stufe
|
||||
|
||||
## Logik (Kurz)
|
||||
|
||||
- `certificateScore` aus gewichteten Punktwerten (Wissen, Produktion, Amt, Adel, Ruf, Haus)
|
||||
- `raw_target` aus Score-Schwellen (1.2 / 2.1 / 3.0 / 4.0)
|
||||
- `effective_target` mit Mindestanforderungen je Stufe (Spec §4.5)
|
||||
- Aufstieg nur wenn `effective_target > current` → **`current + 1`** (gegen `effective_target` begrenzt)
|
||||
- **Bankrott** (`money <= -5000`): Zertifikat auf **1**, mit Event
|
||||
|
||||
## Politische Ämter
|
||||
|
||||
Rang aus **`political_office_type.name`** (Substring-Heuristik im Daemon, ohne DB-Änderung). Anpassung über `political_name_to_rank` in `falukant_certificate.rs`.
|
||||
|
||||
## Kirchliche Ämter
|
||||
|
||||
`officePoints` aus **`max(hierarchy_level)`** der aktiven `church_office`-Zeilen (gekappt 0–5).
|
||||
|
||||
## Abgeschlossene Produktionen
|
||||
|
||||
**`COUNT(*)`** aus `falukant_log.production` mit `producer_id = falukant_user.id` (Zeilen = aggregierte Log-Einträge).
|
||||
|
||||
## Events (WebSocket)
|
||||
|
||||
Bei Änderung der Stufe:
|
||||
|
||||
1. `falukantUpdateProductionCertificate` mit `reason: "daily_recalculation"`, `old_certificate`, `new_certificate`
|
||||
2. `falukantUpdateStatus`
|
||||
|
||||
## Nicht umgesetzt (optional / später)
|
||||
|
||||
- **Tod ohne Erben** / Zertifikats-Reset
|
||||
- Feinere **Bankrott**-Definition
|
||||
- **`political_office_history`** (nicht im Repo)
|
||||
Reference in New Issue
Block a user