Reconnaissance: new tiers, spyglass, lost hunters

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-11-12 10:38:10 +00:00
parent f042a718cd
commit 852c70af01
2 changed files with 46 additions and 5 deletions

31
game.py
View file

@ -135,7 +135,7 @@ TOOLS = {"mining": ("pickaxe", "⛏️"), "woodcutting": ("axe", "🪓"), "farmi
"fishing": ("fishing rod", "🎣"), "hunting": ("hunting knife", "🔪"), "construction": ("hammer", "🔨"),
"smithing": ("chisel", "🔧"), "jewelcrafting": ("gem drill", "🪛"), "cooking": ("cleaver", "🔪"),
"herblore": ("mortar and pestle", "🥣"), "leatherworking": ("awl", "📍"), "tailoring": ("shears", "✂️"),
"firekeeping": ("bellows", "🪭")}
"firekeeping": ("bellows", "🪭"), "reconnaissance": ("spyglass", "🔭")}
TOOL_SPEED = [0.15, 0.30, 0.38, 0.45, 0.52, 0.60]
# Crafting stations: a second slot for every crafting skill, beside its tool, and as fast.
# Builders make every station, from the tier's planks and hardware and a material from
@ -1472,6 +1472,10 @@ ACTIONS = [
devotion=20, city={"temple": 2}, group="Offer at the temple"),
_action("recon_roads", "reconnaissance", "Scout the roads", 1, 60, 12, special="recon", recon=1),
_action("recon_camps", "reconnaissance", "Shadow the war bands", 15, 90, 28, special="recon", recon=2),
_action("recon_fires", "reconnaissance", "Count the campfires", 30, 90, 45, special="recon", recon=3),
_action("recon_slip", "reconnaissance", "Slip into the camp", 45, 120, 80, special="recon", recon=5),
_action("recon_turn", "reconnaissance", "Turn a bandit", 60, 150, 130, special="recon", recon=8),
_action("recon_orders", "reconnaissance", "Steal the war orders", 75, 150, 170, special="recon", recon=10),
# Tending: one log a go into one fire; better logs need more Firekeeping.
*[_action(f"tend_{fire}_{log}", "firekeeping", f"Tend the {spec['name'].lower()}", TIER_LEVELS[tier], 30, 0,
{log: 1}, special="tend", tend=fire, tier=tier, group=spec["name"])
@ -1720,7 +1724,7 @@ RAID_TRAITS = ["lightly armoured, heavy on archers", "mounted and fast, few bows
# --- world ---------------------------------------------------------------
WORLD_VERSION = 45
WORLD_VERSION = 46
HOME_CITY = "guildhall"
CITY_KEYS = ("events", "next_event_at", "next_minor_at", "next_hardship_at", "next_fortune_at", "caravan", "orders")
TRAVEL_TIME = 12 * 60 # game seconds on the road between two towns
@ -2142,6 +2146,11 @@ def migrate(world: dict, now: float | None = None) -> World:
for player in world["players"].values():
player["garrison"] = True
world["version"] = 45
if world["version"] < 46:
# Scouts got a tool slot: the spyglass.
for player in world["players"].values():
player["equip"].setdefault("tool_reconnaissance", None)
world["version"] = 46
return world
@ -6498,11 +6507,13 @@ PROBLEMS = {
"bridge": {"name": "Bridge washed out", "icon": "🌉", "need": {"plank": 25},
"block": {"hunting": "The bridge to the hunting grounds is out"},
"text": "No hunting until the bridge is rebuilt with planks."},
"lost_hunters": {"name": "Hunters lost in the hills", "icon": "🧭", "speed": {"hunting": 1.5}, "work": 10,
"action": "find_hunters", "text": "Hunting slower until scouts find them."},
"hornets": {"name": "Hornets in the woods", "icon": "🐝", "speed": {"woodcutting": 1.4}, "work": 8, "action": "smoke_hornets",
"text": "Woodcutting slower until herbalists smoke them out."},
}
MINOR_THREATS = ("collapse", "wolves", "bear", "goblins", "rockslide", "flood", "boars",
"spiders", "smugglers", "bridge", "hornets")
"spiders", "smugglers", "bridge", "hornets", "lost_hunters")
PROBLEM_ACTIONS = [
_encounter("clear_wolves", "Wolf pack", "Frontier", 4, WOLVES, label="Drive off the wolves",
special="problem", problem="wolves"),
@ -6517,6 +6528,7 @@ PROBLEM_ACTIONS = [
_encounter("catch_smugglers", "Smugglers", "Frontier", 8, SMUGGLERS, gold=6, label="Catch the smugglers",
special="problem", problem="smugglers"),
_action("smoke_hornets", "herblore", "Smoke out the hornets", 1, 40, 12, special="problem", problem="hornets"),
_action("find_hunters", "reconnaissance", "Find the lost hunters", 1, 45, 14, special="problem", problem="lost_hunters"),
]
ACTIONS.extend(PROBLEM_ACTIONS)
ACTION_BY_ID.update({action["id"]: action for action in PROBLEM_ACTIONS})
@ -6857,7 +6869,7 @@ def _fortune(world: dict, now: float, rng: random.Random, kind: str | None = Non
lines.append("The rest moved on. More houses would have kept them.")
_record(world, now, "fortune", kind, "🧳", "Refugees arrived", lines)
elif kind == "master":
skill = rng.choice([s for s in SKILL_IDS if s != "reconnaissance"])
skill = rng.choice(SKILL_IDS)
name = next(s["name"] for s in SKILLS if s["id"] == skill)
_add_effect(world, now, 6, kind="master", name=f"A master of {name.lower()}", icon="🎓",
xp={skill: 1.5}, text=f"{name} +50% XP")
@ -7635,7 +7647,7 @@ PIECE_GLYPHS = {"sword": "pointy-sword", "shield": "round-shield", "helmet": "vi
TOOL_GLYPHS = {"pickaxe": "war-pick", "axe": "wood-axe", "hoe": "sickle", "fishing rod": "fishing-pole",
"hunting knife": "bowie-knife", "hammer": "claw-hammer", "chisel": "chisel", "gem drill": "drill",
"cleaver": "meat-cleaver", "mortar and pestle": "mortar", "awl": "needle-drill", "shears": "shears",
"bellows": "bellows"}
"bellows": "bellows", "spyglass": "spyglass"}
LEATHER_GLYPHS = {"cap": "hood", "legs": "trousers", "body": "leather-vest"}
CLOTH_GLYPHS = {"hood": "pointy-hat", "legs": "trousers", "body": "robe"}
FIBRE_GLYPHS = {"cotton": "cotton-flower", "silk_cocoons": "butterfly", "moonpetal": "lotus-flower",
@ -7703,6 +7715,9 @@ ACTION_GLYPHS = {
"fight_green_dragon": ("dragon-head", "#5fae5a"), "fight_blue_dragon": ("dragon-head", "#4f86d6"),
"fight_red_dragon": ("dragon-head", "#d0503c"), "fight_black_dragon": ("dragon-head", "#8a8f98"),
"sabotage": ("fire-bomb", "#e0703a"), "drill_militia": ("sword-brandish", "#e0a050"), "recon_roads": ("spyglass", "#6f8fec"), "recon_camps": ("spyglass", "#8a7fd0"),
"recon_fires": ("campfire", "#e0a050"), "recon_slip": ("hooded-figure", "#8a8f98"),
"recon_turn": ("hooded-assassin", "#a08060"), "recon_orders": ("scroll-unfurled", "#d4c08a"),
"find_hunters": ("treasure-map", "#a3b86c"),
"labour": ("hammer-nails", "#d1a46a"), "clear_wolves": ("wolf-head", "#9aa1ab"),
"catch_goblins": ("goblin-head", "#8fbf6a"), "drive_bear": ("bear-head", "#8a5a32"), "cull_boars": ("boar", "#a06a4a"),
"catch_rats": ("rat", "#9aa1ab"), "clear_rockslide": ("falling-rocks", "#a8a29e"),
@ -7926,6 +7941,12 @@ ORDER_RECIPES, ORDER_RAW = _order_sources()
# What changed, shown on the Patch notes page. Newest first; every shipped change adds a
# line here (new / balance / fix), and a new release a new entry on top.
PATCH_NOTES = [
{"date": "2026-11-12", "title": "Reconnaissance", "notes": [
("new", "Recon: 4 new scouting actions, Lv 30 / 45 / 60 / 75, 3 / 5 / 8 / 10 recon each."),
("new", "Spyglass: recon tool, smithed from every metal, 15–60% faster scouting."),
("new", "Minor threat: hunters lost in the hills. Hunting 50% slower until scouts find them."),
("balance", "Travelling masters can now teach reconnaissance."),
]},
{"date": "2026-11-11", "title": "Work orders", "notes": [
("new", "Work orders: Gather sends materials straight to the order. Gathering carries on once it's filled."),
]},

View file

@ -685,6 +685,26 @@ class EventTest(unittest.TestCase):
game.tick(world, T0 + 2 * game.HOUR, random.Random(2))
self.assertAlmostEqual(raid["recon"], 2.0)
def test_a_spyglass_speeds_scouting_and_scouts_find_lost_hunters(self):
world = world_with(("sam", "commoner"))
p = world["players"]["sam"]
action = game.ACTION_BY_ID["recon_roads"]
plain = game.action_time(world, p, action)
p["equip"]["tool_reconnaissance"] = "copper_spyglass"
self.assertAlmostEqual(game.action_time(world, p, action), plain * 0.85)
game._minor_threat(world, T0, random.Random(1), "lost_hunters")
self.assertEqual(game.skill_mods(world, game.ACTION_BY_ID["hunt_deer"])["speed"], 1.5)
self.assertIsNone(game.start_action(world, p, "find_hunters", T0))
game.process_player(world, p, T0 + 3600, random.Random(1))
self.assertIsNone(game.active_problem(world, "lost_hunters"))
def test_old_worlds_get_the_spyglass_slot(self):
world = world_with(("sam", "commoner"))
del world["players"]["sam"]["equip"]["tool_reconnaissance"]
world["version"] = 45
game.migrate(world)
self.assertIsNone(world["players"]["sam"]["equip"]["tool_reconnaissance"])
def test_victory_rewards_garrison(self):
world = world_with(("wil", "commoner"))
raid = self.announce(world)