From f273b80c9284bc4298684fb5c866872d2e1796b0 Mon Sep 17 00:00:00 2001 From: JustinasLa Date: Thu, 1 Oct 2026 16:14:57 +0200 Subject: [PATCH] fix: match activity lore wording to its amounts Tasks needing one action or giving one point read "Cast 1 votes" and "Earn 1 activity points". Use the singular for an amount of 1, and "an" before Engineer/Animal Station. The description generator now picks the form from every/points, and knows the BreweryX activities. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/main/resources/config.yml | 134 +++++++++++++------------- tools/test_activity_descriptions.py | 21 ++++ tools/update-activity-descriptions.py | 56 +++++++---- 3 files changed, 124 insertions(+), 87 deletions(-) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7b63450..439f586 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -123,9 +123,9 @@ activities: vote: display: "#e6ca40&lVoting" description: - - "&7Cast &a%every% &7votes for the server." + - "&7Cast &a%every% &7vote for the server." - "&7Links: &f/vote" - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: v.paper every: 1 @@ -138,7 +138,7 @@ activities: display: "#e6ca40&lRadioactive Sources" description: - "&7Collect &a%every% &7arcane sources with a Trace Detector." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: SPYGLASS every: 3 @@ -148,7 +148,7 @@ activities: display: "#e6ca40&lArchaeology" description: - "&7Recover &a%every% &7archaeological finds." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: BRUSH every: 3 @@ -158,7 +158,7 @@ activities: display: "#e6ca40&lMusical Instruments" description: - "&7Play &a%every% &7notes with an instrument." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: NOTE_BLOCK every: 20 @@ -169,7 +169,7 @@ activities: description: - "&7Play actively for &a%every% &7minutes." - "&7Idle minutes do not count when AFK checks are enabled." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: CLOCK every: 60 # 60 counted minutes => 1 point @@ -180,7 +180,7 @@ activities: display: "#e6ca40&lMarket Sales" description: - "&7Earn &a%every% &7Denar selling to a Market Block." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: EMERALD every: 25 # 25 denar earned => 1 point @@ -192,7 +192,7 @@ activities: description: - "&7Win &a%every% &7Denar in card-game profit." - "&7Counts profit above your stake, before tax." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: GOLD_NUGGET every: 25 @@ -202,7 +202,7 @@ activities: display: "#e6ca40&lCraft Diamond Blocks" description: - "&7Craft &a%every% &7Diamond Block items." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: DIAMOND_BLOCK every: 3 @@ -213,7 +213,7 @@ activities: display: "#e6ca40&lCraft Golden Carrots" description: - "&7Craft &a%every% &7Golden Carrot items." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: v.golden_carrot every: 16 @@ -223,8 +223,8 @@ activities: craft_anvil: display: "#e6ca40&lCraft Anvils" description: - - "&7Craft &a%every% &7Anvil items." - - "&7Earn &a%points% &7activity points per completion." + - "&7Craft &a%every% &7Anvil item." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: ANVIL every: 1 @@ -237,7 +237,7 @@ activities: description: - "&7Send &a%every% &7substantial in-character messages." - "&7Short or repetitive messages do not count." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: WRITABLE_BOOK every: 30 @@ -247,7 +247,7 @@ activities: injured: display: "#e6ca40&lInjure Yourself" description: - - "&7Receive &a%every% &7roleplay injuries." + - "&7Receive &a%every% &7roleplay injury." - "&7Earn &a%points% &7activity points per completion." - "&7" material: BONE @@ -259,7 +259,7 @@ activities: display: "#e6ca40&lPlace Furniture" description: - "&7Place &a%every% &7pieces of furniture." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: BARREL every: 5 @@ -269,8 +269,8 @@ activities: vehicle_build: display: "#e6ca40&lBuild Vehicles" description: - - "&7Finish &a%every% &7vehicles at a construction station." - - "&7Earn &a%points% &7activity points per completion." + - "&7Finish &a%every% &7vehicle at a construction station." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: MINECART every: 1 @@ -280,9 +280,9 @@ activities: battle_joined: display: "#e6ca40&lFaction Battles" description: - - "&7Participate in &a%every% &7faction battles." + - "&7Participate in &a%every% &7faction battle." - "&7Credit is awarded when the battle ends." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: IRON_SWORD every: 1 @@ -293,7 +293,7 @@ activities: display: "#e6ca40&lAdvanced Crafting" description: - "&7Complete &a%every% &7Advanced Crafting items or alloys." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: SMITHING_TABLE every: 5 @@ -305,7 +305,7 @@ activities: description: - "&7Finish &a%every% &7dishes at cooking pots, stations or boards." - "&7Trough feed counts toward its own activity." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: COOKED_BEEF every: 5 @@ -319,7 +319,7 @@ activities: display: "#e6ca40&lGather Brewing Ingredients" description: - "&7Add &a%every% &7ingredients to a brewing cauldron." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: CAULDRON every: 10 @@ -331,7 +331,7 @@ activities: description: - "&7Fill &a%every% &7bottles from a brewing cauldron" - "&7after at least a minute of cooking." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: GLASS_BOTTLE every: 3 @@ -357,7 +357,7 @@ activities: display: "#e6ca40&lAge Brews" description: - "&7Take &a%every% &7brews aged at least a year out of a barrel." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: BARREL every: 3 @@ -367,8 +367,8 @@ activities: profession_upgrade: display: "#e6ca40&lProfession Upgrade" description: - - "&7Purchase &a%every% &7profession upgrades." - - "&7Earn &a%points% &7activity points per completion." + - "&7Purchase &a%every% &7profession upgrade." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: EXPERIENCE_BOTTLE every: 1 @@ -380,7 +380,7 @@ activities: display: "#e6ca40&lCrafter XP" description: - "&7Earn &a%every% &7Crafter profession XP." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: CRAFTING_TABLE every: 500 # 500 profession XP → 1 point @@ -391,7 +391,7 @@ activities: display: "#e6ca40&lForager XP" description: - "&7Earn &a%every% &7Forager profession XP." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: WHEAT every: 500 @@ -402,7 +402,7 @@ activities: display: "#e6ca40&lHerborist XP" description: - "&7Earn &a%every% &7Herborist profession XP." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: FERN every: 500 @@ -415,7 +415,7 @@ activities: description: - "&7Complete the Flint recipe &a%every% &7times." - "&7Use a Blast Furnace and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: FLINT every: 3 @@ -427,7 +427,7 @@ activities: description: - "&7Complete &a%every% &7standard Coal crafts at a Blast Furnace." - "&7The bulk Coal recipe also counts toward this task." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: COAL every: 3 @@ -440,9 +440,9 @@ activities: tool_iron_pickaxe: display: "#e6ca40&lForge Iron Pickaxes" description: - - "&7Complete the Iron Pickaxe recipe &a%every% &7times." + - "&7Complete the Iron Pickaxe recipe &a%every% &7time." - "&7Use a Crafting Table and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: IRON_PICKAXE every: 1 @@ -452,9 +452,9 @@ activities: tool_iron_axe: display: "#e6ca40&lForge Iron Axes" description: - - "&7Complete the Iron Hatchet recipe &a%every% &7times." + - "&7Complete the Iron Hatchet recipe &a%every% &7time." - "&7Use a Crafting Table and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: IRON_AXE every: 1 @@ -467,7 +467,7 @@ activities: description: - "&7Complete the Andesite recipe &a%every% &7times." - "&7Use a Stonecutter and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: ANDESITE every: 2 @@ -479,7 +479,7 @@ activities: description: - "&7Complete the Clay recipe &a%every% &7times." - "&7Use a Stonecutter and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: CLAY every: 2 @@ -492,7 +492,7 @@ activities: description: - "&7Complete the Arrow recipe &a%every% &7times." - "&7Use a Fletching Table and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: ARROW every: 2 @@ -504,7 +504,7 @@ activities: description: - "&7Complete the String recipe &a%every% &7times." - "&7Use a Fletching Table and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: STRING every: 2 @@ -517,7 +517,7 @@ activities: description: - "&7Complete the Minor Health Potion recipe &a%every% &7times." - "&7Use a Brewing Stand and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: POTION every: 2 @@ -529,7 +529,7 @@ activities: description: - "&7Complete the Alchemy Powder recipe &a%every% &7times." - "&7Use a Brewing Stand and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: GLOWSTONE_DUST every: 2 @@ -540,9 +540,9 @@ activities: instrument_iron_lute: display: "#e6ca40&lBuild Iron Lutes" description: - - "&7Complete the Iron Lute recipe &a%every% &7times." + - "&7Complete the Iron Lute recipe &a%every% &7time." - "&7Use a Jukebox and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: NOTE_BLOCK every: 1 @@ -552,9 +552,9 @@ activities: instrument_steel_lute: display: "#e6ca40&lBuild Steel Lutes" description: - - "&7Complete the Steel Lute recipe &a%every% &7times." + - "&7Complete the Steel Lute recipe &a%every% &7time." - "&7Use a Jukebox and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: JUKEBOX every: 1 @@ -567,7 +567,7 @@ activities: description: - "&7Complete the Scribe Paper recipe &a%every% &7times." - "&7Use a Cartography Table and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: PAPER every: 2 @@ -577,9 +577,9 @@ activities: research_bronze: display: "#e6ca40&lResearch Bronze" description: - - "&7Complete the Research Bronze recipe &a%every% &7times." + - "&7Complete the Research Bronze recipe &a%every% &7time." - "&7Use a Cartography Table and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: COPPER_INGOT every: 1 @@ -592,7 +592,7 @@ activities: description: - "&7Complete the Herb Mixture recipe &a%every% &7times." - "&7Use a Medicine Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: FERN every: 2 @@ -602,9 +602,9 @@ activities: medicine_splint: display: "#e6ca40&lMake Splints" description: - - "&7Complete the Splint recipe &a%every% &7times." + - "&7Complete the Splint recipe &a%every% &7time." - "&7Use a Medicine Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: STICK every: 1 @@ -615,9 +615,9 @@ activities: engineer_bullet_box: display: "#e6ca40&lPack Bullet Boxes" description: - - "&7Complete the Bullet Box recipe &a%every% &7times." - - "&7Use a Engineer Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Complete the Bullet Box recipe &a%every% &7time." + - "&7Use an Engineer Station and claim queued crafts." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: IRON_NUGGET every: 1 @@ -628,8 +628,8 @@ activities: display: "#e6ca40&lRefine Fuel" description: - "&7Complete the Arcane Fuel recipe &a%every% &7times." - - "&7Use a Engineer Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Use an Engineer Station and claim queued crafts." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: COAL_BLOCK every: 2 @@ -640,9 +640,9 @@ activities: fishing_rod: display: "#e6ca40&lMake Fishing Rods" description: - - "&7Complete the Basic Fishing Rod recipe &a%every% &7times." + - "&7Complete the Basic Fishing Rod recipe &a%every% &7time." - "&7Use a Fishing Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: FISHING_ROD every: 1 @@ -654,7 +654,7 @@ activities: description: - "&7Complete the Iron Hook recipe &a%every% &7times." - "&7Use a Fishing Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: TRIPWIRE_HOOK every: 2 @@ -665,9 +665,9 @@ activities: magic_basic_handle: display: "#e6ca40&lCarve Basic Handles" description: - - "&7Complete the Basic Handle recipe &a%every% &7times." + - "&7Complete the Basic Handle recipe &a%every% &7time." - "&7Use a Magic Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: STICK every: 1 @@ -677,9 +677,9 @@ activities: magic_iron_core: display: "#e6ca40&lCast Iron Cores" description: - - "&7Complete the Iron Core recipe &a%every% &7times." + - "&7Complete the Iron Core recipe &a%every% &7time." - "&7Use a Magic Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: IRON_INGOT every: 1 @@ -692,7 +692,7 @@ activities: description: - "&7Fill a trough with wheat or vegetables." - "&7Collect feed &a%every% &7times with an empty-hand right click." - - "&7Earn &a%points% &7activity points per completion." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: WHEAT every: 2 @@ -702,9 +702,9 @@ activities: animal_whistle: display: "#e6ca40&lCraft Animal Whistles" description: - - "&7Complete the Animal Whistle recipe &a%every% &7times." - - "&7Use a Animal Station and claim queued crafts." - - "&7Earn &a%points% &7activity points per completion." + - "&7Complete the Animal Whistle recipe &a%every% &7time." + - "&7Use an Animal Station and claim queued crafts." + - "&7Earn &a%points% &7activity point per completion." - "&7" material: GOAT_HORN every: 1 diff --git a/tools/test_activity_descriptions.py b/tools/test_activity_descriptions.py index 2b634d5..41ad25f 100644 --- a/tools/test_activity_descriptions.py +++ b/tools/test_activity_descriptions.py @@ -56,6 +56,27 @@ def test_accepts_supported_station_formats(self): self.assertIn("Crafting Table", " ".join(description)) self.assertIn("%every%", " ".join(description)) + def test_matches_wording_to_amounts(self): + source = '''activities: + vote: + every: 1 + points: 1 + injured: + every: 2 + points: 5 + engineer: + station: engineer-station/fuel + every: 1 +''' + parsed = yaml.safe_load(lore.update(source))["activities"] + self.assertEqual(parsed["vote"]["description"][0], "&7Cast &a%every% &7vote for the server.") + self.assertEqual(parsed["vote"]["description"][2], "&7Earn &a%points% &7activity point per completion.") + self.assertEqual(parsed["injured"]["description"][0], "&7Receive &a%every% &7roleplay injuries.") + self.assertEqual(parsed["injured"]["description"][1], "&7Earn &a%points% &7activity points per completion.") + self.assertEqual(parsed["engineer"]["description"][:2], [ + "&7Complete the Arcane Fuel recipe &a%every% &7time.", + "&7Use an Engineer Station and claim queued crafts."]) + def test_replaces_complete_yaml_values_and_keeps_comments(self): for value in ['"Old"', '\n - "Old"\n # Keep this comment\n - "Another"', '|\n Old multiline\n explanation', '>\n Old folded\n explanation']: diff --git a/tools/update-activity-descriptions.py b/tools/update-activity-descriptions.py index b5b0079..b0845ea 100644 --- a/tools/update-activity-descriptions.py +++ b/tools/update-activity-descriptions.py @@ -11,23 +11,28 @@ import yaml +# {one|many} picks the singular form when the amount it follows is exactly 1. ACTIONS = { - "vote": ["&7Cast &a%every% &7votes for the server.", "&7Links: &f/vote"], - "playtime": ["&7Play actively for &a%every% &7minutes.", "&7Idle minutes do not count when AFK checks are enabled."], - "geiger": ["&7Collect &a%every% &7arcane sources with a Trace Detector."], - "archaeology_find": ["&7Recover &a%every% &7archaeological finds."], - "instrument": ["&7Play &a%every% &7notes with an instrument."], + "vote": ["&7Cast &a%every% &7{vote|votes} for the server.", "&7Links: &f/vote"], + "playtime": ["&7Play actively for &a%every% &7{minute|minutes}.", "&7Idle minutes do not count when AFK checks are enabled."], + "geiger": ["&7Collect &a%every% &7arcane {source|sources} with a Trace Detector."], + "archaeology_find": ["&7Recover &a%every% &7archaeological {find|finds}."], + "instrument": ["&7Play &a%every% &7{note|notes} with an instrument."], "market_sale": ["&7Earn &a%every% &7Denar selling to a Market Block."], "casino_win": ["&7Win &a%every% &7Denar in card-game profit.", "&7Counts profit above your stake, before tax."], - "ic_chat": ["&7Send &a%every% &7substantial in-character messages.", "&7Short or repetitive messages do not count."], - "injured": ["&7Receive &a%every% &7roleplay injuries."], - "furniture_place": ["&7Place &a%every% &7pieces of furniture."], - "vehicle_build": ["&7Finish &a%every% &7vehicles at a construction station."], - "battle_joined": ["&7Participate in &a%every% &7faction battles.", "&7Credit is awarded when the battle ends."], - "advcraft_item": ["&7Complete &a%every% &7Advanced Crafting items or alloys."], - "cook_dish": ["&7Finish &a%every% &7dishes at cooking pots, stations or boards.", "&7Trough feed counts toward its own activity."], - "profession_upgrade": ["&7Purchase &a%every% &7profession upgrades."], - "animal_universal_feed": ["&7Fill a trough with wheat or vegetables.", "&7Collect feed &a%every% &7times with an empty-hand right click."], + "ic_chat": ["&7Send &a%every% &7substantial in-character {message|messages}.", "&7Short or repetitive messages do not count."], + "injured": ["&7Receive &a%every% &7roleplay {injury|injuries}."], + "furniture_place": ["&7Place &a%every% &7{piece|pieces} of furniture."], + "vehicle_build": ["&7Finish &a%every% &7{vehicle|vehicles} at a construction station."], + "battle_joined": ["&7Participate in &a%every% &7faction {battle|battles}.", "&7Credit is awarded when the battle ends."], + "advcraft_item": ["&7Complete &a%every% &7Advanced Crafting {item or alloy|items or alloys}."], + "cook_dish": ["&7Finish &a%every% &7{dish|dishes} at cooking pots, stations or boards.", "&7Trough feed counts toward its own activity."], + "profession_upgrade": ["&7Purchase &a%every% &7profession {upgrade|upgrades}."], + "brew_ingredient": ["&7Add &a%every% &7{ingredient|ingredients} to a brewing cauldron."], + "brew_bottle": ["&7Fill &a%every% &7{bottle|bottles} from a brewing cauldron", "&7after at least a minute of cooking."], + "brew_age": ["&7Take &a%every% &7{brew|brews} aged at least a year out of a barrel."], + "brew_drink": ["&7Drink &a%every% &7finished {brew|brews}."], + "animal_universal_feed": ["&7Fill a trough with wheat or vegetables.", "&7Collect feed &a%every% &7{time|times} with an empty-hand right click."], } # Recipe names and station locations, checked against Main's active recipes. @@ -59,6 +64,14 @@ } +def counted(line, amount): + return re.sub(r"\{([^|{}]*)\|([^|{}]*)\}", lambda m: m[1] if amount == 1 else m[2], line) + + +def article(name): + return "an" if name[:1].lower() in "aeiou" else "a" + + def description(activity_id, activity): if activity_id in ACTIONS: lines = ACTIONS[activity_id] @@ -72,20 +85,23 @@ def description(activity_id, activity): raise ValueError(f"No audited station location for {station}") if separator: name = RECIPE_NAMES.get(recipe, recipe.replace("-", " ").title()) - lines = [f"&7Complete the {name} recipe &a%every% &7times.", - f"&7Use a {STATIONS[station]} and claim queued crafts."] + lines = [f"&7Complete the {name} recipe &a%every% &7{{time|times}}.", + f"&7Use {article(STATIONS[station])} {STATIONS[station]} and claim queued crafts."] else: - lines = [f"&7Complete &a%every% &7recipes at a {STATIONS[station]}.", + lines = [f"&7Complete &a%every% &7{{recipe|recipes}} at {article(STATIONS[station])} {STATIONS[station]}.", "&7Claim queued crafts to receive credit."] if activity_id == "ingot_coal" and "ingot-station/coal-64" in activity.get("station-actions", {}): - lines = ["&7Complete &a%every% &7standard Coal crafts at a Blast Furnace.", + lines = ["&7Complete &a%every% &7standard Coal {craft|crafts} at a Blast Furnace.", "&7The bulk Coal recipe also counts toward this task."] elif activity.get("craft"): name = activity["craft"].removeprefix("v.").replace("_", " ").title() - lines = [f"&7Craft &a%every% &7{name} items."] + lines = [f"&7Craft &a%every% &7{name} {{item|items}}."] else: raise ValueError(f"No audited description for {activity_id}") - return [*lines, "&7Earn &a%points% &7activity points per completion.", "&7"] + # Defaults match ActivityConfiguration: every 1, points 0. + lines = [counted(line, activity.get("every", 1)) for line in lines] + points = counted("&7Earn &a%points% &7activity {point|points} per completion.", activity.get("points", 0)) + return [*lines, points, "&7"] def remove_description(block):