mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
Achievements: Add “Into Fire”, fix “DIAMONDS!”
This commit is contained in:
parent
7915ca8938
commit
3539eac6b4
2 changed files with 17 additions and 5 deletions
|
@ -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
|
||||
-- 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)
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
|
@ -33,6 +41,7 @@ minetest.register_globalstep(function(dtime)
|
|||
max_hear_distance = 100,
|
||||
gain = 10.0,
|
||||
})
|
||||
check_pickup_achievements(object, player)
|
||||
object:get_luaentity().itemstring = ""
|
||||
object:remove()
|
||||
end
|
||||
|
@ -92,6 +101,7 @@ minetest.register_globalstep(function(dtime)
|
|||
gain = 10.0,
|
||||
})
|
||||
end
|
||||
check_pickup_achievements(object, player)
|
||||
object:get_luaentity().itemstring = ""
|
||||
object:remove()
|
||||
else
|
||||
|
|
|
@ -109,13 +109,10 @@ awards.register_achievement("mcl:buildSword", {
|
|||
|
||||
awards.register_achievement("mcl:diamonds", {
|
||||
title = S("DIAMONDS!"),
|
||||
description = S("Pick up a diamond from the floor."),
|
||||
icon = "default_stone.png^default_mineral_diamond.png",
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "mcl_core:stone_with_diamond",
|
||||
target = 1
|
||||
}
|
||||
})
|
||||
|
||||
awards.register_achievement("mcl:bookcase", {
|
||||
title = S("Librarian"),
|
||||
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.)
|
||||
|
||||
|
|
Loading…
Reference in a new issue