diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index d623e7ca9..13a50b601 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -985,6 +985,11 @@ local trade_inventory = { elseif listname == "output" then if not trader_exists(player:get_player_name()) then return 0 + -- Begin Award Code + -- May need to be moved if award gets unlocked in the wrong cases. + elseif trader_exists(player:get_player_name()) then + awards.unlock(player:get_player_name(), "mcl:whatAdeal") + -- End Award Code end -- Only allow taking full stack local count = stack:get_count() diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index c963773d1..dfd3c0657 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -101,6 +101,17 @@ awards.register_achievement("mcl:bookcase", { } }) +awards.register_achievement("mcl:buildIronPickaxe", { + title = S("Isn't It Iron Pick"), + description = S("Craft a iron pickaxe using sticks and iron."), + icon = "default_tool_steelpick.png", + trigger = { + type = "craft", + item = "mcl_tools:pick_iron", + target = 1 + } +}) + -- Item pickup achievements: These are awarded when picking up a certain item. -- The achivements are manually given in the mod mcl_item_entity. awards.register_achievement("mcl:diamonds", { @@ -163,6 +174,47 @@ awards.register_achievement("mcl:buildNetherPortal", { icon = "default_obsidian.png", }) +awards.register_achievement("mcl:enterEndPortal", { + title = S("The End?"), + description = S("Or the beginning?\nHint: Enter an end portal."), + icon = "mcl_end_end_stone.png", +}) + +-- Triggered in mcl_totems +awards.register_achievement("mcl:postMortal", { + title = S("Postmortal"), + description = S("Use a Totem of Undying to cheat death."), + icon = "mcl_totems_totem.png", +}) + +-- Triggered in mcl_beds +awards.register_achievement("mcl:sweetDreams", { + title = S("Sweet Dreams"), + description = S("Sleep in a bed to change your respawn point."), + icon = "mcl_beds_bed_red.png", +}) + +-- Triggered in mobs_mc +awards.register_achievement("mcl:whatAdeal", { + title = S("What A Deal!"), + description = S("Successfully trade with a Villager."), + icon = "mcl_core_emerald.png", +}) + +-- Triggered in mcl_fishing +awards.register_achievement("mcl:fishyBusiness", { + title = S("Fishy Business"), + description = S("Catch a fish. \nHint: Catch a fish, salmon, clownfish, or pufferfish."), + icon = "mcl_fishing_fishing_rod.png", +}) + +-- Triggered in mcl_compass +awards.register_achievement("mcl:countryLode", { + title = S("Country Lode,\nTake Me Home"), + description = S("Use a compass on a Lodestone."), + icon = "lodestone_side4.png", +}) + -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) if non_pc_achievements then diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index c1e76c90a..e570bd8eb 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -76,6 +76,7 @@ local function lay_down(player, pos, bed_pos, state, skip) -- save respawn position when entering bed if spawn_mod and mcl_spawn.set_spawn_pos(player, bed_pos, nil) then minetest.chat_send_player(name, S("New respawn position set!")) + awards.unlock(player:get_player_name(), "mcl:sweetDreams") end -- No sleeping if too far away diff --git a/mods/ITEMS/mcl_compass/init.lua b/mods/ITEMS/mcl_compass/init.lua index 0bcc3f0af..4536064d1 100644 --- a/mods/ITEMS/mcl_compass/init.lua +++ b/mods/ITEMS/mcl_compass/init.lua @@ -189,6 +189,7 @@ minetest.register_globalstep(function(dtime) if string_find(stack:get_name(), "_lodestone") then stack:set_name("mcl_compass:" .. compass_frame .. "_lodestone") + awards.unlock(player:get_player_name(), "mcl:countryLode") else stack:set_name("mcl_compass:" .. compass_frame) end diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 1d8f24fb3..efc66e00e 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -75,6 +75,7 @@ local fish = function(itemstack, player, pointed_thing) stacks_min = 1, stacks_max = 1, }, pr) + awards.unlock(player:get_player_name(), "mcl:fishyBusiness") elseif r <= junk_value then -- Junk items = mcl_loot.get_loot({ @@ -124,6 +125,9 @@ local fish = function(itemstack, player, pointed_thing) local inv = player:get_inventory() if inv:room_for_item("main", item) then inv:add_item("main", item) + if item:get_name() == "mcl_mobitems:leather" then + awards.unlock(player:get_player_name(), "mcl:killCow") + end else minetest.add_item(pos, item) end diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index e4982c39b..4ebc97d62 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -241,7 +241,7 @@ function mcl_portals.end_portal_teleport(pos, node) end mcl_portals.end_teleport(obj, objpos) - + awards.unlock(obj:get_player_name(), "mcl:enterEndPortal") end end end diff --git a/mods/ITEMS/mcl_totems/init.lua b/mods/ITEMS/mcl_totems/init.lua index 8e529c5d5..26874b50b 100644 --- a/mods/ITEMS/mcl_totems/init.lua +++ b/mods/ITEMS/mcl_totems/init.lua @@ -51,7 +51,8 @@ mcl_damage.register_modifier(function(obj, damage, reason) obj:set_wielded_item(wield) end end - + awards.unlock(obj:get_player_name(), "mcl:postMortal") + -- Effects minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true)