Coal 8, coal-fired bars worth their ore and coal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-28 23:29:36 +00:00
parent 4e54c65503
commit c4a61e8f6c

19
game.py
View file

@ -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 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 = [ METALS = [
("copper", "Copper", ("copper_ore", "Copper ore", "🟤", 2), 0, "🟧", 5, 0, "logs"), ("copper", "Copper", ("copper_ore", "Copper ore", "🟤", 2), 0, "🟧", 5, 0, "logs"),
("iron", "Iron", ("iron_ore", "Iron ore", "⚫", 4), 0, "⬛", 10, 1, "oak_logs"), ("iron", "Iron", ("iron_ore", "Iron ore", "⚫", 4), 0, "⬛", 10, 1, "oak_logs"),
("steel", "Steel", None, 2, "🔲", 20, 2, "willow_logs"), ("steel", "Steel", None, 2, "🔲", None, 2, "willow_logs"),
("mithril", "Mithril", ("mithril_ore", "Mithril ore", "🔵", 15), 3, "🟦", 40, 3, "maple_logs"), ("mithril", "Mithril", ("mithril_ore", "Mithril ore", "🔵", 15), 3, "🟦", None, 3, "maple_logs"),
("adamant", "Adamant", ("adamantite_ore", "Adamantite ore", "🟢", 30), 4, "🟩", 70, 4, "yew_logs"), ("adamant", "Adamant", ("adamantite_ore", "Adamantite ore", "🟢", 30), 4, "🟩", None, 4, "yew_logs"),
("rune", "Rune", ("runite_ore", "Runite ore", "💠", 55), 5, "🟪", 120, 5, "magic_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 # piece, slot, display noun, bars, smithing level above the tier, power by tier, armour by tier
PIECES = [ PIECES = [
@ -252,10 +253,12 @@ FISH = [
COOK_IDS = {"raw_shrimp": "cook_shrimp", "raw_trout": "cook_trout", "raw_salmon": "cook_salmon", "raw_eel": "cook_eel", 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"} "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): for _tier, (_key, _name, _ore, _coal, _bar_icon, _bar_value, _smithy, _wood) in enumerate(METALS):
if _ore: if _ore:
ITEMS[_ore[0]] = {"name": _ore[1], "icon": _ore[2], "value": _ore[3]} 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} 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: for _piece, _slot, _noun, _bars, _offset, _power, _armour in PIECES:
_item = {"name": f"{_name} {_noun}", "plural": f"{_name} {PLURALS[_noun]}", _item = {"name": f"{_name} {_noun}", "plural": f"{_name} {PLURALS[_noun]}",
@ -344,7 +347,7 @@ HARDWARE = [
("rune_lock", "Rune lock", "Rune locks", 2, 1), ("rune_lock", "Rune lock", "Rune locks", 2, 1),
] ]
for (_id, _name, _plural, _bars, _made), _metal in zip(HARDWARE, METALS): 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)} "tier": METALS.index(_metal)}
PLANKS = [("plank", "Plank"), ("oak_plank", "Oak plank"), ("willow_plank", "Willow plank"), PLANKS = [("plank", "Plank"), ("oak_plank", "Oak plank"), ("willow_plank", "Willow plank"),
("maple_plank", "Maple plank"), ("yew_plank", "Yew plank"), ("magic_plank", "Enchanted 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): for _tier, _metal in enumerate(METALS):
ITEMS[f"{_metal[0]}_sword"]["style"] = "sword" ITEMS[f"{_metal[0]}_sword"]["style"] = "sword"
_weapon = {"slot": "weapon", "power": TWO_HANDED_POWER[_tier], "tier": _tier, "two_handed": True, _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"{_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"), ITEMS[f"{WOODS[_tier]}_staff"] = {"name": STAVES[_tier], "plural": STAVES[_tier].replace("staff", "staves"),
"icon": "🪄", "style": "staff", **_weapon} "icon": "🪄", "style": "staff", **_weapon}