feat(falukant): add improve lover affection feature and localization updates
All checks were successful
Deploy to production / deploy (push) Successful in 2m49s

- Introduced the `improveLoverAffection` method in FalukantService to enhance relationship dynamics by allowing users to boost affection at a cost.
- Updated FalukantController and FalukantRouter to include the new endpoint for improving lover affection.
- Enhanced FamilyView component to provide a button for users to trigger the affection improvement action.
- Added localization entries for the new feature in multiple languages, ensuring clarity in user interactions regarding affection improvements.
This commit is contained in:
Torsten Schulz (local)
2026-04-14 11:39:42 +02:00
parent 26daf5fed5
commit deb6f5f36c
9 changed files with 138 additions and 0 deletions

View File

@@ -831,6 +831,10 @@
"maintenanceHigh": "Suporta 75",
"maintenanceSuccess": "Na-update ang suporta.",
"maintenanceError": "Dili ma-update ang suporta.",
"improveAffection": "Pauswaga ang pagmahal ({cost})",
"improveAffectionHint": "Mopataas sa pagmahal, mogasto og kwarta, ug mopataas usab sa visibility.",
"improveAffectionSuccess": "Napalig-on ang pagmahal ({cost}). Bag-ong bili: pagmahal {affection}, visibility {visibility}, discretion {discretion}.",
"improveAffectionError": "Dili mapaayo ang pagmahal.",
"acknowledge": "Iila",
"acknowledgeSuccess": "Giila na ang relasyon.",
"acknowledgeError": "Dili ma-ila ang relasyon.",

View File

@@ -805,6 +805,10 @@
"maintenanceHigh": "Unterhalt 75",
"maintenanceSuccess": "Der Unterhalt wurde angepasst.",
"maintenanceError": "Der Unterhalt konnte nicht angepasst werden.",
"improveAffection": "Zuneigung steigern ({cost})",
"improveAffectionHint": "Erhöht Zuneigung, kostet Geld und erhöht zugleich Sichtbarkeit.",
"improveAffectionSuccess": "Die Zuneigung wurde gestärkt ({cost}). Neuer Stand: Zuneigung {affection}, Sichtbarkeit {visibility}, Diskretion {discretion}.",
"improveAffectionError": "Die Zuneigung konnte nicht gesteigert werden.",
"acknowledge": "Anerkennen",
"acknowledgeSuccess": "Die Beziehung wurde offiziell anerkannt.",
"acknowledgeError": "Die Beziehung konnte nicht anerkannt werden.",

View File

@@ -942,6 +942,10 @@
"maintenanceHigh": "Maintenance 75",
"maintenanceSuccess": "Maintenance has been updated.",
"maintenanceError": "Maintenance could not be updated.",
"improveAffection": "Boost affection ({cost})",
"improveAffectionHint": "Raises affection, costs money, and also increases visibility.",
"improveAffectionSuccess": "Affection has been strengthened ({cost}). New values: affection {affection}, visibility {visibility}, discretion {discretion}.",
"improveAffectionError": "Affection could not be improved.",
"acknowledge": "Acknowledge",
"acknowledgeSuccess": "The relationship has been officially acknowledged.",
"acknowledgeError": "The relationship could not be acknowledged.",

View File

@@ -796,6 +796,10 @@
"maintenanceHigh": "Mantenimiento 75",
"maintenanceSuccess": "Se ha ajustado el mantenimiento.",
"maintenanceError": "No se pudo ajustar el mantenimiento.",
"improveAffection": "Mejorar afecto ({cost})",
"improveAffectionHint": "Aumenta el afecto, cuesta dinero y también sube la visibilidad.",
"improveAffectionSuccess": "El afecto ha mejorado ({cost}). Nuevos valores: afecto {affection}, visibilidad {visibility}, discreción {discretion}.",
"improveAffectionError": "No se pudo mejorar el afecto.",
"acknowledge": "Reconocer",
"acknowledgeSuccess": "La relación ha sido reconocida oficialmente.",
"acknowledgeError": "No se pudo reconocer la relación.",

View File

@@ -794,6 +794,10 @@
"maintenanceHigh": "Entretien 75",
"maintenanceSuccess": "L'entretien a été ajusté.",
"maintenanceError": "La maintenance n'a pas pu être ajustée.",
"improveAffection": "Renforcer laffection ({cost})",
"improveAffectionHint": "Augmente laffection, coûte de largent et augmente aussi la visibilité.",
"improveAffectionSuccess": "Laffection a été renforcée ({cost}). Nouvelles valeurs : affection {affection}, visibilité {visibility}, discrétion {discretion}.",
"improveAffectionError": "Laffection na pas pu être améliorée.",
"acknowledge": "Reconnaître",
"acknowledgeSuccess": "La relation a été officiellement reconnue.",
"acknowledgeError": "La relation n'a pas pu être reconnue.",

View File

@@ -437,6 +437,13 @@
<button class="button button--secondary" @click="setLoverMaintenance(lover, 75)">
{{ $t('falukant.family.lovers.actions.maintenanceHigh') }}
</button>
<button
class="button button--secondary"
@click="improveLoverAffection(lover)"
:title="$t('falukant.family.lovers.actions.improveAffectionHint', { cost: formatCost(loverAffectionActionCost) })"
>
{{ $t('falukant.family.lovers.actions.improveAffection', { cost: formatCost(loverAffectionActionCost) }) }}
</button>
<button
v-if="!lover.acknowledged"
class="button button--secondary"
@@ -504,6 +511,7 @@ const MARRIAGE_GIFT_COSTS = {
decent: 80,
lavish: 180
}
const LOVER_AFFECTION_ACTION_COST = 60
export default {
name: 'FamilyView',
@@ -548,6 +556,9 @@ export default {
marriageGiftCosts() {
return MARRIAGE_GIFT_COSTS;
},
loverAffectionActionCost() {
return LOVER_AFFECTION_ACTION_COST;
},
partnerSummaryLine() {
if (this.relationships?.length > 0) {
const r = this.relationships[0];
@@ -847,6 +858,25 @@ export default {
}
},
async improveLoverAffection(lover) {
try {
const { data } = await apiClient.post(`/api/falukant/family/lover/${lover.relationshipId}/improve-affection`);
await this.loadFamilyData();
showSuccess(
this,
this.$t('falukant.family.lovers.actions.improveAffectionSuccess', {
cost: this.formatCost(data?.cost ?? this.loverAffectionActionCost),
affection: data?.affection ?? '—',
visibility: data?.visibility ?? '—',
discretion: data?.discretion ?? '—',
})
);
} catch (error) {
console.error('Error improving lover affection:', error);
showError(this, this.$t('falukant.family.lovers.actions.improveAffectionError'));
}
},
async endLoverRelationship(lover) {
const confirmed = await confirmAction(this, {
title: this.$t('falukant.family.lovers.actions.end'),