diff --git a/.gitignore b/.gitignore index 231c729..7d5cdb6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ __pycache__ .venv *.pdf *.db +*.json +*.csv diff --git a/solve.py b/solve.py index 61338d7..3cd34e0 100644 --- a/solve.py +++ b/solve.py @@ -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: