From c4a61e8f6cdeebcf61720426fb8661f8f8a71c29 Mon Sep 17 00:00:00 2001 From: rope Date: Wed, 28 Oct 2026 23:29:36 +0000 Subject: [PATCH] Coal 8, coal-fired bars worth their ore and coal Co-Authored-By: Claude Opus 5.5 --- game.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/game.py b/game.py index 76a2046..f481fa1 100644 --- a/game.py +++ b/game.py @@ -90,14 +90,15 @@ ITEMS = { TIER_LEVELS = [1, 15, 30, 45, 60, 75] # each tier's gathering / smelting level; also to wear and use it -# key, name, ore (item id, name, icon, value), coal per bar, bar icon, bar value, smithy level, handle wood +# key, name, ore (item id, name, icon, value), coal per bar, bar icon, bar value (None: its ore and coal, +# marked up), smithy level, handle wood METALS = [ ("copper", "Copper", ("copper_ore", "Copper ore", "🟤", 2), 0, "🟧", 5, 0, "logs"), ("iron", "Iron", ("iron_ore", "Iron ore", "⚫", 4), 0, "⬛", 10, 1, "oak_logs"), - ("steel", "Steel", None, 2, "🔲", 20, 2, "willow_logs"), - ("mithril", "Mithril", ("mithril_ore", "Mithril ore", "🔵", 15), 3, "🟦", 40, 3, "maple_logs"), - ("adamant", "Adamant", ("adamantite_ore", "Adamantite ore", "🟢", 30), 4, "🟩", 70, 4, "yew_logs"), - ("rune", "Rune", ("runite_ore", "Runite ore", "💠", 55), 5, "🟪", 120, 5, "magic_logs"), + ("steel", "Steel", None, 2, "🔲", None, 2, "willow_logs"), + ("mithril", "Mithril", ("mithril_ore", "Mithril ore", "🔵", 15), 3, "🟦", None, 3, "maple_logs"), + ("adamant", "Adamant", ("adamantite_ore", "Adamantite ore", "🟢", 30), 4, "🟩", None, 4, "yew_logs"), + ("rune", "Rune", ("runite_ore", "Runite ore", "💠", 55), 5, "🟪", None, 5, "magic_logs"), ] # piece, slot, display noun, bars, smithing level above the tier, power by tier, armour by tier PIECES = [ @@ -252,10 +253,12 @@ FISH = [ COOK_IDS = {"raw_shrimp": "cook_shrimp", "raw_trout": "cook_trout", "raw_salmon": "cook_salmon", "raw_eel": "cook_eel", "raw_lobster": "cook_lobster", "raw_swordfish": "cook_swordfish"} -ITEMS["coal"] = {"name": "Coal", "icon": "🌑", "value": 6} +ITEMS["coal"] = {"name": "Coal", "icon": "🌑", "value": 8} for _tier, (_key, _name, _ore, _coal, _bar_icon, _bar_value, _smithy, _wood) in enumerate(METALS): if _ore: ITEMS[_ore[0]] = {"name": _ore[1], "icon": _ore[2], "value": _ore[3]} + if _bar_value is None: + _bar_value = round((ITEMS[_ore[0] if _ore else "iron_ore"]["value"] + _coal * ITEMS["coal"]["value"]) * CRAFT_MARKUP) ITEMS[f"{_key}_bar"] = {"name": f"{_name} bar", "icon": _bar_icon, "value": _bar_value, "tier": _tier} for _piece, _slot, _noun, _bars, _offset, _power, _armour in PIECES: _item = {"name": f"{_name} {_noun}", "plural": f"{_name} {PLURALS[_noun]}", @@ -344,7 +347,7 @@ HARDWARE = [ ("rune_lock", "Rune lock", "Rune locks", 2, 1), ] for (_id, _name, _plural, _bars, _made), _metal in zip(HARDWARE, METALS): - ITEMS[_id] = {"name": _name, "plural": _plural, "icon": "🔩", "value": math.ceil(round(_bars * _metal[5] * CRAFT_MARKUP / _made, 6)), + ITEMS[_id] = {"name": _name, "plural": _plural, "icon": "🔩", "value": math.ceil(round(_bars * ITEMS[f"{_metal[0]}_bar"]["value"] * CRAFT_MARKUP / _made, 6)), "tier": METALS.index(_metal)} PLANKS = [("plank", "Plank"), ("oak_plank", "Oak plank"), ("willow_plank", "Willow plank"), ("maple_plank", "Maple plank"), ("yew_plank", "Yew plank"), ("magic_plank", "Enchanted plank")] @@ -362,7 +365,7 @@ BOWS = ["Shortbow", "Oak bow", "Willow bow", "Maple bow", "Yew bow", "Enchanted for _tier, _metal in enumerate(METALS): ITEMS[f"{_metal[0]}_sword"]["style"] = "sword" _weapon = {"slot": "weapon", "power": TWO_HANDED_POWER[_tier], "tier": _tier, "two_handed": True, - "req": ["combat", TIER_LEVELS[_tier]], "value": round(5 * _metal[5] * 1.2)} + "req": ["combat", TIER_LEVELS[_tier]], "value": round(5 * ITEMS[f"{_metal[0]}_bar"]["value"] * 1.2)} ITEMS[f"{_metal[0]}_warhammer"] = {"name": f"{_metal[1]} warhammer", "icon": "🔨", "style": "hammer", **_weapon} ITEMS[f"{WOODS[_tier]}_staff"] = {"name": STAVES[_tier], "plural": STAVES[_tier].replace("staff", "staves"), "icon": "🪄", "style": "staff", **_weapon}