From 162e908c1c2d03aaf102046a996d89d6f870d773 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Mon, 13 Apr 2026 12:21:24 +0200 Subject: [PATCH] feat(falukant): add 'lover_breakup_risk_high' event handling and localization updates - Introduced a new event type for high breakup risk in relationships, including a sample payload for integration. - Updated the MessagesDialog component to handle new parameters related to breakup risk. - Added translations for the new event in Cebuano, German, English, Spanish, and French to enhance user understanding of relationship dynamics. - Enhanced documentation to reflect the new notification structure for high breakup risk events. --- docs/FALUKANT_LOVERS_DAEMON_HANDOFF.md | 16 ++++++++++++ docs/FALUKANT_LOVERS_DAEMON_SPEC.md | 17 ++++++++++++ .../components/falukant/MessagesDialog.vue | 26 +++++++++++++++++++ frontend/src/i18n/locales/ceb/falukant.json | 4 +++ frontend/src/i18n/locales/de/falukant.json | 4 +++ frontend/src/i18n/locales/en/falukant.json | 4 +++ frontend/src/i18n/locales/es/falukant.json | 4 +++ frontend/src/i18n/locales/fr/falukant.json | 4 +++ 8 files changed, 79 insertions(+) diff --git a/docs/FALUKANT_LOVERS_DAEMON_HANDOFF.md b/docs/FALUKANT_LOVERS_DAEMON_HANDOFF.md index e73091f..cb1195f 100644 --- a/docs/FALUKANT_LOVERS_DAEMON_HANDOFF.md +++ b/docs/FALUKANT_LOVERS_DAEMON_HANDOFF.md @@ -128,6 +128,22 @@ Optional: - Notification - Ereignislog +Empfohlene Notification für hohes Trennungsrisiko: + +```json +{ + "tr": "random_event.lover_breakup_risk_high", + "event_id": "lover_breakup_risk_high", + "event_type": "family", + "relationship_id": 123, + "risk_percent": 42, + "affection": 18, + "visibility": 61, + "discretion": 23, + "months_underfunded": 2 +} +``` + ## Pflichtlogik Monthly Tick Der externe Daemon muss monatlich: diff --git a/docs/FALUKANT_LOVERS_DAEMON_SPEC.md b/docs/FALUKANT_LOVERS_DAEMON_SPEC.md index a86320c..3ee9e41 100644 --- a/docs/FALUKANT_LOVERS_DAEMON_SPEC.md +++ b/docs/FALUKANT_LOVERS_DAEMON_SPEC.md @@ -560,6 +560,23 @@ Mögliche Ereignisse: - Forderung nach höherem Unterhalt - kirchlicher Tadel - Erpressung +- akutes Trennungsrisiko bei Liebschaft (`lover_breakup_risk_high`) + +Beispiel-Payload für `lover_breakup_risk_high`: + +```json +{ + "tr": "random_event.lover_breakup_risk_high", + "event_id": "lover_breakup_risk_high", + "event_type": "family", + "relationship_id": 123, + "risk_percent": 42, + "affection": 18, + "visibility": 61, + "discretion": 23, + "months_underfunded": 2 +} +``` - Kind wird bekannt ## Kinder aus Liebschaften diff --git a/frontend/src/components/falukant/MessagesDialog.vue b/frontend/src/components/falukant/MessagesDialog.vue index 8d59041..72bc079 100644 --- a/frontend/src/components/falukant/MessagesDialog.vue +++ b/frontend/src/components/falukant/MessagesDialog.vue @@ -170,6 +170,14 @@ export default { let key = raw; let params = {}; + // Fallback: Manche Daemon-Events liefern event_id/event_type, aber kein tr. + if ((!raw || !String(raw).trim()) && payload?.event_id) { + raw = payload.event_type === 'random_event' + ? `random_event.${payload.event_id}` + : String(payload.event_id); + key = raw; + } + // 1) JSON-Format unterstützen: {"tr":"random_event.windfall","amount":1000,"characterName":"Max"} if (typeof raw === 'string') { const trimmed = raw.trim(); @@ -353,6 +361,24 @@ export default { if (base.amount !== undefined) { params.amount = base.amount; } + if (base.risk_percent !== undefined) { + params.risk_percent = base.risk_percent; + } + if (base.affection !== undefined) { + params.affection = base.affection; + } + if (base.visibility !== undefined) { + params.visibility = base.visibility; + } + if (base.discretion !== undefined) { + params.discretion = base.discretion; + } + if (base.months_underfunded !== undefined) { + params.months_underfunded = base.months_underfunded; + } + if (base.relationship_id !== undefined) { + params.relationship_id = base.relationship_id; + } if (base.deceased && typeof base.deceased === 'object') { if (base.deceased.display_name) { diff --git a/frontend/src/i18n/locales/ceb/falukant.json b/frontend/src/i18n/locales/ceb/falukant.json index 66b28ef..8f5c2d5 100644 --- a/frontend/src/i18n/locales/ceb/falukant.json +++ b/frontend/src/i18n/locales/ceb/falukant.json @@ -99,6 +99,10 @@ "earthquake": { "title": "Linog", "description": "Naigo sa linog ang rehiyon nga {regionName}." + }, + "lover_breakup_risk_high": { + "title": "Krisis sa relasyon", + "description": "Ang usa ka affair hapit na mabuwag. Risgo: {risk_percent}% · Affection {affection}, visibility {visibility}, discretion {discretion}, underfunded sulod sa {months_underfunded} ka bulan." } } }, diff --git a/frontend/src/i18n/locales/de/falukant.json b/frontend/src/i18n/locales/de/falukant.json index 52de3dc..d27feed 100644 --- a/frontend/src/i18n/locales/de/falukant.json +++ b/frontend/src/i18n/locales/de/falukant.json @@ -101,6 +101,10 @@ "earthquake": { "title": "Erdbeben", "description": "Ein Erdbeben hat die Region {regionName} erschüttert." + }, + "lover_breakup_risk_high": { + "title": "Krise in einer Liebschaft", + "description": "Eine Liebschaft steht vor dem Aus. Risiko: {risk_percent}% · Zuneigung {affection}, Sichtbarkeit {visibility}, Diskretion {discretion}, Unterversorgung {months_underfunded} Monate." } , "taxes": { diff --git a/frontend/src/i18n/locales/en/falukant.json b/frontend/src/i18n/locales/en/falukant.json index 11f9b78..3eba021 100644 --- a/frontend/src/i18n/locales/en/falukant.json +++ b/frontend/src/i18n/locales/en/falukant.json @@ -99,6 +99,10 @@ "earthquake": { "title": "Earthquake", "description": "An earthquake has shaken the region {regionName}." + }, + "lover_breakup_risk_high": { + "title": "Affair in Crisis", + "description": "An affair is close to breaking up. Risk: {risk_percent}% · Affection {affection}, visibility {visibility}, discretion {discretion}, underfunded for {months_underfunded} months." } } }, diff --git a/frontend/src/i18n/locales/es/falukant.json b/frontend/src/i18n/locales/es/falukant.json index 3bddbcd..6fc963c 100644 --- a/frontend/src/i18n/locales/es/falukant.json +++ b/frontend/src/i18n/locales/es/falukant.json @@ -102,6 +102,10 @@ "title": "Terremoto", "description": "Un terremoto ha sacudido la región {regionName}." }, + "lover_breakup_risk_high": { + "title": "Crisis en una relación", + "description": "Una relación está cerca de romperse. Riesgo: {risk_percent}% · Afecto {affection}, visibilidad {visibility}, discreción {discretion}, con fondos insuficientes durante {months_underfunded} meses." + }, "taxes": { "title": "Impuestos", "loading": "Cargando datos de impuestos...", diff --git a/frontend/src/i18n/locales/fr/falukant.json b/frontend/src/i18n/locales/fr/falukant.json index 800eeec..d3f29f2 100644 --- a/frontend/src/i18n/locales/fr/falukant.json +++ b/frontend/src/i18n/locales/fr/falukant.json @@ -102,6 +102,10 @@ "title": "tremblement de terre", "description": "Un tremblement de terre a frappé la région {regionName}." }, + "lover_breakup_risk_high": { + "title": "Crise dans une liaison", + "description": "Une liaison est proche de la rupture. Risque : {risk_percent}% · Affection {affection}, visibilité {visibility}, discrétion {discretion}, sous-financée depuis {months_underfunded} mois." + }, "taxes": { "title": "Diriger", "loading": "Chargement des données fiscales...",