Recon caps at the threat's total; leads kept once fully scouted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-19 15:39:02 +01:00
parent b248a030ea
commit 43b7a3a193
3 changed files with 23 additions and 6 deletions

11
game.py
View file

@ -1102,14 +1102,15 @@ def _complete(world: dict, player: dict, action: dict, now: float, rng: random.R
xp = xp // 3
if action.get("special") == "recon":
event = upcoming_raid(world)
if event:
# Once a threat is fully scouted, scouting only trains the skill (and keeps the informant's leads).
if event and event["recon"] < intel_costs(event)[-1]:
city = world["city"]
gain = recon_gain(world, action)
# An informant's leads double the reconnaissance (and the XP) of whoever follows them up.
boost = min(city.get("recon_boost", 0), gain)
city["recon_boost"] = city.get("recon_boost", 0) - boost
xp *= 1 + boost / gain
event["recon"] += gain + boost
event["recon"] = min(intel_costs(event)[-1], event["recon"] + gain + boost)
if action.get("special") == "problem" and action["skill"] != "combat":
_work_problem(world, player, action, now)
threat = upcoming_raid(world) if action.get("special") == "drill" else None
@ -1597,7 +1598,7 @@ def _city_hour(world: dict, now: float) -> None:
city["construction"]["labour"] += pop * TOWNSFOLK_LABOUR
threat = upcoming_raid(world)
if threat and building_level(world, "spymaster"):
threat["recon"] += SPYMASTER_AGENTS * building_level(world, "spymaster")
threat["recon"] = min(intel_costs(threat)[-1], threat["recon"] + SPYMASTER_AGENTS * building_level(world, "spymaster"))
city["food_due"] += (pop * 0.5 / 24 * city_rate(world, "food") * (1.5 if city.get("cold") else 1)
* (0.9 if fitted(world, "grain_bins") else 1))
stock = city["stockpile"]
@ -1738,13 +1739,13 @@ def event_view(world: dict, event: dict, now: float) -> dict:
"""What the city knows about an upcoming event, filtered by intel."""
level = intel_level(world, event, now)
half = WINDOW_HOURS[level] * HOUR / speed(world)
costs = intel_costs(event)
costs = intel_costs(event) if "strength" in event else [0, 0, 0]
centre = event["fire_at"] + event["jitter"] * half * 0.6
view = {
"id": event["id"], "kind": event["kind"], "intel": level,
"earliest": max(now, centre - half), "latest": max(now, centre + half),
"exact": event["fire_at"] if level >= 3 else None,
"recon": int(event["recon"]), "recon_full": costs[-1],
"recon": int(min(event["recon"], costs[-1])), "recon_full": costs[-1],
"recon_next": max(0, round(costs[level] - event["recon"])) if level < 3 else 0,
}
if event["kind"] == "dragon":