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

@@ -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'),