From 71dad18e8de23f693166759b2bcce27091795fde Mon Sep 17 00:00:00 2001 From: Adrien Jaguenet Date: Tue, 22 Sep 2026 15:28:11 +0200 Subject: [PATCH] Let central banks work their reserves and cleared the landlocked famines Central banks now redeem the national money foreign banks hold, sell reserves to defend a weak rate, and cover part of strategic imports from reserves. Five repeatable technologies raise each commodity's output per unit of energy. Hostile troops on a road or sea lane sever trade, power and unit supply. Middlemen buy food to resell to neighbours at a markup, and starving regions buy before those topping up their buffers, which clears the landlocked famines. The economic map's trade graph gains a colour legend. --- client/css/style.css | 33 ++++++ client/index.html | 4 + client/js/map_view.js | 2 + client/js/map_view/modes.js | 30 +++++ client/js/modals/format.js | 10 ++ shared/data/economy.js | 18 +++ shared/data/effects.js | 9 ++ shared/data/resources.js | 26 +++++ shared/data/technologies.js | 64 +++++++++++ shared/game_state/industry.js | 18 +++ shared/game_state/money.js | 185 ++++++++++++++++++++++++++++-- shared/game_state/resources.js | 141 +++++++++++++++++++++-- tests/central_bank_fx_test.js | 92 +++++++++++++++ tests/food_security_test.js | 43 +++++++ tests/map_modes_test.js | 34 ++++++ tests/resource_efficiency_test.js | 114 ++++++++++++++++++ tests/trade_route_test.js | 55 +++++++++ 17 files changed, 857 insertions(+), 21 deletions(-) create mode 100644 tests/central_bank_fx_test.js create mode 100644 tests/food_security_test.js create mode 100644 tests/resource_efficiency_test.js create mode 100644 tests/trade_route_test.js diff --git a/client/css/style.css b/client/css/style.css index 440ffb1..c0e2bba 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -754,6 +754,39 @@ input:focus, select:focus { border-color: var(--accent); } color: var(--text); font-variant-numeric: tabular-nums; } +/* The trade-route key, shown under the colour scale in the economic modes. */ +.map-legend-graph { + margin-top: 10px; + border-top: 1px solid var(--panel-border); + padding-top: 8px; +} +.map-legend-resources { + display: flex; + flex-direction: column; + gap: 4px; + font-size: 11px; + color: var(--text); +} +.map-legend-resource { + display: flex; + align-items: center; + gap: 6px; +} +.map-legend-swatch { + width: 16px; + height: 3px; + border-radius: 2px; + flex: none; +} +.map-legend-node { + width: 8px; + height: 8px; + margin: 0 4px; + border-radius: 50%; + background: #ffffff; + border: 1px solid rgba(0, 0, 0, 0.6); + flex: none; +} /* The inspected tile / city panel is anchored to the bottom right. */ #tile-panel { diff --git a/client/index.html b/client/index.html index a9bf023..a2eb631 100644 --- a/client/index.html +++ b/client/index.html @@ -136,6 +136,10 @@ +