feat: More bonus (exponential) and method to list icons needed

This commit is contained in:
gauvainboiche
2026-10-08 14:20:58 +02:00
parent fc0d5e3ba4
commit a88b8f5f14
25 changed files with 977 additions and 40 deletions
+5 -4
View File
@@ -1,7 +1,7 @@
// Main game view. Static markup lives in index.html; this module binds the
// controls once, builds the generator/upgrade lists, and refreshes the numbers.
import { generatorQuote, isUnlocked, upgradeVisible } from '../engine/engine.js';
import { generatorQuote, isUnlocked, materialPurchase, upgradeVisible } from '../engine/engine.js';
import { t } from '../services/i18n.js';
import { $, h, icon, refreshStaticIcons } from './dom.js';
@@ -232,15 +232,16 @@ export function createView(actions) {
setText(el.makeYield, t('ui.makeYield', { amount: fmt.number(d.clickYield) }));
el.make.disabled = state.material < d.materialPerUnit;
const purchase = materialPurchase(state, d); // a partial lot when funds are short
setText(
el.buyMaterialInfo,
t('ui.batchInfo', {
amount: fmt.number(d.batchSize),
cost: money(d.batchCost),
amount: fmt.number(Math.floor(purchase.amount || d.batchSize)),
cost: money(purchase.amount ? purchase.cost : d.batchCost),
trend: TREND[state.materialTrend] ?? '',
}),
);
el.buyMaterial.disabled = state.funds < d.batchCost;
el.buyMaterial.disabled = purchase.amount <= 0;
updateMarket(state, d);
updateGenerators(state, d);