Update product definitions and revenue calculations in Falukant: Adjust product sell costs and production times for better balance. Refactor revenue calculations to focus on profit per minute instead of revenue per minute. Enhance localization files to include new terms related to product unlocks and certificate levels in English, German, and Spanish, improving user experience across languages.

This commit is contained in:
Torsten Schulz (local)
2026-03-26 20:19:49 +01:00
parent 01849c8ffe
commit e0c3b472db
10 changed files with 303 additions and 43 deletions

View File

@@ -20,7 +20,7 @@
</tr>
</thead>
<tbody>
<tr v-for="product in products" :key="product.id" :class="{ highlight: product.id === productWithMaxRevenuePerMinute?.id }">
<tr v-for="product in products" :key="product.id" :class="{ highlight: product.id === productWithMaxProfitPerMinute?.id }">
<td>{{ $t(`falukant.product.${product.labelTr}`) }}</td>
<td>{{ product.knowledges && product.knowledges[0] ? product.knowledges[0].knowledge : 0 }}</td>
<td>{{ calculateProductRevenue(product).absolute }}</td>
@@ -64,12 +64,12 @@
};
},
computed: {
productWithMaxRevenuePerMinute() {
productWithMaxProfitPerMinute() {
if (!this.products || this.products.length === 0) return null;
return this.products.reduce((maxProduct, currentProduct) => {
const currentRevenue = parseFloat(this.calculateProductRevenue(currentProduct).perMinute);
const maxRevenue = maxProduct ? parseFloat(this.calculateProductRevenue(maxProduct).perMinute) : 0;
return currentRevenue > maxRevenue ? currentProduct : maxProduct;
const currentProfit = parseFloat(this.calculateProductProfit(currentProduct).perMinute);
const maxProfit = maxProduct ? parseFloat(this.calculateProductProfit(maxProduct).perMinute) : Number.NEGATIVE_INFINITY;
return currentProfit > maxProfit ? currentProduct : maxProduct;
}, null);
},
},
@@ -223,4 +223,4 @@
font-style: italic;
}
</style>