From 7dc780352ccb2b4fc10bb2edf009a297b6f339f7 Mon Sep 17 00:00:00 2001 From: rope Date: Wed, 4 Nov 2026 11:08:03 +0000 Subject: [PATCH] Crucible: 5th fire for silver and gold bars Co-Authored-By: Claude Opus 5.5 --- README.md | 5 +++-- game.py | 17 +++++++++++++---- static/styles.css | 2 +- tests/test_game.py | 30 +++++++++++++++++++++++++----- 4 files changed, 42 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0b7490b..10627f3 100644 --- a/README.md +++ b/README.md @@ -161,8 +161,9 @@ Beta. The core game is in place; changes from here are mostly balance and tuning and combat has Strength and Defence ladders. Health potions (I–VI, the tier's herb and cooked fish) are the one heal you take into a fight. Potions last 50 uses, one per skill at a time; an empty one is replaced from the bank automatically. -- **Firekeeping:** the guild shares four fires: the forge (bars), the kitchen - fire (cooking), the kiln (bricks) and the still (potions). Every craft at a +- **Firekeeping:** the guild shares five fires: the forge (bars), the kitchen + fire (cooking), the kiln (bricks), the still (potions) and the crucible + (silver and gold bars). Every craft at a fire takes one log of its tier as fuel; a fire burning that tier's flame or hotter pays it, and a hot forge takes a coal off every bar (never the last). Anyone can tend any fire: each go feeds one log onto your own pile in it, for diff --git a/game.py b/game.py index 45dfe98..b1cc80d 100644 --- a/game.py +++ b/game.py @@ -177,6 +177,7 @@ FIRES = { "kitchen": {"name": "Kitchen fire", "icon": "🍳", "skill": "cooking", "glyph": "cooking-pot"}, "kiln": {"name": "Kiln", "icon": "🧱", "skill": "construction", "glyph": "brick-pile"}, "still": {"name": "Still", "icon": "⚗️", "skill": "herblore", "glyph": "erlenmeyer"}, + "crucible": {"name": "Crucible", "icon": "💍", "skill": "jewelcrafting", "glyph": "furnace"}, } FLAMES = [("Red", "#ff6a2a"), ("Gold", "#ffcb3d"), ("White", "#eeeaf8"), ("Blue", "#4fa3ff"), ("Green", "#3ed37a"), ("Violet", "#b07cff")] @@ -1068,9 +1069,9 @@ def _jewel_actions() -> list[dict]: {source: PROSPECT_ORE}, finds=[(gem, 1, PROSPECT_ODDS)], group="Prospecting")) actions += [ _action("jc_silver_bar", "jewelcrafting", "Silver bar", 10, 25, 12, {"silver_ore": 1, "logs": 1}, - {"silver_bar": 1}, group="Bars"), - _action("jc_gold_bar", "jewelcrafting", "Gold bar", 40, 30, 32, {"gold_ore": 1, "coal": 1}, - {"gold_bar": 1}, group="Bars"), + {"silver_bar": 1}, group="Bars", fire="crucible", fuel=0), + _action("jc_gold_bar", "jewelcrafting", "Gold bar", 40, 30, 32, _fuelled({"gold_ore": 1, "coal": 1}, 2), + {"gold_bar": 1}, group="Bars", fire="crucible", fuel=2), ] for tier, (gem, gem_name, *_rest) in enumerate(GEMS): for key, slot, noun, _stat, _bonus, bands, gems, shards, offset, _glyph in JEWELLERY: @@ -1682,7 +1683,7 @@ RAID_TRAITS = ["lightly armoured, heavy on archers", "mounted and fast, few bows # --- world --------------------------------------------------------------- -WORLD_VERSION = 37 +WORLD_VERSION = 38 def new_world(now: float, speed: float = 1.0) -> dict: @@ -1956,6 +1957,10 @@ def migrate(world: dict, now: float | None = None) -> dict: if world["version"] < 37: _planks_to_frames(world) world["version"] = 37 + if world["version"] < 38: + # The crucible: a fifth fire, for the jeweller's silver and gold. + world["city"]["fires"].setdefault("crucible", new_fire(now)) + world["version"] = 38 return world @@ -6850,6 +6855,10 @@ 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-04", "title": "Crucible", "notes": [ + ("new", "Crucible: 5th fire, for silver and gold bars."), + ("balance", "Gold bar: +1 willow log. White flame or hotter pays it."), + ]}, {"date": "2026-11-03", "title": "Combat materials on order", "notes": [ ("new", "Work orders: relics, reagents and trophies under Materials ⚔️, by area."), ("new", "Work orders: 🔨 on recipes and gathering, opens the order."), diff --git a/static/styles.css b/static/styles.css index 3c1a422..3451127 100644 --- a/static/styles.css +++ b/static/styles.css @@ -833,7 +833,7 @@ button.sheet-skill:hover { background: var(--panel-2); } .fire-tools .tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 3px 9px; } .fire-tools .tag .gi { width: 1.2em; height: 1.2em; } -.fire-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); } +.fire-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); } .fire-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .4s, box-shadow .4s; diff --git a/tests/test_game.py b/tests/test_game.py index 9c1ad94..0b116f1 100644 --- a/tests/test_game.py +++ b/tests/test_game.py @@ -3072,28 +3072,40 @@ class FirekeepingTest(unittest.TestCase): self.fires["forge"].update(fuel=[{"tier": 0, "left": 600, "by": "sam"}], at=T0) self.fires["kitchen"].update(fuel=[{"tier": 0, "left": game.fire_bank(1) * 60, "by": "kai"}], at=T0) # kai's pile is full self.fires["kiln"].update(fuel=[{"tier": 0, "left": 300, "by": "sam"}], at=T0) + self.fires["crucible"].update(fuel=[{"tier": 0, "left": 900, "by": "sam"}], at=T0) self.kai["bank"] = {"logs": 1} self.tend(self.kai, "all", "logs", T0, 35) self.assertEqual([chunk["by"] for chunk in self.fires["still"]["fuel"]], ["kai"]) # out, so lowest self.kai["bank"] = {"logs": 100} - for key in ("forge", "kiln", "still"): + for key in ("forge", "kiln", "still", "crucible"): self.fires[key].update(fuel=[{"tier": 0, "left": game.fire_bank(1) * 60, "by": "kai"}], at=T0 + 35) self.assertEqual(game.start_action(self.world, self.kai, "tend_all_logs", T0 + 35), "Your piles are all full") def test_queued_tending_runs_until_full_then_on_with_the_queue(self): - self.kai["bank"] = {"logs": 500} + self.kai["bank"] = {"logs": 2000} game.start_action(self.world, self.kai, "mine_stone", T0) self.assertIsNone(game.queue_add(self.world, self.kai, "tend_all_logs", 1, T0)) # starts it, mining comes after self.assertIsNone(game.queue_add(self.world, self.kai, "split_logs", 2, T0)) self.assertEqual(self.kai["action"]["left"], 1) game.process_player(self.world, self.kai, T0 + 600, random.Random(1)) self.assertEqual(self.kai["action"]["id"], "tend_all_logs") # past one log: no count, still tending - summary = game.process_player(self.world, self.kai, T0 + 4 * 3600, random.Random(1)) + summary = game.process_player(self.world, self.kai, T0 + 12 * 3600, random.Random(1)) self.assertEqual(summary["skipped"], []) self.assertEqual(self.kai["bank"]["kindling"], 2 * game.KINDLING_YIELD[0]) self.assertEqual((self.kai["action"]["id"], summary["resumed"]), ("mine_stone", "mine_stone")) - tended = 500 - 2 - self.kai["bank"]["logs"] - self.assertGreater(tended, 4 * game.fire_bank(1) / game.fire_minutes(1)) # every pile filled + tended = 2000 - 2 - self.kai["bank"]["logs"] + self.assertGreater(tended, len(game.FIRES) * game.fire_bank(1) / game.fire_minutes(1)) # every pile filled + + def test_the_crucible_pays_the_jewellers_bars(self): + silver, gold = game.ACTION_BY_ID["jc_silver_bar"], game.ACTION_BY_ID["jc_gold_bar"] + tier_three = game.FIREWOOD[2] + self.assertEqual(game.fire_inputs(self.world, silver), {"silver_ore": 1, "logs": 1}) + self.assertEqual(game.fire_inputs(self.world, gold), {"gold_ore": 1, "coal": 1, tier_three: 1}) + self.fires["crucible"].update(fuel=[{"tier": 0, "left": 600, "by": "sam"}], at=T0) + self.assertEqual(game.fire_inputs(self.world, silver), {"silver_ore": 1}) + self.assertIn(tier_three, game.fire_inputs(self.world, gold)) # red flame: too cool for gold + self.fires["crucible"]["fuel"][0]["tier"] = 2 + self.assertEqual(game.fire_inputs(self.world, gold), {"gold_ore": 1, "coal": 1}) # the coal stays def test_better_logs_need_the_level(self): self.kai["bank"] = {"maple_logs": 3} @@ -3230,6 +3242,14 @@ class FirekeepingTest(unittest.TestCase): self.assertEqual(self.kai["xp"]["firekeeping"], 0) self.assertIn("tool_firekeeping", self.kai["equip"]) + def test_old_worlds_get_the_crucible_and_keep_their_fires(self): + del self.fires["crucible"] + self.fires["forge"].update(fuel=[{"tier": 1, "left": 600, "by": "sam"}], at=T0) + self.world["version"] = 37 + game.migrate(self.world, T0) + self.assertEqual(self.world["city"]["fires"]["crucible"], game.new_fire(T0)) + self.assertEqual(self.fires["forge"]["fuel"], [{"tier": 1, "left": 600, "by": "sam"}]) + class PatchNotesTest(unittest.TestCase): def test_newest_first_and_known_kinds(self):