International marketing: a monthly budget builds up reach abroad

The reach grows over a year or two towards what the budget holds, falls
faster when the budget is cut, and brings income every month by league and
prestige. The investments page sets the budget and shows reach and income.

Engine: marketing.hpp, read advertising.internationalMarketing, command
marketing.commit; saved in state/modern.json. Also fixes the monthly amount
on the naming rights tile, which was shown a hundredth too small.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-17 16:33:10 +01:00
1 parent 97acf0d74d
commit 7b3f52d809
18 files changed
+327 -7

No files matched your search

+13
View File
@@ -194,6 +194,11 @@ void save_world_career(const std::filesystem::path& path, const World& world, co
return J(std::move(rows));
}()},
{"dismissals", state.dismissals},
{"marketing", [&] {
A rows;
for (const auto& m : state.marketing) rows.push_back(O{{"budget", int64_t(m.budget)}, {"reach", int64_t(m.reach)}});
return J(std::move(rows));
}()},
{"stadiums", [&] {
A rows;
for (const auto& s : state.stadiums)
@@ -276,6 +281,14 @@ SavedWorldCareer load_world_career(const std::filesystem::path& path, const Worl
if (const auto it = o->find("dismissals"); it != o->end() && std::holds_alternative<bool>(it->second.value))
out.state.dismissals = std::get<bool>(it->second.value);
}
// international marketing (since 17 November 2026)
if (o->count("marketing"))
for (const J& row : arr(get(modern, "marketing"))) {
ModernState::Marketing m;
m.budget = int32_t(num(get(row, "budget"))), m.reach = uint16_t(num(get(row, "reach")));
if (m.budget < 0 || m.budget > 500000 || m.reach > 1000) fail("invalid marketing state");
out.state.marketing.push_back(m);
}
// stadium names and naming rights (since 17 November 2026)
if (o->count("stadiums"))
for (const J& row : arr(get(modern, "stadiums"))) {