Better collect descriptions and capitalist bug fix

Capitalist only gives capital on hub collecting capital now
This commit is contained in:
Pagwin 2026-06-22 12:33:40 -04:00
parent 63154d8e23
commit f36ba39e58
2 changed files with 16 additions and 2 deletions

2
.gitignore vendored
View file

@ -2,3 +2,5 @@ __pycache__
.venv
*.pdf
*.db
*.json
*.csv

View file

@ -1021,20 +1021,28 @@ class _Builder:
# so these never co-occur with the Planner's Overwork doubling.
# Baron -> +N Trade Goods (N = bonus per Bastion)
# Artificer -> +1 Trade Good
# Capitalist -> +2 Capital
# Capitalist -> +2 Capital (only on a Hub collecting Capital)
# Vinter -> +2 Luxuries
for resource, attr in (
("trade_goods", "bonus_trade_goods"),
("capital", "bonus_capital"),
("luxuries", "bonus_luxuries"),
):
bonus = self._bonus_collect_expr(ci, t, attr)
if bonus is not None:
self._add_delta(resource, t, self._gate_expr(bonus, collect))
# Capitalist's +2 Capital only applies on a Hub taking the Capital
# option, so gate it on hub_cap_choice rather than any Collection.
cap_bonus = self._bonus_collect_expr(ci, t, "bonus_capital")
if cap_bonus is not None:
self._add_delta(
"capital", t, self._gate_expr(cap_bonus, hub_cap_choice)
)
# store detail
self._collect_detail[(ci, t)] = dict(
hub_lux=hub_lux_choice,
hub_cap=hub_cap_choice,
monument=mon_active,
)
# NOTE: Foundry collection handled in _build_vats.
@ -1578,6 +1586,10 @@ def _extract(problem: Problem, b: _Builder, solver, status_name: str) -> Solutio
cd = b._collect_detail.get((ci, t), {})
if "hub_lux" in cd and solver.Value(cd["hub_lux"]) == 1:
detail = "hub: +2 luxuries"
elif "hub_cap" in cd and solver.Value(cd["hub_cap"]) == 1:
detail = "hub: +2 capital"
elif "monument" in cd and solver.Value(cd["monument"]) == 1:
detail = "monument: +2 renown"
else:
detail = "collect"
elif chosen == Action.UPGRADE: