Achievements: Add “Into Fire”, fix “DIAMONDS!”

This commit is contained in:
Wuzzy 2017-03-05 22:33:09 +01:00
parent 7915ca8938
commit 3539eac6b4
2 changed files with 17 additions and 5 deletions

View File

@ -12,6 +12,14 @@ item_drop_settings.random_item_velocity = true --this sets random item velocity
item_drop_settings.drop_single_item = false --if true, the drop control drops 1 item instead of the entire stack, and sneak+drop drops the stack item_drop_settings.drop_single_item = false --if true, the drop control drops 1 item instead of the entire stack, and sneak+drop drops the stack
-- drop_single_item is disabled by default because it is annoying to throw away items from the intentory screen -- drop_single_item is disabled by default because it is annoying to throw away items from the intentory screen
local check_pickup_achievements = function(object, player)
local itemname = ItemStack(object:get_luaentity().itemstring):get_name()
if itemname == "mcl_mobitems:blaze_rod" then
awards.unlock(player:get_player_name(), "mcl:blazeRod")
elseif itemname == "mcl_core:diamond" then
awards.unlock(player:get_player_name(), "mcl:diamonds")
end
end
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
for _,player in ipairs(minetest.get_connected_players()) do for _,player in ipairs(minetest.get_connected_players()) do
@ -33,6 +41,7 @@ minetest.register_globalstep(function(dtime)
max_hear_distance = 100, max_hear_distance = 100,
gain = 10.0, gain = 10.0,
}) })
check_pickup_achievements(object, player)
object:get_luaentity().itemstring = "" object:get_luaentity().itemstring = ""
object:remove() object:remove()
end end
@ -92,6 +101,7 @@ minetest.register_globalstep(function(dtime)
gain = 10.0, gain = 10.0,
}) })
end end
check_pickup_achievements(object, player)
object:get_luaentity().itemstring = "" object:get_luaentity().itemstring = ""
object:remove() object:remove()
else else

View File

@ -109,13 +109,10 @@ awards.register_achievement("mcl:buildSword", {
awards.register_achievement("mcl:diamonds", { awards.register_achievement("mcl:diamonds", {
title = S("DIAMONDS!"), title = S("DIAMONDS!"),
description = S("Pick up a diamond from the floor."),
icon = "default_stone.png^default_mineral_diamond.png", icon = "default_stone.png^default_mineral_diamond.png",
trigger = {
type = "dig",
node = "mcl_core:stone_with_diamond",
target = 1
}
}) })
awards.register_achievement("mcl:bookcase", { awards.register_achievement("mcl:bookcase", {
title = S("Librarian"), title = S("Librarian"),
icon = "default_bookshelf.png", icon = "default_bookshelf.png",
@ -126,6 +123,11 @@ awards.register_achievement("mcl:bookcase", {
} }
}) })
awards.register_achievement("mcl:blazeRod", {
title = S("Into Fire"),
description = S("Pick up a blaze rod from the floor."),
icon = "mcl_mobitems_blaze_rod.png",
})
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)