diff options
| author | historia <[not public]> | 2026-06-21 01:05:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-21 01:05:35 -0400 |
| commit | c36c1dc0c65e65b4d6ee53df6bbcc3a860eb6e4b (patch) | |
| tree | ea5b796d7b8ce6ae422b30542e0da97e818207e8 | |
| parent | 470bc5bd99b793e46305310b5fbeb3068eba45f1 (diff) | |
| download | thehouseoficarus-c36c1dc0c65e65b4d6ee53df6bbcc3a860eb6e4b.tar.gz | |
Added %i, %n, %b to production skill messages to consistent color inputs, item names, and byproducts
131 files changed, 347 insertions, 271 deletions
diff --git a/data/items/ammo/headless_arrow.yaml b/data/items/ammo/headless_arrow.yaml index 6f1c939..f2095c2 100644 --- a/data/items/ammo/headless_arrow.yaml +++ b/data/items/ammo/headless_arrow.yaml @@ -8,7 +8,7 @@ craft: - feather quantity: 15 level: 1 - message: You attach feathers to the arrow shafts. + message: "You attach feathers to the %i1." output_qty: 15 skill: fletching type: fletching diff --git a/data/items/consumables/amp_potion.yaml b/data/items/consumables/amp_potion.yaml index ac98966..bce0752 100644 --- a/data/items/consumables/amp_potion.yaml +++ b/data/items/consumables/amp_potion.yaml @@ -8,7 +8,6 @@ craft: - limpwurt_root quantity: 1 level: 12 - message: You mix an amp potion. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/anchovies.yaml b/data/items/consumables/anchovies.yaml index 535585a..a8c88f1 100644 --- a/data/items/consumables/anchovies.yaml +++ b/data/items/consumables/anchovies.yaml @@ -7,7 +7,6 @@ craft: fail: burnt_fish fail_message: You accidentally burn the anchovies. level: 1 - message: Cooked to perfection. It looks great! skill: cooking station: - fire diff --git a/data/items/consumables/avantoe_potion_unf.yaml b/data/items/consumables/avantoe_potion_unf.yaml index bd2ebb1..868dd6f 100644 --- a/data/items/consumables/avantoe_potion_unf.yaml +++ b/data/items/consumables/avantoe_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - avantoe diff --git a/data/items/consumables/bio_serum.yaml b/data/items/consumables/bio_serum.yaml index 6a7e181..0ef934c 100644 --- a/data/items/consumables/bio_serum.yaml +++ b/data/items/consumables/bio_serum.yaml @@ -8,7 +8,6 @@ craft: - antitoxin_powder quantity: 1 level: 5 - message: You mix a bio serum. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/bread.yaml b/data/items/consumables/bread.yaml index a00a3ef..9268822 100644 --- a/data/items/consumables/bread.yaml +++ b/data/items/consumables/bread.yaml @@ -7,7 +7,7 @@ craft: fail: burnt_meat fail_message: You burn the bread to a crisp. level: 1 - message: You bake the dough into a fresh loaf of bread. + message: "You bake the dough into a %n." skill: cooking station: - cooking_range diff --git a/data/items/consumables/cadantine_potion_unf.yaml b/data/items/consumables/cadantine_potion_unf.yaml index 5d5db0b..d39c1af 100644 --- a/data/items/consumables/cadantine_potion_unf.yaml +++ b/data/items/consumables/cadantine_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - cadantine diff --git a/data/items/consumables/dwarf_weed_potion_unf.yaml b/data/items/consumables/dwarf_weed_potion_unf.yaml index 44f2eab..6314187 100644 --- a/data/items/consumables/dwarf_weed_potion_unf.yaml +++ b/data/items/consumables/dwarf_weed_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - dwarf_weed diff --git a/data/items/consumables/full_restore.yaml b/data/items/consumables/full_restore.yaml index 28204e8..2e1c234 100644 --- a/data/items/consumables/full_restore.yaml +++ b/data/items/consumables/full_restore.yaml @@ -8,7 +8,6 @@ craft: - arachnid_enzyme quantity: 1 level: 63 - message: You mix a full restore. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/guam_potion_unf.yaml b/data/items/consumables/guam_potion_unf.yaml index caddd74..6387f21 100644 --- a/data/items/consumables/guam_potion_unf.yaml +++ b/data/items/consumables/guam_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - guam @@ -9,6 +9,7 @@ craft: - vial_of_water quantity: 1 wait: 0 + message: "You mix %i1 and %i2 into %n!!!" description: An unfinished potion with guam floating in water. id: guam_potion_unf name: guam potion (unf) diff --git a/data/items/consumables/harralander_potion_unf.yaml b/data/items/consumables/harralander_potion_unf.yaml index 22a7611..f4a768c 100644 --- a/data/items/consumables/harralander_potion_unf.yaml +++ b/data/items/consumables/harralander_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - harralander diff --git a/data/items/consumables/herring.yaml b/data/items/consumables/herring.yaml index 1e20697..1baaaa0 100644 --- a/data/items/consumables/herring.yaml +++ b/data/items/consumables/herring.yaml @@ -7,7 +7,6 @@ craft: fail: burnt_fish fail_message: You accidentally burn the herring. level: 5 - message: Cooked to perfection. It looks great! skill: cooking station: - fire diff --git a/data/items/consumables/irit_potion_unf.yaml b/data/items/consumables/irit_potion_unf.yaml index 841487e..8d7c7e6 100644 --- a/data/items/consumables/irit_potion_unf.yaml +++ b/data/items/consumables/irit_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - irit diff --git a/data/items/consumables/kwuarm_potion_unf.yaml b/data/items/consumables/kwuarm_potion_unf.yaml index 9ab2f67..75feea4 100644 --- a/data/items/consumables/kwuarm_potion_unf.yaml +++ b/data/items/consumables/kwuarm_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - kwuarm diff --git a/data/items/consumables/lantadyme_potion_unf.yaml b/data/items/consumables/lantadyme_potion_unf.yaml index 52ff04f..addbce0 100644 --- a/data/items/consumables/lantadyme_potion_unf.yaml +++ b/data/items/consumables/lantadyme_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - lantadyme diff --git a/data/items/consumables/marrentill_potion_unf.yaml b/data/items/consumables/marrentill_potion_unf.yaml index 8a01b4a..f3ccdd8 100644 --- a/data/items/consumables/marrentill_potion_unf.yaml +++ b/data/items/consumables/marrentill_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - marrentill diff --git a/data/items/consumables/nano_restore.yaml b/data/items/consumables/nano_restore.yaml index dc55b1b..9bea071 100644 --- a/data/items/consumables/nano_restore.yaml +++ b/data/items/consumables/nano_restore.yaml @@ -8,7 +8,6 @@ craft: - arachnid_enzyme quantity: 1 level: 22 - message: You mix a nano restore. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/pie_dish.yaml b/data/items/consumables/pie_dish.yaml index a562b9e..338ce52 100644 --- a/data/items/consumables/pie_dish.yaml +++ b/data/items/consumables/pie_dish.yaml @@ -6,7 +6,7 @@ craft: quantity: 1 fail_message: The pie dish cracks in the oven and is ruined. level: 7 - message: You fire the pie dish in the oven successfully. + message: "You fire the %i1 in the oven." skill: crafting station: - pottery_oven diff --git a/data/items/consumables/ranarr_potion_unf.yaml b/data/items/consumables/ranarr_potion_unf.yaml index 941f5da..6e8359e 100644 --- a/data/items/consumables/ranarr_potion_unf.yaml +++ b/data/items/consumables/ranarr_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - ranarr diff --git a/data/items/consumables/restoration_compound.yaml b/data/items/consumables/restoration_compound.yaml index 1bb2a14..d1f9035 100644 --- a/data/items/consumables/restoration_compound.yaml +++ b/data/items/consumables/restoration_compound.yaml @@ -8,7 +8,6 @@ craft: - crushed_nest quantity: 1 level: 81 - message: You mix a restoration compound. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/salmon.yaml b/data/items/consumables/salmon.yaml index e7988ed..dabc280 100644 --- a/data/items/consumables/salmon.yaml +++ b/data/items/consumables/salmon.yaml @@ -7,7 +7,6 @@ craft: fail: burnt_fish fail_message: You accidentally burn the salmon. level: 25 - message: Cooked to perfection. It looks great! skill: cooking station: - fire diff --git a/data/items/consumables/sardine.yaml b/data/items/consumables/sardine.yaml index c094185..885d0f4 100644 --- a/data/items/consumables/sardine.yaml +++ b/data/items/consumables/sardine.yaml @@ -7,7 +7,6 @@ craft: fail: burnt_fish fail_message: You accidentally burn the sardine. level: 1 - message: Cooked to perfection. It looks great! skill: cooking station: - fire diff --git a/data/items/consumables/science_serum.yaml b/data/items/consumables/science_serum.yaml index b77cf58..4763e1d 100644 --- a/data/items/consumables/science_serum.yaml +++ b/data/items/consumables/science_serum.yaml @@ -8,7 +8,6 @@ craft: - potato_cactus quantity: 1 level: 76 - message: You mix a science serum. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/shield_potion.yaml b/data/items/consumables/shield_potion.yaml index a0b65c2..3b8b1c7 100644 --- a/data/items/consumables/shield_potion.yaml +++ b/data/items/consumables/shield_potion.yaml @@ -8,7 +8,6 @@ craft: - white_berries quantity: 1 level: 30 - message: You mix a shield potion. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/shrimps.yaml b/data/items/consumables/shrimps.yaml index 03a7edb..dcfc0c4 100644 --- a/data/items/consumables/shrimps.yaml +++ b/data/items/consumables/shrimps.yaml @@ -7,7 +7,6 @@ craft: fail: burnt_fish fail_message: You accidentally burn the shrimps. level: 1 - message: Cooked to perfection. It looks great! skill: cooking station: - fire diff --git a/data/items/consumables/snapdragon_potion_unf.yaml b/data/items/consumables/snapdragon_potion_unf.yaml index fc91a84..a49de71 100644 --- a/data/items/consumables/snapdragon_potion_unf.yaml +++ b/data/items/consumables/snapdragon_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - snapdragon diff --git a/data/items/consumables/stim_potion.yaml b/data/items/consumables/stim_potion.yaml index e9ac25f..34e7282 100644 --- a/data/items/consumables/stim_potion.yaml +++ b/data/items/consumables/stim_potion.yaml @@ -8,7 +8,6 @@ craft: - eye_of_newt quantity: 1 level: 1 - message: You mix a stim potion. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/super_amp.yaml b/data/items/consumables/super_amp.yaml index 361c99b..6105611 100644 --- a/data/items/consumables/super_amp.yaml +++ b/data/items/consumables/super_amp.yaml @@ -8,7 +8,6 @@ craft: - limpwurt_root quantity: 1 level: 55 - message: You mix a super amp. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/super_bio_serum.yaml b/data/items/consumables/super_bio_serum.yaml index 9f5796e..5e4a9cd 100644 --- a/data/items/consumables/super_bio_serum.yaml +++ b/data/items/consumables/super_bio_serum.yaml @@ -8,7 +8,6 @@ craft: - antitoxin_powder quantity: 1 level: 48 - message: You mix a super bio serum. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/super_shield.yaml b/data/items/consumables/super_shield.yaml index 9dc6430..9d0f8dd 100644 --- a/data/items/consumables/super_shield.yaml +++ b/data/items/consumables/super_shield.yaml @@ -8,7 +8,6 @@ craft: - white_berries quantity: 1 level: 66 - message: You mix a super shield. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/super_stim.yaml b/data/items/consumables/super_stim.yaml index 38275ac..00f3aa1 100644 --- a/data/items/consumables/super_stim.yaml +++ b/data/items/consumables/super_stim.yaml @@ -8,7 +8,6 @@ craft: - eye_of_newt quantity: 1 level: 45 - message: You mix a super stim. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/super_stim_cell.yaml b/data/items/consumables/super_stim_cell.yaml index 3fb5761..6879a87 100644 --- a/data/items/consumables/super_stim_cell.yaml +++ b/data/items/consumables/super_stim_cell.yaml @@ -8,7 +8,6 @@ craft: - blight_spore quantity: 1 level: 52 - message: You mix a super stim cell. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/targeting_serum.yaml b/data/items/consumables/targeting_serum.yaml index 5c94040..1d61b64 100644 --- a/data/items/consumables/targeting_serum.yaml +++ b/data/items/consumables/targeting_serum.yaml @@ -8,7 +8,6 @@ craft: - catalyst_wine quantity: 1 level: 72 - message: You mix a targeting serum. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/tarromin_potion_unf.yaml b/data/items/consumables/tarromin_potion_unf.yaml index c7d7dd3..5c15bd9 100644 --- a/data/items/consumables/tarromin_potion_unf.yaml +++ b/data/items/consumables/tarromin_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - tarromin diff --git a/data/items/consumables/tech_serum.yaml b/data/items/consumables/tech_serum.yaml index c763216..1ce7d15 100644 --- a/data/items/consumables/tech_serum.yaml +++ b/data/items/consumables/tech_serum.yaml @@ -8,7 +8,6 @@ craft: - snape_grass quantity: 1 level: 38 - message: You mix a tech serum. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/consumables/toadflax_potion_unf.yaml b/data/items/consumables/toadflax_potion_unf.yaml index 305807d..fce21ec 100644 --- a/data/items/consumables/toadflax_potion_unf.yaml +++ b/data/items/consumables/toadflax_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - toadflax diff --git a/data/items/consumables/torstol_potion_unf.yaml b/data/items/consumables/torstol_potion_unf.yaml index a25fdee..ace9c6e 100644 --- a/data/items/consumables/torstol_potion_unf.yaml +++ b/data/items/consumables/torstol_potion_unf.yaml @@ -1,6 +1,6 @@ color: "48" craft: - type: combine + type: pharmacy consume: - items: - torstol diff --git a/data/items/consumables/trout.yaml b/data/items/consumables/trout.yaml index bb2b69c..4811991 100644 --- a/data/items/consumables/trout.yaml +++ b/data/items/consumables/trout.yaml @@ -7,7 +7,6 @@ craft: fail: burnt_fish fail_message: You accidentally burn the trout. level: 15 - message: Cooked to perfection. It looks great! skill: cooking station: - fire diff --git a/data/items/equipment/coif.yaml b/data/items/equipment/coif.yaml index 3ba300e..111788e 100644 --- a/data/items/equipment/coif.yaml +++ b/data/items/equipment/coif.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 38 - message: You craft a coif. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/diamond_amulet_u.yaml b/data/items/equipment/diamond_amulet_u.yaml index f46fb8b..7370c66 100644 --- a/data/items/equipment/diamond_amulet_u.yaml +++ b/data/items/equipment/diamond_amulet_u.yaml @@ -13,7 +13,6 @@ craft: - amulet_mould quantity: 1 level: 70 - message: You cast a diamond amulet. skill: crafting station: - furnace diff --git a/data/items/equipment/diamond_bracelet.yaml b/data/items/equipment/diamond_bracelet.yaml index c409d4a..96be95b 100644 --- a/data/items/equipment/diamond_bracelet.yaml +++ b/data/items/equipment/diamond_bracelet.yaml @@ -13,7 +13,6 @@ craft: - bracelet_mould quantity: 1 level: 58 - message: You cast a diamond bracelet. skill: crafting station: - furnace diff --git a/data/items/equipment/diamond_necklace.yaml b/data/items/equipment/diamond_necklace.yaml index c53d1cc..8cf6c9f 100644 --- a/data/items/equipment/diamond_necklace.yaml +++ b/data/items/equipment/diamond_necklace.yaml @@ -13,7 +13,6 @@ craft: - necklace_mould quantity: 1 level: 56 - message: You cast a diamond necklace. skill: crafting station: - furnace diff --git a/data/items/equipment/diamond_ring.yaml b/data/items/equipment/diamond_ring.yaml index 36d13d8..67e6599 100644 --- a/data/items/equipment/diamond_ring.yaml +++ b/data/items/equipment/diamond_ring.yaml @@ -13,7 +13,6 @@ craft: - ring_mould quantity: 1 level: 43 - message: You cast a diamond ring. skill: crafting station: - furnace diff --git a/data/items/equipment/emerald_amulet_u.yaml b/data/items/equipment/emerald_amulet_u.yaml index 69a76d5..f493825 100644 --- a/data/items/equipment/emerald_amulet_u.yaml +++ b/data/items/equipment/emerald_amulet_u.yaml @@ -13,7 +13,6 @@ craft: - amulet_mould quantity: 1 level: 31 - message: You cast a emerald amulet. skill: crafting station: - furnace diff --git a/data/items/equipment/emerald_bracelet.yaml b/data/items/equipment/emerald_bracelet.yaml index a809c50..a29424e 100644 --- a/data/items/equipment/emerald_bracelet.yaml +++ b/data/items/equipment/emerald_bracelet.yaml @@ -13,7 +13,6 @@ craft: - bracelet_mould quantity: 1 level: 30 - message: You cast a emerald bracelet. skill: crafting station: - furnace diff --git a/data/items/equipment/emerald_necklace.yaml b/data/items/equipment/emerald_necklace.yaml index 44d7528..22d1544 100644 --- a/data/items/equipment/emerald_necklace.yaml +++ b/data/items/equipment/emerald_necklace.yaml @@ -13,7 +13,6 @@ craft: - necklace_mould quantity: 1 level: 29 - message: You cast a emerald necklace. skill: crafting station: - furnace diff --git a/data/items/equipment/emerald_ring.yaml b/data/items/equipment/emerald_ring.yaml index 8ef1d4a..3b1a436 100644 --- a/data/items/equipment/emerald_ring.yaml +++ b/data/items/equipment/emerald_ring.yaml @@ -13,7 +13,6 @@ craft: - ring_mould quantity: 1 level: 27 - message: You cast a emerald ring. skill: crafting station: - furnace diff --git a/data/items/equipment/gold_amulet_u.yaml b/data/items/equipment/gold_amulet_u.yaml index 2aebbe5..91ae98d 100644 --- a/data/items/equipment/gold_amulet_u.yaml +++ b/data/items/equipment/gold_amulet_u.yaml @@ -10,7 +10,6 @@ craft: - amulet_mould quantity: 1 level: 8 - message: You cast a gold amulet. skill: crafting station: - furnace diff --git a/data/items/equipment/gold_bracelet.yaml b/data/items/equipment/gold_bracelet.yaml index 8c3f2af..a5a19e0 100644 --- a/data/items/equipment/gold_bracelet.yaml +++ b/data/items/equipment/gold_bracelet.yaml @@ -10,7 +10,6 @@ craft: - bracelet_mould quantity: 1 level: 7 - message: You cast a gold bracelet. skill: crafting station: - furnace diff --git a/data/items/equipment/gold_necklace.yaml b/data/items/equipment/gold_necklace.yaml index 569e9b6..7174f8e 100644 --- a/data/items/equipment/gold_necklace.yaml +++ b/data/items/equipment/gold_necklace.yaml @@ -10,7 +10,6 @@ craft: - necklace_mould quantity: 1 level: 6 - message: You cast a gold necklace. skill: crafting station: - furnace diff --git a/data/items/equipment/gold_ring.yaml b/data/items/equipment/gold_ring.yaml index 7a71889..600ac60 100644 --- a/data/items/equipment/gold_ring.yaml +++ b/data/items/equipment/gold_ring.yaml @@ -10,7 +10,6 @@ craft: - ring_mould quantity: 1 level: 5 - message: You cast a gold ring. skill: crafting station: - furnace diff --git a/data/items/equipment/hard_leather_body.yaml b/data/items/equipment/hard_leather_body.yaml index 6c48cee..d100299 100644 --- a/data/items/equipment/hard_leather_body.yaml +++ b/data/items/equipment/hard_leather_body.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 28 - message: You craft a hard leather body. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/hard_leather_shield.yaml b/data/items/equipment/hard_leather_shield.yaml index 4d8e16d..b21bff3 100644 --- a/data/items/equipment/hard_leather_shield.yaml +++ b/data/items/equipment/hard_leather_shield.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 41 - message: You craft a hard leather shield. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/leather_body.yaml b/data/items/equipment/leather_body.yaml index 0e5b864..cf628b4 100644 --- a/data/items/equipment/leather_body.yaml +++ b/data/items/equipment/leather_body.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 14 - message: You craft a leather body. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/leather_boots.yaml b/data/items/equipment/leather_boots.yaml index 7cea340..40c499b 100644 --- a/data/items/equipment/leather_boots.yaml +++ b/data/items/equipment/leather_boots.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 7 - message: You craft a pair of leather boots. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/leather_chaps.yaml b/data/items/equipment/leather_chaps.yaml index 0c2dd44..fd98c09 100644 --- a/data/items/equipment/leather_chaps.yaml +++ b/data/items/equipment/leather_chaps.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 18 - message: You craft a pair of leather chaps. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/leather_cowl.yaml b/data/items/equipment/leather_cowl.yaml index 0c1ab0d..95b75c5 100644 --- a/data/items/equipment/leather_cowl.yaml +++ b/data/items/equipment/leather_cowl.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 9 - message: You craft a leather cowl. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/leather_gloves.yaml b/data/items/equipment/leather_gloves.yaml index a526ab4..805605f 100644 --- a/data/items/equipment/leather_gloves.yaml +++ b/data/items/equipment/leather_gloves.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 1 - message: You craft a pair of leather gloves. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/leather_vambraces.yaml b/data/items/equipment/leather_vambraces.yaml index b23e190..50b84cc 100644 --- a/data/items/equipment/leather_vambraces.yaml +++ b/data/items/equipment/leather_vambraces.yaml @@ -8,7 +8,6 @@ craft: - thread quantity: 1 level: 11 - message: You craft a pair of leather vambraces. skill: crafting tool: needle type: crafting diff --git a/data/items/equipment/ruby_amulet_u.yaml b/data/items/equipment/ruby_amulet_u.yaml index e4123ea..fe9f6c2 100644 --- a/data/items/equipment/ruby_amulet_u.yaml +++ b/data/items/equipment/ruby_amulet_u.yaml @@ -13,7 +13,6 @@ craft: - amulet_mould quantity: 1 level: 50 - message: You cast a ruby amulet. skill: crafting station: - furnace diff --git a/data/items/equipment/ruby_bracelet.yaml b/data/items/equipment/ruby_bracelet.yaml index edc9658..8721d12 100644 --- a/data/items/equipment/ruby_bracelet.yaml +++ b/data/items/equipment/ruby_bracelet.yaml @@ -13,7 +13,6 @@ craft: - bracelet_mould quantity: 1 level: 42 - message: You cast a ruby bracelet. skill: crafting station: - furnace diff --git a/data/items/equipment/ruby_necklace.yaml b/data/items/equipment/ruby_necklace.yaml index 8496eb6..b66f3e9 100644 --- a/data/items/equipment/ruby_necklace.yaml +++ b/data/items/equipment/ruby_necklace.yaml @@ -13,7 +13,6 @@ craft: - necklace_mould quantity: 1 level: 40 - message: You cast a ruby necklace. skill: crafting station: - furnace diff --git a/data/items/equipment/ruby_ring.yaml b/data/items/equipment/ruby_ring.yaml index 335fbb0..01bd441 100644 --- a/data/items/equipment/ruby_ring.yaml +++ b/data/items/equipment/ruby_ring.yaml @@ -13,7 +13,6 @@ craft: - ring_mould quantity: 1 level: 63 - message: You cast a ruby ring. skill: crafting station: - furnace diff --git a/data/items/equipment/sapphire_amulet_u.yaml b/data/items/equipment/sapphire_amulet_u.yaml index b342ae4..71462c4 100644 --- a/data/items/equipment/sapphire_amulet_u.yaml +++ b/data/items/equipment/sapphire_amulet_u.yaml @@ -13,7 +13,6 @@ craft: - amulet_mould quantity: 1 level: 24 - message: You cast a sapphire amulet. skill: crafting station: - furnace diff --git a/data/items/equipment/sapphire_bracelet.yaml b/data/items/equipment/sapphire_bracelet.yaml index 7d19018..ffcf8d7 100644 --- a/data/items/equipment/sapphire_bracelet.yaml +++ b/data/items/equipment/sapphire_bracelet.yaml @@ -13,7 +13,6 @@ craft: - bracelet_mould quantity: 1 level: 23 - message: You cast a sapphire bracelet. skill: crafting station: - furnace diff --git a/data/items/equipment/sapphire_necklace.yaml b/data/items/equipment/sapphire_necklace.yaml index e51a47f..f9a3576 100644 --- a/data/items/equipment/sapphire_necklace.yaml +++ b/data/items/equipment/sapphire_necklace.yaml @@ -13,7 +13,6 @@ craft: - necklace_mould quantity: 1 level: 22 - message: You cast a sapphire necklace. skill: crafting station: - furnace diff --git a/data/items/equipment/sapphire_ring.yaml b/data/items/equipment/sapphire_ring.yaml index d880c75..f410593 100644 --- a/data/items/equipment/sapphire_ring.yaml +++ b/data/items/equipment/sapphire_ring.yaml @@ -13,7 +13,6 @@ craft: - ring_mould quantity: 1 level: 20 - message: You cast a sapphire ring. skill: crafting station: - furnace diff --git a/data/items/materials/adamantite_bar.yaml b/data/items/materials/adamantite_bar.yaml index 1367d4e..2d2dad5 100644 --- a/data/items/materials/adamantite_bar.yaml +++ b/data/items/materials/adamantite_bar.yaml @@ -9,7 +9,6 @@ craft: quantity: 6 fail_message: You fail to smelt a usable bar. level: 65 - message: You remove a white hot adamantite bar! skill: smithing station: - furnace diff --git a/data/items/materials/avantoe.yaml b/data/items/materials/avantoe.yaml index 47fc405..328ada2 100644 --- a/data/items/materials/avantoe.yaml +++ b/data/items/materials/avantoe.yaml @@ -5,7 +5,6 @@ craft: - grimy_avantoe quantity: 1 level: 48 - message: You clean the grimy avantoe leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/ball_of_wool.yaml b/data/items/materials/ball_of_wool.yaml index 0f2c000..7c17ffe 100644 --- a/data/items/materials/ball_of_wool.yaml +++ b/data/items/materials/ball_of_wool.yaml @@ -5,7 +5,7 @@ craft: - wool quantity: 1 level: 1 - message: You spin the wool into a ball. + message: "You spin the wool into a %n." skill: crafting station: - spinning_wheel diff --git a/data/items/materials/bowstring.yaml b/data/items/materials/bowstring.yaml index ef17ce5..4b2b18e 100644 --- a/data/items/materials/bowstring.yaml +++ b/data/items/materials/bowstring.yaml @@ -5,7 +5,7 @@ craft: - flax quantity: 1 level: 1 - message: You spin the flax into a bowstring. + message: "You spin the flax into a %n." skill: crafting station: - spinning_wheel diff --git a/data/items/materials/bronze_bar.yaml b/data/items/materials/bronze_bar.yaml index 7590114..0eb7316 100644 --- a/data/items/materials/bronze_bar.yaml +++ b/data/items/materials/bronze_bar.yaml @@ -9,7 +9,6 @@ craft: quantity: 1 fail_message: You fail to smelt a usable bar. level: 1 - message: You remove a white hot bronze bar! skill: smithing station: - furnace diff --git a/data/items/materials/cadantine.yaml b/data/items/materials/cadantine.yaml index 24da88a..10a99f9 100644 --- a/data/items/materials/cadantine.yaml +++ b/data/items/materials/cadantine.yaml @@ -5,7 +5,6 @@ craft: - grimy_cadantine quantity: 1 level: 65 - message: You clean the grimy cadantine leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/diamond.yaml b/data/items/materials/diamond.yaml index aecdade..8372d79 100644 --- a/data/items/materials/diamond.yaml +++ b/data/items/materials/diamond.yaml @@ -5,7 +5,7 @@ craft: - uncut_diamond quantity: 1 level: 43 - message: You cut the diamond into a beautiful gem. + message: "You cut the %i1 into a beautiful %n." skill: crafting tool: chisel type: crafting diff --git a/data/items/materials/dwarf_weed.yaml b/data/items/materials/dwarf_weed.yaml index 13b54ec..f9d7011 100644 --- a/data/items/materials/dwarf_weed.yaml +++ b/data/items/materials/dwarf_weed.yaml @@ -5,7 +5,6 @@ craft: - grimy_dwarf_weed quantity: 1 level: 70 - message: You clean the grimy dwarf weed leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/emerald.yaml b/data/items/materials/emerald.yaml index 8b3a888..424e5c0 100644 --- a/data/items/materials/emerald.yaml +++ b/data/items/materials/emerald.yaml @@ -5,7 +5,7 @@ craft: - uncut_emerald quantity: 1 level: 27 - message: You cut the emerald into a beautiful gem. + message: "You cut the %i1 into a beautiful %n." skill: crafting tool: chisel type: crafting diff --git a/data/items/materials/gold_bar.yaml b/data/items/materials/gold_bar.yaml index e46bb1b..ae39ece 100644 --- a/data/items/materials/gold_bar.yaml +++ b/data/items/materials/gold_bar.yaml @@ -6,7 +6,6 @@ craft: quantity: 1 fail_message: You fail to smelt a usable bar. level: 45 - message: You remove a white hot gold bar! skill: smithing station: - furnace diff --git a/data/items/materials/guam.yaml b/data/items/materials/guam.yaml index 191252a..9bfe8b9 100644 --- a/data/items/materials/guam.yaml +++ b/data/items/materials/guam.yaml @@ -5,7 +5,6 @@ craft: - grimy_guam quantity: 1 level: 1 - message: You clean the grimy guam leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/harralander.yaml b/data/items/materials/harralander.yaml index c8b42e7..8f965e5 100644 --- a/data/items/materials/harralander.yaml +++ b/data/items/materials/harralander.yaml @@ -5,7 +5,6 @@ craft: - grimy_harralander quantity: 1 level: 20 - message: You clean the grimy harralander leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/irit.yaml b/data/items/materials/irit.yaml index 3a6498e..147e28d 100644 --- a/data/items/materials/irit.yaml +++ b/data/items/materials/irit.yaml @@ -5,7 +5,6 @@ craft: - grimy_irit quantity: 1 level: 40 - message: You clean the grimy irit leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/iron_bar.yaml b/data/items/materials/iron_bar.yaml index ae474cd..5ca3635 100644 --- a/data/items/materials/iron_bar.yaml +++ b/data/items/materials/iron_bar.yaml @@ -6,7 +6,6 @@ craft: quantity: 1 fail_message: The iron is too impure to make a workable bar. level: 20 - message: You remove a white hot iron bar! skill: smithing station: - furnace diff --git a/data/items/materials/kwuarm.yaml b/data/items/materials/kwuarm.yaml index bcb9af4..8d7a9f2 100644 --- a/data/items/materials/kwuarm.yaml +++ b/data/items/materials/kwuarm.yaml @@ -5,7 +5,6 @@ craft: - grimy_kwuarm quantity: 1 level: 54 - message: You clean the grimy kwuarm leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/lantadyme.yaml b/data/items/materials/lantadyme.yaml index ef55555..1444874 100644 --- a/data/items/materials/lantadyme.yaml +++ b/data/items/materials/lantadyme.yaml @@ -5,7 +5,6 @@ craft: - grimy_lantadyme quantity: 1 level: 67 - message: You clean the grimy lantadyme leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/mahogany_planks.yaml b/data/items/materials/mahogany_planks.yaml index da50f67..f24ea08 100644 --- a/data/items/materials/mahogany_planks.yaml +++ b/data/items/materials/mahogany_planks.yaml @@ -5,7 +5,7 @@ craft: - mahogany_logs quantity: 1 level: 50 - message: You saw the mahogany logs into luxurious mahogany planks. + message: "You saw the mahogany logs into %n." skill: construction station: - workbench diff --git a/data/items/materials/marrentill.yaml b/data/items/materials/marrentill.yaml index 1da0427..771c3f3 100644 --- a/data/items/materials/marrentill.yaml +++ b/data/items/materials/marrentill.yaml @@ -5,7 +5,6 @@ craft: - grimy_marrentill quantity: 1 level: 5 - message: You clean the grimy marrentill leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/mithril_bar.yaml b/data/items/materials/mithril_bar.yaml index aee681a..55d35e9 100644 --- a/data/items/materials/mithril_bar.yaml +++ b/data/items/materials/mithril_bar.yaml @@ -9,7 +9,6 @@ craft: quantity: 4 fail_message: You fail to smelt a usable bar. level: 50 - message: You remove a white hot mithril bar! skill: smithing station: - furnace diff --git a/data/items/materials/oak_planks.yaml b/data/items/materials/oak_planks.yaml index 2975555..9a35533 100644 --- a/data/items/materials/oak_planks.yaml +++ b/data/items/materials/oak_planks.yaml @@ -5,7 +5,7 @@ craft: - oak_logs quantity: 1 level: 15 - message: You saw the oak logs into sturdy oak planks. + message: "You saw the oak logs into %n." skill: construction station: - workbench diff --git a/data/items/materials/planks.yaml b/data/items/materials/planks.yaml index ce0e68f..44017b2 100644 --- a/data/items/materials/planks.yaml +++ b/data/items/materials/planks.yaml @@ -5,7 +5,7 @@ craft: - logs quantity: 1 level: 1 - message: You saw the logs into some regular planks. + message: "You saw the logs into %n." skill: construction station: - workbench diff --git a/data/items/materials/ranarr.yaml b/data/items/materials/ranarr.yaml index c34cbb7..090df69 100644 --- a/data/items/materials/ranarr.yaml +++ b/data/items/materials/ranarr.yaml @@ -5,7 +5,6 @@ craft: - grimy_ranarr quantity: 1 level: 25 - message: You clean the grimy ranarr leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/ruby.yaml b/data/items/materials/ruby.yaml index 301bdd3..4bfbc9c 100644 --- a/data/items/materials/ruby.yaml +++ b/data/items/materials/ruby.yaml @@ -5,7 +5,7 @@ craft: - uncut_ruby quantity: 1 level: 63 - message: You cut the ruby into a beautiful gem. + message: "You cut the %i1 into a beautiful %n." skill: crafting tool: chisel type: crafting diff --git a/data/items/materials/runite_bar.yaml b/data/items/materials/runite_bar.yaml index 65f5209..b04bf92 100644 --- a/data/items/materials/runite_bar.yaml +++ b/data/items/materials/runite_bar.yaml @@ -9,7 +9,6 @@ craft: quantity: 8 fail_message: You fail to smelt a usable bar. level: 80 - message: You remove a white hot runite bar! skill: smithing station: - furnace diff --git a/data/items/materials/sapphire.yaml b/data/items/materials/sapphire.yaml index e2a2bb3..aaa5607 100644 --- a/data/items/materials/sapphire.yaml +++ b/data/items/materials/sapphire.yaml @@ -5,7 +5,7 @@ craft: - uncut_sapphire quantity: 1 level: 20 - message: You cut the sapphire into a beautiful gem. + message: "You cut the %i1 into a beautiful %n." skill: crafting tool: chisel type: crafting diff --git a/data/items/materials/silver_bar.yaml b/data/items/materials/silver_bar.yaml index 58c2056..04c0982 100644 --- a/data/items/materials/silver_bar.yaml +++ b/data/items/materials/silver_bar.yaml @@ -6,7 +6,6 @@ craft: quantity: 1 fail_message: You fail to smelt a usable bar. level: 25 - message: You remove a white hot silver bar! skill: smithing station: - furnace diff --git a/data/items/materials/snapdragon.yaml b/data/items/materials/snapdragon.yaml index 95ac4bf..8dbbac1 100644 --- a/data/items/materials/snapdragon.yaml +++ b/data/items/materials/snapdragon.yaml @@ -5,7 +5,6 @@ craft: - grimy_snapdragon quantity: 1 level: 59 - message: You clean the grimy snapdragon leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/steel_bar.yaml b/data/items/materials/steel_bar.yaml index 27ed65c..ee300c1 100644 --- a/data/items/materials/steel_bar.yaml +++ b/data/items/materials/steel_bar.yaml @@ -9,7 +9,6 @@ craft: quantity: 2 fail_message: You fail to smelt a usable bar. level: 40 - message: You remove a white hot steel bar! skill: smithing station: - furnace diff --git a/data/items/materials/stim_cell.yaml b/data/items/materials/stim_cell.yaml index c89191c..5b2f670 100644 --- a/data/items/materials/stim_cell.yaml +++ b/data/items/materials/stim_cell.yaml @@ -8,7 +8,6 @@ craft: - chocolate_dust quantity: 1 level: 26 - message: You mix a stim cell. skill: pharmacy type: pharmacy wait: 4 diff --git a/data/items/materials/tarromin.yaml b/data/items/materials/tarromin.yaml index 3451e89..33a06c7 100644 --- a/data/items/materials/tarromin.yaml +++ b/data/items/materials/tarromin.yaml @@ -5,7 +5,6 @@ craft: - grimy_tarromin quantity: 1 level: 11 - message: You clean the grimy tarromin leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/teak_planks.yaml b/data/items/materials/teak_planks.yaml index 8a9effc..ea4d470 100644 --- a/data/items/materials/teak_planks.yaml +++ b/data/items/materials/teak_planks.yaml @@ -5,7 +5,7 @@ craft: - teak_logs quantity: 1 level: 35 - message: You saw the teak logs into fine teak planks. + message: "You saw the teak logs into %n." skill: construction station: - workbench diff --git a/data/items/materials/toadflax.yaml b/data/items/materials/toadflax.yaml index d3fa236..24aae74 100644 --- a/data/items/materials/toadflax.yaml +++ b/data/items/materials/toadflax.yaml @@ -5,7 +5,6 @@ craft: - grimy_toadflax quantity: 1 level: 30 - message: You clean the grimy toadflax leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/materials/torstol.yaml b/data/items/materials/torstol.yaml index 97cc20e..859c279 100644 --- a/data/items/materials/torstol.yaml +++ b/data/items/materials/torstol.yaml @@ -5,7 +5,6 @@ craft: - grimy_torstol quantity: 1 level: 75 - message: You clean the grimy torstol leaf. skill: pharmacy type: clean wait: 2 diff --git a/data/items/misc/mahogany_table.yaml b/data/items/misc/mahogany_table.yaml index f932fbe..c52bf86 100644 --- a/data/items/misc/mahogany_table.yaml +++ b/data/items/misc/mahogany_table.yaml @@ -5,7 +5,6 @@ craft: - mahogany_planks quantity: 3 level: 52 - message: You build a luxurious mahogany table. skill: construction station: - workbench diff --git a/data/items/misc/oak_shelf.yaml b/data/items/misc/oak_shelf.yaml index b797d70..cb607b2 100644 --- a/data/items/misc/oak_shelf.yaml +++ b/data/items/misc/oak_shelf.yaml @@ -5,7 +5,6 @@ craft: - oak_planks quantity: 2 level: 18 - message: You assemble the oak planks into a sturdy shelf. skill: construction station: - workbench diff --git a/data/items/misc/oak_table.yaml b/data/items/misc/oak_table.yaml index 407380f..7a715a8 100644 --- a/data/items/misc/oak_table.yaml +++ b/data/items/misc/oak_table.yaml @@ -5,7 +5,6 @@ craft: - oak_planks quantity: 3 level: 20 - message: You build a fine oak table. skill: construction station: - workbench diff --git a/data/items/misc/teak_table.yaml b/data/items/misc/teak_table.yaml index 36c1be6..bc5e19b 100644 --- a/data/items/misc/teak_table.yaml +++ b/data/items/misc/teak_table.yaml @@ -5,7 +5,6 @@ craft: - teak_planks quantity: 3 level: 38 - message: You build an elegant teak table. skill: construction station: - workbench diff --git a/data/items/misc/wooden_chair.yaml b/data/items/misc/wooden_chair.yaml index 786a818..04d39df 100644 --- a/data/items/misc/wooden_chair.yaml +++ b/data/items/misc/wooden_chair.yaml @@ -5,7 +5,6 @@ craft: - planks quantity: 2 level: 8 - message: You craft a comfortable wooden chair. skill: construction station: - workbench diff --git a/data/items/misc/wooden_shelf.yaml b/data/items/misc/wooden_shelf.yaml index a99c0a5..c691bf4 100644 --- a/data/items/misc/wooden_shelf.yaml +++ b/data/items/misc/wooden_shelf.yaml @@ -5,7 +5,6 @@ craft: - planks quantity: 2 level: 4 - message: You assemble the planks into a wooden shelf. skill: construction station: - workbench diff --git a/data/items/misc/wooden_table.yaml b/data/items/misc/wooden_table.yaml index c59c997..a1c71d4 100644 --- a/data/items/misc/wooden_table.yaml +++ b/data/items/misc/wooden_table.yaml @@ -5,7 +5,6 @@ craft: - planks quantity: 3 level: 6 - message: You build a sturdy wooden table. skill: construction station: - workbench diff --git a/data/items/tools/empty_pot.yaml b/data/items/tools/empty_pot.yaml index 0e1669a..b780af1 100644 --- a/data/items/tools/empty_pot.yaml +++ b/data/items/tools/empty_pot.yaml @@ -6,7 +6,7 @@ craft: quantity: 1 fail_message: The pot cracks in the oven and is ruined. level: 1 - message: You fire the pot in the oven successfully. + message: "You fire the %i1 in the oven." skill: crafting station: - pottery_oven diff --git a/data/items/tools/plant_pot.yaml b/data/items/tools/plant_pot.yaml index bafd007..abe9610 100644 --- a/data/items/tools/plant_pot.yaml +++ b/data/items/tools/plant_pot.yaml @@ -6,7 +6,7 @@ craft: quantity: 1 fail_message: The plant pot cracks in the oven and is ruined. level: 19 - message: You fire the plant pot in the oven successfully. + message: "You fire the %i1 in the oven." skill: crafting station: - pottery_oven diff --git a/data/items/tools/unfired_pie_dish.yaml b/data/items/tools/unfired_pie_dish.yaml index ee3fc6b..0b3049b 100644 --- a/data/items/tools/unfired_pie_dish.yaml +++ b/data/items/tools/unfired_pie_dish.yaml @@ -5,7 +5,7 @@ craft: - soft_clay quantity: 1 level: 7 - message: You shape the clay into a pie dish. + message: "You shape the clay into a %n." skill: crafting station: - pottery_wheel diff --git a/data/items/tools/unfired_plant_pot.yaml b/data/items/tools/unfired_plant_pot.yaml index 960112e..943cd67 100644 --- a/data/items/tools/unfired_plant_pot.yaml +++ b/data/items/tools/unfired_plant_pot.yaml @@ -5,7 +5,7 @@ craft: - soft_clay quantity: 1 level: 19 - message: You shape the clay into a plant pot. + message: "You shape the clay into a %n." skill: crafting station: - pottery_wheel diff --git a/data/items/tools/unfired_pot.yaml b/data/items/tools/unfired_pot.yaml index 654cd77..5c6b446 100644 --- a/data/items/tools/unfired_pot.yaml +++ b/data/items/tools/unfired_pot.yaml @@ -5,7 +5,7 @@ craft: - soft_clay quantity: 1 level: 1 - message: You shape the clay into a pot. + message: "You shape the clay into a %n." skill: crafting station: - pottery_wheel diff --git a/internal/game/action_burn.go b/internal/game/action_burn.go index 71b5a35..03a5572 100644 --- a/internal/game/action_burn.go +++ b/internal/game/action_burn.go @@ -199,7 +199,7 @@ func (g *Game) advanceBurn(sess *net.Session, p *player.Player) { g.AccountStore.SaveCharacter(p) sess.WriteLine(g.colorize(sess, "fire", fmt.Sprintf("You drop the %s and begin to make a fire...", g.itemColorize(sess, logDef, logDef.Name)))) - g.broadcastDrop(p, logDef.Name) + g.broadcastDrop(p, itemID, logDef.Name) data["phase"] = 1 p.Action.WaitLeft = engine.ToTicks(toolSpeed) @@ -293,7 +293,7 @@ func (g *Game) advanceStoke(sess *net.Session, p *player.Player) { g.AccountStore.SaveCharacter(p) - msg := g.colorize(sess, "fire", fmt.Sprintf("You throw %s onto the fire.", name)) + msg := g.colorize(sess, "fire", fmt.Sprintf("You throw %s onto the fire.", g.itemColorize(sess, logDef, name))) if xp > 0 && p.OptionBool("xp_drops") { msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", xp, player.SkillAbbr[player.Firemaking])) } @@ -407,11 +407,16 @@ func (g *Game) hasFireObject(roomID int) bool { return g.findFireObjectKey(roomID) != "" } -func (g *Game) broadcastDrop(p *player.Player, itemName string) { +func (g *Game) broadcastDrop(p *player.Player, itemID, itemName string) { + itemDef, _ := g.ItemStore.Load(itemID) for _, other := range g.Hub.PlayersInRoom(p.RoomID) { op := other.Player if op != nil && op.Name != p.Name { - other.WriteLine(fmt.Sprintf("\n%s drops a %s.", p.Name, itemName)) + colored := itemName + if itemDef != nil { + colored = g.itemColorize(other, itemDef, itemName) + } + other.WriteLine(fmt.Sprintf("%s drops a %s.", p.Name, colored)) } } } diff --git a/internal/game/action_clean.go b/internal/game/action_clean.go index b85a3e0..77b6ea3 100644 --- a/internal/game/action_clean.go +++ b/internal/game/action_clean.go @@ -6,6 +6,7 @@ import ( "thehouseoficarus/internal/engine" "thehouseoficarus/internal/net" + "thehouseoficarus/internal/object" "thehouseoficarus/internal/player" ) @@ -21,7 +22,7 @@ func (g *Game) advanceClean(sess *net.Session, p *player.Player) { items := g.CraftIndex.ByType("clean") - var match *cleanMatch + var matchItem *object.ItemDef for _, item := range items { c := item.FirstCraft() if filter != "" { @@ -39,41 +40,36 @@ func (g *Game) advanceClean(sess *net.Session, p *player.Player) { if !craftHasAllItems(c, p.HasItem) { continue } - match = &cleanMatch{c.Consume[0].Items[0], item.ID, c.XP, c.Message} + matchItem = item break } - if match == nil { - sess.WriteLine("\nYou've finished cleaning herbs.") + if matchItem == nil { + sess.WriteLine("You've finished cleaning herbs.") g.cancelBgAction(p) return } + craft := matchItem.FirstCraft() + consumeID := craft.Consume[0].Items[0] + for i := 0; i < 28; i++ { slot := p.InvSlot(i) - if slot != nil && slot.ItemID == match.consumeID { - slot.ItemID = match.outputID + if slot != nil && slot.ItemID == consumeID { + slot.ItemID = matchItem.ID break } } - if match.xp > 0 { - g.awardSkillXP(sess, p, player.Pharmacy, match.xp) + if craft.XP > 0 { + g.awardSkillXP(sess, p, player.Pharmacy, craft.XP) } g.AccountStore.SaveCharacter(p) - msg := match.message - if msg == "" { - outDef, _ := g.ItemStore.Load(match.outputID) - outputName := match.outputID - if outDef != nil { - outputName = outDef.Name - } - msg = fmt.Sprintf("You clean a %s.", outputName) - } - if p.OptionBool("xp_drops") && match.xp > 0 { + msg := g.resolveCraftMessage(sess, craft.Message, "You clean the %i1.", craft, matchItem.ID, nil, p.HasItem) + if p.OptionBool("xp_drops") && craft.XP > 0 { abbr := player.SkillAbbr[player.Pharmacy] - msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", match.xp, abbr)) + msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", craft.XP, abbr)) } sess.WriteLine(msg) @@ -96,17 +92,10 @@ func (g *Game) advanceClean(sess *net.Session, p *player.Player) { } if !hasMore { - sess.WriteLine("\nYou've finished cleaning herbs.") + sess.WriteLine("You've finished cleaning herbs.") g.cancelBgAction(p) return } p.BackgroundAction.WaitLeft = engine.ToTicks(2) } - -type cleanMatch struct { - consumeID string - outputID string - xp int - message string -} diff --git a/internal/game/action_farm.go b/internal/game/action_farm.go index 679af83..6361901 100644 --- a/internal/game/action_farm.go +++ b/internal/game/action_farm.go @@ -114,7 +114,7 @@ func (g *Game) advanceFarmGrowth(sess *net.Session, p *player.Player) { p.Flags[prefix+"_dead"] = true p.Flags[prefix+"_diseased"] = false sess.WriteLine(g.colorize(sess, "farm_disease", - fmt.Sprintf("\nYour %s has died from disease!", seedDisplayName(g, seedID)))) + fmt.Sprintf("\nYour %s has died from disease!", g.seedDisplayName(sess, seedID)))) g.AccountStore.SaveCharacter(p) continue } @@ -140,7 +140,7 @@ func (g *Game) advanceFarmGrowth(sess *net.Session, p *player.Player) { p.Flags[prefix+"_watered"] = false sess.WriteLine(g.colorize(sess, "farm_grow", fmt.Sprintf("\nYour %s is fully grown and ready to harvest!", - seedDisplayName(g, seedID)))) + g.seedDisplayName(sess, seedID)))) } else { if !watered && rand.Float64() < 0.10 { p.Flags[prefix+"_stage"] = stage @@ -148,22 +148,22 @@ func (g *Game) advanceFarmGrowth(sess *net.Session, p *player.Player) { p.Flags[prefix+"_watered"] = false sess.WriteLine(g.colorize(sess, "farm_disease", fmt.Sprintf("\nYour %s has become diseased!", - seedDisplayName(g, seedID)))) + g.seedDisplayName(sess, seedID)))) } else { p.Flags[prefix+"_stage"] = stage p.Flags[prefix+"_watered"] = false sess.WriteLine(g.colorize(sess, "farm_grow", fmt.Sprintf("\nYour %s has grown to stage %d/%d.", - seedDisplayName(g, seedID), stage, maxStages))) + g.seedDisplayName(sess, seedID), stage, maxStages))) } } g.AccountStore.SaveCharacter(p) } } -func seedDisplayName(g *Game, seedID string) string { +func (g *Game) seedDisplayName(sess *net.Session, seedID string) string { if def, err := g.ItemStore.Load(seedID); err == nil { - return def.Name + return g.itemColorize(sess, def, def.Name) } return seedID } @@ -194,7 +194,7 @@ func (g *Game) advancePlant(sess *net.Session, p *player.Player) { seedName := seedID if def, err := g.ItemStore.Load(seedID); err == nil { - seedName = def.Name + seedName = g.itemColorize(sess, def, def.Name) } patchName := patchDisplayName(prefix) msg := fmt.Sprintf("You plant a %s in the %s.", seedName, patchName) @@ -287,7 +287,7 @@ func (g *Game) advanceHarvest(sess *net.Session, p *player.Player) { productName := product if productDef != nil { - productName = productDef.Name + productName = g.itemColorize(sess, productDef, productDef.Name) } patchName := patchDisplayName(prefix) msg := fmt.Sprintf("You harvest %d %s from the %s.", yield, productName, patchName) @@ -562,7 +562,7 @@ func (g *Game) showFarmPatches(sess *net.Session, p *player.Player) { seedName := seedID if sd, err := g.ItemStore.Load(seedID); err == nil { - seedName = sd.Name + seedName = g.itemColorize(sess, sd, sd.Name) } dead, _ := p.Flags[prefix+"_dead"].(bool) diff --git a/internal/game/action_finishing_blow.go b/internal/game/action_finishing_blow.go index 1a31d86..674c2ef 100644 --- a/internal/game/action_finishing_blow.go +++ b/internal/game/action_finishing_blow.go @@ -53,11 +53,11 @@ func (g *Game) doFinishingBlow(sess *net.Session, p *player.Player, mob *world.M return } if !fbDef.MatchesName(itemInput) && !strings.EqualFold(itemInput, fbDef.ID) { - sess.WriteLine(fmt.Sprintf("That won't work on %s. You need %s.", mobDisplayName(mob, true), fbDef.Name)) + sess.WriteLine(fmt.Sprintf("That won't work on %s. You need %s.", mobDisplayName(mob, true), g.itemColorize(sess, fbDef, fbDef.Name))) return } if !p.HasItem(mob.FinishingBlow) { - sess.WriteLine(fmt.Sprintf("You don't have any %s.", fbDef.Name)) + sess.WriteLine(fmt.Sprintf("You don't have any %s.", g.itemColorize(sess, fbDef, fbDef.Name))) return } autoKey := "assassin_unlocked_auto_" + mob.FinishingBlow diff --git a/internal/game/action_fletch.go b/internal/game/action_fletch.go index 52de86b..a8571ea 100644 --- a/internal/game/action_fletch.go +++ b/internal/game/action_fletch.go @@ -82,7 +82,12 @@ func (g *Game) doInstantFletch(sess *net.Session, p *player.Player, item *object g.AccountStore.SaveCharacter(p) - msg := fmt.Sprintf("You fletch %d %s.", totalOutput, item.Name) + outDef, _ := g.ItemStore.Load(item.ID) + outputName := item.Name + if outDef != nil { + outputName = g.itemColorize(sess, outDef, outDef.Name) + } + msg := fmt.Sprintf("You fletch %d %s.", totalOutput, outputName) if p.OptionBool("xp_drops") && c.XP > 0 { totalXP := c.XP * batches abbr := player.SkillAbbr[skill] @@ -92,6 +97,19 @@ func (g *Game) doInstantFletch(sess *net.Session, p *player.Player, item *object } func (g *Game) startTimedFletch(sess *net.Session, p *player.Player, item *object.ItemDef, count int) { + craft := item.FirstCraft() + + startMsg := g.resolveCraftMessage(sess, craft.StartMessage, "You begin fletching %i1.", craft, item.ID, nil, p.HasItem) + + sess.WriteLine(startMsg) + + broadcastName := item.Name + if def, _ := g.ItemStore.Load(item.ID); def != nil { + broadcastName = def.Name + } + g.broadcastAction(sess, "%s starts fletching.", p.Name) + _ = broadcastName + p.BackgroundAction = &action.Action{ Type: "fletch", TargetID: item.ID, @@ -99,16 +117,12 @@ func (g *Game) startTimedFletch(sess *net.Session, p *player.Player, item *objec Data: map[string]any{ "item_id": item.ID, "phase": 0, - "wait": item.FirstCraft().Wait, + "wait": craft.Wait, "remaining": count, }, WaitLeft: engine.ToTicks(1), } p.BackgroundActionState = &ActionState{Type: ActionFletching, TargetName: item.Name} - - g.broadcastAction(sess, "\n%s starts fletching.", p.Name) - - sess.WriteLine(fmt.Sprintf("\nYou begin fletching %s.", item.Name)) } func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { @@ -132,7 +146,7 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { tmpItem := &object.ItemDef{Craft: object.CraftList{*c}} if !g.canDoFletchItem(p, tmpItem) { - sess.WriteLine("\nYou've run out of fletching materials.") + sess.WriteLine("You've run out of fletching materials.") g.cancelBgAction(p) return } @@ -160,7 +174,7 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { craftConsumeAll(c, p.HasItem, p.RemoveItem) freeSlot := p.FirstFreeSlot() if freeSlot == -1 { - sess.WriteLine("\nYour inventory is too full!") + sess.WriteLine("Your inventory is too full!") g.cancelBgAction(p) return } @@ -172,10 +186,7 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { } g.AccountStore.SaveCharacter(p) - msg := c.Message - if msg == "" { - msg = fmt.Sprintf("You fletch %s.", item.Name) - } + msg := g.resolveCraftMessage(sess, c.Message, "You fletch a %n.", c, item.ID, nil, p.HasItem) if p.OptionBool("xp_drops") && c.XP > 0 { abbr := player.SkillAbbr[skill] msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", c.XP, abbr)) @@ -186,14 +197,14 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { remaining-- p.BackgroundAction.Data["remaining"] = remaining if remaining <= 0 { - sess.WriteLine("\nYou've finished fletching.") + sess.WriteLine("You've finished fletching.") g.cancelBgAction(p) return } } if !g.canContinueProduction(p, item) { - sess.WriteLine("\nYou've run out of fletching materials.") + sess.WriteLine("You've run out of fletching materials.") g.cancelBgAction(p) return } diff --git a/internal/game/action_gather.go b/internal/game/action_gather.go index 9b47de2..00c9070 100644 --- a/internal/game/action_gather.go +++ b/internal/game/action_gather.go @@ -378,8 +378,9 @@ func (g *Game) checkBirdNest(sess *net.Session, p *player.Player, cfg *action.Ga } nestName := "bird's nest" - if def, err := g.ItemStore.Load(birdsNestItemID); err == nil { - nestName = def.Name + nestDef, _ := g.ItemStore.Load(birdsNestItemID) + if nestDef != nil { + nestName = g.itemColorize(sess, nestDef, nestDef.Name) } freeSlot := -1 diff --git a/internal/game/action_identify.go b/internal/game/action_identify.go index fd7df20..faca2f5 100644 --- a/internal/game/action_identify.go +++ b/internal/game/action_identify.go @@ -60,7 +60,7 @@ func (g *Game) advanceIdentify(sess *net.Session, p *player.Player) { totalXP := scrapCount * xpPer junkName := junkID if def, err := g.ItemStore.Load(junkID); err == nil { - junkName = def.Name + junkName = g.itemColorize(sess, def, def.Name) } msg := fmt.Sprintf("The altar hums. You identify %d scrap into %d %s.", scrapCount, totalJunk, junkName) diff --git a/internal/game/action_use.go b/internal/game/action_use.go index a3858a9..b4c4b25 100644 --- a/internal/game/action_use.go +++ b/internal/game/action_use.go @@ -22,7 +22,7 @@ func (g *Game) startUse(sess *net.Session, p *player.Player, obj *object.ObjectD if !p.HasItem(itemID) { defName := itemID if def, err := g.ItemStore.Load(itemID); err == nil { - defName = def.Name + defName = g.itemColorize(sess, def, def.Name) } sess.WriteLine(fmt.Sprintf("You need %s to use this.", defName)) return @@ -60,7 +60,7 @@ func (g *Game) advanceUse(sess *net.Session, p *player.Player) { if !p.HasItem(itemID) { defName := itemID if def, err := g.ItemStore.Load(itemID); err == nil { - defName = def.Name + defName = g.itemColorize(sess, def, def.Name) } sess.WriteLine(fmt.Sprintf("You've run out of %s.", defName)) g.cancelAction(p) diff --git a/internal/game/cmd_bank.go b/internal/game/cmd_bank.go index 5f9067d..d95f7c0 100644 --- a/internal/game/cmd_bank.go +++ b/internal/game/cmd_bank.go @@ -101,9 +101,10 @@ func (g *Game) showBankBrowse(sess *net.Session) { }) for _, e := range entries { + def, _ := g.ItemStore.Load(e.id) t.Rows = append(t.Rows, []string{ fmt.Sprintf("%d", e.slot+1), - g.colorize(sess, "item", e.name), + g.itemColorize(sess, def, e.name), fmt.Sprintf("%d", e.qty), }) } diff --git a/internal/game/cmd_clean.go b/internal/game/cmd_clean.go index 28758b8..a40f5fc 100644 --- a/internal/game/cmd_clean.go +++ b/internal/game/cmd_clean.go @@ -74,9 +74,9 @@ func (g *Game) doClean(sess *net.Session, input string) { } p.BackgroundActionState = &ActionState{Type: ActionCleaning} - g.broadcastAction(sess, "\n%s starts cleaning herbs.", p.Name) + g.broadcastAction(sess, "%s starts cleaning herbs.", p.Name) - sess.WriteLine("\nYou begin cleaning herbs.") + sess.WriteLine("You begin cleaning herbs.") } func matchesCleanFilter(item *object.ItemDef, filter string) bool { diff --git a/internal/game/cmd_shop.go b/internal/game/cmd_shop.go index c6b7831..f0e18fe 100644 --- a/internal/game/cmd_shop.go +++ b/internal/game/cmd_shop.go @@ -138,7 +138,7 @@ func (g *Game) showShopBrowse(sess *net.Session) { sellStr = fmt.Sprintf("%d cr", si.SellPrice) } t.Rows = append(t.Rows, []string{ - g.colorize(sess, "item", itemName), + g.itemColorize(sess, def, itemName), g.colorize(sess, "credits_pickup", buyStr), g.colorize(sess, "credits_pickup", sellStr), }) @@ -182,7 +182,7 @@ func (g *Game) doShopBuy(sess *net.Session, input string, qty int, all bool) { if len(matches) > 1 { sess.WriteLine("That's ambiguous, which one?") for _, m := range matches { - sess.WriteLine(fmt.Sprintf(" - %s", g.colorize(sess, "item", m.name))) + sess.WriteLine(fmt.Sprintf(" - %s", g.itemColorize(sess, m.def, m.name))) } return } @@ -325,8 +325,9 @@ func (g *Game) doShopSell(sess *net.Session, input string, qty int, all bool) { if len(matches) > 1 { sess.WriteLine("That's ambiguous, which one?") - for _, m := range uniqueItemNames(matches) { - sess.WriteLine(fmt.Sprintf(" - %s", g.colorize(sess, "item", m))) + for _, m := range matches { + def, _ := g.ItemStore.Load(m.ID) + sess.WriteLine(fmt.Sprintf(" - %s", g.itemColorize(sess, def, m.Name))) } return } @@ -348,7 +349,7 @@ func (g *Game) doShopSell(sess *net.Session, input string, qty int, all bool) { if def != nil { displayName = def.Name } - sess.WriteLine(fmt.Sprintf("The shop doesn't want to buy %s.", g.colorize(sess, "item", displayName))) + sess.WriteLine(fmt.Sprintf("The shop doesn't want to buy %s.", g.itemColorize(sess, def, displayName))) return } diff --git a/internal/game/cmd_stats.go b/internal/game/cmd_stats.go index 906abf2..333d535 100644 --- a/internal/game/cmd_stats.go +++ b/internal/game/cmd_stats.go @@ -20,8 +20,10 @@ func (g *Game) doStats(sess *net.Session) { attackType := "crush" weaponName := "unarmed" var weaponType object.WeaponType + var weaponDef *object.ItemDef if itemID, ok := p.Equipment[object.SlotMainHand]; ok { if def, err := g.ItemStore.Load(itemID); err == nil { + weaponDef = def weaponName = def.Name weaponType = def.WeaponType if def.AttackType != "" { @@ -34,6 +36,9 @@ func (g *Game) doStats(sess *net.Session) { } } + if weaponDef != nil { + weaponName = g.itemColorize(sess, weaponDef, weaponName) + } sess.WriteLines( "", fmt.Sprintf("Weapon: %s (attack type: %s)", weaponName, attackType), diff --git a/internal/game/cmd_trigger_enchant.go b/internal/game/cmd_trigger_enchant.go index a1a6950..0279b4e 100644 --- a/internal/game/cmd_trigger_enchant.go +++ b/internal/game/cmd_trigger_enchant.go @@ -56,7 +56,7 @@ func (g *Game) triggerEnchant(sess *net.Session, p *player.Player, mod *ModDef, inputName = inputDef.Name } - sess.WriteLine(fmt.Sprintf("You enchant the %s and it becomes a %s!", inputName, outputName)) + sess.WriteLine(fmt.Sprintf("You enchant the %s and it becomes a %s!", g.itemColorize(sess, inputDef, inputName), g.itemColorize(sess, outputDef, outputName))) } func (g *Game) triggerChipBolts(sess *net.Session, p *player.Player, mod *ModDef, chip chipEntry) { @@ -98,5 +98,5 @@ func (g *Game) triggerChipBolts(sess *net.Session, p *player.Player, mod *ModDef name = inputDef.Name } - sess.WriteLine(fmt.Sprintf("You chip %d %s with arcane circuitry.", chip.Qty, name)) + sess.WriteLine(fmt.Sprintf("You chip %d %s with arcane circuitry.", chip.Qty, g.itemColorize(sess, inputDef, name))) } diff --git a/internal/game/cmd_trigger_utility.go b/internal/game/cmd_trigger_utility.go index 69abc34..5733722 100644 --- a/internal/game/cmd_trigger_utility.go +++ b/internal/game/cmd_trigger_utility.go @@ -71,7 +71,7 @@ func (g *Game) triggerProcessing(sess *net.Session, p *player.Player, mod *ModDe g.triggerModReward(sess, p, mod, 1.0) sess.WriteLine(fmt.Sprintf("You process the %s. You receive %s credits.", - itemDef.Name, g.colorize(sess, "credits_pickup", fmt.Sprint(creditValue)))) + g.itemColorize(sess, itemDef, itemDef.Name), g.colorize(sess, "credits_pickup", fmt.Sprint(creditValue)))) } func (g *Game) triggerBonesToNuts(sess *net.Session, p *player.Player, mod *ModDef) { @@ -150,7 +150,7 @@ func (g *Game) triggerEmGrab(sess *net.Session, p *player.Player, mod *ModDef, t g.triggerModReward(sess, p, mod, 1.0) - sess.WriteLine(fmt.Sprintf("You magnetically pull the %s toward you.", name)) + sess.WriteLine(fmt.Sprintf("You magnetically pull the %s toward you.", g.itemColorize(sess, def, name))) } func (g *Game) triggerSuperheat(sess *net.Session, p *player.Player, mod *ModDef, targetArg string) { @@ -243,7 +243,7 @@ func (g *Game) triggerSuperheat(sess *net.Session, p *player.Player, mod *ModDef inputName = inputDef.Name } - sess.WriteLine(fmt.Sprintf("You superheat the %s and produce a %s.", inputName, outputName)) + sess.WriteLine(fmt.Sprintf("You superheat the %s and produce a %s.", g.itemColorize(sess, inputDef, inputName), g.itemColorize(sess, match, outputName))) } func (g *Game) triggerPlankMake(sess *net.Session, p *player.Player, mod *ModDef, targetArg string) { diff --git a/internal/game/cmd_wear.go b/internal/game/cmd_wear.go index f2fd84c..8f8117f 100644 --- a/internal/game/cmd_wear.go +++ b/internal/game/cmd_wear.go @@ -13,7 +13,7 @@ func (g *Game) executeWear(sess *net.Session, args []string, rawInput string) { g.doWear(sess, strings.Join(args, " ")) } -func (g *Game) checkRequirements(p *player.Player, def *object.ItemDef) string { +func (g *Game) checkRequirements(sess *net.Session, p *player.Player, def *object.ItemDef) string { if len(def.Requirements) == 0 { return "" } @@ -26,7 +26,7 @@ func (g *Game) checkRequirements(p *player.Player, def *object.ItemDef) string { if len(unmet) == 0 { return "" } - return fmt.Sprintf("You need %s to wear %s.", strings.Join(unmet, ", "), def.Name) + return fmt.Sprintf("You need %s to wear %s.", strings.Join(unmet, ", "), g.itemColorize(sess, def, def.Name)) } func (g *Game) doWear(sess *net.Session, input string) { @@ -56,8 +56,14 @@ func (g *Game) doWear(sess *net.Session, input string) { unique := uniqueItemNames(matches) if len(unique) > 1 { sess.WriteLine("Equip what?") - for _, name := range unique { - sess.WriteLine(fmt.Sprintf(" - %s", name)) + seen := make(map[string]bool) + for _, m := range matches { + if seen[m.Name] { + continue + } + seen[m.Name] = true + def, _ := g.ItemStore.Load(m.ID) + sess.WriteLine(fmt.Sprintf(" - %s", g.itemColorize(sess, def, m.Name))) } return } @@ -74,7 +80,7 @@ func (g *Game) doWear(sess *net.Session, input string) { return } - if msg := g.checkRequirements(p, def); msg != "" { + if msg := g.checkRequirements(sess, p, def); msg != "" { sess.WriteLine(msg) return } @@ -190,7 +196,7 @@ func (g *Game) doWearAll(sess *net.Session) { if err != nil || def.EquipSlot == "" { continue } - if g.checkRequirements(p, def) != "" { + if g.checkRequirements(sess, p, def) != "" { continue } current, exists := bestPerSlot[def.EquipSlot] diff --git a/internal/game/core_production.go b/internal/game/core_production.go index 4aecc54..47a164c 100644 --- a/internal/game/core_production.go +++ b/internal/game/core_production.go @@ -15,19 +15,64 @@ import ( "thehouseoficarus/internal/player" ) -func craftFirstItemName(c *object.CraftDef, load func(string) (string, bool)) string { - if c == nil { - return "" +func (g *Game) resolveCraftVar(sess *net.Session, varSpec string, craft *object.CraftDef, outputID string, byproducts []string, hasItem func(string) bool) string { + if !strings.Contains(varSpec, "%") { + return varSpec } - for _, e := range c.Consume { + + outDef, _ := g.ItemStore.Load(outputID) + outputName := outputID + if outDef != nil { + outputName = g.itemColorize(sess, outDef, outDef.Name) + } + varSpec = strings.ReplaceAll(varSpec, "%n", outputName) + + for i, e := range craft.Consume { + key := fmt.Sprintf("%%i%d", i+1) + if !strings.Contains(varSpec, key) { + continue + } + var matchedID string for _, id := range e.Items { - if name, ok := load(id); ok { - return name + if hasItem(id) { + matchedID = id + break } - return id + } + if matchedID == "" && len(e.Items) > 0 { + matchedID = e.Items[0] + } + if def, err := g.ItemStore.Load(matchedID); err == nil { + varSpec = strings.ReplaceAll(varSpec, key, g.itemColorize(sess, def, def.Name)) + } else { + varSpec = strings.ReplaceAll(varSpec, key, matchedID) } } - return "" + + for i, bpID := range byproducts { + key := fmt.Sprintf("%%b%d", i+1) + if !strings.Contains(varSpec, key) { + continue + } + if def, err := g.ItemStore.Load(bpID); err == nil { + varSpec = strings.ReplaceAll(varSpec, key, g.itemColorize(sess, def, def.Name)) + } else { + varSpec = strings.ReplaceAll(varSpec, key, bpID) + } + } + + return color.ExpandTags(g.colorMode(sess), varSpec) +} + +func (g *Game) resolveCraftMessage(sess *net.Session, itemMsg, defaultMsg string, craft *object.CraftDef, outputID string, byproducts []string, hasItem func(string) bool) string { + msg := itemMsg + if msg == "" { + msg = defaultMsg + } + if msg == "" { + return "" + } + return g.resolveCraftVar(sess, msg, craft, outputID, byproducts, hasItem) } func (g *Game) startProduction(sess *net.Session, p *player.Player, item *object.ItemDef, craft *object.CraftDef, actionType, displayVerb, startMsg, endMsg string, count int) { @@ -79,7 +124,7 @@ func (g *Game) startProduction(sess *net.Session, p *player.Player, item *object p.ActionState = &ActionState{Type: ActionProducing, TargetName: outputName, Verb: displayVerb} - g.broadcastAction(sess, "\n%s starts %s.", p.Name, displayVerb) + g.broadcastAction(sess, "%s starts %s.", p.Name, displayVerb) } func (g *Game) startProductionFromItem(sess *net.Session, p *player.Player, item *object.ItemDef, count int) { @@ -93,30 +138,25 @@ func (g *Game) startProductionFromItem(sess *net.Session, p *player.Player, item stationName = "inventory" } - firstItem := craftFirstItemName(craft, func(id string) (string, bool) { - def, err := g.ItemStore.Load(id) - if err != nil { - return id, false - } - return def.Name, true - }) - info, ok := productionTypes[craft.Type] if !ok { - info = productionTypeInfo{craft.Type, craft.Type} + info = productionTypeInfo{ + ActionType: craft.Type, + DisplayVerb: craft.Type, + StartMessage: "You start " + craft.Type + " %i1.", + SuccessMessage: "You produce %n.", + EndMessage: "You've finished " + craft.Type + ".", + } } - actionType := info.ActionType - displayVerb := info.DisplayVerb - var startMsg, endMsg string + startMsg := g.resolveCraftMessage(sess, craft.StartMessage, info.StartMessage, craft, item.ID, nil, p.HasItem) if stationName != "inventory" { - startMsg = fmt.Sprintf("You start %s %s on the %s.", displayVerb, firstItem, stationName) - } else { - startMsg = fmt.Sprintf("You start %s %s.", displayVerb, firstItem) + startMsg += " on the " + stationName + "." } - endMsg = fmt.Sprintf("You've finished %s.", displayVerb) - g.startProduction(sess, p, item, craft, actionType, displayVerb, startMsg, endMsg, count) + endMsg := g.resolveCraftMessage(sess, craft.EndMessage, info.EndMessage, craft, item.ID, nil, p.HasItem) + + g.startProduction(sess, p, item, craft, info.ActionType, info.DisplayVerb, startMsg, endMsg, count) } func (g *Game) loadCraftItem(itemID string) *object.ItemDef { @@ -144,7 +184,7 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { if phase == 0 { if startMsg != "" { - sess.WriteLine(fmt.Sprintf("\n%s", startMsg)) + sess.WriteLine(startMsg) } if len(craft.Steps) > 0 { p.Action.Data["next_step_index"] = 0 @@ -161,7 +201,7 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { p.Action.Data["steps_accumulated_ticks"] = accTicks for i := stepsIdx; i < len(craft.Steps); i++ { if accTicks >= craft.Steps[i].Tick { - sess.WriteLine(craft.Steps[i].Message) + sess.WriteLine(g.resolveCraftVar(sess, craft.Steps[i].Message, craft, item.ID, nil, p.HasItem)) p.Action.Data["next_step_index"] = i + 1 } } @@ -174,6 +214,8 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { chance = action.SuccessChance(action.SuccessFormula(*craft.Success), skillLevel, craft.Level) } + info, _ := productionTypes[craft.Type] + if rand.Float64() < chance { outputQty := craft.OutputQty if outputQty <= 0 { @@ -219,14 +261,13 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { } g.AccountStore.SaveCharacter(p) - msg := craft.Message - if msg == "" { - outputName := item.ID - if outDef != nil { - outputName = outDef.Name - } - msg = fmt.Sprintf("You produce %s.", outputName) + var defaultSuccess string + if info.SuccessMessage != "" { + defaultSuccess = info.SuccessMessage + } else { + defaultSuccess = "You produce %n." } + msg := g.resolveCraftMessage(sess, craft.Message, defaultSuccess, craft, item.ID, byproducts, p.HasItem) if p.OptionBool("xp_drops") && craft.XP > 0 { abbr := player.SkillAbbr[player.SkillName(skill)] msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", craft.XP, abbr)) @@ -243,11 +284,10 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { } g.AccountStore.SaveCharacter(p) - msg := craft.FailMessage - if msg == "" { - msg = "You fail and the materials are lost." + msg := g.resolveCraftMessage(sess, craft.FailMessage, info.FailMessage, craft, item.ID, nil, p.HasItem) + if msg != "" { + sess.WriteLine(g.colorize(sess, "damage", msg)) } - sess.WriteLine(g.colorize(sess, "damage", msg)) } if remaining > 0 { @@ -255,7 +295,7 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { p.Action.Data["remaining"] = remaining if remaining <= 0 { if endMsg != "" { - sess.WriteLine(fmt.Sprintf("\n%s", endMsg)) + sess.WriteLine(endMsg) } g.cancelAction(p) return false @@ -268,7 +308,7 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { } if endMsg != "" { - sess.WriteLine(fmt.Sprintf("\n%s", endMsg)) + sess.WriteLine(endMsg) } g.cancelAction(p) return false @@ -404,7 +444,7 @@ func (g *Game) dispatchMenuEntry(sess *net.Session, entry map[string]string) { g.reprompt(sess) } -func (g *Game) formatMaterials(item *object.ItemDef) string { +func (g *Game) formatMaterials(sess *net.Session, item *object.ItemDef) string { craft := item.FirstCraft() if craft == nil { return "" @@ -413,7 +453,7 @@ func (g *Game) formatMaterials(item *object.ItemDef) string { for _, e := range craft.Consume { itemName := e.Items[0] if def, err := g.ItemStore.Load(e.Items[0]); err == nil { - itemName = def.Name + itemName = g.itemColorize(sess, def, def.Name) } if e.Quantity > 1 { parts = append(parts, fmt.Sprintf("%s x%d", itemName, e.Quantity)) @@ -454,7 +494,7 @@ func (g *Game) showProductionTable(sess *net.Session, p *player.Player, items [] productName = fmt.Sprintf("%s x%d", productName, outputQty) } - matStr := g.formatMaterials(item) + matStr := g.formatMaterials(sess, item) levelStr := fmt.Sprint(craft.Level) numStr := fmt.Sprintf("%d", i+1) @@ -607,19 +647,73 @@ func (g *Game) hasToolType(p *player.Player, toolType string) bool { } type productionTypeInfo struct { - ActionType string - DisplayVerb string + ActionType string + DisplayVerb string + StartMessage string + SuccessMessage string + EndMessage string + FailMessage string } var productionTypes = map[string]productionTypeInfo{ - "cooking": {"cook", "cooking"}, - "smelting": {"smelt", "smelting"}, - "smithing": {"smith", "smithing"}, - "crafting": {"craft", "crafting"}, - "combine": {"combine", "combining"}, - "fletching": {"fletch", "fletching"}, - "pharmacy": {"mix", "mixing"}, - "construction": {"construct", "constructing"}, + "cooking": { + ActionType: "cook", + DisplayVerb: "cooking", + StartMessage: "You start cooking %i1.", + SuccessMessage: "Cooked to perfection. %n looks great!", + EndMessage: "You've finished cooking.", + FailMessage: "You accidentally burn the %i1.", + }, + "smelting": { + ActionType: "smelt", + DisplayVerb: "smelting", + StartMessage: "You place the %i1 into the furnace.", + SuccessMessage: "You remove a white hot %n!", + EndMessage: "You've finished smelting.", + FailMessage: "The %i1 is consumed by the flames.", + }, + "smithing": { + ActionType: "smith", + DisplayVerb: "smithing", + StartMessage: "You begin smithing %i1.", + SuccessMessage: "You smith a %n.", + EndMessage: "You've finished smithing.", + }, + "crafting": { + ActionType: "craft", + DisplayVerb: "crafting", + StartMessage: "You begin crafting %i1.", + SuccessMessage: "You craft a %n.", + EndMessage: "You've finished crafting.", + }, + "combine": { + ActionType: "combine", + DisplayVerb: "combining", + StartMessage: "You start combining %i1.", + SuccessMessage: "You produce %n.", + EndMessage: "You've finished combining.", + }, + "fletching": { + ActionType: "fletch", + DisplayVerb: "fletching", + StartMessage: "You begin fletching %i1.", + SuccessMessage: "You fletch a %n.", + EndMessage: "You've finished fletching.", + }, + "pharmacy": { + ActionType: "mix", + DisplayVerb: "mixing", + StartMessage: "You start mixing %i1.", + SuccessMessage: "You mix a %n.", + EndMessage: "You've finished mixing.", + }, + "construction": { + ActionType: "construct", + DisplayVerb: "constructing", + StartMessage: "You begin constructing %i1.", + SuccessMessage: "You construct a %n.", + EndMessage: "You've finished constructing.", + }, } var productionActionTypes map[string]bool diff --git a/internal/game/game.go b/internal/game/game.go index 0dd5bdc..8bf289b 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -284,7 +284,9 @@ func (g *Game) ProcessQueuedCommands() { if len(parts) > 0 { g.executeCommand(qc.Session, parts[0], parts[1:], raw) } - g.writePrompt(qc.Session) + if p.BackgroundAction == nil { + g.writePrompt(qc.Session) + } } delete(g.freeQueue, p.Name) @@ -322,7 +324,7 @@ func (g *Game) ProcessQueuedCommands() { } isBusy := p.Action != nil || len(p.WalkSequence) > 0 || combat.GetCombat(p.Name) != nil || p.MoveTicks > 0 _, isResting := g.restTimers[p.Name] - if !isResting && !isBusy { + if !isResting && !isBusy && qc.Session.State == net.StateGame { g.writePrompt(qc.Session) } } diff --git a/internal/object/item.go b/internal/object/item.go index 241cc0b..b0865d6 100644 --- a/internal/object/item.go +++ b/internal/object/item.go @@ -154,20 +154,22 @@ type SuccessFormula struct { } type CraftDef struct { - Type string `yaml:"type"` - Skill string `yaml:"skill"` - Level int `yaml:"level"` - XP int `yaml:"xp"` - Wait float64 `yaml:"wait"` - Station []string `yaml:"station"` - Tool string `yaml:"tool"` - Consume []ConsumeEntry `yaml:"consume"` - OutputQty int `yaml:"output_qty"` - Fail string `yaml:"fail"` - Message string `yaml:"message"` - FailMessage string `yaml:"fail_message"` - Steps []CraftStep `yaml:"steps"` - Success *SuccessFormula `yaml:"success"` + Type string `yaml:"type"` + Skill string `yaml:"skill"` + Level int `yaml:"level"` + XP int `yaml:"xp"` + Wait float64 `yaml:"wait"` + Station []string `yaml:"station"` + Tool string `yaml:"tool"` + Consume []ConsumeEntry `yaml:"consume"` + OutputQty int `yaml:"output_qty"` + Fail string `yaml:"fail"` + Message string `yaml:"message"` + FailMessage string `yaml:"fail_message"` + StartMessage string `yaml:"start_message"` + EndMessage string `yaml:"end_message"` + Steps []CraftStep `yaml:"steps"` + Success *SuccessFormula `yaml:"success"` } func (c *CraftDef) EffectiveSkill() string { diff --git a/worldbuilding_guide/recipes.md b/worldbuilding_guide/recipes.md index e442c8c..450ded9 100644 --- a/worldbuilding_guide/recipes.md +++ b/worldbuilding_guide/recipes.md @@ -18,13 +18,49 @@ Crafting information lives on the **output item's YAML file** via the `craft:` b | `consume` | []ConsumeEntry | Ingredients consumed (see below) | | `output_qty` | int | Quantity produced (default 1, for stackables) | | `fail` | string | ItemID produced on failure (optional) | -| `message` | string | Success message | -| `fail_message` | string | Failure message | +| `message` | string | Success message per cycle (optional, see message defaults) | +| `fail_message` | string | Failure message (optional, empty = silent fail) | +| `start_message`| string | Message when action begins (optional, see message defaults) | +| `end_message` | string | Message when action completes (optional, see message defaults) | | `steps` | []CraftStep | Multi-step messages at tick intervals (optional)| | `success` | SuccessFormula | Optional skill check formula (see Behaviors) | The output is the item itself — no `output` field needed. The item ID IS the craft ID. +### Message Variables + +All message fields (`message`, `fail_message`, `start_message`, `end_message`, and `steps[].message`) support variables that expand to colorized item names: + +| Variable | Expands to | +| -------- | ----------------------------------------------- | +| `%n` | Output item name (colored, e.g. "stim potion") | +| `%i1` | 1st consume entry's matched item (colored) | +| `%i2` | 2nd consume entry's matched item (colored) | +| `%b1` | 1st byproduct item name (colored, success only) | +| `%b2` | 2nd byproduct item name (colored, success only) | + +Numbering follows YAML consume/byproduct order. If a consume entry has multiple alternative items (`items: [a, b]`), the variable expands to whichever the player actually possesses, colored with that item's `color:` field. + +Variables work alongside inline color tags (`{196}text{/}`) which are expanded after variable substitution. + +### Message Defaults + +If a message field is omitted from the YAML, the game uses a skill-level default based on the craft `type`: + +| Type | Default `message` | Default `start_message` | +|------|-------------------|------------------------| +| `cooking` | `"Cooked to perfection. %n looks great!"` | `"You start cooking %i1."` | +| `smelting` | `"You remove a white hot %n!"` | `"You place the %i1 into the furnace."` | +| `smithing` | `"You smith a %n."` | `"You begin smithing %i1."` | +| `crafting` | `"You craft a %n."` | `"You begin crafting %i1."` | +| `fletching` | `"You fletch a %n."` | `"You begin fletching %i1."` | +| `pharmacy` | `"You mix a %n."` | `"You start mixing %i1."` | +| `construction` | `"You construct a %n."` | `"You begin constructing %i1."` | +| `clean` | `"You clean the %i1."` | `"You begin cleaning herbs."` | +| (unset) | `"You produce %n."` | `"You start <verb> %i1."` | + +Any of these can be overridden per-item by setting the field in YAML. For skills that never fail (smithing, crafting, fletching, pharmacy, construction), `fail_message` defaults to empty — no message is shown on failure. + ### CraftStep — Multi-Step Messages Optional interim messages fired at specific tick offsets during the craft cycle. The `tick` is the number of ticks elapsed since the start of the cycle. @@ -85,7 +121,7 @@ craft: quantity: 1 - items: [eye_of_newt] quantity: 1 - message: "You mix a stim potion." + message: "You mix a %n." # %n expands to "stim potion" colored ``` ### Station-Based Production @@ -104,7 +140,8 @@ craft: quantity: 1 - items: [tin_ore] quantity: 1 - message: "You smelt a bronze bar." + message: "You smelt a %n." # default is "You remove a white hot %n!" + # overridden here for simpler flavor ``` ```yaml @@ -119,7 +156,7 @@ craft: consume: - items: [bronze_bar] quantity: 1 - message: "You hammer out a bronze dagger." + # message omitted — uses default "You smith a %n." ``` For stackable outputs, use `output_qty`: @@ -137,7 +174,7 @@ craft: - items: [bronze_bar] quantity: 1 output_qty: 15 - message: "You hammer out some bronze nails." + # message omitted — uses default "You smith a %n." ``` ### Tool-Based Production @@ -172,7 +209,7 @@ craft: byproducts: [empty_vial, empty_jug] - items: [empty_bucket] quantity: 1 - message: "You pour water into the bucket." + message: "You pour the %i1 into the %i2." # %i1 = water source, %i2 = bucket ``` ### Multi-Piece Assembly (3+ items → 1) @@ -193,7 +230,7 @@ craft: message: "You try to puzzle how the pieces fit together." - tick: 3 message: "Aha, this edge lines up here!" - message: "You assemble the ancient map." + message: "You assemble the %n." ``` ### Clean Recipes @@ -211,7 +248,8 @@ craft: consume: - items: [grimy_guam] quantity: 1 - message: "You clean the grimy guam leaf." + # message omitted — uses default "You clean the %i1." + # %i1 expands to the grimy herb name with its color ``` ### Food/Healing Items |
