diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua old mode 100644 new mode 100755 index 4d272fe86..61ef9a9f2 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -431,6 +431,27 @@ awards.register_achievement("mcl:wax_off", { group = "Husbandry", }) +-- Triggered in mcl_smithing_table +awards.register_achievement("mcl:trim", { + title = S("Crafting a New Look"), + description = S("Craft a trimmed armor at a Smithing Table"), + icon = "dune_armor_trim_smithing_template.png", + type = "Advancement", + group = "Adventure", +}) + +awards.register_achievement("mcl:lots_of_trimming", { + title = S("Smithing with Style"), + description = S("Apply these smithing templates at least once: Spire, Snout, Rib, Ward, Silence, Vex, Tide, Wayfinder"), + icon = "silence_armor_trim_smithing_template.png", + type = "Advancement", + group = "Adventure", + on_unlock = function(name, awdef) + -- delete json that is no longer needed + minetest.get_player_by_name(name):get_meta():set_string("mcl_smithing_table:achievement_trims", "") + end, +}) + -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) if non_pc_achievements then diff --git a/mods/HUD/mcl_achievements/locale/mcl_achievements.de.tr b/mods/HUD/mcl_achievements/locale/mcl_achievements.de.tr old mode 100644 new mode 100755 index 1c6f668e5..7b73d1887 --- a/mods/HUD/mcl_achievements/locale/mcl_achievements.de.tr +++ b/mods/HUD/mcl_achievements/locale/mcl_achievements.de.tr @@ -51,3 +51,7 @@ Bring Home the Beacon=Den Nachbarn heimleuchten Use a beacon.=Benutzen Sie ein Leuchtfeuer. Beaconator=Leuchtturmwärter Use a fully powered beacon.=Benutzen Sie ein vollständiges Leuchtfeuer. +Crafting a New Look=Ein neues Aussehen +Craft a trimmed armor at a Smithing Table=Versieh ein Rüstungsteil an einem Schmiedetisch mit einem Rüstungsbesatz +Smithing with Style=Schmieden mit Stil +Apply these smithing templates at least once: Spire, Snout, Rib, Ward, Silence, Vex, Tide, Wayfinder=Wende jede dieser Schmiedevorlagen mindestens einmal an: Turmspitze, Schnauze, Rippe, Warthof, Stille, Plagegeist, Gezeiten und Wegfinder \ No newline at end of file diff --git a/mods/HUD/mcl_achievements/locale/template.txt b/mods/HUD/mcl_achievements/locale/template.txt old mode 100644 new mode 100755 index d865b1668..89c422a08 --- a/mods/HUD/mcl_achievements/locale/template.txt +++ b/mods/HUD/mcl_achievements/locale/template.txt @@ -111,3 +111,7 @@ Voluntary Exile= Kill a raid captain. Maybe consider staying away from the local villages for the time being...= Tactical Fishing= Catch a fish... without a fishing rod!= +Crafting a New Look= +Craft a trimmed armor at a Smithing Table= +Smithing with Style= +Apply these smithing templates at least once: Spire, Snout, Rib, Ward, Silence, Vex, Tide, Wayfinder= \ No newline at end of file diff --git a/mods/ITEMS/mcl_armor/api.lua b/mods/ITEMS/mcl_armor/api.lua old mode 100644 new mode 100755 index 558607785..1e88643f1 --- a/mods/ITEMS/mcl_armor/api.lua +++ b/mods/ITEMS/mcl_armor/api.lua @@ -326,11 +326,17 @@ end tt.register_snippet(function(itemstring, toolcaps, stack) if not stack then return nil end local meta = stack:get_meta() - if meta:get_string("mcl_armor:trim_overlay") == "" then return nil end -- remember, get_string returns "" if the key doesn't exist + if not mcl_armor.is_trimmed(stack) then return nil end -- we need to get the part of the overlay image between the overlay begin ( and the trim name end _ -- we COULD easily store this info in meta, but that would bloat the meta storage, as the same few values would be stored over and over again on every trimmed item -- this is fine here as this code gets only executed when you put armor and a trim in a smithing table local full_overlay = meta:get_string("mcl_armor:trim_overlay") local trim_name = full_overlay:match("%((.-)%_") return "Upgrade:\n " .. trim_name:gsub("^%l", string.upper) .. " Armor Trim" -end) \ No newline at end of file +end) + +function mcl_armor.is_trimmed(itemstack) + -- this meta value will be there for every trimmed armor piece + -- remember, get_string returns "" if the key doesn't exist + return itemstack:get_meta():get_string("mcl_armor:trim_overlay") ~= "" +end \ No newline at end of file diff --git a/mods/ITEMS/mcl_armor/init.lua b/mods/ITEMS/mcl_armor/init.lua index e85158f6c..402d9eef3 100644 --- a/mods/ITEMS/mcl_armor/init.lua +++ b/mods/ITEMS/mcl_armor/init.lua @@ -60,7 +60,7 @@ mcl_armor = { trims = { core_textures = {}, blacklisted = {["mcl_armor:elytra"]=true, ["mcl_armor:elytra_enchanted"]=true}, - overlays = {"sentry","dune","coast","wild","tide","ward","vex","rib","snout","eye","spire"}, + overlays = {"sentry","dune","coast","wild","tide","ward","vex","rib","snout","eye","spire","silence","wayfinder"}, colors = {["amethyst"]="#8246a5",["gold"]="#ce9627",["emerald"]="#1b9958",["copper"]="#c36447",["diamond"]="#5faed8",["iron"]="#938e88",["lapis"]="#1c306b",["netherite"]="#302a26",["quartz"]="#c9bcb9",["redstone"]="#af2c23"}, }, } diff --git a/mods/ITEMS/mcl_armor/trims.lua b/mods/ITEMS/mcl_armor/trims.lua index 9e8e32625..76d37deb0 100644 --- a/mods/ITEMS/mcl_armor/trims.lua +++ b/mods/ITEMS/mcl_armor/trims.lua @@ -43,4 +43,22 @@ minetest.register_craft({ {"mcl_core:diamond","mcl_core:goldblock","mcl_core:diamond"}, {"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"}, } +}) + +minetest.register_craft({ + output = mod_registername .. "silence", + recipe = { + {"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"}, + {"mcl_core:diamond", mod_registername.."ward","mcl_core:diamond"}, + {"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"}, + } +}) + +minetest.register_craft({ + output = mod_registername .. "wayfinder", + recipe = { + {"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"}, + {"mcl_core:diamond", "mcl_maps:empty_map","mcl_core:diamond"}, + {"mcl_core:diamond","mcl_core:diamond","mcl_core:diamond"}, + } }) \ No newline at end of file diff --git a/mods/ITEMS/mcl_smithing_table/init.lua b/mods/ITEMS/mcl_smithing_table/init.lua old mode 100644 new mode 100755 index 4690a1ed6..996dcf8a9 --- a/mods/ITEMS/mcl_smithing_table/init.lua +++ b/mods/ITEMS/mcl_smithing_table/init.lua @@ -88,7 +88,18 @@ local smithing_materials = { ["mcl_copper:copper_ingot"] = "copper", ["mcl_core:emerald"] = "emerald", ["mcl_nether:quartz"] = "quartz" -} +} + +local achievement_trims = { + ["mcl_armor:spire"] = true, + ["mcl_armor:snout"] = true, + ["mcl_armor:rib"] = true, + ["mcl_armor:ward"] = true, + ["mcl_armor:silence"] = true, + ["mcl_armor:vex"] = true, + ["mcl_armor:tide"] = true, + ["mcl_armor:wayfinder"] = true +} function mcl_smithing_table.upgrade_trimmed(itemstack, color_mineral, template) --get information required @@ -156,16 +167,19 @@ minetest.register_node("mcl_smithing_table:table", { end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local stackname = stack:get_name() + local def = stack:get_definition() if listname == "upgrade_item" - and string.find(stack:get_name(),"mcl_armor:") -- allow any armor piece to go in (in case the player wants to trim them) - and not mcl_armor.trims.blacklisted[stack:get_name()] + and def._mcl_armor_element -- allow any armor piece to go in (in case the player wants to trim them) + and not mcl_armor.trims.blacklisted[stackname] + or def._mcl_upgradable -- for diamond tools or listname == "mineral" - and mcl_smithing_table.is_smithing_mineral(stack:get_name()) + and mcl_smithing_table.is_smithing_mineral(stackname) or listname == "template" - and string.find(stack:get_name(),"mcl_armor") + and string.find(stackname, "mcl_armor") then return stack:get_count() end @@ -181,27 +195,51 @@ minetest.register_node("mcl_smithing_table:table", { on_metadata_inventory_take = function(pos, listname, index, stack, player) local inv = minetest.get_meta(pos):get_inventory() - + local function take_item(listname) local itemstack = inv:get_stack(listname, 1) itemstack:take_item() inv:set_stack(listname, 1, itemstack) end - + if listname == "upgraded_item" then + -- ToDo: make epic sound + minetest.sound_play("mcl_smithing_table_upgrade", { pos = pos, max_hear_distance = 16 }) + + if stack:get_name() == "mcl_farming:hoe_netherite" then + awards.unlock(player:get_player_name(), "mcl:seriousDedication") + elseif mcl_armor.is_trimmed(stack) then + local template_name = inv:get_stack("template", 1):get_name() + local playername = player:get_player_name() + awards.unlock(playername, "mcl:trim") + + if not awards.players[playername].unlocked["mcl:lots_of_trimming"] and achievement_trims[template_name] then + local meta = player:get_meta() + local used_achievement_trims = minetest.deserialize(meta:get_string("mcl_smithing_table:achievement_trims")) or {} + if not used_achievement_trims[template_name] then + used_achievement_trims[template_name] = true + end + + local used_all = true + for name, _ in pairs(achievement_trims) do + if not used_achievement_trims[name] then + used_all = false + break + end + end + + if used_all then + awards.unlock(playername, "mcl:lots_of_trimming") + else + meta:set_string("mcl_smithing_table:achievement_trims", minetest.serialize(used_achievement_trims)) + end + end + end + take_item("upgrade_item") take_item("mineral") take_item("template") - - -- ToDo: make epic sound - minetest.sound_play("mcl_smithing_table_upgrade", { pos = pos, max_hear_distance = 16 }) end - if listname == "upgraded_item" then - if stack:get_name() == "mcl_farming:hoe_netherite" then - awards.unlock(player:get_player_name(), "mcl:seriousDedication") - end - end - reset_upgraded_item(pos) end, diff --git a/textures/silence_armor_trim_smithing_template.png b/textures/silence_armor_trim_smithing_template.png new file mode 100644 index 000000000..77e72d074 Binary files /dev/null and b/textures/silence_armor_trim_smithing_template.png differ diff --git a/textures/silence_boots.png b/textures/silence_boots.png new file mode 100644 index 000000000..760203a4d Binary files /dev/null and b/textures/silence_boots.png differ diff --git a/textures/silence_chestplate.png b/textures/silence_chestplate.png new file mode 100644 index 000000000..7742dfe96 Binary files /dev/null and b/textures/silence_chestplate.png differ diff --git a/textures/silence_helmet.png b/textures/silence_helmet.png new file mode 100644 index 000000000..ad2de6ab0 Binary files /dev/null and b/textures/silence_helmet.png differ diff --git a/textures/silence_leggings.png b/textures/silence_leggings.png new file mode 100644 index 000000000..83b18c856 Binary files /dev/null and b/textures/silence_leggings.png differ diff --git a/textures/wayfinder_armor_trim_smithing_template.png b/textures/wayfinder_armor_trim_smithing_template.png new file mode 100644 index 000000000..23fd30a87 Binary files /dev/null and b/textures/wayfinder_armor_trim_smithing_template.png differ diff --git a/textures/wayfinder_boots.png b/textures/wayfinder_boots.png new file mode 100644 index 000000000..5e8717ccb Binary files /dev/null and b/textures/wayfinder_boots.png differ diff --git a/textures/wayfinder_chestplate.png b/textures/wayfinder_chestplate.png new file mode 100644 index 000000000..6f5f5f2ea Binary files /dev/null and b/textures/wayfinder_chestplate.png differ diff --git a/textures/wayfinder_helmet.png b/textures/wayfinder_helmet.png new file mode 100644 index 000000000..d2e7fe765 Binary files /dev/null and b/textures/wayfinder_helmet.png differ diff --git a/textures/wayfinder_leggings.png b/textures/wayfinder_leggings.png new file mode 100644 index 000000000..48da69e7b Binary files /dev/null and b/textures/wayfinder_leggings.png differ