Better collect descriptions and capitalist bug fix
Capitalist only gives capital on hub collecting capital now
This commit is contained in:
parent
63154d8e23
commit
f36ba39e58
2 changed files with 16 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -2,3 +2,5 @@ __pycache__
|
||||||
.venv
|
.venv
|
||||||
*.pdf
|
*.pdf
|
||||||
*.db
|
*.db
|
||||||
|
*.json
|
||||||
|
*.csv
|
||||||
|
|
|
||||||
16
solve.py
16
solve.py
|
|
@ -1021,20 +1021,28 @@ class _Builder:
|
||||||
# so these never co-occur with the Planner's Overwork doubling.
|
# so these never co-occur with the Planner's Overwork doubling.
|
||||||
# Baron -> +N Trade Goods (N = bonus per Bastion)
|
# Baron -> +N Trade Goods (N = bonus per Bastion)
|
||||||
# Artificer -> +1 Trade Good
|
# Artificer -> +1 Trade Good
|
||||||
# Capitalist -> +2 Capital
|
# Capitalist -> +2 Capital (only on a Hub collecting Capital)
|
||||||
# Vinter -> +2 Luxuries
|
# Vinter -> +2 Luxuries
|
||||||
for resource, attr in (
|
for resource, attr in (
|
||||||
("trade_goods", "bonus_trade_goods"),
|
("trade_goods", "bonus_trade_goods"),
|
||||||
("capital", "bonus_capital"),
|
|
||||||
("luxuries", "bonus_luxuries"),
|
("luxuries", "bonus_luxuries"),
|
||||||
):
|
):
|
||||||
bonus = self._bonus_collect_expr(ci, t, attr)
|
bonus = self._bonus_collect_expr(ci, t, attr)
|
||||||
if bonus is not None:
|
if bonus is not None:
|
||||||
self._add_delta(resource, t, self._gate_expr(bonus, collect))
|
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
|
# store detail
|
||||||
self._collect_detail[(ci, t)] = dict(
|
self._collect_detail[(ci, t)] = dict(
|
||||||
hub_lux=hub_lux_choice,
|
hub_lux=hub_lux_choice,
|
||||||
|
hub_cap=hub_cap_choice,
|
||||||
|
monument=mon_active,
|
||||||
)
|
)
|
||||||
# NOTE: Foundry collection handled in _build_vats.
|
# 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), {})
|
cd = b._collect_detail.get((ci, t), {})
|
||||||
if "hub_lux" in cd and solver.Value(cd["hub_lux"]) == 1:
|
if "hub_lux" in cd and solver.Value(cd["hub_lux"]) == 1:
|
||||||
detail = "hub: +2 luxuries"
|
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:
|
else:
|
||||||
detail = "collect"
|
detail = "collect"
|
||||||
elif chosen == Action.UPGRADE:
|
elif chosen == Action.UPGRADE:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue